Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@cowboyd
Last active March 27, 2019 19:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cowboyd/fb05257a428b508c0f0e5cfd928f59f3 to your computer and use it in GitHub Desktop.
Save cowboyd/fb05257a428b508c0f0e5cfd928f59f3 to your computer and use it in GitHub Desktop.
Built assets resulting from a run of `tns test ios` on the `cl/blueteeth` branch of the application: https://github.com/resideo-platform/exemplar/tree/cl/blueteeth
module.exports =
(global["webpackJsonp"] = global["webpackJsonp"] || []).push([["bundle"],{
/***/ "../node_modules/nativescript-unit-test-runner sync recursive (root|page)\\.(xml|css|js|ts|scss)$":
/***/ (function(module, exports, __webpack_require__) {
var map = {
"./app-root.xml": "../node_modules/nativescript-unit-test-runner/app-root.xml",
"./bundle-app-root.xml": "../node_modules/nativescript-unit-test-runner/bundle-app-root.xml",
"./bundle-main-page.js": "../node_modules/nativescript-unit-test-runner/bundle-main-page.js",
"./bundle-main-page.xml": "../node_modules/nativescript-unit-test-runner/bundle-main-page.xml",
"./main-page.js": "../node_modules/nativescript-unit-test-runner/main-page.js",
"./main-page.xml": "../node_modules/nativescript-unit-test-runner/main-page.xml",
"./test-run-page.js": "../node_modules/nativescript-unit-test-runner/test-run-page.js",
"./test-run-page.xml": "../node_modules/nativescript-unit-test-runner/test-run-page.xml"
};
function webpackContext(req) {
var id = webpackContextResolve(req);
return __webpack_require__(id);
}
function webpackContextResolve(req) {
var id = map[req];
if(!(id + 1)) { // check for number or string
var e = new Error("Cannot find module '" + req + "'");
e.code = 'MODULE_NOT_FOUND';
throw e;
}
return id;
}
webpackContext.keys = function webpackContextKeys() {
return Object.keys(map);
};
webpackContext.resolve = webpackContextResolve;
module.exports = webpackContext;
webpackContext.id = "../node_modules/nativescript-unit-test-runner sync recursive (root|page)\\.(xml|css|js|ts|scss)$";
/***/ }),
/***/ "./ sync recursive tests\\/.*\\.js":
/***/ (function(module, exports) {
function webpackEmptyContext(req) {
var e = new Error("Cannot find module '" + req + "'");
e.code = 'MODULE_NOT_FOUND';
throw e;
}
webpackEmptyContext.keys = function() { return []; };
webpackEmptyContext.resolve = webpackEmptyContext;
module.exports = webpackEmptyContext;
webpackEmptyContext.id = "./ sync recursive tests\\/.*\\.js";
/***/ }),
/***/ "./main.ts":
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global) {
__webpack_require__("../node_modules/tns-core-modules/bundle-entry-points.js");
const runnerContext = __webpack_require__("../node_modules/nativescript-unit-test-runner sync recursive (root|page)\\.(xml|css|js|ts|scss)$");
global.registerWebpackModules(runnerContext);
const context = __webpack_require__("./ sync recursive tests\\/.*\\.js");
global.registerWebpackModules(context);
__webpack_require__("../node_modules/nativescript-unit-test-runner/bundle-app.js");
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("../node_modules/webpack/buildin/global.js")))
/***/ }),
/***/ "./package.json":
/***/ (function(module) {
module.exports = {"main":"main.js","android":{"v8Flags":"--expose_gc"}};
/***/ })
},[["./main.ts","runtime","vendor"]]]);
{
"main": "starter",
"android": {
"v8Flags": "--expose_gc"
}
}
/******/ (function(modules) { // webpackBootstrap
/******/ // install a JSONP callback for chunk loading
/******/ function webpackJsonpCallback(data) {
/******/ var chunkIds = data[0];
/******/ var moreModules = data[1];
/******/ var executeModules = data[2];
/******/ // add "moreModules" to the modules object,
/******/ // then flag all "chunkIds" as loaded and fire callback
/******/ var moduleId, chunkId, i = 0, resolves = [];
/******/ for(;i < chunkIds.length; i++) {
/******/ chunkId = chunkIds[i];
/******/ if(installedChunks[chunkId]) {
/******/ resolves.push(installedChunks[chunkId][0]);
/******/ }
/******/ installedChunks[chunkId] = 0;
/******/ }
/******/ for(moduleId in moreModules) {
/******/ if(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {
/******/ modules[moduleId] = moreModules[moduleId];
/******/ }
/******/ }
/******/ if(parentJsonpFunction) parentJsonpFunction(data);
/******/ while(resolves.length) {
/******/ resolves.shift()();
/******/ }
/******/
/******/ // add entry modules from loaded chunk to deferred list
/******/ deferredModules.push.apply(deferredModules, executeModules || []);
/******/
/******/ // run deferred modules when all chunks ready
/******/ return checkDeferredModules();
/******/ };
/******/ function checkDeferredModules() {
/******/ var result;
/******/ for(var i = 0; i < deferredModules.length; i++) {
/******/ var deferredModule = deferredModules[i];
/******/ var fulfilled = true;
/******/ for(var j = 1; j < deferredModule.length; j++) {
/******/ var depId = deferredModule[j];
/******/ if(installedChunks[depId] !== 0) fulfilled = false;
/******/ }
/******/ if(fulfilled) {
/******/ deferredModules.splice(i--, 1);
/******/ result = __webpack_require__(__webpack_require__.s = deferredModule[0]);
/******/ }
/******/ }
/******/ return result;
/******/ }
/******/ function hotDisposeChunk(chunkId) {
/******/ delete installedChunks[chunkId];
/******/ }
/******/ var parentHotUpdateCallback = global["webpackHotUpdate"];
/******/ global["webpackHotUpdate"] = function webpackHotUpdateCallback(chunkId, moreModules) {
/******/ hotAddUpdateChunk(chunkId, moreModules);
/******/ if (parentHotUpdateCallback) {
/******/ parentHotUpdateCallback(chunkId, moreModules);
/******/ }
/******/ }
/******/
/******/ function hotDownloadUpdateChunk(chunkId) {
/******/ const requestPath = './' + "" + chunkId + "." + hotCurrentHash + ".hot-update.js";
/******/ try {
/******/ require(requestPath);
/******/ } catch (e) {
/******/ console.log("Hot download for update chunk failed.");
/******/ console.error(e);
/******/ }
/******/ }
/******/
/******/ function hotDownloadManifest() {
/******/ return new Promise(function (resolve, reject) {
/******/ const requestPath = './' + "" + hotCurrentHash + ".hot-update.json";
/******/ try {
/******/ const update = require(requestPath);
/******/ resolve(update);
/******/ } catch (e) {
/******/ console.log("Hot download for manifest failed.");
/******/ console.error(e);
/******/ reject(e);
/******/ }
/******/ });
/******/ }
/******/
/******/ var hotApplyOnUpdate = true;
/******/ // eslint-disable-next-line no-unused-vars
/******/ var hotCurrentHash = "05c6af004b4ed18d12aa";
/******/ var hotRequestTimeout = 10000;
/******/ var hotCurrentModuleData = {};
/******/ var hotCurrentChildModule;
/******/ // eslint-disable-next-line no-unused-vars
/******/ var hotCurrentParents = [];
/******/ // eslint-disable-next-line no-unused-vars
/******/ var hotCurrentParentsTemp = [];
/******/
/******/ // eslint-disable-next-line no-unused-vars
/******/ function hotCreateRequire(moduleId) {
/******/ var me = installedModules[moduleId];
/******/ if (!me) return __webpack_require__;
/******/ var fn = function(request) {
/******/ if (me.hot.active) {
/******/ if (installedModules[request]) {
/******/ if (installedModules[request].parents.indexOf(moduleId) === -1) {
/******/ installedModules[request].parents.push(moduleId);
/******/ }
/******/ } else {
/******/ hotCurrentParents = [moduleId];
/******/ hotCurrentChildModule = request;
/******/ }
/******/ if (me.children.indexOf(request) === -1) {
/******/ me.children.push(request);
/******/ }
/******/ } else {
/******/ console.warn(
/******/ "[HMR] unexpected require(" +
/******/ request +
/******/ ") from disposed module " +
/******/ moduleId
/******/ );
/******/ hotCurrentParents = [];
/******/ }
/******/ return __webpack_require__(request);
/******/ };
/******/ var ObjectFactory = function ObjectFactory(name) {
/******/ return {
/******/ configurable: true,
/******/ enumerable: true,
/******/ get: function() {
/******/ return __webpack_require__[name];
/******/ },
/******/ set: function(value) {
/******/ __webpack_require__[name] = value;
/******/ }
/******/ };
/******/ };
/******/ for (var name in __webpack_require__) {
/******/ if (
/******/ Object.prototype.hasOwnProperty.call(__webpack_require__, name) &&
/******/ name !== "e" &&
/******/ name !== "t"
/******/ ) {
/******/ Object.defineProperty(fn, name, ObjectFactory(name));
/******/ }
/******/ }
/******/ fn.e = function(chunkId) {
/******/ if (hotStatus === "ready") hotSetStatus("prepare");
/******/ hotChunksLoading++;
/******/ return __webpack_require__.e(chunkId).then(finishChunkLoading, function(err) {
/******/ finishChunkLoading();
/******/ throw err;
/******/ });
/******/
/******/ function finishChunkLoading() {
/******/ hotChunksLoading--;
/******/ if (hotStatus === "prepare") {
/******/ if (!hotWaitingFilesMap[chunkId]) {
/******/ hotEnsureUpdateChunk(chunkId);
/******/ }
/******/ if (hotChunksLoading === 0 && hotWaitingFiles === 0) {
/******/ hotUpdateDownloaded();
/******/ }
/******/ }
/******/ }
/******/ };
/******/ fn.t = function(value, mode) {
/******/ if (mode & 1) value = fn(value);
/******/ return __webpack_require__.t(value, mode & ~1);
/******/ };
/******/ return fn;
/******/ }
/******/
/******/ // eslint-disable-next-line no-unused-vars
/******/ function hotCreateModule(moduleId) {
/******/ var hot = {
/******/ // private stuff
/******/ _acceptedDependencies: {},
/******/ _declinedDependencies: {},
/******/ _selfAccepted: false,
/******/ _selfDeclined: false,
/******/ _disposeHandlers: [],
/******/ _main: hotCurrentChildModule !== moduleId,
/******/
/******/ // Module API
/******/ active: true,
/******/ accept: function(dep, callback) {
/******/ if (dep === undefined) hot._selfAccepted = true;
/******/ else if (typeof dep === "function") hot._selfAccepted = dep;
/******/ else if (typeof dep === "object")
/******/ for (var i = 0; i < dep.length; i++)
/******/ hot._acceptedDependencies[dep[i]] = callback || function() {};
/******/ else hot._acceptedDependencies[dep] = callback || function() {};
/******/ },
/******/ decline: function(dep) {
/******/ if (dep === undefined) hot._selfDeclined = true;
/******/ else if (typeof dep === "object")
/******/ for (var i = 0; i < dep.length; i++)
/******/ hot._declinedDependencies[dep[i]] = true;
/******/ else hot._declinedDependencies[dep] = true;
/******/ },
/******/ dispose: function(callback) {
/******/ hot._disposeHandlers.push(callback);
/******/ },
/******/ addDisposeHandler: function(callback) {
/******/ hot._disposeHandlers.push(callback);
/******/ },
/******/ removeDisposeHandler: function(callback) {
/******/ var idx = hot._disposeHandlers.indexOf(callback);
/******/ if (idx >= 0) hot._disposeHandlers.splice(idx, 1);
/******/ },
/******/
/******/ // Management API
/******/ check: hotCheck,
/******/ apply: hotApply,
/******/ status: function(l) {
/******/ if (!l) return hotStatus;
/******/ hotStatusHandlers.push(l);
/******/ },
/******/ addStatusHandler: function(l) {
/******/ hotStatusHandlers.push(l);
/******/ },
/******/ removeStatusHandler: function(l) {
/******/ var idx = hotStatusHandlers.indexOf(l);
/******/ if (idx >= 0) hotStatusHandlers.splice(idx, 1);
/******/ },
/******/
/******/ //inherit from previous dispose call
/******/ data: hotCurrentModuleData[moduleId]
/******/ };
/******/ hotCurrentChildModule = undefined;
/******/ return hot;
/******/ }
/******/
/******/ var hotStatusHandlers = [];
/******/ var hotStatus = "idle";
/******/
/******/ function hotSetStatus(newStatus) {
/******/ hotStatus = newStatus;
/******/ for (var i = 0; i < hotStatusHandlers.length; i++)
/******/ hotStatusHandlers[i].call(null, newStatus);
/******/ }
/******/
/******/ // while downloading
/******/ var hotWaitingFiles = 0;
/******/ var hotChunksLoading = 0;
/******/ var hotWaitingFilesMap = {};
/******/ var hotRequestedFilesMap = {};
/******/ var hotAvailableFilesMap = {};
/******/ var hotDeferred;
/******/
/******/ // The update info
/******/ var hotUpdate, hotUpdateNewHash;
/******/
/******/ function toModuleId(id) {
/******/ var isNumber = +id + "" === id;
/******/ return isNumber ? +id : id;
/******/ }
/******/
/******/ function hotCheck(apply) {
/******/ if (hotStatus !== "idle") {
/******/ throw new Error("check() is only allowed in idle status");
/******/ }
/******/ hotApplyOnUpdate = apply;
/******/ hotSetStatus("check");
/******/ return hotDownloadManifest(hotRequestTimeout).then(function(update) {
/******/ if (!update) {
/******/ hotSetStatus("idle");
/******/ return null;
/******/ }
/******/ hotRequestedFilesMap = {};
/******/ hotWaitingFilesMap = {};
/******/ hotAvailableFilesMap = update.c;
/******/ hotUpdateNewHash = update.h;
/******/
/******/ hotSetStatus("prepare");
/******/ var promise = new Promise(function(resolve, reject) {
/******/ hotDeferred = {
/******/ resolve: resolve,
/******/ reject: reject
/******/ };
/******/ });
/******/ hotUpdate = {};
/******/ for(var chunkId in installedChunks)
/******/ // eslint-disable-next-line no-lone-blocks
/******/ {
/******/ /*globals chunkId */
/******/ hotEnsureUpdateChunk(chunkId);
/******/ }
/******/ if (
/******/ hotStatus === "prepare" &&
/******/ hotChunksLoading === 0 &&
/******/ hotWaitingFiles === 0
/******/ ) {
/******/ hotUpdateDownloaded();
/******/ }
/******/ return promise;
/******/ });
/******/ }
/******/
/******/ // eslint-disable-next-line no-unused-vars
/******/ function hotAddUpdateChunk(chunkId, moreModules) {
/******/ if (!hotAvailableFilesMap[chunkId] || !hotRequestedFilesMap[chunkId])
/******/ return;
/******/ hotRequestedFilesMap[chunkId] = false;
/******/ for (var moduleId in moreModules) {
/******/ if (Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {
/******/ hotUpdate[moduleId] = moreModules[moduleId];
/******/ }
/******/ }
/******/ if (--hotWaitingFiles === 0 && hotChunksLoading === 0) {
/******/ hotUpdateDownloaded();
/******/ }
/******/ }
/******/
/******/ function hotEnsureUpdateChunk(chunkId) {
/******/ if (!hotAvailableFilesMap[chunkId]) {
/******/ hotWaitingFilesMap[chunkId] = true;
/******/ } else {
/******/ hotRequestedFilesMap[chunkId] = true;
/******/ hotWaitingFiles++;
/******/ hotDownloadUpdateChunk(chunkId);
/******/ }
/******/ }
/******/
/******/ function hotUpdateDownloaded() {
/******/ hotSetStatus("ready");
/******/ var deferred = hotDeferred;
/******/ hotDeferred = null;
/******/ if (!deferred) return;
/******/ if (hotApplyOnUpdate) {
/******/ // Wrap deferred object in Promise to mark it as a well-handled Promise to
/******/ // avoid triggering uncaught exception warning in Chrome.
/******/ // See https://bugs.chromium.org/p/chromium/issues/detail?id=465666
/******/ Promise.resolve()
/******/ .then(function() {
/******/ return hotApply(hotApplyOnUpdate);
/******/ })
/******/ .then(
/******/ function(result) {
/******/ deferred.resolve(result);
/******/ },
/******/ function(err) {
/******/ deferred.reject(err);
/******/ }
/******/ );
/******/ } else {
/******/ var outdatedModules = [];
/******/ for (var id in hotUpdate) {
/******/ if (Object.prototype.hasOwnProperty.call(hotUpdate, id)) {
/******/ outdatedModules.push(toModuleId(id));
/******/ }
/******/ }
/******/ deferred.resolve(outdatedModules);
/******/ }
/******/ }
/******/
/******/ function hotApply(options) {
/******/ if (hotStatus !== "ready")
/******/ throw new Error("apply() is only allowed in ready status");
/******/ options = options || {};
/******/
/******/ var cb;
/******/ var i;
/******/ var j;
/******/ var module;
/******/ var moduleId;
/******/
/******/ function getAffectedStuff(updateModuleId) {
/******/ var outdatedModules = [updateModuleId];
/******/ var outdatedDependencies = {};
/******/
/******/ var queue = outdatedModules.slice().map(function(id) {
/******/ return {
/******/ chain: [id],
/******/ id: id
/******/ };
/******/ });
/******/ while (queue.length > 0) {
/******/ var queueItem = queue.pop();
/******/ var moduleId = queueItem.id;
/******/ var chain = queueItem.chain;
/******/ module = installedModules[moduleId];
/******/ if (!module || module.hot._selfAccepted) continue;
/******/ if (module.hot._selfDeclined) {
/******/ return {
/******/ type: "self-declined",
/******/ chain: chain,
/******/ moduleId: moduleId
/******/ };
/******/ }
/******/ if (module.hot._main) {
/******/ return {
/******/ type: "unaccepted",
/******/ chain: chain,
/******/ moduleId: moduleId
/******/ };
/******/ }
/******/ for (var i = 0; i < module.parents.length; i++) {
/******/ var parentId = module.parents[i];
/******/ var parent = installedModules[parentId];
/******/ if (!parent) continue;
/******/ if (parent.hot._declinedDependencies[moduleId]) {
/******/ return {
/******/ type: "declined",
/******/ chain: chain.concat([parentId]),
/******/ moduleId: moduleId,
/******/ parentId: parentId
/******/ };
/******/ }
/******/ if (outdatedModules.indexOf(parentId) !== -1) continue;
/******/ if (parent.hot._acceptedDependencies[moduleId]) {
/******/ if (!outdatedDependencies[parentId])
/******/ outdatedDependencies[parentId] = [];
/******/ addAllToSet(outdatedDependencies[parentId], [moduleId]);
/******/ continue;
/******/ }
/******/ delete outdatedDependencies[parentId];
/******/ outdatedModules.push(parentId);
/******/ queue.push({
/******/ chain: chain.concat([parentId]),
/******/ id: parentId
/******/ });
/******/ }
/******/ }
/******/
/******/ return {
/******/ type: "accepted",
/******/ moduleId: updateModuleId,
/******/ outdatedModules: outdatedModules,
/******/ outdatedDependencies: outdatedDependencies
/******/ };
/******/ }
/******/
/******/ function addAllToSet(a, b) {
/******/ for (var i = 0; i < b.length; i++) {
/******/ var item = b[i];
/******/ if (a.indexOf(item) === -1) a.push(item);
/******/ }
/******/ }
/******/
/******/ // at begin all updates modules are outdated
/******/ // the "outdated" status can propagate to parents if they don't accept the children
/******/ var outdatedDependencies = {};
/******/ var outdatedModules = [];
/******/ var appliedUpdate = {};
/******/
/******/ var warnUnexpectedRequire = function warnUnexpectedRequire() {
/******/ console.warn(
/******/ "[HMR] unexpected require(" + result.moduleId + ") to disposed module"
/******/ );
/******/ };
/******/
/******/ for (var id in hotUpdate) {
/******/ if (Object.prototype.hasOwnProperty.call(hotUpdate, id)) {
/******/ moduleId = toModuleId(id);
/******/ /** @type {TODO} */
/******/ var result;
/******/ if (hotUpdate[id]) {
/******/ result = getAffectedStuff(moduleId);
/******/ } else {
/******/ result = {
/******/ type: "disposed",
/******/ moduleId: id
/******/ };
/******/ }
/******/ /** @type {Error|false} */
/******/ var abortError = false;
/******/ var doApply = false;
/******/ var doDispose = false;
/******/ var chainInfo = "";
/******/ if (result.chain) {
/******/ chainInfo = "\nUpdate propagation: " + result.chain.join(" -> ");
/******/ }
/******/ switch (result.type) {
/******/ case "self-declined":
/******/ if (options.onDeclined) options.onDeclined(result);
/******/ if (!options.ignoreDeclined)
/******/ abortError = new Error(
/******/ "Aborted because of self decline: " +
/******/ result.moduleId +
/******/ chainInfo
/******/ );
/******/ break;
/******/ case "declined":
/******/ if (options.onDeclined) options.onDeclined(result);
/******/ if (!options.ignoreDeclined)
/******/ abortError = new Error(
/******/ "Aborted because of declined dependency: " +
/******/ result.moduleId +
/******/ " in " +
/******/ result.parentId +
/******/ chainInfo
/******/ );
/******/ break;
/******/ case "unaccepted":
/******/ if (options.onUnaccepted) options.onUnaccepted(result);
/******/ if (!options.ignoreUnaccepted)
/******/ abortError = new Error(
/******/ "Aborted because " + moduleId + " is not accepted" + chainInfo
/******/ );
/******/ break;
/******/ case "accepted":
/******/ if (options.onAccepted) options.onAccepted(result);
/******/ doApply = true;
/******/ break;
/******/ case "disposed":
/******/ if (options.onDisposed) options.onDisposed(result);
/******/ doDispose = true;
/******/ break;
/******/ default:
/******/ throw new Error("Unexception type " + result.type);
/******/ }
/******/ if (abortError) {
/******/ hotSetStatus("abort");
/******/ return Promise.reject(abortError);
/******/ }
/******/ if (doApply) {
/******/ appliedUpdate[moduleId] = hotUpdate[moduleId];
/******/ addAllToSet(outdatedModules, result.outdatedModules);
/******/ for (moduleId in result.outdatedDependencies) {
/******/ if (
/******/ Object.prototype.hasOwnProperty.call(
/******/ result.outdatedDependencies,
/******/ moduleId
/******/ )
/******/ ) {
/******/ if (!outdatedDependencies[moduleId])
/******/ outdatedDependencies[moduleId] = [];
/******/ addAllToSet(
/******/ outdatedDependencies[moduleId],
/******/ result.outdatedDependencies[moduleId]
/******/ );
/******/ }
/******/ }
/******/ }
/******/ if (doDispose) {
/******/ addAllToSet(outdatedModules, [result.moduleId]);
/******/ appliedUpdate[moduleId] = warnUnexpectedRequire;
/******/ }
/******/ }
/******/ }
/******/
/******/ // Store self accepted outdated modules to require them later by the module system
/******/ var outdatedSelfAcceptedModules = [];
/******/ for (i = 0; i < outdatedModules.length; i++) {
/******/ moduleId = outdatedModules[i];
/******/ if (
/******/ installedModules[moduleId] &&
/******/ installedModules[moduleId].hot._selfAccepted
/******/ )
/******/ outdatedSelfAcceptedModules.push({
/******/ module: moduleId,
/******/ errorHandler: installedModules[moduleId].hot._selfAccepted
/******/ });
/******/ }
/******/
/******/ // Now in "dispose" phase
/******/ hotSetStatus("dispose");
/******/ Object.keys(hotAvailableFilesMap).forEach(function(chunkId) {
/******/ if (hotAvailableFilesMap[chunkId] === false) {
/******/ hotDisposeChunk(chunkId);
/******/ }
/******/ });
/******/
/******/ var idx;
/******/ var queue = outdatedModules.slice();
/******/ while (queue.length > 0) {
/******/ moduleId = queue.pop();
/******/ module = installedModules[moduleId];
/******/ if (!module) continue;
/******/
/******/ var data = {};
/******/
/******/ // Call dispose handlers
/******/ var disposeHandlers = module.hot._disposeHandlers;
/******/ for (j = 0; j < disposeHandlers.length; j++) {
/******/ cb = disposeHandlers[j];
/******/ cb(data);
/******/ }
/******/ hotCurrentModuleData[moduleId] = data;
/******/
/******/ // disable module (this disables requires from this module)
/******/ module.hot.active = false;
/******/
/******/ // remove module from cache
/******/ delete installedModules[moduleId];
/******/
/******/ // when disposing there is no need to call dispose handler
/******/ delete outdatedDependencies[moduleId];
/******/
/******/ // remove "parents" references from all children
/******/ for (j = 0; j < module.children.length; j++) {
/******/ var child = installedModules[module.children[j]];
/******/ if (!child) continue;
/******/ idx = child.parents.indexOf(moduleId);
/******/ if (idx >= 0) {
/******/ child.parents.splice(idx, 1);
/******/ }
/******/ }
/******/ }
/******/
/******/ // remove outdated dependency from module children
/******/ var dependency;
/******/ var moduleOutdatedDependencies;
/******/ for (moduleId in outdatedDependencies) {
/******/ if (
/******/ Object.prototype.hasOwnProperty.call(outdatedDependencies, moduleId)
/******/ ) {
/******/ module = installedModules[moduleId];
/******/ if (module) {
/******/ moduleOutdatedDependencies = outdatedDependencies[moduleId];
/******/ for (j = 0; j < moduleOutdatedDependencies.length; j++) {
/******/ dependency = moduleOutdatedDependencies[j];
/******/ idx = module.children.indexOf(dependency);
/******/ if (idx >= 0) module.children.splice(idx, 1);
/******/ }
/******/ }
/******/ }
/******/ }
/******/
/******/ // Not in "apply" phase
/******/ hotSetStatus("apply");
/******/
/******/ hotCurrentHash = hotUpdateNewHash;
/******/
/******/ // insert new code
/******/ for (moduleId in appliedUpdate) {
/******/ if (Object.prototype.hasOwnProperty.call(appliedUpdate, moduleId)) {
/******/ modules[moduleId] = appliedUpdate[moduleId];
/******/ }
/******/ }
/******/
/******/ // call accept handlers
/******/ var error = null;
/******/ for (moduleId in outdatedDependencies) {
/******/ if (
/******/ Object.prototype.hasOwnProperty.call(outdatedDependencies, moduleId)
/******/ ) {
/******/ module = installedModules[moduleId];
/******/ if (module) {
/******/ moduleOutdatedDependencies = outdatedDependencies[moduleId];
/******/ var callbacks = [];
/******/ for (i = 0; i < moduleOutdatedDependencies.length; i++) {
/******/ dependency = moduleOutdatedDependencies[i];
/******/ cb = module.hot._acceptedDependencies[dependency];
/******/ if (cb) {
/******/ if (callbacks.indexOf(cb) !== -1) continue;
/******/ callbacks.push(cb);
/******/ }
/******/ }
/******/ for (i = 0; i < callbacks.length; i++) {
/******/ cb = callbacks[i];
/******/ try {
/******/ cb(moduleOutdatedDependencies);
/******/ } catch (err) {
/******/ if (options.onErrored) {
/******/ options.onErrored({
/******/ type: "accept-errored",
/******/ moduleId: moduleId,
/******/ dependencyId: moduleOutdatedDependencies[i],
/******/ error: err
/******/ });
/******/ }
/******/ if (!options.ignoreErrored) {
/******/ if (!error) error = err;
/******/ }
/******/ }
/******/ }
/******/ }
/******/ }
/******/ }
/******/
/******/ // Load self accepted modules
/******/ for (i = 0; i < outdatedSelfAcceptedModules.length; i++) {
/******/ var item = outdatedSelfAcceptedModules[i];
/******/ moduleId = item.module;
/******/ hotCurrentParents = [moduleId];
/******/ try {
/******/ __webpack_require__(moduleId);
/******/ } catch (err) {
/******/ if (typeof item.errorHandler === "function") {
/******/ try {
/******/ item.errorHandler(err);
/******/ } catch (err2) {
/******/ if (options.onErrored) {
/******/ options.onErrored({
/******/ type: "self-accept-error-handler-errored",
/******/ moduleId: moduleId,
/******/ error: err2,
/******/ originalError: err
/******/ });
/******/ }
/******/ if (!options.ignoreErrored) {
/******/ if (!error) error = err2;
/******/ }
/******/ if (!error) error = err;
/******/ }
/******/ } else {
/******/ if (options.onErrored) {
/******/ options.onErrored({
/******/ type: "self-accept-errored",
/******/ moduleId: moduleId,
/******/ error: err
/******/ });
/******/ }
/******/ if (!options.ignoreErrored) {
/******/ if (!error) error = err;
/******/ }
/******/ }
/******/ }
/******/ }
/******/
/******/ // handle errors in accept handlers and self accepted module load
/******/ if (error) {
/******/ hotSetStatus("fail");
/******/ return Promise.reject(error);
/******/ }
/******/
/******/ hotSetStatus("idle");
/******/ return new Promise(function(resolve) {
/******/ resolve(outdatedModules);
/******/ });
/******/ }
/******/
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // object to store loaded and loading chunks
/******/ var installedChunks = {
/******/ "runtime": 0
/******/ };
/******/
/******/ var deferredModules = [];
/******/
/******/ // 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] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {},
/******/ hot: hotCreateModule(moduleId),
/******/ parents: (hotCurrentParentsTemp = hotCurrentParents, hotCurrentParents = [], hotCurrentParentsTemp),
/******/ children: []
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, hotCreateRequire(moduleId));
/******/
/******/ // Flag the module as loaded
/******/ module.l = 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;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ }
/******/ };
/******/
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ return ns;
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/ // __webpack_hash__
/******/ __webpack_require__.h = function() { return hotCurrentHash; };
/******/
/******/ var jsonpArray = global["webpackJsonp"] = global["webpackJsonp"] || [];
/******/ var oldJsonpFunction = jsonpArray.push.bind(jsonpArray);
/******/ jsonpArray.push = webpackJsonpCallback;
/******/ jsonpArray = jsonpArray.slice();
/******/ for(var i = 0; i < jsonpArray.length; i++) webpackJsonpCallback(jsonpArray[i]);
/******/ var parentJsonpFunction = oldJsonpFunction;
/******/
/******/
/******/ // run deferred modules from other chunks
/******/ checkDeferredModules();
/******/ })
/************************************************************************/
/******/ ([]);
require("./runtime")
require("./vendor")
require("./bundle")
(global["webpackJsonp"] = global["webpackJsonp"] || []).push([["vendor"],{
/***/ "../node_modules/nativescript-unit-test-runner/app-root.xml":
/***/ (function(module, exports) {
module.exports = "<Frame defaultPage=\"./tns_modules/nativescript-unit-test-runner/main-page\" id=\"root-frame\">\n</Frame>\n"
/***/ }),
/***/ "../node_modules/nativescript-unit-test-runner/bundle-app-root.xml":
/***/ (function(module, exports) {
module.exports = "<Frame defaultPage=\"bundle-main-page\" id=\"root-frame\">\n</Frame>\n"
/***/ }),
/***/ "../node_modules/nativescript-unit-test-runner/bundle-app.js":
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", { value: true });
var application = __webpack_require__("../node_modules/tns-core-modules/application/application.js");
application.run({ moduleName: "bundle-app-root" });
/***/ }),
/***/ "../node_modules/nativescript-unit-test-runner/bundle-main-page.js":
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", { value: true });
var vmModule = __webpack_require__("../node_modules/nativescript-unit-test-runner/main-view-model.js");
function pageLoaded(args) {
var page = args.object;
page.bindingContext = vmModule.mainViewModel;
}
exports.pageLoaded = pageLoaded;
/***/ }),
/***/ "../node_modules/nativescript-unit-test-runner/bundle-main-page.xml":
/***/ (function(module, exports) {
module.exports = "<Page xmlns=\"http://www.nativescript.org/tns.xsd\" loaded=\"pageLoaded\">\n <GridLayout cssClass=\"landingContainer\">\n <Image src=\"{{ imageSrc }}\" stretch=\"none\" cssClass=\"landingBackground\"/>\n\n <Label text=\"{{ serverInfo }}\" cssClass=\"landingText\"/>\n </GridLayout>\n</Page>\n"
/***/ }),
/***/ "../node_modules/nativescript-unit-test-runner/config.js":
/***/ (function(module, exports) {
module.exports = {"port":"9876","ips":["127.0.0.1","192.168.86.63"],"options":{"debugTransport":false,"debugBrk":false,"watch":true,"bundle":true,"appDirectoryRelativePath":"src"}}
/***/ }),
/***/ "../node_modules/nativescript-unit-test-runner/main-page.js":
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", { value: true });
var vmModule = __webpack_require__("../node_modules/nativescript-unit-test-runner/main-view-model.js");
function pageLoaded(args) {
var page = args.object;
page.bindingContext = vmModule.mainViewModel;
}
exports.pageLoaded = pageLoaded;
/***/ }),
/***/ "../node_modules/nativescript-unit-test-runner/main-page.xml":
/***/ (function(module, exports) {
module.exports = "<Page xmlns=\"http://www.nativescript.org/tns.xsd\" loaded=\"pageLoaded\">\n <GridLayout cssClass=\"landingContainer\">\n <Image src=\"{{ imageSrc }}\" stretch=\"none\" cssClass=\"landingBackground\"/>\n\n <Label text=\"{{ serverInfo }}\" cssClass=\"landingText\"/>\n </GridLayout>\n</Page>\n"
/***/ }),
/***/ "../node_modules/nativescript-unit-test-runner/main-view-model.js":
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global) {Object.defineProperty(exports, "__esModule", { value: true });
var observable_1 = __webpack_require__("../node_modules/tns-core-modules/data/observable/observable.js");
var observable_array_1 = __webpack_require__("../node_modules/tns-core-modules/data/observable-array/observable-array.js");
var http = __webpack_require__("../node_modules/tns-core-modules/http/http.js");
var platform = __webpack_require__("../node_modules/tns-core-modules/platform/platform.js");
var frameModule = __webpack_require__("../node_modules/tns-core-modules/ui/frame/frame.js");
var karma_host_resolver_1 = __webpack_require__("../node_modules/nativescript-unit-test-runner/services/karma-host-resolver.js");
var karma_files_service_1 = __webpack_require__("../node_modules/nativescript-unit-test-runner/services/karma-files-service.js");
var test_execution_service_1 = __webpack_require__("../node_modules/nativescript-unit-test-runner/services/test-execution-service.js");
var stopProcess = __webpack_require__("../node_modules/nativescript-unit-test-runner/stop-process.js");
function enableSocketIoDebugging() {
console.log('enabling socket.io debugging');
global.localStorage = {
debug: "*"
};
global.window = global;
}
var config = __webpack_require__("../node_modules/nativescript-unit-test-runner/config.js");
config.options = config.options || {};
if (!config.options.appDirectoryRelativePath) {
config.options.appDirectoryRelativePath = "app";
}
var bundle = config.options && config.options.bundle;
var TestBrokerViewModel = (function (_super) {
__extends(TestBrokerViewModel, _super);
function TestBrokerViewModel() {
var _this = _super.call(this) || this;
global.__karma__ = _this;
if (config.options.debugTransport) {
enableSocketIoDebugging();
}
_this.testResults = new observable_array_1.ObservableArray();
_this.updateView({
testResults: _this.testResults,
serverInfo: 'disconnected',
imageSrc: _this.getImageSrc(),
goToTestsText: 'Run Tests',
isConnected: false,
testsPassed: '-',
testsFailed: '-',
testsRan: 0,
testsTotal: 0
});
_this.startEmitted = false;
_this.karmaHostResolver = new karma_host_resolver_1.KarmaHostResolver(http);
_this.karmaFilesService = new karma_files_service_1.KarmaFilesService(http);
_this.testExecutionService = new test_execution_service_1.TestExecutionService();
_this.karmaHostResolver.resolveKarmaHost(config.ips, config.port)
.then(function (hostIP) {
var serverInfo = hostIP ? "found karma at " + hostIP : 'no reachable hosts';
_this.updateView({ serverInfo: serverInfo });
_this.connectToKarma(hostIP);
})
.catch(function (e) { return console.log(e.toString()); });
return _this;
}
TestBrokerViewModel.prototype.viewTestRunDetails = function () {
this.navigateTo('run-details');
};
TestBrokerViewModel.prototype.beginLocalRun = function () {
this.config = this.config || { args: [] };
this.navigateTo('test-run-page');
};
TestBrokerViewModel.prototype.onKarmaExecute = function (cfg) {
this.karmaRequestedRun = true;
this.config = cfg;
this.beginLocalRun();
};
TestBrokerViewModel.prototype.executeTestRun = function () {
var _this = this;
if (this.executed) {
console.log('NSUTR: disregarding second execution');
return;
}
this.executed = true;
this.startEmitted = false;
this.hasError = false;
this.set('goToTestsText', 'View Test Run');
this.karmaFilesService.getServedFilesData(this.baseUrl, config)
.then(function (scriptsContents) { return setTimeout(function () { return _this.runTests(scriptsContents); }, 0); });
};
TestBrokerViewModel.prototype.runTests = function (scripts) {
var _this = this;
var errors = this.testExecutionService.runTests(scripts);
errors.forEach(function (err) { return _this.error(err.msg, err.url, err.line); });
if (!this.hasError) {
console.log('NSUTR: beginning test run');
if (config.options.debugBrk) {
debugger;
}
this.start(this.config);
}
};
TestBrokerViewModel.prototype.start = function (cfg) {
this.error("You need to include a test adapter for the testing framework you're using");
};
TestBrokerViewModel.prototype.info = function (data) {
this.emitInfoToSocketIfNeeded(data);
this.emitStartToSocketIfNeeded(data);
this.updateView({
testsRunning: true,
testsPassed: 0,
testsFailed: 0,
testsRan: 0,
testsTotal: data.total
});
};
TestBrokerViewModel.prototype.result = function (data) {
this.emitStartToSocketIfNeeded({ total: null });
this.emitToSocket('result', data);
this.updateView({
testsPassed: data.success ? this.get('testsPassed') + 1 : undefined,
testsFailed: data.success ? undefined : this.get('testsFailed') + 1,
testsRan: this.get('testsRan') + 1
});
this.testResults.push(data);
};
TestBrokerViewModel.prototype.complete = function (data) {
var _this = this;
console.log("NSUTR: completed test run.");
this.set('testsRunning', false);
delete this.start;
this.emitToSocket('complete', data || {}, function () {
console.log('NSUTR: completeAck');
_this.emitToSocket('disconnect');
setTimeout(function () { return stopProcess(); }, 500);
});
};
TestBrokerViewModel.prototype.error = function (msg, url, line) {
this.hasError = true;
var fullMsg = url ? msg + '\nat ' + url + (line ? ':' + line : '') : msg;
console.log("NSUTR: this.error: " + fullMsg);
this.result({
id: url,
description: url + " at line " + line || "",
log: [msg],
time: 0,
success: false,
suite: [],
});
this.complete();
return false;
};
TestBrokerViewModel.prototype.connectToKarma = function (hostIP) {
var _this = this;
if (!hostIP) {
return;
}
this.baseUrl = "http://" + hostIP + ":" + config.port;
console.log("NSUTR: connecting to karma at " + this.baseUrl);
global.navigator = {
userAgent: 'nativescript',
};
global.document = {
documentElement: {
style: {}
}
};
this.updateView({ serverInfo: "connecting to " + this.baseUrl });
var io = __webpack_require__("../node_modules/nativescript-unit-test-runner/socket.io.js");
var socket = this.socket = io.connect(this.baseUrl, { forceBase64: true });
socket.on('connect', function (err) {
console.log('NSUTR: successfully connected to karma');
delete global.navigator;
delete global.document;
_this.updateBanner('connected');
_this.updateView({ isConnected: true });
socket.emit('register', {
id: 'NativeScriptUnit-' + (0 | (Math.random() * 10000)),
name: "NativeScript / " + platform.device.sdkVersion + " (" + platform.device.osVersion + "; " + platform.device.model + ")",
});
});
this.attachOnServerSocketEvents(socket);
};
TestBrokerViewModel.prototype.attachOnServerSocketEvents = function (socket) {
socket.on('disconnect', this.updateBanner('disconnected'));
socket.on('reconnecting', this.updateBanner('reconnecting in $ ms...'));
socket.on('reconnect_failed', this.updateBanner('failed to reconnect'));
socket.on('connect_failed', this.updateBanner('connection failed'));
socket.on('reconnect', this.updateBanner('connected'));
socket.on('connect_error', function (data) { return console.log('NSUTR: socket.io error on connect: ' + data); });
socket.on('execute', this.onKarmaExecute.bind(this));
};
TestBrokerViewModel.prototype.emitToSocket = function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
if (this.karmaRequestedRun) {
this.socket.emit.apply(this.socket, arguments);
}
};
TestBrokerViewModel.prototype.emitStartToSocketIfNeeded = function (data) {
if (!this.startEmitted) {
this.emitToSocket('start', data);
this.startEmitted = true;
}
};
TestBrokerViewModel.prototype.emitInfoToSocketIfNeeded = function (data) {
if (this.startEmitted) {
this.emitToSocket('info', data);
}
};
TestBrokerViewModel.prototype.updateView = function (data) {
var _this = this;
Object.keys(data).forEach(function (key) {
if (data[key] !== null && data[key] !== undefined) {
_this.set(key, data[key]);
}
});
};
TestBrokerViewModel.prototype.updateBanner = function (message) {
var _this = this;
return function (err) {
_this.updateView({ serverInfo: message });
if (err) {
console.log('NSUTR-socket.io: ' + err.toString());
}
};
};
TestBrokerViewModel.prototype.navigateTo = function (pageName) {
var url = bundle ? pageName : "tns_modules/nativescript-unit-test-runner/" + pageName;
frameModule.getFrameById('root-frame').navigate(url);
};
TestBrokerViewModel.prototype.getImageSrc = function () {
var result = '~/tns_modules/nativescript-unit-test-runner/nativescript.png';
if (bundle) {
result = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAAEsCAIAAAD2HxkiAAAAA3NCSVQICAjb4U/gAAAAYnpUWHRSYXcgcHJvZmlsZSB0eXBlIEFQUDEAAHicVcixDYAwDADB3lN4hHccHDIOQgFFQoCyf0EBDVee7O1so696j2vrRxNVVVXPkmuuaQFmXgZuGAkoXy38TEQNDyseBiAPSLYUyXpQ8HMAABl/SURBVHic7d1rfBTV/cfx7+9M9ppNNiEEA0FULqKoCFZBLFiLL2uLVamoVdSCqCAiSlHuYOSmgEKhUhHwAlUoltoqpRf/LfoSK4qKIlDkDiLhkgvkvpts9pz/A6oighJZ9pwz+3s/4lFyyMxnd+bMmRnq2jsOxpg+QvcAGEt1HCFjmnGEjGnGETKmGUfImGYcIWOacYSMacYRMqYZR8iYZhwhY5pxhIxpxhEyphlHyJhmHCFjmnGEjGnGETKmGUfImGYcIWOacYSMacYRMqYZR8iYZhwhY5pxhIxpxhEyphlHyJhmHCFjmnGEjGnGETKmGUfImGYcIWOacYSMacYRMqYZR8iYZhwhY5pxhIxpxhEyphlHyJhmHCFjmnGEjGnGETKmGUfImGYcIWOacYSMacYRMqYZR8iYZhwhY5pxhIxpxhEyplma7gEkXjyO2nrUxRCLQ6pE/uRwEH5vIn+gW8UlSisT9tOUAhE8Dnxp8HngOAn7yYZwQ4QExCWiMVRFVHkEZ+fjRxfT+a2R34QEJey3pKXhxeVq1TpkBhP2M11JSpwWxm+GUV0sMT9QSUiFvcVqwza884navAeZAWQEyO+BI5DQj1k9rI8wFkdhqWqZR7d3R+eLxWUdE5fdN3S6iG59UO4ugtdz6n6J9aRCRhCdL0r4hvjqB767Vq3+UL26Etv3qfwc8lj+3Uhde8d1j+F7itWjrFp1akv33U4d2pHfl4xfWl6FbrfFQ0Fy+Gz6OOrjaJ2HF2ee8j9QtBZrN6o5i9TqzSorSB5rv1Bs3ZXKqpGTgfnjxMInxaUdk1QggHAIM0eKg1UuOAiynt+HSzvSgifE/HGicQYOVeke0PdlX4RxiU171aCb8bdnRbfORKfw8PPYunehUX3E5yUq+b+afRMRunWi5c+Kwbfg070qLnUPqOEsi7AqgnQ/Vi907u2tc+R9bqSBPam0QuMQ2NEG3Co+WOiE/KiK6B5KA9kUYWUNLmiJhVNFyxa6hwLc31ec1RSxet3jYEc4qwUWThXtW6KyRvdQGsKaCCtr0CYfz00VzZroHgoAID2ABVPE9iKV2EuR7CQ1bYLnpoq2zW3q0I4IqyJo3wqLZwmjJqMbZ2PFHFFW6YZLVW6S5mDRTHFhK2uOSy2IMC7ROIwpw80q8LD259CwvrT/EGdoljQHU4aL3DDqbZinsSDCrfvV3PGmHIV+U99edPMVVGHPwU+KaNoEc8eLrfst+Hw0PcKyaky6h0yYifkWjw0XeVmqNkGrtFiinNUCk+8h868fGh1hrB4tGmOA1qsRJ2jeZEeQlRep3G1Ab3FGrumT2Ebv3+U1amR/O66In9EMM0eIg5UWHPykmpH9qbzG6O1iboSxODqdTV0vsSNCAJdeRBPupZ1F4JU0Rul6CXVqSzGDl0gbGiEBhaVq4O0aVqWdjJt/Lm69EuXVusfBjkCEgbdRYakydlcyNMK4RKum1KGdsX+345o2QrRphkid7nGwI3RoR62akrFn7IZGGI2h5+VI2r0RCUSEmePII3gljUH8PvS8HFFTp68NjbAyojr/wNCxfafmeTRjpNh2gCs0SOcfiMqIoVvE0B29IoIuHXUP4iR06Uhzh4vPSwzd6imoS0dUmLqKzcQI43G0zbfvbPAoPa+mG7pRpakbPgW1zae4kXOkJkZYG8NlHXQPIhEmDxPNcsAraQxxWQdDt4WREdbjglbWfxMCCPjw4jThS1PS1Hm5lHJBK6o1cumMiRHG4jB2uXZD5WRj1hjxeSmfHOrXrAnMvGRvYoRKIYHPC9XuovNo+O3iQBl3qJkgKCM3gokREty28uv+X9HtP+Fn0rBjMzFC0JEPenWJhweIS9oiyitp2DcYGaEbBf2YOFSU1ygzj4iYRhxh8rRohmWzxJZ9XCH7Go4wqc5pTdMfEHxyyI7EESbbHb+g67qijG93Yl/gCDV4bJg4p7ky/JkLLGk4Qg2EwPzHneIKXknDAI5Ql6wMLJggyqp5rpRxhPp0u4TG3kV7S3WPg+nGEep06/Xijp9a/GI9lhAcoWZjBok2zQy9xYYlB0eomdeD56eIeD0/ODh1cYT6ZYcxc5QoqeA5mhTFERqh2yU08V7xWbG5z8Zkpw5HaIpfXkv3XU+8kiYFcYQGGTFI+H2o40maFMMRGoSAvz0tlOJJmtTCEZolNwfzx4vyKp6kSSEcoXEubEfD+orCg9xhquAITdS3F/XqRuX8Cu7UwBEa6onR4oIzUFOrexzs1OMIzTVhqAh4wbc7uR5HaK5WLTBzJK0p5Cv4LscRGu3i9vRKAX3Otzu5GkdoumuuFL/ohgqepHEvjtACjw8TLfPMfdEsO0kcoQV8XrwwVTjgV3C7E0doh6xMzB7Hr+B2J47QGhdfQE/cJ0r5tkPX4Qht8qte1OsKKq3UPQ6WUByhZUYNEhe25Lc7uQpHaJmgH089IqTkBwe7B0don8aN8Ox48XkJnxy6BEdopY7n06P9xX5+BbcrcIS26ncT9evBkzRuwBFa7KH+4oIzwG93sh1HaDGvB09PFBsO8Eoau3GEdsvJwqo5oqJa8eud7MURWq/9uTT6LlFSrnsc7PviCN3g1uuox2Uo5wcH24kjdIkZY8Q5zXkljZU4QveYPV54HMTjusfBGogjdI8mOZj0IBVX8hSNZThCV+nehWYMEdv2K+KHQ9mDI3Sba6+iQT2pjF/BbQ+O0IVG3ieaZPEruK3BEbpQmoOXZwoBfruTHThCd8rJwpwCUVzOkzQW4Ahdq+N5NH6A2FPKHZqOI2yAVWss26F7X0+3dideSXMYCZg5aWxihILgOLoHcSzT58v31lrW4aRhom1zRPjtToDjQHCEJ8ibpnx+E/9awQDd+6isiegeR0MIwvTRIujjSRr4/ORNM/Ez1LgIlULIj3CGiX8sxwEE3TVK1lt1H22LZpjziNhdbOKfNJkyM1TIDwPv+TIuQqmQk0FNm5j4TQiFgBdrt+HJ+ZZ9rZzXlqYOFvsO6h6HVs2aUE4GGXgDtHERxiVys5Ae0D2O41BA4zCeXYZXXzdvY36r266nm36MQym8kiY9gNwsGHhYblyENVF06qh7EN8lLxujZ8sP11nW4cSHROe2KT1J06kjaqK6B/ENxkVYXKW6dzFuVEchQlaI+o2Tdr1TPs3B+KEiUmfgaVGSdO8iiquM+9+btbvXx3FlezTP0z2OE+AI+H00YJS060nYzfOwdLr44DPjdsTkaJ6HK9uj3rBbLs2KsCqiuncRAb/ucZwYnwcfbcf431pVIdCuDf1hjDiYkg8sDfjRvYuoipj1GWRWhDsP4pZrjZwXPY5GIfzx3/iLbZM0N/yMelyG1Lzd6ZZraadhs8QGRVhejUl9hbHzosfTOIwbJsgdu3WPo4Eee0ic2yIVb3dKD2BSX2HUUj5TIpQKAa/qc5NNX4NfuuwMunFofM9+3eNoCI8HL0wVMp6KK2n63EQBr0FPTDYlwuJyjO0vsjN1j+N7EQRSNPEpadcT6dODmDVaHKxMucnS7EyM7S+KjXlSqxERVkdxeXtcc6WVX4OHBf146xM8Odeyr5Uf/oBG9hF7SlLumTTXXEmXt0e1GdcM9UcYiyPsV/MmCzNXuJ+43DBe+Lt64U+Wfa/0vYkeuJGKynSPI7kEYd5kEfarmAGXKzRHGJeIRDFvshD6Pw0SoEkWTZwvP91mWYf33iHat0Rdik3SCIF5k0Ukqn8hm859Py5RVqlmjqQ2Z1r+JfgFAvIa0f0TZLlVV+GCfsydKHaUGDRXkRxtzqRZI6msUvPslLYI6+oRjapF08SPL3VJgYc5AuURuv1hWWfVJE12GCvnivJKpFiGuOJSWjxNRKNK4/bSE2FZNU4L4/XnRMd2rirwsIAXu4vw+GzdRzkNdG4bGnU37T+UahmiQzt6/TlxWhhlmi4eJjvCWBzF5arn5Vg6W+Q2cmGBh2UG8cxy9fpblu3Qt11Pt/8kFR8cnNuIls4WPS9HcbmGqZrkRVgfR2GpCgexeIqYOFT4vEn7zXq0Po3umiw/XG9Zh48OES3zVAq+3cnnxcShYvEUEQ6isFQlc5H3KY8wLlFTi51F6uzmmD1CvP68uOh8134BHqVFIxo2VRUbtlLxOz0zyRGU1L3QHBedT68/L2aPEGc3x64iVVObjLnTtMT+OKUgFeJxxOKoqUPAq5qGcf6F1LeXaHkG+d3+7XcUx0FFFIPHyyWzbLoC0zQXs8eIfo/IrFCqfFwepcePqfsPaccuteDPasMWta8ckToKeuFx/vfItsSubUhkhILg8SIcQn4TtD4d7VrhtCbi7Jbk8yTwl1gm6MN/P8Ojs+SjD9rU4SUXUsEA8cB01bqpiU9GSgK/F+3OpmkjqTaGLTvUgSK1cTu2fY7CIpRXIVaPBN5Hmsg9QyooBaUg5Vf/Ts1NeKTsEOa8htf+Zdkf4sYe1O+aFL3d6Uhf7sZSQcqv9vAESvDhaG0d9peisAir1iFSB79H5mXhvDZ0Zy9qdQb5fYn9bXZQCm2aYtzvZP5p4uL2Nh3gTRoqNu+QO/cjkHobLlqL7Z+pF15R/92q9pchGqPAKTscTfAxEhEcAa8H6X40zkQoQBURenMNfjpI9h8tl79h2bdBohCQ7qfBj8kDpbqH0kBPFYh0n/6FXUm2/A3Vf7T86SD55hpURCgUoMaZSPfD64FzCp6lf8pPVIRA0Iczm9DWQjzwhLyqr/xoQyqmmOYgFqf7xlk255iXi6nDaGfKPDj4ow3qqr7ygSfk1kKc2YSCPiRhVXPyZgvSHOQ3oqooeo+UY6fLWqueU5YQAS82F9JE255Jc2kHem602HHA5R3W1mHsdNl7pKyKIr8RpSXxbSjJnrJLc5AbpmVv46bB8aKDLt+u35QdwsJ/qpeXW/Yf79Gd7ryaKmt0j+OUKTqobro/vuxt5IaTmt9heubNw+k4UE5X95Mfb7Rsdzx5eVk0cZ7autOy//i4IaJpDly5kubjjerqfvJAOYXT9QxA28UrbxoCAeo9XL7xrmW740kiQjgdXe+WZRW6h9IQPg/+MEOEXPd2pzfeVb2Hy0CAvAm+UNAAOq8gOwLZGTRkitq6K7U6FAJn5NCgAmnXE+mzMvHbsWLfIfdc+t26Sw2ZorIzyNG6kkLzMg5HIBjAPWMse471yfN58MEWPLvYsv/2BefQ6DtFUbkbMpQS94yRwQD0FgjtEQLwOKiIUv/U6zAvC0++rH7/imU79D2/pDuuolKrjqW/SUr0HyMrouQx4J3Q+iMEkO7Hyk+wfIVlu+NJUsDpOfT4C/L9Tyz7jw8fKC47D3a9DOcoy1eolZ8g3YwXLhgRIYDcLEyaJw9Z/vnaUARkheiBSZadHPq8KHhQ1Etl6dnhoQpMmidzs3SP4wumRCgI0RgtXGrnVj0JaQ7ioDuHW/bg4NOb4pXpzmo73+60cKmKxsicR2yaEiGAcDpGL5DVEd3jSDq/Fxt2oWCmZefErc/ColGixLaDl+oIRi+Qui4JHpNBEQJo1QhLlln54XqSskN47S0ss+12p5t/TjdcYdkruJcsU60a6R7E15kVYShAb7wnI2Y8nDzJGmXixgly03bLOpwwRLQ/E7Y83zESxRvvyVDAmCNRAKZFmOZgxToUWvV6owTqdDrd/JDcV6x7HA3hOJj7mKissWMlTeF+rFiH5K8O/XZmRQggN0Qr3rVhe54CRPCkUcEMyy6ZZqTjhYniUJUFk6Ur3pW55j04x7gIg36s/lj3IPQJ+vDORoybYVWFQOcONGmg2G/8W2VWf4ygGdcGj2RchI5ASRmqUm+O9EuNQliyAkv/bvzXytf16kF9fobSCsC4b5r/qYqgpEz/IrVvMm5EglBaqfYVWbYLJlazRvj1DLnJtrc7jRwozj8L0TpDO9xXpEorlTmXB79kXIREqIqiotK8P1VytcilAY/KPft0j6MhPGl4/nERr1dxIx/iUVFJVdHEPyHm5BkXIYC6eqqNWvYlkHCOQFWEhk+17OQwlI6nx4nqGhM3X21U1dWbl6CZER5+hjcL+rF+Fwpsm6TpejENvcvE/Soeh5kvYDTxj8W+lJWOBa/b90yaH3Ux8QtHSUMfRc0Rmq5FY3rkabl+k5G7D0sEjtACOWEaUCDLynWPg50aHKEFHIF6Rb8cKq1YGsYaiiO0g8+DvSV4ch5X6EIcoTWyMzBjqfp7qr7Pw8U4QmsohbPzaMh0+dZq7tBVOELL5GTQ2Jmq1Pil0uzEcYSWSXMQqcfgAj45dA+O0D4BL9bvgnUr2tjxcIRWygrhtZX4k223O7Fj4ghtlRvGhLlyw2bu0Hocoa2IkBGkywem3BOT3YcjtJgQaN2YBhfIer7pxGYcod18HqzZhhnzeZLGYhyh9RpnYv4y9eJf+OTQVhyhG+Rl0+jfyfU8SWMnjtAlTs+lfmNlySHd42ANxxG6hCOgFP16smVvWWPgCN0k4MOHm/DEMzxJYxmO0FUah/GHf6uXeJLGKhyh2+Rk0sOz5dqN3KE1OEK3IaBVExo0QVZW6x4KOzEcoQsJgbo43Tlc1sV0D4WdAI7QnfxebN1r39udUhNH6FqZQSxZgf9bySeHpuMI3axFLq4bK9es5w6NxhG63EX59Oupatce3eNgx8cRupwjUB1BwW/45NBcHKH7Bf34aDtG8DNpTMURpoSsdPzxTbXoNT45NBFHmCryc2jKc/K/fLuTeTjCVEFARpD6PSJLDuoeCvs6jjCFOA6Uop6D+eTQLBxhavF5UF6FJ/l2J5NwhCknK4RZf1ZL/8Ynh6bgCFPRmbk0do5872Pu0AgcYYrKyaDBk2R5pe5xMI4wZTkC5FC/UTJWr3soKY8jTF0+Dz79DNN4kkY3jjCl5WTi2b9i6XI+OdSJI0x1+Tl4dL58Zw13qA1HmOqIEA5Sv0dkZY3uoaQqjpDBEcgKUf+RUvLXoQ4cIQMAbxrWf4ax03mSRgOOkP1PdgivvoUlf+Vvw2TjCNlXcjLxwAy5ZYfucaQYjpB9TZumdN2D8T37dI8jlXCE7GsEIeSjgpkyym93ShYjI1QAn5joE/Bh1UZM51dwJ4uJESpAcYRaNc7Egn+oZxbxZkgGEyMkAl+w0i4vix5fKNdvcs+WkAqCdA/iWEyM0ONgb5HuQTAgP4cGT5IHy3SPI0H2FiPN0T2IYzExQl8aNmxzzwewvRyB6lrqM0JG63QPJRHWb1U+j+5BHIuREXrwzjrdg2AAAL8Xu4tQ4Iq3O636BL403YM4FhMjdBxs3sPfhKbIDGLJm+qv/7J+i2wpVA4fjp64zADe/Vj3INgXWjSm/lPlB+ss7vDdj5ER0D2I4zA0wowArV7jhkMg1zgrl4Y8JvcX6x7H97V6jcwIGDk3amyEfg9eXQletGEOR6C2nh6cIG28hButxasr4TdyVgbGRugIbN+n1m60cIO7V8CHT/dgjIW3O63dqLbvU46hO7upESogP4fmLFI2fu66WFY6FvwDf/mnTVtFKcx5SeXnkLGDNjRCAB4H729W//nA2D9dKlIKrfIwerZ8f6012+U/H6j3tyiPkfOih5kbIYBwkKbMs2Zjp46sEA2ZKvfs1z2OEzNlngoHDZ2SOczoCD1p+KwYcxfbdxLibmkOYvV079i47oF8t7mL5e4SeIy8Rv8loyMEkB3CmPlq527d42Bf5/didwmNfdLoz8cduzF2vspK1z2O72J6hADa5NGAArmPl3QbJpyOJW+ol1419HxhbxEGFMg2eUYfiB5mQYRpAsXlGDlN1ltw+JNa8rJp6vPqU/NW28fiGDlNlpTD2MsSR7JhjEAogE+247Yh3KFZCMgM4Uf9ZalJtzvF4uj9oFy3HSFT16kdxY4IAWQEsXkP7hrBx6VmEYSzcunu0TIS1T0UAMDeItw1XG4tREZQ91BOmDURAsgIYt0O9BkheZ7GKN40bPocc17UP0mzYzf6jJDrd9pUIOyKEEAogKooLukT5+sWRsnNxKw/qd+/ovPk8JnFsnOfeHXUmqPQL1kWIQBH4Nxm9NTL+Pnd8u33eV2bERRwemN6fIF8O+krnJTC26vVNXfL3/0R5zQjK2ZijkJde9s61xGrR1mN6tyWBt5GHdqR33fKf2Pfh+SmQpi8AEqvuEQkqt5e5ISScjQYrcXajerpl9T7m1VWOhl+Rf5bWBzhYbE4CktVq6bU83J0vpi6dDiF14XufFh+uocj/Da1MZyZh8W/Eaf0kUqrPlarP1SvrsSO/So/h2zfItZHCICAuEQ0hsqIqoigbXP88EI6vzWa5ZIgUIKOT7weTHtW7Ttkx6UnjcqrcUVH3NKD6usT9jOlQmGRWr8Nqz5RWwoRDiAUIL8HjnDDY6LdEOFR4nHUxlBbj1gcSoES99XYKGToM/NME61DeUJfOSoIHgdeD3xpMPM5MSfD2uPo43McBB1YNUftNn4v/F7dg7AHH1oxphlHyJhmHCFjmnGEjGnGETKmGUfImGYcIWOacYSMacYRMqYZR8iYZhwhY5pxhIxpxhEyphlHyJhmHCFjmnGEjGnGETKmGUfImGYcIWOacYSMacYRMqYZR8iYZhwhY5pxhIxpxhEyphlHyJhmHCFjmnGEjGnGETKmGUfImGYcIWOacYSMacYRMqYZR8iYZhwhY5pxhIxpxhEyphlHyJhmHCFjmnGEjGnGETKmGUfImGYcIWOacYSMacYRMqYZR8iYZhwhY5pxhIxp9v9d9u4jkrCD9AAAAABJRU5ErkJggg==";
}
return result;
};
return TestBrokerViewModel;
}(observable_1.Observable));
exports.TestBrokerViewModel = TestBrokerViewModel;
exports.mainViewModel = new TestBrokerViewModel();
__webpack_require__("../node_modules/tns-core-modules/application/application.js").onUncaughtError = function (error) {
console.log("NSUTR: uncaught error");
exports.mainViewModel.error(error.message);
};
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("../node_modules/webpack/buildin/global.js")))
/***/ }),
/***/ "../node_modules/nativescript-unit-test-runner/services/karma-files-service.js":
/***/ (function(module, exports) {
Object.defineProperty(exports, "__esModule", { value: true });
var KarmaFilesService = (function () {
function KarmaFilesService(http) {
this.http = http;
}
KarmaFilesService.prototype.getServedFilesData = function (baseUrl, config) {
var _this = this;
var contextUrl = baseUrl + "/context.json";
console.log("NSUTR: downloading " + contextUrl);
var bundle = config && config.options && config.options.bundle;
var result = this.http.getString(contextUrl)
.then(function (content) {
var parsedContent = JSON.parse(content);
return parsedContent.files;
})
.then(function (scriptUrls) {
return Promise.all(scriptUrls.map(function (url) {
var appPrefix = "/base/" + config.options.appDirectoryRelativePath + "/";
var type = _this.getScriptType(url, config);
if (!bundle && url.startsWith(appPrefix)) {
var paramsStart = url.indexOf('?');
var relativePath = url.substring(appPrefix.length, paramsStart);
return Promise.resolve({
url: url,
type: type,
localPath: '../../../' + relativePath,
});
}
else {
return _this.http.getString(baseUrl + url)
.then(function (contents) {
return {
url: url,
type: type,
contents: contents
};
});
}
}));
});
return result;
};
KarmaFilesService.prototype.getScriptType = function (url, config) {
var type = 1;
if (url.startsWith("/base/" + config.options.appDirectoryRelativePath + "/tests")) {
type = 0;
}
else if (url.startsWith("/base/node_modules/")) {
type = 2;
}
return type;
};
return KarmaFilesService;
}());
exports.KarmaFilesService = KarmaFilesService;
/***/ }),
/***/ "../node_modules/nativescript-unit-test-runner/services/karma-host-resolver.js":
/***/ (function(module, exports) {
Object.defineProperty(exports, "__esModule", { value: true });
var KarmaHostResolver = (function () {
function KarmaHostResolver(http) {
this.http = http;
}
KarmaHostResolver.prototype.resolveKarmaHost = function (ips, port) {
var _this = this;
var result = new Promise(function (resolve) {
var foundKarma = false;
var resolvers = ips.map(function (ip) {
var karmaClientUrl = "http://" + ip + ":" + port + "/context.json";
console.log('NSUTR: fetching ' + karmaClientUrl);
return _this.http.getString({
url: karmaClientUrl,
method: 'GET',
timeout: 3000,
}).then(function () {
console.log('NSUTR: found karma at ' + ip);
if (!foundKarma) {
foundKarma = true;
resolve(ip);
}
}, function () { return undefined; });
});
Promise.all(resolvers)
.then(function () {
if (!foundKarma) {
resolve(null);
}
});
});
return result;
};
return KarmaHostResolver;
}());
exports.KarmaHostResolver = KarmaHostResolver;
/***/ }),
/***/ "../node_modules/nativescript-unit-test-runner/services/test-execution-service.js":
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global) {Object.defineProperty(exports, "__esModule", { value: true });
var TestExecutionService = (function () {
function TestExecutionService() {
}
TestExecutionService.prototype.runTests = function (scripts) {
var _this = this;
var errors = [];
var testScripts = scripts.filter(function (script) { return script.type === 2 || script.type === 0; });
testScripts
.forEach(function (script) {
try {
_this.runTest(script);
}
catch (err) {
errors.push({
msg: err.toString(),
url: script.localPath || script.url,
line: err.lineNumber || 0
});
}
});
return errors;
};
TestExecutionService.prototype.runTest = function (script) {
if (script.localPath) {
console.log('NSUTR: require script ' + script.url + ' from ' + script.localPath);
if (false) {}
}
else {
var queryStringStart = script.url.lastIndexOf('?');
var pathWithoutQueryString = script.url.substring(0, queryStringStart);
var extensionRegex = /\.([^.\/]+)$/;
var fileExtension = extensionRegex.exec(pathWithoutQueryString)[1];
if (!fileExtension || fileExtension.toLowerCase() === "js") {
console.log('NSUTR: eval script ' + script.url);
this.loadShim(script.url);
var geval = eval;
geval(script.contents);
this.completeLoading(script.url);
}
else {
console.log('NSUTR: ignoring evaluation of script ' + script.url);
}
}
};
TestExecutionService.prototype.loadShim = function (url) {
if (url.indexOf('mocha') !== -1) {
global.window = global;
global.location = { href: '/' };
global.document = {
getElementById: function (id) { return null; }
};
}
else if (url.indexOf('chai') !== -1) {
global.__shim_require = global.require;
global.require = function () {
throw Error();
};
global.window = global;
}
else if (url.indexOf('qunit.js') !== -1) {
global.define = function (factory) {
global.QUnit = factory();
};
global.define.amd = true;
}
};
TestExecutionService.prototype.completeLoading = function (url) {
if (url.indexOf('mocha') !== -1) {
delete global.window;
delete global.document;
}
if (url.indexOf('chai') !== -1) {
delete global.window;
global.require = global.__shim_require;
delete global.__shim_require;
}
else if (url.indexOf('qunit.js') !== -1) {
delete global.define;
}
};
return TestExecutionService;
}());
exports.TestExecutionService = TestExecutionService;
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("../node_modules/webpack/buildin/global.js")))
/***/ }),
/***/ "../node_modules/nativescript-unit-test-runner/socket.io.js":
/***/ (function(module, exports, __webpack_require__) {
/*!
* Socket.IO v2.1.1
* (c) 2014-2018 Guillermo Rauch
* Released under the MIT License.
*/
!function(t,e){ true?module.exports=e():undefined}(this,function(){return function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return t[r].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){"use strict";function r(t,e){"object"===("undefined"==typeof t?"undefined":o(t))&&(e=t,t=void 0),e=e||{};var n,r=i(t),s=r.source,p=r.id,h=r.path,f=u[p]&&h in u[p].nsps,l=e.forceNew||e["force new connection"]||!1===e.multiplex||f;return l?(c("ignoring socket cache for %s",s),n=a(s,e)):(u[p]||(c("new io instance for %s",s),u[p]=a(s,e)),n=u[p]),r.query&&!e.query&&(e.query=r.query),n.socket(r.path,e)}var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i=n(1),s=n(7),a=n(12),c=n(3)("socket.io-client");t.exports=e=r;var u=e.managers={};e.protocol=s.protocol,e.connect=r,e.Manager=n(12),e.Socket=n(37)},function(t,e,n){(function(e){"use strict";function r(t,n){var r=t;n=n||e.location,null==t&&(t=n.protocol+"//"+n.host),"string"==typeof t&&("/"===t.charAt(0)&&(t="/"===t.charAt(1)?n.protocol+t:n.host+t),/^(https?|wss?):\/\//.test(t)||(i("protocol-less url %s",t),t="undefined"!=typeof n?n.protocol+"//"+t:"https://"+t),i("parse %s",t),r=o(t)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";var s=r.host.indexOf(":")!==-1,a=s?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+a+":"+r.port,r.href=r.protocol+"://"+a+(n&&n.port===r.port?"":":"+r.port),r}var o=n(2),i=n(3)("socket.io-client:url");t.exports=r}).call(e,function(){return this}())},function(t,e){var n=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,r=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];t.exports=function(t){var e=t,o=t.indexOf("["),i=t.indexOf("]");o!=-1&&i!=-1&&(t=t.substring(0,o)+t.substring(o,i).replace(/:/g,";")+t.substring(i,t.length));for(var s=n.exec(t||""),a={},c=14;c--;)a[r[c]]=s[c]||"";return o!=-1&&i!=-1&&(a.source=e,a.host=a.host.substring(1,a.host.length-1).replace(/;/g,":"),a.authority=a.authority.replace("[","").replace("]","").replace(/;/g,":"),a.ipv6uri=!0),a}},function(t,e,n){(function(r){function o(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))}function i(t){var n=this.useColors;if(t[0]=(n?"%c":"")+this.namespace+(n?" %c":" ")+t[0]+(n?"%c ":" ")+"+"+e.humanize(this.diff),n){var r="color: "+this.color;t.splice(1,0,r,"color: inherit");var o=0,i=0;t[0].replace(/%[a-zA-Z%]/g,function(t){"%%"!==t&&(o++,"%c"===t&&(i=o))}),t.splice(i,0,r)}}function s(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function a(t){try{null==t?e.storage.removeItem("debug"):e.storage.debug=t}catch(n){}}function c(){var t;try{t=e.storage.debug}catch(n){}return!t&&"undefined"!=typeof r&&"env"in r&&(t=r.env.DEBUG),t}function u(){try{return window.localStorage}catch(t){}}e=t.exports=n(5),e.log=s,e.formatArgs=i,e.save=a,e.load=c,e.useColors=o,e.storage="undefined"!=typeof chrome&&"undefined"!=typeof chrome.storage?chrome.storage.local:u(),e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],e.formatters.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}},e.enable(c())}).call(e,n(4))},function(t,e){function n(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function o(t){if(p===setTimeout)return setTimeout(t,0);if((p===n||!p)&&setTimeout)return p=setTimeout,setTimeout(t,0);try{return p(t,0)}catch(e){try{return p.call(null,t,0)}catch(e){return p.call(this,t,0)}}}function i(t){if(h===clearTimeout)return clearTimeout(t);if((h===r||!h)&&clearTimeout)return h=clearTimeout,clearTimeout(t);try{return h(t)}catch(e){try{return h.call(null,t)}catch(e){return h.call(this,t)}}}function s(){y&&l&&(y=!1,l.length?d=l.concat(d):m=-1,d.length&&a())}function a(){if(!y){var t=o(s);y=!0;for(var e=d.length;e;){for(l=d,d=[];++m<e;)l&&l[m].run();m=-1,e=d.length}l=null,y=!1,i(t)}}function c(t,e){this.fun=t,this.array=e}function u(){}var p,h,f=t.exports={};!function(){try{p="function"==typeof setTimeout?setTimeout:n}catch(t){p=n}try{h="function"==typeof clearTimeout?clearTimeout:r}catch(t){h=r}}();var l,d=[],y=!1,m=-1;f.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];d.push(new c(t,e)),1!==d.length||y||o(a)},c.prototype.run=function(){this.fun.apply(null,this.array)},f.title="browser",f.browser=!0,f.env={},f.argv=[],f.version="",f.versions={},f.on=u,f.addListener=u,f.once=u,f.off=u,f.removeListener=u,f.removeAllListeners=u,f.emit=u,f.prependListener=u,f.prependOnceListener=u,f.listeners=function(t){return[]},f.binding=function(t){throw new Error("process.binding is not supported")},f.cwd=function(){return"/"},f.chdir=function(t){throw new Error("process.chdir is not supported")},f.umask=function(){return 0}},function(t,e,n){function r(t){var n,r=0;for(n in t)r=(r<<5)-r+t.charCodeAt(n),r|=0;return e.colors[Math.abs(r)%e.colors.length]}function o(t){function n(){if(n.enabled){var t=n,r=+new Date,i=r-(o||r);t.diff=i,t.prev=o,t.curr=r,o=r;for(var s=new Array(arguments.length),a=0;a<s.length;a++)s[a]=arguments[a];s[0]=e.coerce(s[0]),"string"!=typeof s[0]&&s.unshift("%O");var c=0;s[0]=s[0].replace(/%([a-zA-Z%])/g,function(n,r){if("%%"===n)return n;c++;var o=e.formatters[r];if("function"==typeof o){var i=s[c];n=o.call(t,i),s.splice(c,1),c--}return n}),e.formatArgs.call(t,s);var u=n.log||e.log||console.log.bind(console);u.apply(t,s)}}var o;return n.namespace=t,n.enabled=e.enabled(t),n.useColors=e.useColors(),n.color=r(t),n.destroy=i,"function"==typeof e.init&&e.init(n),e.instances.push(n),n}function i(){var t=e.instances.indexOf(this);return t!==-1&&(e.instances.splice(t,1),!0)}function s(t){e.save(t),e.names=[],e.skips=[];var n,r=("string"==typeof t?t:"").split(/[\s,]+/),o=r.length;for(n=0;n<o;n++)r[n]&&(t=r[n].replace(/\*/g,".*?"),"-"===t[0]?e.skips.push(new RegExp("^"+t.substr(1)+"$")):e.names.push(new RegExp("^"+t+"$")));for(n=0;n<e.instances.length;n++){var i=e.instances[n];i.enabled=e.enabled(i.namespace)}}function a(){e.enable("")}function c(t){if("*"===t[t.length-1])return!0;var n,r;for(n=0,r=e.skips.length;n<r;n++)if(e.skips[n].test(t))return!1;for(n=0,r=e.names.length;n<r;n++)if(e.names[n].test(t))return!0;return!1}function u(t){return t instanceof Error?t.stack||t.message:t}e=t.exports=o.debug=o["default"]=o,e.coerce=u,e.disable=a,e.enable=s,e.enabled=c,e.humanize=n(6),e.instances=[],e.names=[],e.skips=[],e.formatters={}},function(t,e){function n(t){if(t=String(t),!(t.length>100)){var e=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(t);if(e){var n=parseFloat(e[1]),r=(e[2]||"ms").toLowerCase();switch(r){case"years":case"year":case"yrs":case"yr":case"y":return n*p;case"days":case"day":case"d":return n*u;case"hours":case"hour":case"hrs":case"hr":case"h":return n*c;case"minutes":case"minute":case"mins":case"min":case"m":return n*a;case"seconds":case"second":case"secs":case"sec":case"s":return n*s;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}function r(t){return t>=u?Math.round(t/u)+"d":t>=c?Math.round(t/c)+"h":t>=a?Math.round(t/a)+"m":t>=s?Math.round(t/s)+"s":t+"ms"}function o(t){return i(t,u,"day")||i(t,c,"hour")||i(t,a,"minute")||i(t,s,"second")||t+" ms"}function i(t,e,n){if(!(t<e))return t<1.5*e?Math.floor(t/e)+" "+n:Math.ceil(t/e)+" "+n+"s"}var s=1e3,a=60*s,c=60*a,u=24*c,p=365.25*u;t.exports=function(t,e){e=e||{};var i=typeof t;if("string"===i&&t.length>0)return n(t);if("number"===i&&isNaN(t)===!1)return e["long"]?o(t):r(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))}},function(t,e,n){function r(){}function o(t){var n=""+t.type;if(e.BINARY_EVENT!==t.type&&e.BINARY_ACK!==t.type||(n+=t.attachments+"-"),t.nsp&&"/"!==t.nsp&&(n+=t.nsp+","),null!=t.id&&(n+=t.id),null!=t.data){var r=i(t.data);if(r===!1)return g;n+=r}return f("encoded %j as %s",t,n),n}function i(t){try{return JSON.stringify(t)}catch(e){return!1}}function s(t,e){function n(t){var n=d.deconstructPacket(t),r=o(n.packet),i=n.buffers;i.unshift(r),e(i)}d.removeBlobs(t,n)}function a(){this.reconstructor=null}function c(t){var n=0,r={type:Number(t.charAt(0))};if(null==e.types[r.type])return h("unknown packet type "+r.type);if(e.BINARY_EVENT===r.type||e.BINARY_ACK===r.type){for(var o="";"-"!==t.charAt(++n)&&(o+=t.charAt(n),n!=t.length););if(o!=Number(o)||"-"!==t.charAt(n))throw new Error("Illegal attachments");r.attachments=Number(o)}if("/"===t.charAt(n+1))for(r.nsp="";++n;){var i=t.charAt(n);if(","===i)break;if(r.nsp+=i,n===t.length)break}else r.nsp="/";var s=t.charAt(n+1);if(""!==s&&Number(s)==s){for(r.id="";++n;){var i=t.charAt(n);if(null==i||Number(i)!=i){--n;break}if(r.id+=t.charAt(n),n===t.length)break}r.id=Number(r.id)}if(t.charAt(++n)){var a=u(t.substr(n)),c=a!==!1&&(r.type===e.ERROR||y(a));if(!c)return h("invalid payload");r.data=a}return f("decoded %s as %j",t,r),r}function u(t){try{return JSON.parse(t)}catch(e){return!1}}function p(t){this.reconPack=t,this.buffers=[]}function h(t){return{type:e.ERROR,data:"parser error: "+t}}var f=n(3)("socket.io-parser"),l=n(8),d=n(9),y=n(10),m=n(11);e.protocol=4,e.types=["CONNECT","DISCONNECT","EVENT","ACK","ERROR","BINARY_EVENT","BINARY_ACK"],e.CONNECT=0,e.DISCONNECT=1,e.EVENT=2,e.ACK=3,e.ERROR=4,e.BINARY_EVENT=5,e.BINARY_ACK=6,e.Encoder=r,e.Decoder=a;var g=e.ERROR+'"encode error"';r.prototype.encode=function(t,n){if(f("encoding packet %j",t),e.BINARY_EVENT===t.type||e.BINARY_ACK===t.type)s(t,n);else{var r=o(t);n([r])}},l(a.prototype),a.prototype.add=function(t){var n;if("string"==typeof t)n=c(t),e.BINARY_EVENT===n.type||e.BINARY_ACK===n.type?(this.reconstructor=new p(n),0===this.reconstructor.reconPack.attachments&&this.emit("decoded",n)):this.emit("decoded",n);else{if(!m(t)&&!t.base64)throw new Error("Unknown type: "+t);if(!this.reconstructor)throw new Error("got binary data when not reconstructing a packet");n=this.reconstructor.takeBinaryData(t),n&&(this.reconstructor=null,this.emit("decoded",n))}},a.prototype.destroy=function(){this.reconstructor&&this.reconstructor.finishedReconstruction()},p.prototype.takeBinaryData=function(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){var e=d.reconstructPacket(this.reconPack,this.buffers);return this.finishedReconstruction(),e}return null},p.prototype.finishedReconstruction=function(){this.reconPack=null,this.buffers=[]}},function(t,e,n){function r(t){if(t)return o(t)}function o(t){for(var e in r.prototype)t[e]=r.prototype[e];return t}t.exports=r,r.prototype.on=r.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this},r.prototype.once=function(t,e){function n(){this.off(t,n),e.apply(this,arguments)}return n.fn=e,this.on(t,n),this},r.prototype.off=r.prototype.removeListener=r.prototype.removeAllListeners=r.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n=this._callbacks["$"+t];if(!n)return this;if(1==arguments.length)return delete this._callbacks["$"+t],this;for(var r,o=0;o<n.length;o++)if(r=n[o],r===e||r.fn===e){n.splice(o,1);break}return this},r.prototype.emit=function(t){this._callbacks=this._callbacks||{};var e=[].slice.call(arguments,1),n=this._callbacks["$"+t];if(n){n=n.slice(0);for(var r=0,o=n.length;r<o;++r)n[r].apply(this,e)}return this},r.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]},r.prototype.hasListeners=function(t){return!!this.listeners(t).length}},function(t,e,n){(function(t){function r(t,e){if(!t)return t;if(s(t)){var n={_placeholder:!0,num:e.length};return e.push(t),n}if(i(t)){for(var o=new Array(t.length),a=0;a<t.length;a++)o[a]=r(t[a],e);return o}if("object"==typeof t&&!(t instanceof Date)){var o={};for(var c in t)o[c]=r(t[c],e);return o}return t}function o(t,e){if(!t)return t;if(t&&t._placeholder)return e[t.num];if(i(t))for(var n=0;n<t.length;n++)t[n]=o(t[n],e);else if("object"==typeof t)for(var r in t)t[r]=o(t[r],e);return t}var i=n(10),s=n(11),a=Object.prototype.toString,c="function"==typeof t.Blob||"[object BlobConstructor]"===a.call(t.Blob),u="function"==typeof t.File||"[object FileConstructor]"===a.call(t.File);e.deconstructPacket=function(t){var e=[],n=t.data,o=t;return o.data=r(n,e),o.attachments=e.length,{packet:o,buffers:e}},e.reconstructPacket=function(t,e){return t.data=o(t.data,e),t.attachments=void 0,t},e.removeBlobs=function(t,e){function n(t,a,p){if(!t)return t;if(c&&t instanceof Blob||u&&t instanceof File){r++;var h=new FileReader;h.onload=function(){p?p[a]=this.result:o=this.result,--r||e(o)},h.readAsArrayBuffer(t)}else if(i(t))for(var f=0;f<t.length;f++)n(t[f],f,t);else if("object"==typeof t&&!s(t))for(var l in t)n(t[l],l,t)}var r=0,o=t;n(o),r||e(o)}}).call(e,function(){return this}())},function(t,e){var n={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==n.call(t)}},function(t,e){(function(e){function n(t){return r&&e.Buffer.isBuffer(t)||o&&(t instanceof e.ArrayBuffer||i(t))}t.exports=n;var r="function"==typeof e.Buffer&&"function"==typeof e.Buffer.isBuffer,o="function"==typeof e.ArrayBuffer,i=function(){return o&&"function"==typeof e.ArrayBuffer.isView?e.ArrayBuffer.isView:function(t){return t.buffer instanceof e.ArrayBuffer}}()}).call(e,function(){return this}())},function(t,e,n){"use strict";function r(t,e){if(!(this instanceof r))return new r(t,e);t&&"object"===("undefined"==typeof t?"undefined":o(t))&&(e=t,t=void 0),e=e||{},e.path=e.path||"/socket.io",this.nsps={},this.subs=[],this.opts=e,this.reconnection(e.reconnection!==!1),this.reconnectionAttempts(e.reconnectionAttempts||1/0),this.reconnectionDelay(e.reconnectionDelay||1e3),this.reconnectionDelayMax(e.reconnectionDelayMax||5e3),this.randomizationFactor(e.randomizationFactor||.5),this.backoff=new l({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(null==e.timeout?2e4:e.timeout),this.readyState="closed",this.uri=t,this.connecting=[],this.lastPing=null,this.encoding=!1,this.packetBuffer=[];var n=e.parser||c;this.encoder=new n.Encoder,this.decoder=new n.Decoder,this.autoConnect=e.autoConnect!==!1,this.autoConnect&&this.open()}var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i=n(13),s=n(37),a=n(8),c=n(7),u=n(39),p=n(40),h=n(3)("socket.io-client:manager"),f=n(36),l=n(41),d=Object.prototype.hasOwnProperty;t.exports=r,r.prototype.emitAll=function(){this.emit.apply(this,arguments);for(var t in this.nsps)d.call(this.nsps,t)&&this.nsps[t].emit.apply(this.nsps[t],arguments)},r.prototype.updateSocketIds=function(){for(var t in this.nsps)d.call(this.nsps,t)&&(this.nsps[t].id=this.generateId(t))},r.prototype.generateId=function(t){return("/"===t?"":t+"#")+this.engine.id},a(r.prototype),r.prototype.reconnection=function(t){return arguments.length?(this._reconnection=!!t,this):this._reconnection},r.prototype.reconnectionAttempts=function(t){return arguments.length?(this._reconnectionAttempts=t,this):this._reconnectionAttempts},r.prototype.reconnectionDelay=function(t){return arguments.length?(this._reconnectionDelay=t,this.backoff&&this.backoff.setMin(t),this):this._reconnectionDelay},r.prototype.randomizationFactor=function(t){return arguments.length?(this._randomizationFactor=t,this.backoff&&this.backoff.setJitter(t),this):this._randomizationFactor},r.prototype.reconnectionDelayMax=function(t){return arguments.length?(this._reconnectionDelayMax=t,this.backoff&&this.backoff.setMax(t),this):this._reconnectionDelayMax},r.prototype.timeout=function(t){return arguments.length?(this._timeout=t,this):this._timeout},r.prototype.maybeReconnectOnOpen=function(){!this.reconnecting&&this._reconnection&&0===this.backoff.attempts&&this.reconnect()},r.prototype.open=r.prototype.connect=function(t,e){if(h("readyState %s",this.readyState),~this.readyState.indexOf("open"))return this;h("opening %s",this.uri),this.engine=i(this.uri,this.opts);var n=this.engine,r=this;this.readyState="opening",this.skipReconnect=!1;var o=u(n,"open",function(){r.onopen(),t&&t()}),s=u(n,"error",function(e){if(h("connect_error"),r.cleanup(),r.readyState="closed",r.emitAll("connect_error",e),t){var n=new Error("Connection error");n.data=e,t(n)}else r.maybeReconnectOnOpen()});if(!1!==this._timeout){var a=this._timeout;h("connect attempt will timeout after %d",a);var c=setTimeout(function(){h("connect attempt timed out after %d",a),o.destroy(),n.close(),n.emit("error","timeout"),r.emitAll("connect_timeout",a)},a);this.subs.push({destroy:function(){clearTimeout(c)}})}return this.subs.push(o),this.subs.push(s),this},r.prototype.onopen=function(){h("open"),this.cleanup(),this.readyState="open",this.emit("open");var t=this.engine;this.subs.push(u(t,"data",p(this,"ondata"))),this.subs.push(u(t,"ping",p(this,"onping"))),this.subs.push(u(t,"pong",p(this,"onpong"))),this.subs.push(u(t,"error",p(this,"onerror"))),this.subs.push(u(t,"close",p(this,"onclose"))),this.subs.push(u(this.decoder,"decoded",p(this,"ondecoded")))},r.prototype.onping=function(){this.lastPing=new Date,this.emitAll("ping")},r.prototype.onpong=function(){this.emitAll("pong",new Date-this.lastPing)},r.prototype.ondata=function(t){this.decoder.add(t)},r.prototype.ondecoded=function(t){this.emit("packet",t)},r.prototype.onerror=function(t){h("error",t),this.emitAll("error",t)},r.prototype.socket=function(t,e){function n(){~f(o.connecting,r)||o.connecting.push(r)}var r=this.nsps[t];if(!r){r=new s(this,t,e),this.nsps[t]=r;var o=this;r.on("connecting",n),r.on("connect",function(){r.id=o.generateId(t)}),this.autoConnect&&n()}return r},r.prototype.destroy=function(t){var e=f(this.connecting,t);~e&&this.connecting.splice(e,1),this.connecting.length||this.close()},r.prototype.packet=function(t){h("writing packet %j",t);var e=this;t.query&&0===t.type&&(t.nsp+="?"+t.query),e.encoding?e.packetBuffer.push(t):(e.encoding=!0,this.encoder.encode(t,function(n){for(var r=0;r<n.length;r++)e.engine.write(n[r],t.options);e.encoding=!1,e.processPacketQueue()}))},r.prototype.processPacketQueue=function(){if(this.packetBuffer.length>0&&!this.encoding){var t=this.packetBuffer.shift();this.packet(t)}},r.prototype.cleanup=function(){h("cleanup");for(var t=this.subs.length,e=0;e<t;e++){var n=this.subs.shift();n.destroy()}this.packetBuffer=[],this.encoding=!1,this.lastPing=null,this.decoder.destroy()},r.prototype.close=r.prototype.disconnect=function(){h("disconnect"),this.skipReconnect=!0,this.reconnecting=!1,"opening"===this.readyState&&this.cleanup(),this.backoff.reset(),this.readyState="closed",this.engine&&this.engine.close()},r.prototype.onclose=function(t){h("onclose"),this.cleanup(),this.backoff.reset(),this.readyState="closed",this.emit("close",t),this._reconnection&&!this.skipReconnect&&this.reconnect()},r.prototype.reconnect=function(){if(this.reconnecting||this.skipReconnect)return this;var t=this;if(this.backoff.attempts>=this._reconnectionAttempts)h("reconnect failed"),this.backoff.reset(),this.emitAll("reconnect_failed"),this.reconnecting=!1;else{var e=this.backoff.duration();h("will wait %dms before reconnect attempt",e),this.reconnecting=!0;var n=setTimeout(function(){t.skipReconnect||(h("attempting reconnect"),t.emitAll("reconnect_attempt",t.backoff.attempts),t.emitAll("reconnecting",t.backoff.attempts),t.skipReconnect||t.open(function(e){e?(h("reconnect attempt error"),t.reconnecting=!1,t.reconnect(),t.emitAll("reconnect_error",e.data)):(h("reconnect success"),t.onreconnect())}))},e);this.subs.push({destroy:function(){clearTimeout(n)}})}},r.prototype.onreconnect=function(){var t=this.backoff.attempts;this.reconnecting=!1,this.backoff.reset(),this.updateSocketIds(),this.emitAll("reconnect",t)}},function(t,e,n){t.exports=n(14),t.exports.parser=n(21)},function(t,e,n){(function(e){function r(t,n){if(!(this instanceof r))return new r(t,n);n=n||{},t&&"object"==typeof t&&(n=t,t=null),t?(t=p(t),n.hostname=t.host,n.secure="https"===t.protocol||"wss"===t.protocol,n.port=t.port,t.query&&(n.query=t.query)):n.host&&(n.hostname=p(n.host).host),this.secure=null!=n.secure?n.secure:e.location&&"https:"===location.protocol,n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.agent=n.agent||!1,this.hostname=n.hostname||(e.location?location.hostname:"localhost"),this.port=n.port||(e.location&&location.port?location.port:this.secure?443:80),this.query=n.query||{},"string"==typeof this.query&&(this.query=h.decode(this.query)),this.upgrade=!1!==n.upgrade,this.path=(n.path||"/engine.io").replace(/\/$/,"")+"/",this.forceJSONP=!!n.forceJSONP,this.jsonp=!1!==n.jsonp,this.forceBase64=!!n.forceBase64,this.enablesXDR=!!n.enablesXDR,this.timestampParam=n.timestampParam||"t",this.timestampRequests=n.timestampRequests,this.transports=n.transports||["polling","websocket"],this.transportOptions=n.transportOptions||{},this.readyState="",this.writeBuffer=[],this.prevBufferLen=0,this.policyPort=n.policyPort||843,this.rememberUpgrade=n.rememberUpgrade||!1,this.binaryType=null,this.onlyBinaryUpgrades=n.onlyBinaryUpgrades,this.perMessageDeflate=!1!==n.perMessageDeflate&&(n.perMessageDeflate||{}),!0===this.perMessageDeflate&&(this.perMessageDeflate={}),this.perMessageDeflate&&null==this.perMessageDeflate.threshold&&(this.perMessageDeflate.threshold=1024),this.pfx=n.pfx||null,this.key=n.key||null,this.passphrase=n.passphrase||null,this.cert=n.cert||null,this.ca=n.ca||null,this.ciphers=n.ciphers||null,this.rejectUnauthorized=void 0===n.rejectUnauthorized||n.rejectUnauthorized,this.forceNode=!!n.forceNode;var o="object"==typeof e&&e;o.global===o&&(n.extraHeaders&&Object.keys(n.extraHeaders).length>0&&(this.extraHeaders=n.extraHeaders),n.localAddress&&(this.localAddress=n.localAddress)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingIntervalTimer=null,this.pingTimeoutTimer=null,this.open()}function o(t){var e={};for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}var i=n(15),s=n(8),a=n(3)("engine.io-client:socket"),c=n(36),u=n(21),p=n(2),h=n(30);t.exports=r,r.priorWebsocketSuccess=!1,s(r.prototype),r.protocol=u.protocol,r.Socket=r,r.Transport=n(20),r.transports=n(15),r.parser=n(21),r.prototype.createTransport=function(t){a('creating transport "%s"',t);var e=o(this.query);e.EIO=u.protocol,e.transport=t;var n=this.transportOptions[t]||{};this.id&&(e.sid=this.id);var r=new i[t]({query:e,socket:this,agent:n.agent||this.agent,hostname:n.hostname||this.hostname,port:n.port||this.port,secure:n.secure||this.secure,path:n.path||this.path,forceJSONP:n.forceJSONP||this.forceJSONP,jsonp:n.jsonp||this.jsonp,forceBase64:n.forceBase64||this.forceBase64,enablesXDR:n.enablesXDR||this.enablesXDR,timestampRequests:n.timestampRequests||this.timestampRequests,timestampParam:n.timestampParam||this.timestampParam,policyPort:n.policyPort||this.policyPort,pfx:n.pfx||this.pfx,key:n.key||this.key,passphrase:n.passphrase||this.passphrase,cert:n.cert||this.cert,ca:n.ca||this.ca,ciphers:n.ciphers||this.ciphers,rejectUnauthorized:n.rejectUnauthorized||this.rejectUnauthorized,perMessageDeflate:n.perMessageDeflate||this.perMessageDeflate,extraHeaders:n.extraHeaders||this.extraHeaders,forceNode:n.forceNode||this.forceNode,localAddress:n.localAddress||this.localAddress,requestTimeout:n.requestTimeout||this.requestTimeout,protocols:n.protocols||void 0});return r},r.prototype.open=function(){var t;if(this.rememberUpgrade&&r.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1)t="websocket";else{if(0===this.transports.length){var e=this;return void setTimeout(function(){e.emit("error","No transports available")},0)}t=this.transports[0]}this.readyState="opening";try{t=this.createTransport(t)}catch(n){return this.transports.shift(),void this.open()}t.open(),this.setTransport(t)},r.prototype.setTransport=function(t){a("setting transport %s",t.name);var e=this;this.transport&&(a("clearing existing transport %s",this.transport.name),this.transport.removeAllListeners()),this.transport=t,t.on("drain",function(){e.onDrain()}).on("packet",function(t){e.onPacket(t)}).on("error",function(t){e.onError(t)}).on("close",function(){e.onClose("transport close")})},r.prototype.probe=function(t){function e(){if(f.onlyBinaryUpgrades){var e=!this.supportsBinary&&f.transport.supportsBinary;h=h||e}h||(a('probe transport "%s" opened',t),p.send([{type:"ping",data:"probe"}]),p.once("packet",function(e){if(!h)if("pong"===e.type&&"probe"===e.data){if(a('probe transport "%s" pong',t),f.upgrading=!0,f.emit("upgrading",p),!p)return;r.priorWebsocketSuccess="websocket"===p.name,a('pausing current transport "%s"',f.transport.name),f.transport.pause(function(){h||"closed"!==f.readyState&&(a("changing transport and sending upgrade packet"),u(),f.setTransport(p),p.send([{type:"upgrade"}]),f.emit("upgrade",p),p=null,f.upgrading=!1,f.flush())})}else{a('probe transport "%s" failed',t);var n=new Error("probe error");n.transport=p.name,f.emit("upgradeError",n)}}))}function n(){h||(h=!0,u(),p.close(),p=null)}function o(e){var r=new Error("probe error: "+e);r.transport=p.name,n(),a('probe transport "%s" failed because of error: %s',t,e),f.emit("upgradeError",r)}function i(){o("transport closed")}function s(){o("socket closed")}function c(t){p&&t.name!==p.name&&(a('"%s" works - aborting "%s"',t.name,p.name),n())}function u(){p.removeListener("open",e),p.removeListener("error",o),p.removeListener("close",i),f.removeListener("close",s),f.removeListener("upgrading",c)}a('probing transport "%s"',t);var p=this.createTransport(t,{probe:1}),h=!1,f=this;r.priorWebsocketSuccess=!1,p.once("open",e),p.once("error",o),p.once("close",i),this.once("close",s),this.once("upgrading",c),p.open()},r.prototype.onOpen=function(){if(a("socket open"),this.readyState="open",r.priorWebsocketSuccess="websocket"===this.transport.name,this.emit("open"),this.flush(),"open"===this.readyState&&this.upgrade&&this.transport.pause){a("starting upgrade probes");for(var t=0,e=this.upgrades.length;t<e;t++)this.probe(this.upgrades[t])}},r.prototype.onPacket=function(t){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState)switch(a('socket receive: type "%s", data "%s"',t.type,t.data),this.emit("packet",t),this.emit("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"pong":this.setPing(),this.emit("pong");break;case"error":var e=new Error("server error");e.code=t.data,this.onError(e);break;case"message":this.emit("data",t.data),this.emit("message",t.data)}else a('packet received with socket readyState "%s"',this.readyState)},r.prototype.onHandshake=function(t){this.emit("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this.upgrades=this.filterUpgrades(t.upgrades),this.pingInterval=t.pingInterval,this.pingTimeout=t.pingTimeout,this.onOpen(),"closed"!==this.readyState&&(this.setPing(),this.removeListener("heartbeat",this.onHeartbeat),this.on("heartbeat",this.onHeartbeat))},r.prototype.onHeartbeat=function(t){clearTimeout(this.pingTimeoutTimer);var e=this;e.pingTimeoutTimer=setTimeout(function(){"closed"!==e.readyState&&e.onClose("ping timeout")},t||e.pingInterval+e.pingTimeout)},r.prototype.setPing=function(){var t=this;clearTimeout(t.pingIntervalTimer),t.pingIntervalTimer=setTimeout(function(){a("writing ping packet - expecting pong within %sms",t.pingTimeout),t.ping(),t.onHeartbeat(t.pingTimeout)},t.pingInterval)},r.prototype.ping=function(){var t=this;this.sendPacket("ping",function(){t.emit("ping")})},r.prototype.onDrain=function(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,0===this.writeBuffer.length?this.emit("drain"):this.flush()},r.prototype.flush=function(){"closed"!==this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length&&(a("flushing %d packets in socket",this.writeBuffer.length),this.transport.send(this.writeBuffer),this.prevBufferLen=this.writeBuffer.length,this.emit("flush"))},r.prototype.write=r.prototype.send=function(t,e,n){return this.sendPacket("message",t,e,n),this},r.prototype.sendPacket=function(t,e,n,r){if("function"==typeof e&&(r=e,e=void 0),"function"==typeof n&&(r=n,n=null),"closing"!==this.readyState&&"closed"!==this.readyState){n=n||{},n.compress=!1!==n.compress;var o={type:t,data:e,options:n};this.emit("packetCreate",o),this.writeBuffer.push(o),r&&this.once("flush",r),this.flush()}},r.prototype.close=function(){function t(){r.onClose("forced close"),a("socket closing - telling transport to close"),r.transport.close()}function e(){r.removeListener("upgrade",e),r.removeListener("upgradeError",e),t()}function n(){r.once("upgrade",e),r.once("upgradeError",e)}if("opening"===this.readyState||"open"===this.readyState){this.readyState="closing";var r=this;this.writeBuffer.length?this.once("drain",function(){this.upgrading?n():t()}):this.upgrading?n():t()}return this},r.prototype.onError=function(t){a("socket error %j",t),r.priorWebsocketSuccess=!1,this.emit("error",t),this.onClose("transport error",t)},r.prototype.onClose=function(t,e){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState){a('socket close with reason: "%s"',t);var n=this;clearTimeout(this.pingIntervalTimer),clearTimeout(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),this.readyState="closed",this.id=null,this.emit("close",t,e),n.writeBuffer=[],n.prevBufferLen=0}},r.prototype.filterUpgrades=function(t){for(var e=[],n=0,r=t.length;n<r;n++)~c(this.transports,t[n])&&e.push(t[n]);return e}}).call(e,function(){return this}())},function(t,e,n){(function(t){function r(e){var n,r=!1,a=!1,c=!1!==e.jsonp;if(t.location){var u="https:"===location.protocol,p=location.port;
p||(p=u?443:80),r=e.hostname!==location.hostname||p!==e.port,a=e.secure!==u}if(e.xdomain=r,e.xscheme=a,n=new o(e),"open"in n&&!e.forceJSONP)return new i(e);if(!c)throw new Error("JSONP disabled");return new s(e)}var o=n(16),i=n(18),s=n(33),a=n(34);e.polling=r,e.websocket=a}).call(e,function(){return this}())},function(t,e,n){(function(e){var r=n(17);t.exports=function(t){var n=t.xdomain,o=t.xscheme,i=t.enablesXDR;try{if("undefined"!=typeof XMLHttpRequest&&(!n||r))return new XMLHttpRequest}catch(s){}try{if("undefined"!=typeof XDomainRequest&&!o&&i)return new XDomainRequest}catch(s){}if(!n)try{return new(e[["Active"].concat("Object").join("X")])("Microsoft.XMLHTTP")}catch(s){}}}).call(e,function(){return this}())},function(t,e){try{t.exports="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(n){t.exports=!1}},function(t,e,n){(function(e){function r(){}function o(t){if(c.call(this,t),this.requestTimeout=t.requestTimeout,this.extraHeaders=t.extraHeaders,e.location){var n="https:"===location.protocol,r=location.port;r||(r=n?443:80),this.xd=t.hostname!==e.location.hostname||r!==t.port,this.xs=t.secure!==n}}function i(t){this.method=t.method||"GET",this.uri=t.uri,this.xd=!!t.xd,this.xs=!!t.xs,this.async=!1!==t.async,this.data=void 0!==t.data?t.data:null,this.agent=t.agent,this.isBinary=t.isBinary,this.supportsBinary=t.supportsBinary,this.enablesXDR=t.enablesXDR,this.requestTimeout=t.requestTimeout,this.pfx=t.pfx,this.key=t.key,this.passphrase=t.passphrase,this.cert=t.cert,this.ca=t.ca,this.ciphers=t.ciphers,this.rejectUnauthorized=t.rejectUnauthorized,this.extraHeaders=t.extraHeaders,this.create()}function s(){for(var t in i.requests)i.requests.hasOwnProperty(t)&&i.requests[t].abort()}var a=n(16),c=n(19),u=n(8),p=n(31),h=n(3)("engine.io-client:polling-xhr");t.exports=o,t.exports.Request=i,p(o,c),o.prototype.supportsBinary=!0,o.prototype.request=function(t){return t=t||{},t.uri=this.uri(),t.xd=this.xd,t.xs=this.xs,t.agent=this.agent||!1,t.supportsBinary=this.supportsBinary,t.enablesXDR=this.enablesXDR,t.pfx=this.pfx,t.key=this.key,t.passphrase=this.passphrase,t.cert=this.cert,t.ca=this.ca,t.ciphers=this.ciphers,t.rejectUnauthorized=this.rejectUnauthorized,t.requestTimeout=this.requestTimeout,t.extraHeaders=this.extraHeaders,new i(t)},o.prototype.doWrite=function(t,e){var n="string"!=typeof t&&void 0!==t,r=this.request({method:"POST",data:t,isBinary:n}),o=this;r.on("success",e),r.on("error",function(t){o.onError("xhr post error",t)}),this.sendXhr=r},o.prototype.doPoll=function(){h("xhr poll");var t=this.request(),e=this;t.on("data",function(t){e.onData(t)}),t.on("error",function(t){e.onError("xhr poll error",t)}),this.pollXhr=t},u(i.prototype),i.prototype.create=function(){var t={agent:this.agent,xdomain:this.xd,xscheme:this.xs,enablesXDR:this.enablesXDR};t.pfx=this.pfx,t.key=this.key,t.passphrase=this.passphrase,t.cert=this.cert,t.ca=this.ca,t.ciphers=this.ciphers,t.rejectUnauthorized=this.rejectUnauthorized;var n=this.xhr=new a(t),r=this;try{h("xhr open %s: %s",this.method,this.uri),n.open(this.method,this.uri,this.async);try{if(this.extraHeaders){n.setDisableHeaderCheck&&n.setDisableHeaderCheck(!0);for(var o in this.extraHeaders)this.extraHeaders.hasOwnProperty(o)&&n.setRequestHeader(o,this.extraHeaders[o])}}catch(s){}if("POST"===this.method)try{this.isBinary?n.setRequestHeader("Content-type","application/octet-stream"):n.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(s){}try{n.setRequestHeader("Accept","*/*")}catch(s){}"withCredentials"in n&&(n.withCredentials=!0),this.requestTimeout&&(n.timeout=this.requestTimeout),this.hasXDR()?(n.onload=function(){r.onLoad()},n.onerror=function(){r.onError(n.responseText)}):n.onreadystatechange=function(){if(2===n.readyState)try{var t=n.getResponseHeader("Content-Type");r.supportsBinary&&"application/octet-stream"===t&&(n.responseType="arraybuffer")}catch(e){}4===n.readyState&&(200===n.status||1223===n.status?r.onLoad():setTimeout(function(){r.onError(n.status)},0))},h("xhr data %s",this.data),n.send(this.data)}catch(s){return void setTimeout(function(){r.onError(s)},0)}e.document&&(this.index=i.requestsCount++,i.requests[this.index]=this)},i.prototype.onSuccess=function(){this.emit("success"),this.cleanup()},i.prototype.onData=function(t){this.emit("data",t),this.onSuccess()},i.prototype.onError=function(t){this.emit("error",t),this.cleanup(!0)},i.prototype.cleanup=function(t){if("undefined"!=typeof this.xhr&&null!==this.xhr){if(this.hasXDR()?this.xhr.onload=this.xhr.onerror=r:this.xhr.onreadystatechange=r,t)try{this.xhr.abort()}catch(n){}e.document&&delete i.requests[this.index],this.xhr=null}},i.prototype.onLoad=function(){var t;try{var e;try{e=this.xhr.getResponseHeader("Content-Type")}catch(n){}t="application/octet-stream"===e?this.xhr.response||this.xhr.responseText:this.xhr.responseText}catch(n){this.onError(n)}null!=t&&this.onData(t)},i.prototype.hasXDR=function(){return"undefined"!=typeof e.XDomainRequest&&!this.xs&&this.enablesXDR},i.prototype.abort=function(){this.cleanup()},i.requestsCount=0,i.requests={},e.document&&(e.attachEvent?e.attachEvent("onunload",s):e.addEventListener&&e.addEventListener("beforeunload",s,!1))}).call(e,function(){return this}())},function(t,e,n){function r(t){var e=t&&t.forceBase64;p&&!e||(this.supportsBinary=!1),o.call(this,t)}var o=n(20),i=n(30),s=n(21),a=n(31),c=n(32),u=n(3)("engine.io-client:polling");t.exports=r;var p=function(){var t=n(16),e=new t({xdomain:!1});return null!=e.responseType}();a(r,o),r.prototype.name="polling",r.prototype.doOpen=function(){this.poll()},r.prototype.pause=function(t){function e(){u("paused"),n.readyState="paused",t()}var n=this;if(this.readyState="pausing",this.polling||!this.writable){var r=0;this.polling&&(u("we are currently polling - waiting to pause"),r++,this.once("pollComplete",function(){u("pre-pause polling complete"),--r||e()})),this.writable||(u("we are currently writing - waiting to pause"),r++,this.once("drain",function(){u("pre-pause writing complete"),--r||e()}))}else e()},r.prototype.poll=function(){u("polling"),this.polling=!0,this.doPoll(),this.emit("poll")},r.prototype.onData=function(t){var e=this;u("polling got data %s",t);var n=function(t,n,r){return"opening"===e.readyState&&e.onOpen(),"close"===t.type?(e.onClose(),!1):void e.onPacket(t)};s.decodePayload(t,this.socket.binaryType,n),"closed"!==this.readyState&&(this.polling=!1,this.emit("pollComplete"),"open"===this.readyState?this.poll():u('ignoring poll - transport state "%s"',this.readyState))},r.prototype.doClose=function(){function t(){u("writing close packet"),e.write([{type:"close"}])}var e=this;"open"===this.readyState?(u("transport open - closing"),t()):(u("transport not open - deferring close"),this.once("open",t))},r.prototype.write=function(t){var e=this;this.writable=!1;var n=function(){e.writable=!0,e.emit("drain")};s.encodePayload(t,this.supportsBinary,function(t){e.doWrite(t,n)})},r.prototype.uri=function(){var t=this.query||{},e=this.secure?"https":"http",n="";!1!==this.timestampRequests&&(t[this.timestampParam]=c()),this.supportsBinary||t.sid||(t.b64=1),t=i.encode(t),this.port&&("https"===e&&443!==Number(this.port)||"http"===e&&80!==Number(this.port))&&(n=":"+this.port),t.length&&(t="?"+t);var r=this.hostname.indexOf(":")!==-1;return e+"://"+(r?"["+this.hostname+"]":this.hostname)+n+this.path+t}},function(t,e,n){function r(t){this.path=t.path,this.hostname=t.hostname,this.port=t.port,this.secure=t.secure,this.query=t.query,this.timestampParam=t.timestampParam,this.timestampRequests=t.timestampRequests,this.readyState="",this.agent=t.agent||!1,this.socket=t.socket,this.enablesXDR=t.enablesXDR,this.pfx=t.pfx,this.key=t.key,this.passphrase=t.passphrase,this.cert=t.cert,this.ca=t.ca,this.ciphers=t.ciphers,this.rejectUnauthorized=t.rejectUnauthorized,this.forceNode=t.forceNode,this.extraHeaders=t.extraHeaders,this.localAddress=t.localAddress}var o=n(21),i=n(8);t.exports=r,i(r.prototype),r.prototype.onError=function(t,e){var n=new Error(t);return n.type="TransportError",n.description=e,this.emit("error",n),this},r.prototype.open=function(){return"closed"!==this.readyState&&""!==this.readyState||(this.readyState="opening",this.doOpen()),this},r.prototype.close=function(){return"opening"!==this.readyState&&"open"!==this.readyState||(this.doClose(),this.onClose()),this},r.prototype.send=function(t){if("open"!==this.readyState)throw new Error("Transport not open");this.write(t)},r.prototype.onOpen=function(){this.readyState="open",this.writable=!0,this.emit("open")},r.prototype.onData=function(t){var e=o.decodePacket(t,this.socket.binaryType);this.onPacket(e)},r.prototype.onPacket=function(t){this.emit("packet",t)},r.prototype.onClose=function(){this.readyState="closed",this.emit("close")}},function(t,e,n){(function(t){function r(t,n){var r="b"+e.packets[t.type]+t.data.data;return n(r)}function o(t,n,r){if(!n)return e.encodeBase64Packet(t,r);var o=t.data,i=new Uint8Array(o),s=new Uint8Array(1+o.byteLength);s[0]=v[t.type];for(var a=0;a<i.length;a++)s[a+1]=i[a];return r(s.buffer)}function i(t,n,r){if(!n)return e.encodeBase64Packet(t,r);var o=new FileReader;return o.onload=function(){t.data=o.result,e.encodePacket(t,n,!0,r)},o.readAsArrayBuffer(t.data)}function s(t,n,r){if(!n)return e.encodeBase64Packet(t,r);if(g)return i(t,n,r);var o=new Uint8Array(1);o[0]=v[t.type];var s=new k([o.buffer,t.data]);return r(s)}function a(t){try{t=d.decode(t,{strict:!1})}catch(e){return!1}return t}function c(t,e,n){for(var r=new Array(t.length),o=l(t.length,n),i=function(t,n,o){e(n,function(e,n){r[t]=n,o(e,r)})},s=0;s<t.length;s++)i(s,t[s],o)}var u,p=n(22),h=n(23),f=n(24),l=n(25),d=n(26);t&&t.ArrayBuffer&&(u=n(28));var y="undefined"!=typeof navigator&&/Android/i.test(navigator.userAgent),m="undefined"!=typeof navigator&&/PhantomJS/i.test(navigator.userAgent),g=y||m;e.protocol=3;var v=e.packets={open:0,close:1,ping:2,pong:3,message:4,upgrade:5,noop:6},b=p(v),w={type:"error",data:"parser error"},k=n(29);e.encodePacket=function(e,n,i,a){"function"==typeof n&&(a=n,n=!1),"function"==typeof i&&(a=i,i=null);var c=void 0===e.data?void 0:e.data.buffer||e.data;if(t.ArrayBuffer&&c instanceof ArrayBuffer)return o(e,n,a);if(k&&c instanceof t.Blob)return s(e,n,a);if(c&&c.base64)return r(e,a);var u=v[e.type];return void 0!==e.data&&(u+=i?d.encode(String(e.data),{strict:!1}):String(e.data)),a(""+u)},e.encodeBase64Packet=function(n,r){var o="b"+e.packets[n.type];if(k&&n.data instanceof t.Blob){var i=new FileReader;return i.onload=function(){var t=i.result.split(",")[1];r(o+t)},i.readAsDataURL(n.data)}var s;try{s=String.fromCharCode.apply(null,new Uint8Array(n.data))}catch(a){for(var c=new Uint8Array(n.data),u=new Array(c.length),p=0;p<c.length;p++)u[p]=c[p];s=String.fromCharCode.apply(null,u)}return o+=t.btoa(s),r(o)},e.decodePacket=function(t,n,r){if(void 0===t)return w;if("string"==typeof t){if("b"===t.charAt(0))return e.decodeBase64Packet(t.substr(1),n);if(r&&(t=a(t),t===!1))return w;var o=t.charAt(0);return Number(o)==o&&b[o]?t.length>1?{type:b[o],data:t.substring(1)}:{type:b[o]}:w}var i=new Uint8Array(t),o=i[0],s=f(t,1);return k&&"blob"===n&&(s=new k([s])),{type:b[o],data:s}},e.decodeBase64Packet=function(t,e){var n=b[t.charAt(0)];if(!u)return{type:n,data:{base64:!0,data:t.substr(1)}};var r=u.decode(t.substr(1));return"blob"===e&&k&&(r=new k([r])),{type:n,data:r}},e.encodePayload=function(t,n,r){function o(t){return t.length+":"+t}function i(t,r){e.encodePacket(t,!!s&&n,!1,function(t){r(null,o(t))})}"function"==typeof n&&(r=n,n=null);var s=h(t);return n&&s?k&&!g?e.encodePayloadAsBlob(t,r):e.encodePayloadAsArrayBuffer(t,r):t.length?void c(t,i,function(t,e){return r(e.join(""))}):r("0:")},e.decodePayload=function(t,n,r){if("string"!=typeof t)return e.decodePayloadAsBinary(t,n,r);"function"==typeof n&&(r=n,n=null);var o;if(""===t)return r(w,0,1);for(var i,s,a="",c=0,u=t.length;c<u;c++){var p=t.charAt(c);if(":"===p){if(""===a||a!=(i=Number(a)))return r(w,0,1);if(s=t.substr(c+1,i),a!=s.length)return r(w,0,1);if(s.length){if(o=e.decodePacket(s,n,!1),w.type===o.type&&w.data===o.data)return r(w,0,1);var h=r(o,c+i,u);if(!1===h)return}c+=i,a=""}else a+=p}return""!==a?r(w,0,1):void 0},e.encodePayloadAsArrayBuffer=function(t,n){function r(t,n){e.encodePacket(t,!0,!0,function(t){return n(null,t)})}return t.length?void c(t,r,function(t,e){var r=e.reduce(function(t,e){var n;return n="string"==typeof e?e.length:e.byteLength,t+n.toString().length+n+2},0),o=new Uint8Array(r),i=0;return e.forEach(function(t){var e="string"==typeof t,n=t;if(e){for(var r=new Uint8Array(t.length),s=0;s<t.length;s++)r[s]=t.charCodeAt(s);n=r.buffer}e?o[i++]=0:o[i++]=1;for(var a=n.byteLength.toString(),s=0;s<a.length;s++)o[i++]=parseInt(a[s]);o[i++]=255;for(var r=new Uint8Array(n),s=0;s<r.length;s++)o[i++]=r[s]}),n(o.buffer)}):n(new ArrayBuffer(0))},e.encodePayloadAsBlob=function(t,n){function r(t,n){e.encodePacket(t,!0,!0,function(t){var e=new Uint8Array(1);if(e[0]=1,"string"==typeof t){for(var r=new Uint8Array(t.length),o=0;o<t.length;o++)r[o]=t.charCodeAt(o);t=r.buffer,e[0]=0}for(var i=t instanceof ArrayBuffer?t.byteLength:t.size,s=i.toString(),a=new Uint8Array(s.length+1),o=0;o<s.length;o++)a[o]=parseInt(s[o]);if(a[s.length]=255,k){var c=new k([e.buffer,a.buffer,t]);n(null,c)}})}c(t,r,function(t,e){return n(new k(e))})},e.decodePayloadAsBinary=function(t,n,r){"function"==typeof n&&(r=n,n=null);for(var o=t,i=[];o.byteLength>0;){for(var s=new Uint8Array(o),a=0===s[0],c="",u=1;255!==s[u];u++){if(c.length>310)return r(w,0,1);c+=s[u]}o=f(o,2+c.length),c=parseInt(c);var p=f(o,0,c);if(a)try{p=String.fromCharCode.apply(null,new Uint8Array(p))}catch(h){var l=new Uint8Array(p);p="";for(var u=0;u<l.length;u++)p+=String.fromCharCode(l[u])}i.push(p),o=f(o,c)}var d=i.length;i.forEach(function(t,o){r(e.decodePacket(t,n,!0),o,d)})}}).call(e,function(){return this}())},function(t,e){t.exports=Object.keys||function(t){var e=[],n=Object.prototype.hasOwnProperty;for(var r in t)n.call(t,r)&&e.push(r);return e}},function(t,e,n){(function(e){function r(t){if(!t||"object"!=typeof t)return!1;if(o(t)){for(var n=0,i=t.length;n<i;n++)if(r(t[n]))return!0;return!1}if("function"==typeof e.Buffer&&e.Buffer.isBuffer&&e.Buffer.isBuffer(t)||"function"==typeof e.ArrayBuffer&&t instanceof ArrayBuffer||s&&t instanceof Blob||a&&t instanceof File)return!0;if(t.toJSON&&"function"==typeof t.toJSON&&1===arguments.length)return r(t.toJSON(),!0);for(var c in t)if(Object.prototype.hasOwnProperty.call(t,c)&&r(t[c]))return!0;return!1}var o=n(10),i=Object.prototype.toString,s="function"==typeof e.Blob||"[object BlobConstructor]"===i.call(e.Blob),a="function"==typeof e.File||"[object FileConstructor]"===i.call(e.File);t.exports=r}).call(e,function(){return this}())},function(t,e){t.exports=function(t,e,n){var r=t.byteLength;if(e=e||0,n=n||r,t.slice)return t.slice(e,n);if(e<0&&(e+=r),n<0&&(n+=r),n>r&&(n=r),e>=r||e>=n||0===r)return new ArrayBuffer(0);for(var o=new Uint8Array(t),i=new Uint8Array(n-e),s=e,a=0;s<n;s++,a++)i[a]=o[s];return i.buffer}},function(t,e){function n(t,e,n){function o(t,r){if(o.count<=0)throw new Error("after called too many times");--o.count,t?(i=!0,e(t),e=n):0!==o.count||i||e(null,r)}var i=!1;return n=n||r,o.count=t,0===t?e():o}function r(){}t.exports=n},function(t,e,n){var r;(function(t,o){!function(i){function s(t){for(var e,n,r=[],o=0,i=t.length;o<i;)e=t.charCodeAt(o++),e>=55296&&e<=56319&&o<i?(n=t.charCodeAt(o++),56320==(64512&n)?r.push(((1023&e)<<10)+(1023&n)+65536):(r.push(e),o--)):r.push(e);return r}function a(t){for(var e,n=t.length,r=-1,o="";++r<n;)e=t[r],e>65535&&(e-=65536,o+=w(e>>>10&1023|55296),e=56320|1023&e),o+=w(e);return o}function c(t,e){if(t>=55296&&t<=57343){if(e)throw Error("Lone surrogate U+"+t.toString(16).toUpperCase()+" is not a scalar value");return!1}return!0}function u(t,e){return w(t>>e&63|128)}function p(t,e){if(0==(4294967168&t))return w(t);var n="";return 0==(4294965248&t)?n=w(t>>6&31|192):0==(4294901760&t)?(c(t,e)||(t=65533),n=w(t>>12&15|224),n+=u(t,6)):0==(4292870144&t)&&(n=w(t>>18&7|240),n+=u(t,12),n+=u(t,6)),n+=w(63&t|128)}function h(t,e){e=e||{};for(var n,r=!1!==e.strict,o=s(t),i=o.length,a=-1,c="";++a<i;)n=o[a],c+=p(n,r);return c}function f(){if(b>=v)throw Error("Invalid byte index");var t=255&g[b];if(b++,128==(192&t))return 63&t;throw Error("Invalid continuation byte")}function l(t){var e,n,r,o,i;if(b>v)throw Error("Invalid byte index");if(b==v)return!1;if(e=255&g[b],b++,0==(128&e))return e;if(192==(224&e)){if(n=f(),i=(31&e)<<6|n,i>=128)return i;throw Error("Invalid continuation byte")}if(224==(240&e)){if(n=f(),r=f(),i=(15&e)<<12|n<<6|r,i>=2048)return c(i,t)?i:65533;throw Error("Invalid continuation byte")}if(240==(248&e)&&(n=f(),r=f(),o=f(),i=(7&e)<<18|n<<12|r<<6|o,i>=65536&&i<=1114111))return i;throw Error("Invalid UTF-8 detected")}function d(t,e){e=e||{};var n=!1!==e.strict;g=s(t),v=g.length,b=0;for(var r,o=[];(r=l(n))!==!1;)o.push(r);return a(o)}var y="object"==typeof e&&e,m=("object"==typeof t&&t&&t.exports==y&&t,"object"==typeof o&&o);m.global!==m&&m.window!==m||(i=m);var g,v,b,w=String.fromCharCode,k={version:"2.1.2",encode:h,decode:d};r=function(){return k}.call(e,n,e,t),!(void 0!==r&&(t.exports=r))}(this)}).call(e,n(27)(t),function(){return this}())},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children=[],t.webpackPolyfill=1),t}},function(t,e){!function(){"use strict";for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=new Uint8Array(256),r=0;r<t.length;r++)n[t.charCodeAt(r)]=r;e.encode=function(e){var n,r=new Uint8Array(e),o=r.length,i="";for(n=0;n<o;n+=3)i+=t[r[n]>>2],i+=t[(3&r[n])<<4|r[n+1]>>4],i+=t[(15&r[n+1])<<2|r[n+2]>>6],i+=t[63&r[n+2]];return o%3===2?i=i.substring(0,i.length-1)+"=":o%3===1&&(i=i.substring(0,i.length-2)+"=="),i},e.decode=function(t){var e,r,o,i,s,a=.75*t.length,c=t.length,u=0;"="===t[t.length-1]&&(a--,"="===t[t.length-2]&&a--);var p=new ArrayBuffer(a),h=new Uint8Array(p);for(e=0;e<c;e+=4)r=n[t.charCodeAt(e)],o=n[t.charCodeAt(e+1)],i=n[t.charCodeAt(e+2)],s=n[t.charCodeAt(e+3)],h[u++]=r<<2|o>>4,h[u++]=(15&o)<<4|i>>2,h[u++]=(3&i)<<6|63&s;return p}}()},function(t,e){(function(e){function n(t){for(var e=0;e<t.length;e++){var n=t[e];if(n.buffer instanceof ArrayBuffer){var r=n.buffer;if(n.byteLength!==r.byteLength){var o=new Uint8Array(n.byteLength);o.set(new Uint8Array(r,n.byteOffset,n.byteLength)),r=o.buffer}t[e]=r}}}function r(t,e){e=e||{};var r=new i;n(t);for(var o=0;o<t.length;o++)r.append(t[o]);return e.type?r.getBlob(e.type):r.getBlob()}function o(t,e){return n(t),new Blob(t,e||{})}var i=e.BlobBuilder||e.WebKitBlobBuilder||e.MSBlobBuilder||e.MozBlobBuilder,s=function(){try{var t=new Blob(["hi"]);return 2===t.size}catch(e){return!1}}(),a=s&&function(){try{var t=new Blob([new Uint8Array([1,2])]);return 2===t.size}catch(e){return!1}}(),c=i&&i.prototype.append&&i.prototype.getBlob;t.exports=function(){return s?a?e.Blob:o:c?r:void 0}()}).call(e,function(){return this}())},function(t,e){e.encode=function(t){var e="";for(var n in t)t.hasOwnProperty(n)&&(e.length&&(e+="&"),e+=encodeURIComponent(n)+"="+encodeURIComponent(t[n]));return e},e.decode=function(t){for(var e={},n=t.split("&"),r=0,o=n.length;r<o;r++){var i=n[r].split("=");e[decodeURIComponent(i[0])]=decodeURIComponent(i[1])}return e}},function(t,e){t.exports=function(t,e){var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}},function(t,e){"use strict";function n(t){var e="";do e=s[t%a]+e,t=Math.floor(t/a);while(t>0);return e}function r(t){var e=0;for(p=0;p<t.length;p++)e=e*a+c[t.charAt(p)];return e}function o(){var t=n(+new Date);return t!==i?(u=0,i=t):t+"."+n(u++)}for(var i,s="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),a=64,c={},u=0,p=0;p<a;p++)c[s[p]]=p;o.encode=n,o.decode=r,t.exports=o},function(t,e,n){(function(e){function r(){}function o(t){i.call(this,t),this.query=this.query||{},a||(e.___eio||(e.___eio=[]),a=e.___eio),this.index=a.length;var n=this;a.push(function(t){n.onData(t)}),this.query.j=this.index,e.document&&e.addEventListener&&e.addEventListener("beforeunload",function(){n.script&&(n.script.onerror=r)},!1)}var i=n(19),s=n(31);t.exports=o;var a,c=/\n/g,u=/\\n/g;s(o,i),o.prototype.supportsBinary=!1,o.prototype.doClose=function(){this.script&&(this.script.parentNode.removeChild(this.script),this.script=null),this.form&&(this.form.parentNode.removeChild(this.form),this.form=null,this.iframe=null),i.prototype.doClose.call(this)},o.prototype.doPoll=function(){var t=this,e=document.createElement("script");this.script&&(this.script.parentNode.removeChild(this.script),this.script=null),e.async=!0,e.src=this.uri(),e.onerror=function(e){t.onError("jsonp poll error",e)};var n=document.getElementsByTagName("script")[0];n?n.parentNode.insertBefore(e,n):(document.head||document.body).appendChild(e),this.script=e;var r="undefined"!=typeof navigator&&/gecko/i.test(navigator.userAgent);r&&setTimeout(function(){var t=document.createElement("iframe");document.body.appendChild(t),document.body.removeChild(t)},100)},o.prototype.doWrite=function(t,e){function n(){r(),e()}function r(){if(o.iframe)try{o.form.removeChild(o.iframe)}catch(t){o.onError("jsonp polling iframe removal error",t)}try{var e='<iframe src="javascript:0" name="'+o.iframeId+'">';i=document.createElement(e)}catch(t){i=document.createElement("iframe"),i.name=o.iframeId,i.src="javascript:0"}i.id=o.iframeId,o.form.appendChild(i),o.iframe=i}var o=this;if(!this.form){var i,s=document.createElement("form"),a=document.createElement("textarea"),p=this.iframeId="eio_iframe_"+this.index;s.className="socketio",s.style.position="absolute",s.style.top="-1000px",s.style.left="-1000px",s.target=p,s.method="POST",s.setAttribute("accept-charset","utf-8"),a.name="d",s.appendChild(a),document.body.appendChild(s),this.form=s,this.area=a}this.form.action=this.uri(),r(),t=t.replace(u,"\\\n"),this.area.value=t.replace(c,"\\n");try{this.form.submit()}catch(h){}this.iframe.attachEvent?this.iframe.onreadystatechange=function(){"complete"===o.iframe.readyState&&n()}:this.iframe.onload=n}}).call(e,function(){return this}())},function(t,e,n){(function(e){function r(t){var e=t&&t.forceBase64;e&&(this.supportsBinary=!1),this.perMessageDeflate=t.perMessageDeflate,this.usingBrowserWebSocket=h&&!t.forceNode,this.protocols=t.protocols,this.usingBrowserWebSocket||(l=o),i.call(this,t)}var o,i=n(20),s=n(21),a=n(30),c=n(31),u=n(32),p=n(3)("engine.io-client:websocket"),h=e.WebSocket||e.MozWebSocket;if("undefined"==typeof window)try{o=n(35)}catch(f){}var l=h;l||"undefined"!=typeof window||(l=o),t.exports=r,c(r,i),r.prototype.name="websocket",r.prototype.supportsBinary=!0,r.prototype.doOpen=function(){if(this.check()){var t=this.uri(),e=this.protocols,n={agent:this.agent,perMessageDeflate:this.perMessageDeflate};n.pfx=this.pfx,n.key=this.key,n.passphrase=this.passphrase,n.cert=this.cert,n.ca=this.ca,n.ciphers=this.ciphers,n.rejectUnauthorized=this.rejectUnauthorized,this.extraHeaders&&(n.headers=this.extraHeaders),this.localAddress&&(n.localAddress=this.localAddress);try{this.ws=this.usingBrowserWebSocket?e?new l(t,e):new l(t):new l(t,e,n)}catch(r){return this.emit("error",r)}void 0===this.ws.binaryType&&(this.supportsBinary=!1),this.ws.supports&&this.ws.supports.binary?(this.supportsBinary=!0,this.ws.binaryType="nodebuffer"):this.ws.binaryType="arraybuffer",this.addEventListeners()}},r.prototype.addEventListeners=function(){var t=this;this.ws.onopen=function(){t.onOpen()},this.ws.onclose=function(){t.onClose()},this.ws.onmessage=function(e){t.onData(e.data)},this.ws.onerror=function(e){t.onError("websocket error",e)}},r.prototype.write=function(t){function n(){r.emit("flush"),setTimeout(function(){r.writable=!0,r.emit("drain")},0)}var r=this;this.writable=!1;for(var o=t.length,i=0,a=o;i<a;i++)!function(t){s.encodePacket(t,r.supportsBinary,function(i){if(!r.usingBrowserWebSocket){var s={};if(t.options&&(s.compress=t.options.compress),r.perMessageDeflate){var a="string"==typeof i?e.Buffer.byteLength(i):i.length;a<r.perMessageDeflate.threshold&&(s.compress=!1)}}try{r.usingBrowserWebSocket?r.ws.send(i):r.ws.send(i,s)}catch(c){p("websocket closed before onclose event")}--o||n()})}(t[i])},r.prototype.onClose=function(){i.prototype.onClose.call(this)},r.prototype.doClose=function(){"undefined"!=typeof this.ws&&this.ws.close()},r.prototype.uri=function(){var t=this.query||{},e=this.secure?"wss":"ws",n="";this.port&&("wss"===e&&443!==Number(this.port)||"ws"===e&&80!==Number(this.port))&&(n=":"+this.port),this.timestampRequests&&(t[this.timestampParam]=u()),this.supportsBinary||(t.b64=1),t=a.encode(t),t.length&&(t="?"+t);var r=this.hostname.indexOf(":")!==-1;return e+"://"+(r?"["+this.hostname+"]":this.hostname)+n+this.path+t},r.prototype.check=function(){return!(!l||"__initialize"in l&&this.name===r.prototype.name)}}).call(e,function(){return this}())},function(t,e){},function(t,e){var n=[].indexOf;t.exports=function(t,e){if(n)return t.indexOf(e);for(var r=0;r<t.length;++r)if(t[r]===e)return r;return-1}},function(t,e,n){"use strict";function r(t,e,n){this.io=t,this.nsp=e,this.json=this,this.ids=0,this.acks={},this.receiveBuffer=[],this.sendBuffer=[],this.connected=!1,this.disconnected=!0,this.flags={},n&&n.query&&(this.query=n.query),this.io.autoConnect&&this.open()}var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i=n(7),s=n(8),a=n(38),c=n(39),u=n(40),p=n(3)("socket.io-client:socket"),h=n(30),f=n(23);t.exports=e=r;var l={connect:1,connect_error:1,connect_timeout:1,connecting:1,disconnect:1,error:1,reconnect:1,reconnect_attempt:1,reconnect_failed:1,reconnect_error:1,reconnecting:1,ping:1,pong:1},d=s.prototype.emit;s(r.prototype),r.prototype.subEvents=function(){if(!this.subs){var t=this.io;this.subs=[c(t,"open",u(this,"onopen")),c(t,"packet",u(this,"onpacket")),c(t,"close",u(this,"onclose"))]}},r.prototype.open=r.prototype.connect=function(){return this.connected?this:(this.subEvents(),this.io.open(),"open"===this.io.readyState&&this.onopen(),this.emit("connecting"),this)},r.prototype.send=function(){var t=a(arguments);return t.unshift("message"),this.emit.apply(this,t),this},r.prototype.emit=function(t){if(l.hasOwnProperty(t))return d.apply(this,arguments),this;var e=a(arguments),n={type:(void 0!==this.flags.binary?this.flags.binary:f(e))?i.BINARY_EVENT:i.EVENT,data:e};return n.options={},n.options.compress=!this.flags||!1!==this.flags.compress,"function"==typeof e[e.length-1]&&(p("emitting packet with ack id %d",this.ids),this.acks[this.ids]=e.pop(),n.id=this.ids++),this.connected?this.packet(n):this.sendBuffer.push(n),this.flags={},this},r.prototype.packet=function(t){t.nsp=this.nsp,this.io.packet(t)},r.prototype.onopen=function(){if(p("transport is open - connecting"),"/"!==this.nsp)if(this.query){var t="object"===o(this.query)?h.encode(this.query):this.query;p("sending connect packet with query %s",t),this.packet({type:i.CONNECT,query:t})}else this.packet({type:i.CONNECT})},r.prototype.onclose=function(t){p("close (%s)",t),this.connected=!1,this.disconnected=!0,delete this.id,this.emit("disconnect",t)},r.prototype.onpacket=function(t){var e=t.nsp===this.nsp,n=t.type===i.ERROR&&"/"===t.nsp;if(e||n)switch(t.type){case i.CONNECT:this.onconnect();break;case i.EVENT:this.onevent(t);break;case i.BINARY_EVENT:this.onevent(t);break;case i.ACK:this.onack(t);break;case i.BINARY_ACK:this.onack(t);break;case i.DISCONNECT:this.ondisconnect();break;case i.ERROR:this.emit("error",t.data)}},r.prototype.onevent=function(t){var e=t.data||[];p("emitting event %j",e),null!=t.id&&(p("attaching ack callback to event"),e.push(this.ack(t.id))),this.connected?d.apply(this,e):this.receiveBuffer.push(e)},r.prototype.ack=function(t){var e=this,n=!1;return function(){if(!n){n=!0;var r=a(arguments);p("sending ack %j",r),e.packet({type:f(r)?i.BINARY_ACK:i.ACK,id:t,data:r})}}},r.prototype.onack=function(t){var e=this.acks[t.id];"function"==typeof e?(p("calling ack %s with %j",t.id,t.data),e.apply(this,t.data),delete this.acks[t.id]):p("bad ack %s",t.id)},r.prototype.onconnect=function(){this.connected=!0,this.disconnected=!1,this.emit("connect"),this.emitBuffered()},r.prototype.emitBuffered=function(){var t;for(t=0;t<this.receiveBuffer.length;t++)d.apply(this,this.receiveBuffer[t]);for(this.receiveBuffer=[],t=0;t<this.sendBuffer.length;t++)this.packet(this.sendBuffer[t]);this.sendBuffer=[]},r.prototype.ondisconnect=function(){p("server disconnect (%s)",this.nsp),this.destroy(),this.onclose("io server disconnect")},r.prototype.destroy=function(){if(this.subs){for(var t=0;t<this.subs.length;t++)this.subs[t].destroy();this.subs=null}this.io.destroy(this)},r.prototype.close=r.prototype.disconnect=function(){return this.connected&&(p("performing disconnect (%s)",this.nsp),this.packet({type:i.DISCONNECT})),this.destroy(),this.connected&&this.onclose("io client disconnect"),this},r.prototype.compress=function(t){return this.flags.compress=t,this},r.prototype.binary=function(t){return this.flags.binary=t,this}},function(t,e){function n(t,e){var n=[];e=e||0;for(var r=e||0;r<t.length;r++)n[r-e]=t[r];return n}t.exports=n},function(t,e){"use strict";function n(t,e,n){return t.on(e,n),{destroy:function(){t.removeListener(e,n)}}}t.exports=n},function(t,e){var n=[].slice;t.exports=function(t,e){if("string"==typeof e&&(e=t[e]),"function"!=typeof e)throw new Error("bind() requires a function");var r=n.call(arguments,2);return function(){return e.apply(t,r.concat(n.call(arguments)))}}},function(t,e){function n(t){t=t||{},this.ms=t.min||100,this.max=t.max||1e4,this.factor=t.factor||2,this.jitter=t.jitter>0&&t.jitter<=1?t.jitter:0,this.attempts=0}t.exports=n,n.prototype.duration=function(){var t=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),n=Math.floor(e*this.jitter*t);t=0==(1&Math.floor(10*e))?t-n:t+n}return 0|Math.min(t,this.max)},n.prototype.reset=function(){this.attempts=0},n.prototype.setMin=function(t){this.ms=t},n.prototype.setMax=function(t){this.max=t},n.prototype.setJitter=function(t){this.jitter=t}}])});
//# sourceMappingURL=socket.io.js.map
/***/ }),
/***/ "../node_modules/nativescript-unit-test-runner/stop-process.js":
/***/ (function(module, exports) {
function killProcess() {
exit(0);
}
module.exports = killProcess;
/***/ }),
/***/ "../node_modules/nativescript-unit-test-runner/test-run-page.js":
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", { value: true });
var vmModule = __webpack_require__("../node_modules/nativescript-unit-test-runner/main-view-model.js");
function pageNavigatedTo(args) {
var page = args.object;
var broker = vmModule.mainViewModel;
page.bindingContext = broker;
broker.executeTestRun();
}
exports.pageNavigatedTo = pageNavigatedTo;
/***/ }),
/***/ "../node_modules/nativescript-unit-test-runner/test-run-page.xml":
/***/ (function(module, exports) {
module.exports = "<Page xmlns=\"http://www.nativescript.org/tns.xsd\" navigatedTo=\"pageNavigatedTo\">\n <GridLayout rows=\"*,auto,8*,auto,auto\">\n <GridLayout row=\"0\" columns=\"*,auto,*\" cssClass=\"title\">\n <Image src=\"{{ imageSrc }}\" stretch=\"aspectFill\" col=\"1\"/>\n </GridLayout>\n\n <Progress row=\"1\" value=\"{{ testsRan }}\" maxValue=\"{{ testsTotal }}\" cssClass=\"testProgress\"/>\n\n <StackLayout row=\"2\" style=\"margin: 20px;\">\n <Label text=\"{{ testsTotal, 'Total: ' + testsTotal}} \" cssClass=\"testsTotal\"/>\n <Label text=\"{{ testsPassed, 'Passed: ' + testsPassed }}\" cssClass=\"testsPassed\"/>\n <Label text=\"{{ testsFailed, 'Failed: ' + testsFailed }}\" cssClass=\"testsFailed\"/>\n <StackLayout orientation=\"horizontal\" visibility=\"{{ testsRunning, testsRunning ? 'visible' : 'collapsed' }}\" horizontalAlignment=\"left\">\n <ActivityIndicator busy=\"true\"/>\n <Label text=\"Testing in progress...\" verticalAlignment=\"center\"/>\n </StackLayout>\n </StackLayout>\n\n <Button text=\"View Test Run Details\" tap=\"{{ viewTestRunDetails }}\" row=\"3\"/>\n\n <GridLayout row=\"4\" cssClass=\"statusBar\">\n <Label text=\"{{ serverInfo }}\" cssClass=\"statusText\"/>\n </GridLayout>\n </GridLayout>\n</Page>\n"
/***/ }),
/***/ "../node_modules/tns-core-modules/application/application-common.js":
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global) {Object.defineProperty(exports, "__esModule", { value: true });
__webpack_require__("../node_modules/tns-core-modules/globals/globals.js");
var observable_1 = __webpack_require__("../node_modules/tns-core-modules/data/observable/observable.js");
exports.Observable = observable_1.Observable;
var profiling_1 = __webpack_require__("../node_modules/tns-core-modules/profiling/profiling.js");
var events = new observable_1.Observable();
var launched = false;
function setLaunched() {
launched = true;
events.off("launch", setLaunched);
}
events.on("launch", setLaunched);
if (profiling_1.level() > 0) {
events.on("displayed", function () {
var duration = profiling_1.uptime();
var end = profiling_1.time();
var start = end - duration;
profiling_1.trace("Displayed in " + duration.toFixed(2) + "ms", start, end);
});
}
function hasLaunched() {
return launched;
}
exports.hasLaunched = hasLaunched;
exports.launchEvent = "launch";
exports.suspendEvent = "suspend";
exports.displayedEvent = "displayed";
exports.resumeEvent = "resume";
exports.exitEvent = "exit";
exports.lowMemoryEvent = "lowMemory";
exports.uncaughtErrorEvent = "uncaughtError";
exports.discardedErrorEvent = "discardedError";
exports.orientationChangedEvent = "orientationChanged";
var cssFile = "./app.css";
var resources = {};
function getResources() {
return resources;
}
exports.getResources = getResources;
function setResources(res) {
resources = res;
}
exports.setResources = setResources;
exports.android = undefined;
exports.ios = undefined;
exports.on = events.on.bind(events);
exports.off = events.off.bind(events);
exports.notify = events.notify.bind(events);
exports.hasListeners = events.hasListeners.bind(events);
var app;
function setApplication(instance) {
app = instance;
}
exports.setApplication = setApplication;
function livesync(rootView, context) {
events.notify({ eventName: "livesync", object: app });
var liveSyncCore = global.__onLiveSyncCore;
var reapplyAppStyles = false;
var reapplyLocalStyles = false;
if (context && context.path) {
var extensions = ["css", "scss"];
var appStylesFullFileName = getCssFileName();
var appStylesFileName_1 = appStylesFullFileName.substring(0, appStylesFullFileName.lastIndexOf(".") + 1);
reapplyAppStyles = extensions.some(function (ext) { return context.path === appStylesFileName_1.concat(ext); });
if (!reapplyAppStyles) {
reapplyLocalStyles = extensions.some(function (ext) { return context.path.endsWith(ext); });
}
}
if (reapplyAppStyles && rootView) {
rootView._onCssStateChange();
}
else if (liveSyncCore) {
reapplyLocalStyles ? liveSyncCore(context) : liveSyncCore();
}
}
exports.livesync = livesync;
function setCssFileName(cssFileName) {
cssFile = cssFileName;
events.notify({ eventName: "cssChanged", object: app, cssFile: cssFileName });
}
exports.setCssFileName = setCssFileName;
function getCssFileName() {
return cssFile;
}
exports.getCssFileName = getCssFileName;
function loadAppCss() {
try {
events.notify({ eventName: "loadAppCss", object: app, cssFile: getCssFileName() });
}
catch (e) {
throw new Error("The file " + getCssFileName() + " couldn't be loaded! " +
"You may need to register it inside ./app/vendor.ts.");
}
}
exports.loadAppCss = loadAppCss;
function addCss(cssText) {
events.notify({ eventName: "cssChanged", object: app, cssText: cssText });
}
exports.addCss = addCss;
global.__onUncaughtError = function (error) {
events.notify({ eventName: exports.uncaughtErrorEvent, object: app, android: error, ios: error, error: error });
};
global.__onDiscardedError = function (error) {
events.notify({ eventName: exports.discardedErrorEvent, object: app, error: error });
};
//# sourceMappingURL=application-common.js.map
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("../node_modules/webpack/buildin/global.js")))
/***/ }),
/***/ "../node_modules/tns-core-modules/application/application.js":
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global) {function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
Object.defineProperty(exports, "__esModule", { value: true });
var application_common_1 = __webpack_require__("../node_modules/tns-core-modules/application/application-common.js");
__export(__webpack_require__("../node_modules/tns-core-modules/application/application-common.js"));
var builder_1 = __webpack_require__("../node_modules/tns-core-modules/ui/builder/builder.js");
var view_1 = __webpack_require__("../node_modules/tns-core-modules/ui/core/view/view.js");
var frame_1 = __webpack_require__("../node_modules/tns-core-modules/ui/frame/frame.js");
var utils = __webpack_require__("../node_modules/tns-core-modules/utils/utils.js");
var profiling_1 = __webpack_require__("../node_modules/tns-core-modules/profiling/profiling.js");
var Responder = UIResponder.extend({
get window() {
return iosApp ? iosApp.window : undefined;
},
set window(setWindow) {
}
}, {
protocols: [UIApplicationDelegate]
});
var NotificationObserver = (function (_super) {
__extends(NotificationObserver, _super);
function NotificationObserver() {
return _super !== null && _super.apply(this, arguments) || this;
}
NotificationObserver.initWithCallback = function (onReceiveCallback) {
var observer = _super.new.call(this);
observer._onReceiveCallback = onReceiveCallback;
return observer;
};
NotificationObserver.prototype.onReceive = function (notification) {
this._onReceiveCallback(notification);
};
NotificationObserver.ObjCExposedMethods = {
"onReceive": { returns: interop.types.void, params: [NSNotification] }
};
return NotificationObserver;
}(NSObject));
var displayedOnce = false;
var displayedLinkTarget;
var displayedLink;
var CADisplayLinkTarget = (function (_super) {
__extends(CADisplayLinkTarget, _super);
function CADisplayLinkTarget() {
return _super !== null && _super.apply(this, arguments) || this;
}
CADisplayLinkTarget.prototype.onDisplayed = function (link) {
link.invalidate();
var ios = utils.ios.getter(UIApplication, UIApplication.sharedApplication);
var object = iosApp;
displayedOnce = true;
application_common_1.notify({ eventName: application_common_1.displayedEvent, object: object, ios: ios });
displayedLinkTarget = null;
displayedLink = null;
};
CADisplayLinkTarget.ObjCExposedMethods = {
"onDisplayed": { returns: interop.types.void, params: [CADisplayLink] }
};
return CADisplayLinkTarget;
}(NSObject));
var IOSApplication = (function () {
function IOSApplication() {
this._currentOrientation = utils.ios.getter(UIDevice, UIDevice.currentDevice).orientation;
this._observers = new Array();
this.addNotificationObserver(UIApplicationDidFinishLaunchingNotification, this.didFinishLaunchingWithOptions.bind(this));
this.addNotificationObserver(UIApplicationDidBecomeActiveNotification, this.didBecomeActive.bind(this));
this.addNotificationObserver(UIApplicationDidEnterBackgroundNotification, this.didEnterBackground.bind(this));
this.addNotificationObserver(UIApplicationWillTerminateNotification, this.willTerminate.bind(this));
this.addNotificationObserver(UIApplicationDidReceiveMemoryWarningNotification, this.didReceiveMemoryWarning.bind(this));
this.addNotificationObserver(UIDeviceOrientationDidChangeNotification, this.orientationDidChange.bind(this));
}
Object.defineProperty(IOSApplication.prototype, "rootController", {
get: function () {
return this._window.rootViewController;
},
enumerable: true,
configurable: true
});
Object.defineProperty(IOSApplication.prototype, "nativeApp", {
get: function () {
return utils.ios.getter(UIApplication, UIApplication.sharedApplication);
},
enumerable: true,
configurable: true
});
Object.defineProperty(IOSApplication.prototype, "window", {
get: function () {
return this._window;
},
enumerable: true,
configurable: true
});
Object.defineProperty(IOSApplication.prototype, "delegate", {
get: function () {
return this._delegate;
},
set: function (value) {
if (this._delegate !== value) {
this._delegate = value;
}
},
enumerable: true,
configurable: true
});
Object.defineProperty(IOSApplication.prototype, "rootView", {
get: function () {
return this._rootView;
},
enumerable: true,
configurable: true
});
IOSApplication.prototype.addNotificationObserver = function (notificationName, onReceiveCallback) {
var observer = NotificationObserver.initWithCallback(onReceiveCallback);
utils.ios.getter(NSNotificationCenter, NSNotificationCenter.defaultCenter).addObserverSelectorNameObject(observer, "onReceive", notificationName, null);
this._observers.push(observer);
return observer;
};
IOSApplication.prototype.removeNotificationObserver = function (observer, notificationName) {
var index = this._observers.indexOf(observer);
if (index >= 0) {
this._observers.splice(index, 1);
utils.ios.getter(NSNotificationCenter, NSNotificationCenter.defaultCenter).removeObserverNameObject(observer, notificationName, null);
}
};
IOSApplication.prototype.didFinishLaunchingWithOptions = function (notification) {
if (!displayedOnce && profiling_1.level() >= profiling_1.Level.lifecycle) {
displayedLinkTarget = CADisplayLinkTarget.new();
displayedLink = CADisplayLink.displayLinkWithTargetSelector(displayedLinkTarget, "onDisplayed");
displayedLink.addToRunLoopForMode(NSRunLoop.mainRunLoop, NSDefaultRunLoopMode);
displayedLink.addToRunLoopForMode(NSRunLoop.mainRunLoop, UITrackingRunLoopMode);
}
this._window = UIWindow.alloc().initWithFrame(utils.ios.getter(UIScreen, UIScreen.mainScreen).bounds);
this._window.backgroundColor = utils.ios.getter(UIColor, UIColor.whiteColor);
this.notifyAppStarted(notification);
};
IOSApplication.prototype.notifyAppStarted = function (notification) {
var args = {
eventName: application_common_1.launchEvent,
object: this,
ios: notification && notification.userInfo && notification.userInfo.objectForKey("UIApplicationLaunchOptionsLocalNotificationKey") || null
};
application_common_1.notify(args);
application_common_1.notify({ eventName: "loadAppCss", object: this, cssFile: application_common_1.getCssFileName() });
if (this._window) {
this.setWindowContent(args.root);
}
else {
this._window = UIApplication.sharedApplication.delegate.window;
}
};
IOSApplication.prototype.didBecomeActive = function (notification) {
var ios = utils.ios.getter(UIApplication, UIApplication.sharedApplication);
var object = this;
application_common_1.notify({ eventName: application_common_1.resumeEvent, object: object, ios: ios });
var rootView = this._rootView;
if (rootView && !rootView.isLoaded) {
rootView.callLoaded();
}
};
IOSApplication.prototype.didEnterBackground = function (notification) {
application_common_1.notify({ eventName: application_common_1.suspendEvent, object: this, ios: utils.ios.getter(UIApplication, UIApplication.sharedApplication) });
var rootView = this._rootView;
if (rootView && rootView.isLoaded) {
rootView.callUnloaded();
}
};
IOSApplication.prototype.willTerminate = function (notification) {
application_common_1.notify({ eventName: application_common_1.exitEvent, object: this, ios: utils.ios.getter(UIApplication, UIApplication.sharedApplication) });
var rootView = this._rootView;
if (rootView && rootView.isLoaded) {
rootView.callUnloaded();
}
};
IOSApplication.prototype.didReceiveMemoryWarning = function (notification) {
application_common_1.notify({ eventName: application_common_1.lowMemoryEvent, object: this, ios: utils.ios.getter(UIApplication, UIApplication.sharedApplication) });
};
IOSApplication.prototype.orientationDidChange = function (notification) {
var orientation = utils.ios.getter(UIDevice, UIDevice.currentDevice).orientation;
if (this._currentOrientation !== orientation) {
this._currentOrientation = orientation;
var newValue = void 0;
switch (orientation) {
case 4:
case 3:
newValue = "landscape";
break;
case 1:
case 2:
newValue = "portrait";
break;
default:
newValue = "unknown";
break;
}
application_common_1.notify({
eventName: application_common_1.orientationChangedEvent,
ios: this,
newValue: newValue,
object: this
});
}
};
IOSApplication.prototype._onLivesync = function (context) {
if (this._rootView && !this._rootView._onLivesync(context)) {
this.setWindowContent();
}
};
IOSApplication.prototype.setWindowContent = function (view) {
if (this._rootView) {
this._rootView._onRootViewReset();
}
var rootView = createRootView(view);
var controller = getViewController(rootView);
this._rootView = rootView;
if (createRootFrame.value) {
rootView._setupUI({});
}
else {
rootView._setupAsRootView({});
}
setViewControllerView(rootView);
var haveController = this._window.rootViewController !== null;
this._window.rootViewController = controller;
if (!haveController) {
this._window.makeKeyAndVisible();
}
};
__decorate([
profiling_1.profile
], IOSApplication.prototype, "didFinishLaunchingWithOptions", null);
__decorate([
profiling_1.profile
], IOSApplication.prototype, "didBecomeActive", null);
return IOSApplication;
}());
var iosApp = new IOSApplication();
exports.ios = iosApp;
application_common_1.setApplication(iosApp);
global.__onLiveSyncCore = function (context) {
iosApp._onLivesync(context);
};
var mainEntry;
function createRootView(v) {
var rootView = v;
if (!rootView) {
if (!mainEntry) {
throw new Error("Main entry is missing. App cannot be started. Verify app bootstrap.");
}
else {
if (createRootFrame.value) {
var frame = rootView = new frame_1.Frame();
frame.navigate(mainEntry);
}
else {
rootView = builder_1.createViewFromEntry(mainEntry);
}
}
}
return rootView;
}
function getMainEntry() {
return mainEntry;
}
exports.getMainEntry = getMainEntry;
function getRootView() {
return iosApp.rootView;
}
exports.getRootView = getRootView;
var createRootFrame = { value: true };
var started = false;
function _start(entry) {
mainEntry = typeof entry === "string" ? { moduleName: entry } : entry;
started = true;
if (!iosApp.nativeApp) {
UIApplicationMain(0, null, null, iosApp && iosApp.delegate ? NSStringFromClass(iosApp.delegate) : NSStringFromClass(Responder));
}
else {
var rootView = createRootView();
if (rootView) {
var window_1 = iosApp.nativeApp.keyWindow || (iosApp.nativeApp.windows.count > 0 && iosApp.nativeApp.windows[0]);
if (window_1) {
var rootController = window_1.rootViewController;
if (rootController) {
var controller = getViewController(rootView);
rootView._setupAsRootView({});
var embedderDelegate = NativeScriptEmbedder.sharedInstance().delegate;
if (embedderDelegate) {
embedderDelegate.presentNativeScriptApp(controller);
}
else {
var visibleVC = utils.ios.getVisibleViewController(rootController);
visibleVC.presentViewControllerAnimatedCompletion(controller, true, null);
}
iosApp.notifyAppStarted();
}
}
}
}
}
function start(entry) {
console.log("application.start() is deprecated; use application.run() instead");
_start(entry);
}
exports.start = start;
function run(entry) {
createRootFrame.value = false;
_start(entry);
}
exports.run = run;
function _resetRootView(entry) {
createRootFrame.value = false;
mainEntry = typeof entry === "string" ? { moduleName: entry } : entry;
iosApp.setWindowContent();
}
exports._resetRootView = _resetRootView;
function getNativeApplication() {
return iosApp.nativeApp;
}
exports.getNativeApplication = getNativeApplication;
function getViewController(view) {
var viewController = view.viewController || view.ios;
if (viewController instanceof UIViewController) {
return viewController;
}
else {
viewController = view_1.ios.UILayoutViewController.initWithOwner(new WeakRef(view));
view.viewController = viewController;
return viewController;
}
}
function setViewControllerView(view) {
var viewController = view.viewController || view.ios;
var nativeView = view.ios || view.nativeViewProtected;
if (!nativeView || !viewController) {
throw new Error("Root should be either UIViewController or UIView");
}
if (viewController instanceof view_1.ios.UILayoutViewController) {
viewController.view.addSubview(nativeView);
}
}
global.__onLiveSync = function __onLiveSync(context) {
if (!started) {
return;
}
var rootView = getRootView();
application_common_1.livesync(rootView, context);
};
//# sourceMappingURL=application.ios.js.map
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("../node_modules/webpack/buildin/global.js")))
/***/ }),
/***/ "../node_modules/tns-core-modules/bundle-entry-points.js":
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global) {if (true) {
__webpack_require__("../node_modules/tns-core-modules/globals/globals.js");
global.registerModule("text/formatted-string", function () { return __webpack_require__("../node_modules/tns-core-modules/text/formatted-string.js"); });
global.registerModule("text/span", function () { return __webpack_require__("../node_modules/tns-core-modules/text/span.js"); });
global.registerModule("ui/action-bar", function () { return __webpack_require__("../node_modules/tns-core-modules/ui/action-bar/action-bar.js"); });
global.registerModule("ui/activity-indicator", function () { return __webpack_require__("../node_modules/tns-core-modules/ui/activity-indicator/activity-indicator.js"); });
global.registerModule("ui/border", function () { return __webpack_require__("../node_modules/tns-core-modules/ui/border/border.js"); });
global.registerModule("ui/button", function () { return __webpack_require__("../node_modules/tns-core-modules/ui/button/button.js"); });
global.registerModule("ui/content-view", function () { return __webpack_require__("../node_modules/tns-core-modules/ui/content-view/content-view.js"); });
global.registerModule("ui/date-picker", function () { return __webpack_require__("../node_modules/tns-core-modules/ui/date-picker/date-picker.js"); });
global.registerModule("ui/frame", function () { return __webpack_require__("../node_modules/tns-core-modules/ui/frame/frame.js"); });
global.registerModule("ui/html-view", function () { return __webpack_require__("../node_modules/tns-core-modules/ui/html-view/html-view.js"); });
global.registerModule("ui/image", function () { return __webpack_require__("../node_modules/tns-core-modules/ui/image/image.js"); });
global.registerModule("ui/label", function () { return __webpack_require__("../node_modules/tns-core-modules/ui/label/label.js"); });
global.registerModule("ui/layouts/absolute-layout", function () { return __webpack_require__("../node_modules/tns-core-modules/ui/layouts/absolute-layout/absolute-layout.js"); });
global.registerModule("ui/layouts/dock-layout", function () { return __webpack_require__("../node_modules/tns-core-modules/ui/layouts/dock-layout/dock-layout.js"); });
global.registerModule("ui/layouts/grid-layout", function () { return __webpack_require__("../node_modules/tns-core-modules/ui/layouts/grid-layout/grid-layout.js"); });
global.registerModule("ui/layouts/stack-layout", function () { return __webpack_require__("../node_modules/tns-core-modules/ui/layouts/stack-layout/stack-layout.js"); });
global.registerModule("ui/layouts/flexbox-layout", function () { return __webpack_require__("../node_modules/tns-core-modules/ui/layouts/flexbox-layout/flexbox-layout.js"); });
global.registerModule("ui/layouts/wrap-layout", function () { return __webpack_require__("../node_modules/tns-core-modules/ui/layouts/wrap-layout/wrap-layout.js"); });
global.registerModule("ui/list-picker", function () { return __webpack_require__("../node_modules/tns-core-modules/ui/list-picker/list-picker.js"); });
global.registerModule("ui/page", function () { return __webpack_require__("../node_modules/tns-core-modules/ui/page/page.js"); });
global.registerModule("ui/placeholder", function () { return __webpack_require__("../node_modules/tns-core-modules/ui/placeholder/placeholder.js"); });
global.registerModule("ui/progress", function () { return __webpack_require__("../node_modules/tns-core-modules/ui/progress/progress.js"); });
global.registerModule("ui/proxy-view-container", function () { return __webpack_require__("../node_modules/tns-core-modules/ui/proxy-view-container/proxy-view-container.js"); });
global.registerModule("ui/repeater", function () { return __webpack_require__("../node_modules/tns-core-modules/ui/repeater/repeater.js"); });
global.registerModule("ui/scroll-view", function () { return __webpack_require__("../node_modules/tns-core-modules/ui/scroll-view/scroll-view.js"); });
global.registerModule("ui/search-bar", function () { return __webpack_require__("../node_modules/tns-core-modules/ui/search-bar/search-bar.js"); });
global.registerModule("ui/segmented-bar", function () { return __webpack_require__("../node_modules/tns-core-modules/ui/segmented-bar/segmented-bar.js"); });
global.registerModule("ui/slider", function () { return __webpack_require__("../node_modules/tns-core-modules/ui/slider/slider.js"); });
global.registerModule("ui/switch", function () { return __webpack_require__("../node_modules/tns-core-modules/ui/switch/switch.js"); });
global.registerModule("ui/tab-view", function () { return __webpack_require__("../node_modules/tns-core-modules/ui/tab-view/tab-view.js"); });
global.registerModule("ui/web-view", function () { return __webpack_require__("../node_modules/tns-core-modules/ui/web-view/web-view.js"); });
global.registerModule("ui/text-field", function () { return __webpack_require__("../node_modules/tns-core-modules/ui/text-field/text-field.js"); });
global.registerModule("ui/text-view", function () { return __webpack_require__("../node_modules/tns-core-modules/ui/text-view/text-view.js"); });
global.registerModule("ui/time-picker", function () { return __webpack_require__("../node_modules/tns-core-modules/ui/time-picker/time-picker.js"); });
global.registerModule("ui/list-view", function () { return __webpack_require__("../node_modules/tns-core-modules/ui/list-view/list-view.js"); });
}
//# sourceMappingURL=bundle-entry-points.js.map
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("../node_modules/webpack/buildin/global.js")))
/***/ }),
/***/ "../node_modules/tns-core-modules/color/color-common.js":
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", { value: true });
var types = __webpack_require__("../node_modules/tns-core-modules/utils/types.js");
var knownColors = __webpack_require__("../node_modules/tns-core-modules/color/known-colors.js");
var SHARP = "#";
var HEX_REGEX = /(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)|(^#[0-9A-F]{8}$)/i;
var Color = (function () {
function Color() {
if (arguments.length === 1) {
var arg = arguments[0];
if (types.isString(arg)) {
if (isRgbOrRgba(arg)) {
this._argb = argbFromRgbOrRgba(arg);
}
else if (knownColors.isKnownName(arg)) {
var hex = knownColors.getKnownColor(arg);
this._name = arg;
this._argb = this._argbFromString(hex);
}
else if (HEX_REGEX.test(arg)) {
var hex = this._normalizeHex(arg);
this._argb = this._argbFromString(hex);
}
else {
throw new Error("Invalid color: " + arg);
}
}
else if (types.isNumber(arg)) {
this._argb = arg >>> 0;
}
else {
throw new Error("Expected 1 or 4 constructor parameters.");
}
}
else if (arguments.length === 4) {
this._argb = (arguments[0] & 0xFF) * 0x01000000
+ (arguments[1] & 0xFF) * 0x00010000
+ (arguments[2] & 0xFF) * 0x00000100
+ (arguments[3] & 0xFF) * 0x00000001;
}
else {
throw new Error("Expected 1 or 4 constructor parameters.");
}
}
Object.defineProperty(Color.prototype, "a", {
get: function () { return (this._argb / 0x01000000) & 0xFF; },
enumerable: true,
configurable: true
});
Object.defineProperty(Color.prototype, "r", {
get: function () { return (this._argb / 0x00010000) & 0xFF; },
enumerable: true,
configurable: true
});
Object.defineProperty(Color.prototype, "g", {
get: function () { return (this._argb / 0x00000100) & 0xFF; },
enumerable: true,
configurable: true
});
Object.defineProperty(Color.prototype, "b", {
get: function () { return (this._argb / 0x00000001) & 0xFF; },
enumerable: true,
configurable: true
});
Object.defineProperty(Color.prototype, "argb", {
get: function () {
return this._argb;
},
enumerable: true,
configurable: true
});
Object.defineProperty(Color.prototype, "hex", {
get: function () {
if (this.a === 0xFF) {
return ("#" + this._componentToHex(this.r) + this._componentToHex(this.g) + this._componentToHex(this.b)).toUpperCase();
}
else {
return ("#" + this._componentToHex(this.a) + this._componentToHex(this.r) + this._componentToHex(this.g) + this._componentToHex(this.b)).toUpperCase();
}
},
enumerable: true,
configurable: true
});
Object.defineProperty(Color.prototype, "name", {
get: function () {
return this._name;
},
enumerable: true,
configurable: true
});
Object.defineProperty(Color.prototype, "ios", {
get: function () {
return undefined;
},
enumerable: true,
configurable: true
});
Object.defineProperty(Color.prototype, "android", {
get: function () {
return undefined;
},
enumerable: true,
configurable: true
});
Color.prototype._argbFromString = function (hex) {
if (hex.charAt(0) === "#") {
hex = hex.substr(1);
}
if (hex.length === 3) {
hex = hex[0] + hex[0] + hex[1] + hex[1] + hex[2] + hex[2];
}
else if (hex.length === 4) {
hex = hex[0] + hex[0] + hex[1] + hex[1] + hex[2] + hex[2] + hex[3] + hex[3];
}
var intVal = parseInt(hex, 16);
if (hex.length === 6) {
intVal = (intVal & 0x00FFFFFF) + 0xFF000000;
}
return intVal;
};
Color.prototype.equals = function (value) {
return value && this.argb === value.argb;
};
Color.equals = function (value1, value2) {
if (!value1 && !value2) {
return true;
}
if (!value1 || !value2) {
return false;
}
return value1.equals(value2);
};
Color.isValid = function (value) {
if (types.isNullOrUndefined(value) || value instanceof Color) {
return true;
}
if (!types.isString(value)) {
return false;
}
if (knownColors.isKnownName(value)) {
return true;
}
return HEX_REGEX.test(value) || isRgbOrRgba(value);
};
Color.prototype._componentToHex = function (component) {
var hex = component.toString(16);
if (hex.length === 1) {
hex = "0" + hex;
}
return hex;
};
Color.prototype._normalizeHex = function (hexStr) {
if (hexStr.charAt(0) === SHARP && hexStr.length === 4) {
hexStr = hexStr.charAt(0)
+ hexStr.charAt(1) + hexStr.charAt(1)
+ hexStr.charAt(2) + hexStr.charAt(2)
+ hexStr.charAt(3) + hexStr.charAt(3);
}
return hexStr;
};
Color.prototype.toString = function () {
return this.hex;
};
return Color;
}());
exports.Color = Color;
function isRgbOrRgba(value) {
var toLower = value.toLowerCase();
return (toLower.indexOf("rgb(") === 0 || toLower.indexOf("rgba(") === 0) && toLower.indexOf(")") === (toLower.length - 1);
}
function argbFromRgbOrRgba(value) {
var toLower = value.toLowerCase();
var parts = toLower.replace("rgba(", "").replace("rgb(", "").replace(")", "").trim().split(",");
var r = 255;
var g = 255;
var b = 255;
var a = 255;
if (parts[0]) {
r = parseInt(parts[0].trim());
}
if (parts[1]) {
g = parseInt(parts[1].trim());
}
if (parts[2]) {
b = parseInt(parts[2].trim());
}
if (parts[3]) {
a = Math.round(parseFloat(parts[3].trim()) * 255);
}
return (a & 0xFF) * 0x01000000
+ (r & 0xFF) * 0x00010000
+ (g & 0xFF) * 0x00000100
+ (b & 0xFF) * 0x00000001;
}
//# sourceMappingURL=color-common.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/color/color.js":
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", { value: true });
var common = __webpack_require__("../node_modules/tns-core-modules/color/color-common.js");
var Color = (function (_super) {
__extends(Color, _super);
function Color() {
return _super !== null && _super.apply(this, arguments) || this;
}
Object.defineProperty(Color.prototype, "ios", {
get: function () {
if (!this._ios) {
this._ios = UIColor.alloc().initWithRedGreenBlueAlpha(this.r / 255, this.g / 255, this.b / 255, this.a / 255);
}
return this._ios;
},
enumerable: true,
configurable: true
});
return Color;
}(common.Color));
exports.Color = Color;
//# sourceMappingURL=color.ios.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/color/known-colors.js":
/***/ (function(module, exports) {
Object.defineProperty(exports, "__esModule", { value: true });
exports.Transparent = "#00000000";
exports.AliceBlue = "#F0F8FF";
exports.AntiqueWhite = "#FAEBD7";
exports.Aqua = "#00FFFF";
exports.Aquamarine = "#7FFFD4";
exports.Azure = "#F0FFFF";
exports.Beige = "#F5F5DC";
exports.Bisque = "#FFE4C4";
exports.Black = "#000000";
exports.BlanchedAlmond = "#FFEBCD";
exports.Blue = "#0000FF";
exports.BlueViolet = "#8A2BE2";
exports.Brown = "#A52A2A";
exports.BurlyWood = "#DEB887";
exports.CadetBlue = "#5F9EA0";
exports.Chartreuse = "#7FFF00";
exports.Chocolate = "#D2691E";
exports.Coral = "#FF7F50";
exports.CornflowerBlue = "#6495ED";
exports.Cornsilk = "#FFF8DC";
exports.Crimson = "#DC143C";
exports.Cyan = "#00FFFF";
exports.DarkBlue = "#00008B";
exports.DarkCyan = "#008B8B";
exports.DarkGoldenRod = "#B8860B";
exports.DarkGray = "#A9A9A9";
exports.DarkGreen = "#006400";
exports.DarkKhaki = "#BDB76B";
exports.DarkMagenta = "#8B008B";
exports.DarkOliveGreen = "#556B2F";
exports.DarkOrange = "#FF8C00";
exports.DarkOrchid = "#9932CC";
exports.DarkRed = "#8B0000";
exports.DarkSalmon = "#E9967A";
exports.DarkSeaGreen = "#8FBC8F";
exports.DarkSlateBlue = "#483D8B";
exports.DarkSlateGray = "#2F4F4F";
exports.DarkTurquoise = "#00CED1";
exports.DarkViolet = "#9400D3";
exports.DeepPink = "#FF1493";
exports.DeepSkyBlue = "#00BFFF";
exports.DimGray = "#696969";
exports.DodgerBlue = "#1E90FF";
exports.FireBrick = "#B22222";
exports.FloralWhite = "#FFFAF0";
exports.ForestGreen = "#228B22";
exports.Fuchsia = "#FF00FF";
exports.Gainsboro = "#DCDCDC";
exports.GhostWhite = "#F8F8FF";
exports.Gold = "#FFD700";
exports.GoldenRod = "#DAA520";
exports.Gray = "#808080";
exports.Green = "#008000";
exports.GreenYellow = "#ADFF2F";
exports.HoneyDew = "#F0FFF0";
exports.HotPink = "#FF69B4";
exports.IndianRed = "#CD5C5C";
exports.Indigo = "#4B0082";
exports.Ivory = "#FFFFF0";
exports.Khaki = "#F0E68C";
exports.Lavender = "#E6E6FA";
exports.LavenderBlush = "#FFF0F5";
exports.LawnGreen = "#7CFC00";
exports.LemonChiffon = "#FFFACD";
exports.LightBlue = "#ADD8E6";
exports.LightCoral = "#F08080";
exports.LightCyan = "#E0FFFF";
exports.LightGoldenRodYellow = "#FAFAD2";
exports.LightGray = "#D3D3D3";
exports.LightGreen = "#90EE90";
exports.LightPink = "#FFB6C1";
exports.LightSalmon = "#FFA07A";
exports.LightSeaGreen = "#20B2AA";
exports.LightSkyBlue = "#87CEFA";
exports.LightSlateGray = "#778899";
exports.LightSteelBlue = "#B0C4DE";
exports.LightYellow = "#FFFFE0";
exports.Lime = "#00FF00";
exports.LimeGreen = "#32CD32";
exports.Linen = "#FAF0E6";
exports.Magenta = "#FF00FF";
exports.Maroon = "#800000";
exports.MediumAquaMarine = "#66CDAA";
exports.MediumBlue = "#0000CD";
exports.MediumOrchid = "#BA55D3";
exports.MediumPurple = "#9370DB";
exports.MediumSeaGreen = "#3CB371";
exports.MediumSlateBlue = "#7B68EE";
exports.MediumSpringGreen = "#00FA9A";
exports.MediumTurquoise = "#48D1CC";
exports.MediumVioletRed = "#C71585";
exports.MidnightBlue = "#191970";
exports.MintCream = "#F5FFFA";
exports.MistyRose = "#FFE4E1";
exports.Moccasin = "#FFE4B5";
exports.NavajoWhite = "#FFDEAD";
exports.Navy = "#000080";
exports.OldLace = "#FDF5E6";
exports.Olive = "#808000";
exports.OliveDrab = "#6B8E23";
exports.Orange = "#FFA500";
exports.OrangeRed = "#FF4500";
exports.Orchid = "#DA70D6";
exports.PaleGoldenRod = "#EEE8AA";
exports.PaleGreen = "#98FB98";
exports.PaleTurquoise = "#AFEEEE";
exports.PaleVioletRed = "#DB7093";
exports.PapayaWhip = "#FFEFD5";
exports.PeachPuff = "#FFDAB9";
exports.Peru = "#CD853F";
exports.Pink = "#FFC0CB";
exports.Plum = "#DDA0DD";
exports.PowderBlue = "#B0E0E6";
exports.Purple = "#800080";
exports.RebeccaPurple = "#663399";
exports.Red = "#FF0000";
exports.RosyBrown = "#BC8F8F";
exports.RoyalBlue = "#4169E1";
exports.SaddleBrown = "#8B4513";
exports.Salmon = "#FA8072";
exports.SandyBrown = "#F4A460";
exports.SeaGreen = "#2E8B57";
exports.SeaShell = "#FFF5EE";
exports.Sienna = "#A0522D";
exports.Silver = "#C0C0C0";
exports.SkyBlue = "#87CEEB";
exports.SlateBlue = "#6A5ACD";
exports.SlateGray = "#708090";
exports.Snow = "#FFFAFA";
exports.SpringGreen = "#00FF7F";
exports.SteelBlue = "#4682B4";
exports.Tan = "#D2B48C";
exports.Teal = "#008080";
exports.Thistle = "#D8BFD8";
exports.Tomato = "#FF6347";
exports.Turquoise = "#40E0D0";
exports.Violet = "#EE82EE";
exports.Wheat = "#F5DEB3";
exports.White = "#FFFFFF";
exports.WhiteSmoke = "#F5F5F5";
exports.Yellow = "#FFFF00";
exports.YellowGreen = "#9ACD32";
var _allColors = {};
(function () {
var name;
var underscore = "_";
for (var p in exports) {
name = p;
if (name.charAt(0) !== underscore) {
_allColors[name.toLowerCase()] = exports[p];
}
}
})();
function isKnownName(name) {
if (!name) {
return undefined;
}
return name.toLowerCase() in _allColors;
}
exports.isKnownName = isKnownName;
function getKnownColor(name) {
if (!name) {
return undefined;
}
return _allColors[name.toLowerCase()];
}
exports.getKnownColor = getKnownColor;
//# sourceMappingURL=known-colors.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/console/console.js":
/***/ (function(module, exports) {
Object.defineProperty(exports, "__esModule", { value: true });
var Console = (function () {
function Console() {
}
Console.prototype.time = function (reportName) {
};
Console.prototype.timeEnd = function (reportName) {
};
Console.prototype.assert = function (test, message) {
};
Console.prototype.info = function (message) {
};
Console.prototype.warn = function (message) {
};
Console.prototype.error = function (message) {
};
Console.prototype.log = function (message) {
};
Console.prototype.trace = function () {
};
Console.prototype.dir = function (obj) {
};
return Console;
}());
exports.Console = Console;
//# sourceMappingURL=console.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/css-value/index.js":
/***/ (function(module, exports) {
exports.parse = parse;
function parse(str) {
return new Parser(str).parse();
}
function Parser(str) {
this.str = str;
}
Parser.prototype.skip = function(m){
this.str = this.str.slice(m[0].length);
};
Parser.prototype.comma = function(){
var m = /^, */.exec(this.str);
if (!m) return;
this.skip(m);
return { type: 'comma', string: ',' };
};
Parser.prototype.ident = function(){
var m = /^([\w-]+) */.exec(this.str);
if (!m) return;
this.skip(m);
return {
type: 'ident',
string: m[1]
}
};
Parser.prototype.int = function(){
var m = /^(([-\+]?\d+)(\S+)?) */.exec(this.str);
if (!m) return;
this.skip(m);
var n = ~~m[2];
var u = m[3];
return {
type: 'number',
string: m[1],
unit: u || '',
value: n
}
};
Parser.prototype.float = function(){
var m = /^(((?:[-\+]?\d+)?\.\d+)(\S+)?) */.exec(this.str);
if (!m) return;
this.skip(m);
var n = parseFloat(m[2]);
var u = m[3];
return {
type: 'number',
string: m[1],
unit: u || '',
value: n
}
};
Parser.prototype.number = function(){
return this.float() || this.int();
};
Parser.prototype.double = function(){
var m = /^"([^"]*)" */.exec(this.str);
if (!m) return m;
this.skip(m);
return {
type: 'string',
quote: '"',
string: '"' + m[1] + '"',
value: m[1]
}
};
Parser.prototype.single = function(){
var m = /^'([^']*)' */.exec(this.str);
if (!m) return m;
this.skip(m);
return {
type: 'string',
quote: "'",
string: "'" + m[1] + "'",
value: m[1]
}
};
Parser.prototype.string = function(){
return this.single() || this.double();
};
Parser.prototype.value = function(){
return this.number()
|| this.ident()
|| this.string()
|| this.comma();
};
Parser.prototype.parse = function(){
var vals = [];
while (this.str.length) {
var obj = this.value();
if (!obj) throw new Error('failed to parse near `' + this.str.slice(0, 10) + '...`');
vals.push(obj);
}
return vals;
};
/***/ }),
/***/ "../node_modules/tns-core-modules/css/index.js":
/***/ (function(module, exports, __webpack_require__) {
exports.parse = __webpack_require__("../node_modules/tns-core-modules/css/lib/parse/index.js");
/***/ }),
/***/ "../node_modules/tns-core-modules/css/lib/parse/index.js":
/***/ (function(module, exports) {
// http://www.w3.org/TR/CSS21/grammar.html
// https://github.com/visionmedia/css-parse/pull/49#issuecomment-30088027
var commentre = /\/\*[^*]*\*+([^/*][^*]*\*+)*\//g
module.exports = function(css, options){
options = options || {};
/**
* Positional.
*/
var lineno = 1;
var column = 1;
/**
* Update lineno and column based on `str`.
*/
function updatePosition(str) {
var lines = str.match(/\n/g);
if (lines) lineno += lines.length;
var i = str.lastIndexOf('\n');
column = ~i ? str.length - i : column + str.length;
}
/**
* Mark position and patch `node.position`.
*/
function position() {
var start = { line: lineno, column: column };
return function(node){
node.position = new Position(start);
whitespace();
return node;
};
}
/**
* Store position information for a node
*/
function Position(start) {
this.start = start;
this.end = { line: lineno, column: column };
this.source = options.source;
}
/**
* Non-enumerable source string
*/
Position.prototype.content = css;
/**
* Error `msg`.
*/
var errorsList = [];
function error(msg) {
var err = new Error(options.source + ':' + lineno + ':' + column + ': ' + msg);
err.reason = msg;
err.filename = options.source;
err.line = lineno;
err.column = column;
err.source = css;
if (options.silent) {
errorsList.push(err);
} else {
throw err;
}
}
/**
* Parse stylesheet.
*/
function stylesheet() {
var rulesList = rules();
return {
type: 'stylesheet',
stylesheet: {
rules: rulesList,
parsingErrors: errorsList
}
};
}
/**
* Opening brace.
*/
function open() {
return match(/^{\s*/);
}
/**
* Closing brace.
*/
function close() {
return match(/^}/);
}
/**
* Parse ruleset.
*/
function rules() {
var node;
var rules = [];
whitespace();
comments(rules);
while (css.length && css.charAt(0) != '}' && (node = atrule() || rule())) {
if (node !== false) {
rules.push(node);
comments(rules);
}
}
return rules;
}
/**
* Match `re` and return captures.
*/
function match(re) {
var m = re.exec(css);
if (!m) return;
var str = m[0];
updatePosition(str);
css = css.slice(str.length);
return m;
}
/**
* Parse whitespace.
*/
function whitespace() {
match(/^\s*/);
}
/**
* Parse comments;
*/
function comments(rules) {
var c;
rules = rules || [];
while (c = comment()) {
if (c !== false) {
rules.push(c);
}
}
return rules;
}
/**
* Parse comment.
*/
function comment() {
var pos = position();
if ('/' != css.charAt(0) || '*' != css.charAt(1)) return;
var i = 2;
while ("" != css.charAt(i) && ('*' != css.charAt(i) || '/' != css.charAt(i + 1))) ++i;
i += 2;
if ("" === css.charAt(i-1)) {
return error('End of comment missing');
}
var str = css.slice(2, i - 2);
column += 2;
updatePosition(str);
css = css.slice(i);
column += 2;
return pos({
type: 'comment',
comment: str
});
}
/**
* Parse selector.
*/
function selector() {
var m = match(/^([^{]+)/);
if (!m) return;
/* @fix Remove all comments from selectors
* http://ostermiller.org/findcomment.html */
return trim(m[0])
.replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g, '')
.replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g, function(m) {
return m.replace(/,/g, '\u200C');
})
.split(/\s*(?![^(]*\)),\s*/)
.map(function(s) {
return s.replace(/\u200C/g, ',');
});
}
/**
* Parse declaration.
*/
function declaration() {
var pos = position();
// prop
var prop = match(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);
if (!prop) return;
prop = trim(prop[0]);
// :
if (!match(/^:\s*/)) return error("property missing ':'");
// val
var val = match(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/);
var ret = pos({
type: 'declaration',
property: prop.replace(commentre, ''),
value: val ? trim(val[0]).replace(commentre, '') : ''
});
// ;
match(/^[;\s]*/);
return ret;
}
/**
* Parse declarations.
*/
function declarations() {
var decls = [];
if (!open()) return error("missing '{'");
comments(decls);
// declarations
var decl;
while (decl = declaration()) {
if (decl !== false) {
decls.push(decl);
comments(decls);
}
}
if (!close()) return error("missing '}'");
return decls;
}
/**
* Parse keyframe.
*/
function keyframe() {
var m;
var vals = [];
var pos = position();
while (m = match(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/)) {
vals.push(m[1]);
match(/^,\s*/);
}
if (!vals.length) return;
return pos({
type: 'keyframe',
values: vals,
declarations: declarations()
});
}
/**
* Parse keyframes.
*/
function atkeyframes() {
var pos = position();
var m = match(/^@([-\w]+)?keyframes\s*/);
if (!m) return;
var vendor = m[1];
// identifier
var m = match(/^([-\w]+)\s*/);
if (!m) return error("@keyframes missing name");
var name = m[1];
if (!open()) return error("@keyframes missing '{'");
var frame;
var frames = comments();
while (frame = keyframe()) {
frames.push(frame);
frames = frames.concat(comments());
}
if (!close()) return error("@keyframes missing '}'");
return pos({
type: 'keyframes',
name: name,
vendor: vendor,
keyframes: frames
});
}
/**
* Parse supports.
*/
function atsupports() {
var pos = position();
var m = match(/^@supports *([^{]+)/);
if (!m) return;
var supports = trim(m[1]);
if (!open()) return error("@supports missing '{'");
var style = comments().concat(rules());
if (!close()) return error("@supports missing '}'");
return pos({
type: 'supports',
supports: supports,
rules: style
});
}
/**
* Parse host.
*/
function athost() {
var pos = position();
var m = match(/^@host\s*/);
if (!m) return;
if (!open()) return error("@host missing '{'");
var style = comments().concat(rules());
if (!close()) return error("@host missing '}'");
return pos({
type: 'host',
rules: style
});
}
/**
* Parse media.
*/
function atmedia() {
var pos = position();
var m = match(/^@media *([^{]+)/);
if (!m) return;
var media = trim(m[1]);
if (!open()) return error("@media missing '{'");
var style = comments().concat(rules());
if (!close()) return error("@media missing '}'");
return pos({
type: 'media',
media: media,
rules: style
});
}
/**
* Parse custom-media.
*/
function atcustommedia() {
var pos = position();
var m = match(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);
if (!m) return;
return pos({
type: 'custom-media',
name: trim(m[1]),
media: trim(m[2])
});
}
/**
* Parse paged media.
*/
function atpage() {
var pos = position();
var m = match(/^@page */);
if (!m) return;
var sel = selector() || [];
if (!open()) return error("@page missing '{'");
var decls = comments();
// declarations
var decl;
while (decl = declaration()) {
decls.push(decl);
decls = decls.concat(comments());
}
if (!close()) return error("@page missing '}'");
return pos({
type: 'page',
selectors: sel,
declarations: decls
});
}
/**
* Parse document.
*/
function atdocument() {
var pos = position();
var m = match(/^@([-\w]+)?document *([^{]+)/);
if (!m) return;
var vendor = trim(m[1]);
var doc = trim(m[2]);
if (!open()) return error("@document missing '{'");
var style = comments().concat(rules());
if (!close()) return error("@document missing '}'");
return pos({
type: 'document',
document: doc,
vendor: vendor,
rules: style
});
}
/**
* Parse font-face.
*/
function atfontface() {
var pos = position();
var m = match(/^@font-face\s*/);
if (!m) return;
if (!open()) return error("@font-face missing '{'");
var decls = comments();
// declarations
var decl;
while (decl = declaration()) {
decls.push(decl);
decls = decls.concat(comments());
}
if (!close()) return error("@font-face missing '}'");
return pos({
type: 'font-face',
declarations: decls
});
}
/**
* Parse import
*/
var atimport = _compileAtrule('import');
/**
* Parse charset
*/
var atcharset = _compileAtrule('charset');
/**
* Parse namespace
*/
var atnamespace = _compileAtrule('namespace');
/**
* Parse non-block at-rules
*/
function _compileAtrule(name) {
var re = new RegExp('^@' + name + '\\s*([^;]+);');
return function() {
var pos = position();
var m = match(re);
if (!m) return;
var ret = { type: name };
ret[name] = m[1].trim();
return pos(ret);
}
}
/**
* Parse at rule.
*/
function atrule() {
if (css[0] != '@') return;
return atkeyframes()
|| atmedia()
|| atcustommedia()
|| atsupports()
|| atimport()
|| atcharset()
|| atnamespace()
|| atdocument()
|| atpage()
|| athost()
|| atfontface();
}
/**
* Parse rule.
*/
function rule() {
var pos = position();
var sel = selector();
if (!sel) return error('selector missing');
comments();
return pos({
type: 'rule',
selectors: sel,
declarations: declarations()
});
}
return addParent(stylesheet());
};
/**
* Trim `str`.
*/
function trim(str) {
return str ? str.replace(/^\s+|\s+$/g, '') : '';
}
/**
* Adds non-enumerable parent node reference to each node.
*/
function addParent(obj, parent) {
var isNode = obj && typeof obj.type === 'string';
var childParent = isNode ? obj : parent;
for (var k in obj) {
var value = obj[k];
if (Array.isArray(value)) {
value.forEach(function(v) { addParent(v, childParent); });
} else if (value && typeof value === 'object') {
addParent(value, childParent);
}
}
if (isNode) {
Object.defineProperty(obj, 'parent', {
configurable: true,
writable: true,
enumerable: false,
value: parent || null
});
}
return obj;
}
/***/ }),
/***/ "../node_modules/tns-core-modules/css/parser.js":
/***/ (function(module, exports) {
Object.defineProperty(exports, "__esModule", { value: true });
var urlRegEx = /\s*url\((?:('|")([^\1]*)\1|([^\)]*))\)\s*/gy;
function parseURL(text, start) {
if (start === void 0) { start = 0; }
urlRegEx.lastIndex = start;
var result = urlRegEx.exec(text);
if (!result) {
return null;
}
var end = urlRegEx.lastIndex;
var value = result[2] || result[3];
return { start: start, end: end, value: value };
}
exports.parseURL = parseURL;
var hexColorRegEx = /\s*#((?:[0-9A-F]{8})|(?:[0-9A-F]{6})|(?:[0-9A-F]{3}))\s*/giy;
function parseHexColor(text, start) {
if (start === void 0) { start = 0; }
hexColorRegEx.lastIndex = start;
var result = hexColorRegEx.exec(text);
if (!result) {
return null;
}
var end = hexColorRegEx.lastIndex;
var hex = result[1];
var argb;
if (hex.length === 8) {
argb = parseInt("0x" + hex);
}
else if (hex.length === 6) {
argb = parseInt("0xFF" + hex);
}
else if (hex.length === 3) {
argb = parseInt("0xFF" + hex[0] + hex[0] + hex[1] + hex[1] + hex[2] + hex[2]);
}
return { start: start, end: end, value: argb };
}
exports.parseHexColor = parseHexColor;
function rgbaToArgbNumber(r, g, b, a) {
if (a === void 0) { a = 1; }
if (r >= 0 && r <= 255 && g >= 0 && g <= 255 && b >= 0 && b <= 255 && a >= 0 && a <= 1) {
return (Math.round(a * 0xFF) * 0x01000000) + (r * 0x010000) + (g * 0x000100) + (b * 0x000001);
}
else {
return null;
}
}
var rgbColorRegEx = /\s*(rgb\(\s*(\d*)\s*,\s*(\d*)\s*,\s*(\d*)\s*\))/gy;
function parseRGBColor(text, start) {
if (start === void 0) { start = 0; }
rgbColorRegEx.lastIndex = start;
var result = rgbColorRegEx.exec(text);
if (!result) {
return null;
}
var end = rgbColorRegEx.lastIndex;
var value = result[1] && rgbaToArgbNumber(parseInt(result[2]), parseInt(result[3]), parseInt(result[4]));
return { start: start, end: end, value: value };
}
exports.parseRGBColor = parseRGBColor;
var rgbaColorRegEx = /\s*(rgba\(\s*(\d*)\s*,\s*(\d*)\s*,\s*(\d*)\s*,\s*([01]?\.?\d*)\s*\))/gy;
function parseRGBAColor(text, start) {
if (start === void 0) { start = 0; }
rgbaColorRegEx.lastIndex = start;
var result = rgbaColorRegEx.exec(text);
if (!result) {
return null;
}
var end = rgbaColorRegEx.lastIndex;
var value = rgbaToArgbNumber(parseInt(result[2]), parseInt(result[3]), parseInt(result[4]), parseFloat(result[5]));
return { start: start, end: end, value: value };
}
exports.parseRGBAColor = parseRGBAColor;
var colors;
(function (colors) {
colors[colors["transparent"] = 0] = "transparent";
colors[colors["aliceblue"] = 4293982463] = "aliceblue";
colors[colors["antiquewhite"] = 4294634455] = "antiquewhite";
colors[colors["aqua"] = 4278255615] = "aqua";
colors[colors["aquamarine"] = 4286578644] = "aquamarine";
colors[colors["azure"] = 4293984255] = "azure";
colors[colors["beige"] = 4294309340] = "beige";
colors[colors["bisque"] = 4294960324] = "bisque";
colors[colors["black"] = 4278190080] = "black";
colors[colors["blanchedalmond"] = 4294962125] = "blanchedalmond";
colors[colors["blue"] = 4278190335] = "blue";
colors[colors["blueviolet"] = 4287245282] = "blueviolet";
colors[colors["brown"] = 4289014314] = "brown";
colors[colors["burlywood"] = 4292786311] = "burlywood";
colors[colors["cadetblue"] = 4284456608] = "cadetblue";
colors[colors["chartreuse"] = 4286578432] = "chartreuse";
colors[colors["chocolate"] = 4291979550] = "chocolate";
colors[colors["coral"] = 4294934352] = "coral";
colors[colors["cornflowerblue"] = 4284782061] = "cornflowerblue";
colors[colors["cornsilk"] = 4294965468] = "cornsilk";
colors[colors["crimson"] = 4292613180] = "crimson";
colors[colors["cyan"] = 4278255615] = "cyan";
colors[colors["darkblue"] = 4278190219] = "darkblue";
colors[colors["darkcyan"] = 4278225803] = "darkcyan";
colors[colors["darkgoldenrod"] = 4290283019] = "darkgoldenrod";
colors[colors["darkgray"] = 4289309097] = "darkgray";
colors[colors["darkgreen"] = 4278215680] = "darkgreen";
colors[colors["darkgrey"] = 4289309097] = "darkgrey";
colors[colors["darkkhaki"] = 4290623339] = "darkkhaki";
colors[colors["darkmagenta"] = 4287299723] = "darkmagenta";
colors[colors["darkolivegreen"] = 4283788079] = "darkolivegreen";
colors[colors["darkorange"] = 4294937600] = "darkorange";
colors[colors["darkorchid"] = 4288230092] = "darkorchid";
colors[colors["darkred"] = 4287299584] = "darkred";
colors[colors["darksalmon"] = 4293498490] = "darksalmon";
colors[colors["darkseagreen"] = 4287609999] = "darkseagreen";
colors[colors["darkslateblue"] = 4282924427] = "darkslateblue";
colors[colors["darkslategray"] = 4281290575] = "darkslategray";
colors[colors["darkslategrey"] = 4281290575] = "darkslategrey";
colors[colors["darkturquoise"] = 4278243025] = "darkturquoise";
colors[colors["darkviolet"] = 4287889619] = "darkviolet";
colors[colors["deeppink"] = 4294907027] = "deeppink";
colors[colors["deepskyblue"] = 4278239231] = "deepskyblue";
colors[colors["dimgray"] = 4285098345] = "dimgray";
colors[colors["dimgrey"] = 4285098345] = "dimgrey";
colors[colors["dodgerblue"] = 4280193279] = "dodgerblue";
colors[colors["firebrick"] = 4289864226] = "firebrick";
colors[colors["floralwhite"] = 4294966000] = "floralwhite";
colors[colors["forestgreen"] = 4280453922] = "forestgreen";
colors[colors["fuchsia"] = 4294902015] = "fuchsia";
colors[colors["gainsboro"] = 4292664540] = "gainsboro";
colors[colors["ghostwhite"] = 4294506751] = "ghostwhite";
colors[colors["gold"] = 4294956800] = "gold";
colors[colors["goldenrod"] = 4292519200] = "goldenrod";
colors[colors["gray"] = 4286611584] = "gray";
colors[colors["green"] = 4278222848] = "green";
colors[colors["greenyellow"] = 4289593135] = "greenyellow";
colors[colors["grey"] = 4286611584] = "grey";
colors[colors["honeydew"] = 4293984240] = "honeydew";
colors[colors["hotpink"] = 4294928820] = "hotpink";
colors[colors["indianred"] = 4291648604] = "indianred";
colors[colors["indigo"] = 4283105410] = "indigo";
colors[colors["ivory"] = 4294967280] = "ivory";
colors[colors["khaki"] = 4293977740] = "khaki";
colors[colors["lavender"] = 4293322490] = "lavender";
colors[colors["lavenderblush"] = 4294963445] = "lavenderblush";
colors[colors["lawngreen"] = 4286381056] = "lawngreen";
colors[colors["lemonchiffon"] = 4294965965] = "lemonchiffon";
colors[colors["lightblue"] = 4289583334] = "lightblue";
colors[colors["lightcoral"] = 4293951616] = "lightcoral";
colors[colors["lightcyan"] = 4292935679] = "lightcyan";
colors[colors["lightgoldenrodyellow"] = 4294638290] = "lightgoldenrodyellow";
colors[colors["lightgray"] = 4292072403] = "lightgray";
colors[colors["lightgreen"] = 4287688336] = "lightgreen";
colors[colors["lightgrey"] = 4292072403] = "lightgrey";
colors[colors["lightpink"] = 4294948545] = "lightpink";
colors[colors["lightsalmon"] = 4294942842] = "lightsalmon";
colors[colors["lightseagreen"] = 4280332970] = "lightseagreen";
colors[colors["lightskyblue"] = 4287090426] = "lightskyblue";
colors[colors["lightslategray"] = 4286023833] = "lightslategray";
colors[colors["lightslategrey"] = 4286023833] = "lightslategrey";
colors[colors["lightsteelblue"] = 4289774814] = "lightsteelblue";
colors[colors["lightyellow"] = 4294967264] = "lightyellow";
colors[colors["lime"] = 4278255360] = "lime";
colors[colors["limegreen"] = 4281519410] = "limegreen";
colors[colors["linen"] = 4294635750] = "linen";
colors[colors["magenta"] = 4294902015] = "magenta";
colors[colors["maroon"] = 4286578688] = "maroon";
colors[colors["mediumaquamarine"] = 4284927402] = "mediumaquamarine";
colors[colors["mediumblue"] = 4278190285] = "mediumblue";
colors[colors["mediumorchid"] = 4290401747] = "mediumorchid";
colors[colors["mediumpurple"] = 4287852763] = "mediumpurple";
colors[colors["mediumseagreen"] = 4282168177] = "mediumseagreen";
colors[colors["mediumslateblue"] = 4286277870] = "mediumslateblue";
colors[colors["mediumspringgreen"] = 4278254234] = "mediumspringgreen";
colors[colors["mediumturquoise"] = 4282962380] = "mediumturquoise";
colors[colors["mediumvioletred"] = 4291237253] = "mediumvioletred";
colors[colors["midnightblue"] = 4279834992] = "midnightblue";
colors[colors["mintcream"] = 4294311930] = "mintcream";
colors[colors["mistyrose"] = 4294960353] = "mistyrose";
colors[colors["moccasin"] = 4294960309] = "moccasin";
colors[colors["navajowhite"] = 4294958765] = "navajowhite";
colors[colors["navy"] = 4278190208] = "navy";
colors[colors["oldlace"] = 4294833638] = "oldlace";
colors[colors["olive"] = 4286611456] = "olive";
colors[colors["olivedrab"] = 4285238819] = "olivedrab";
colors[colors["orange"] = 4294944000] = "orange";
colors[colors["orangered"] = 4294919424] = "orangered";
colors[colors["orchid"] = 4292505814] = "orchid";
colors[colors["palegoldenrod"] = 4293847210] = "palegoldenrod";
colors[colors["palegreen"] = 4288215960] = "palegreen";
colors[colors["paleturquoise"] = 4289720046] = "paleturquoise";
colors[colors["palevioletred"] = 4292571283] = "palevioletred";
colors[colors["papayawhip"] = 4294963157] = "papayawhip";
colors[colors["peachpuff"] = 4294957753] = "peachpuff";
colors[colors["peru"] = 4291659071] = "peru";
colors[colors["pink"] = 4294951115] = "pink";
colors[colors["plum"] = 4292714717] = "plum";
colors[colors["powderblue"] = 4289781990] = "powderblue";
colors[colors["purple"] = 4286578816] = "purple";
colors[colors["rebeccapurple"] = 4284887961] = "rebeccapurple";
colors[colors["red"] = 4294901760] = "red";
colors[colors["rosybrown"] = 4290547599] = "rosybrown";
colors[colors["royalblue"] = 4282477025] = "royalblue";
colors[colors["saddlebrown"] = 4287317267] = "saddlebrown";
colors[colors["salmon"] = 4294606962] = "salmon";
colors[colors["sandybrown"] = 4294222944] = "sandybrown";
colors[colors["seagreen"] = 4281240407] = "seagreen";
colors[colors["seashell"] = 4294964718] = "seashell";
colors[colors["sienna"] = 4288696877] = "sienna";
colors[colors["silver"] = 4290822336] = "silver";
colors[colors["skyblue"] = 4287090411] = "skyblue";
colors[colors["slateblue"] = 4285160141] = "slateblue";
colors[colors["slategray"] = 4285563024] = "slategray";
colors[colors["slategrey"] = 4285563024] = "slategrey";
colors[colors["snow"] = 4294966010] = "snow";
colors[colors["springgreen"] = 4278255487] = "springgreen";
colors[colors["steelblue"] = 4282811060] = "steelblue";
colors[colors["tan"] = 4291998860] = "tan";
colors[colors["teal"] = 4278222976] = "teal";
colors[colors["thistle"] = 4292394968] = "thistle";
colors[colors["tomato"] = 4294927175] = "tomato";
colors[colors["turquoise"] = 4282441936] = "turquoise";
colors[colors["violet"] = 4293821166] = "violet";
colors[colors["wheat"] = 4294303411] = "wheat";
colors[colors["white"] = 4294967295] = "white";
colors[colors["whitesmoke"] = 4294309365] = "whitesmoke";
colors[colors["yellow"] = 4294967040] = "yellow";
colors[colors["yellowgreen"] = 4288335154] = "yellowgreen";
})(colors = exports.colors || (exports.colors = {}));
;
function parseColorKeyword(value, start, keyword) {
if (keyword === void 0) { keyword = parseKeyword(value, start); }
if (keyword && keyword.value in colors) {
var end = keyword.end;
var value_1 = colors[keyword.value];
return { start: start, end: end, value: value_1 };
}
return null;
}
exports.parseColorKeyword = parseColorKeyword;
function parseColor(value, start, keyword) {
if (start === void 0) { start = 0; }
if (keyword === void 0) { keyword = parseKeyword(value, start); }
return parseHexColor(value, start) || parseColorKeyword(value, start, keyword) || parseRGBColor(value, start) || parseRGBAColor(value, start);
}
exports.parseColor = parseColor;
var keywordRegEx = /\s*([a-z][\w\-]*)\s*/giy;
function parseKeyword(text, start) {
if (start === void 0) { start = 0; }
keywordRegEx.lastIndex = start;
var result = keywordRegEx.exec(text);
if (!result) {
return null;
}
var end = keywordRegEx.lastIndex;
var value = result[1];
return { start: start, end: end, value: value };
}
var backgroundRepeatKeywords = new Set(["repeat", "repeat-x", "repeat-y", "no-repeat"]);
function parseRepeat(value, start, keyword) {
if (start === void 0) { start = 0; }
if (keyword === void 0) { keyword = parseKeyword(value, start); }
if (keyword && backgroundRepeatKeywords.has(keyword.value)) {
var end = keyword.end;
var value_2 = keyword.value;
return { start: start, end: end, value: value_2 };
}
return null;
}
exports.parseRepeat = parseRepeat;
var unitRegEx = /\s*([\+\-]?(?:\d+\.\d+|\d+|\.\d+)(?:[eE][\+\-]?\d+)?)([a-zA-Z]+|%)?\s*/gy;
function parseUnit(text, start) {
if (start === void 0) { start = 0; }
unitRegEx.lastIndex = start;
var result = unitRegEx.exec(text);
if (!result) {
return null;
}
var end = unitRegEx.lastIndex;
var value = parseFloat(result[1]);
var unit = result[2] || "dip";
return { start: start, end: end, value: { value: value, unit: unit } };
}
exports.parseUnit = parseUnit;
function parsePercentageOrLength(text, start) {
if (start === void 0) { start = 0; }
var unitResult = parseUnit(text, start);
if (unitResult) {
var start_1 = unitResult.start, end = unitResult.end;
var value = unitResult.value;
if (value.unit === "%") {
value.value /= 100;
}
else if (!value.unit) {
value.unit = "dip";
}
else if (value.unit === "px" || value.unit === "dip") {
}
else {
return null;
}
return { start: start_1, end: end, value: value };
}
return null;
}
exports.parsePercentageOrLength = parsePercentageOrLength;
var angleUnitsToRadMap = {
"deg": function (start, end, deg) { return ({ start: start, end: end, value: deg / 180 * Math.PI }); },
"rad": function (start, end, rad) { return ({ start: start, end: end, value: rad }); },
"grad": function (start, end, grad) { return ({ start: start, end: end, value: grad / 200 * Math.PI }); },
"turn": function (start, end, turn) { return ({ start: start, end: end, value: turn * Math.PI * 2 }); }
};
function parseAngle(value, start) {
if (start === void 0) { start = 0; }
var angleResult = parseUnit(value, start);
if (angleResult) {
var start_2 = angleResult.start, end = angleResult.end, value_3 = angleResult.value;
return (angleUnitsToRadMap[value_3.unit] || (function (_, __, ___) { return null; }))(start_2, end, value_3.value);
}
return null;
}
exports.parseAngle = parseAngle;
var backgroundSizeKeywords = new Set(["auto", "contain", "cover"]);
function parseBackgroundSize(value, start, keyword) {
if (start === void 0) { start = 0; }
if (keyword === void 0) { keyword = parseKeyword(value, start); }
var end = start;
if (keyword && backgroundSizeKeywords.has(keyword.value)) {
end = keyword.end;
var value_4 = keyword.value;
return { start: start, end: end, value: value_4 };
}
var firstLength = parsePercentageOrLength(value, end);
if (firstLength) {
end = firstLength.end;
var secondLength = parsePercentageOrLength(value, firstLength.end);
if (secondLength) {
end = secondLength.end;
return { start: start, end: end, value: { x: firstLength.value, y: secondLength.value } };
}
else {
return { start: start, end: end, value: { x: firstLength.value, y: "auto" } };
}
}
return null;
}
exports.parseBackgroundSize = parseBackgroundSize;
var backgroundPositionKeywords = Object.freeze(new Set(["left", "right", "top", "bottom", "center"]));
var backgroundPositionKeywordsDirection = {
"left": "x",
"right": "x",
"center": "center",
"top": "y",
"bottom": "y"
};
function parseBackgroundPosition(text, start, keyword) {
if (start === void 0) { start = 0; }
if (keyword === void 0) { keyword = parseKeyword(text, start); }
function formatH(align, offset) {
if (align.value === "center") {
return "center";
}
if (offset && offset.value.value !== 0) {
return { align: align.value, offset: offset.value };
}
return align.value;
}
function formatV(align, offset) {
if (align.value === "center") {
return "center";
}
if (offset && offset.value.value !== 0) {
return { align: align.value, offset: offset.value };
}
return align.value;
}
var end = start;
if (keyword && backgroundPositionKeywords.has(keyword.value)) {
end = keyword.end;
var firstDirection = backgroundPositionKeywordsDirection[keyword.value];
var firstLength = firstDirection !== "center" && parsePercentageOrLength(text, end);
if (firstLength) {
end = firstLength.end;
}
var secondKeyword = parseKeyword(text, end);
if (secondKeyword && backgroundPositionKeywords.has(secondKeyword.value)) {
end = secondKeyword.end;
var secondDirection = backgroundPositionKeywordsDirection[secondKeyword.end];
if (firstDirection === secondDirection && firstDirection !== "center") {
return null;
}
var secondLength = secondDirection !== "center" && parsePercentageOrLength(text, end);
if (secondLength) {
end = secondLength.end;
}
if ((firstDirection === secondDirection && secondDirection === "center") || (firstDirection === "x" || secondDirection === "y")) {
return { start: start, end: end, value: {
x: formatH(keyword, firstLength),
y: formatV(secondKeyword, secondLength)
} };
}
else {
return { start: start, end: end, value: {
x: formatH(secondKeyword, secondLength),
y: formatV(keyword, firstLength),
} };
}
}
else {
if (firstDirection === "center") {
return { start: start, end: end, value: { x: "center", y: "center" } };
}
else if (firstDirection === "x") {
return { start: start, end: end, value: { x: formatH(keyword, firstLength), y: "center" } };
}
else {
return { start: start, end: end, value: { x: "center", y: formatV(keyword, firstLength) } };
}
}
}
else {
var firstLength = parsePercentageOrLength(text, end);
if (firstLength) {
end = firstLength.end;
var secondLength = parsePercentageOrLength(text, end);
if (secondLength) {
end = secondLength.end;
return { start: start, end: end, value: { x: { align: "left", offset: firstLength.value }, y: { align: "top", offset: secondLength.value } } };
}
else {
return { start: start, end: end, value: { x: { align: "left", offset: firstLength.value }, y: "center" } };
}
}
else {
return null;
}
}
}
exports.parseBackgroundPosition = parseBackgroundPosition;
var directionRegEx = /\s*to\s*(left|right|top|bottom)\s*(left|right|top|bottom)?\s*/gy;
var sideDirections = {
top: Math.PI * 0 / 2,
right: Math.PI * 1 / 2,
bottom: Math.PI * 2 / 2,
left: Math.PI * 3 / 2
};
var cornerDirections = {
top: {
right: Math.PI * 1 / 4,
left: Math.PI * 7 / 4
},
right: {
top: Math.PI * 1 / 4,
bottom: Math.PI * 3 / 4
},
bottom: {
right: Math.PI * 3 / 4,
left: Math.PI * 5 / 4
},
left: {
top: Math.PI * 7 / 4,
bottom: Math.PI * 5 / 4
}
};
function parseDirection(text, start) {
if (start === void 0) { start = 0; }
directionRegEx.lastIndex = start;
var result = directionRegEx.exec(text);
if (!result) {
return null;
}
var end = directionRegEx.lastIndex;
var firstDirection = result[1];
if (result[2]) {
var secondDirection = result[2];
var value = cornerDirections[firstDirection][secondDirection];
return value === undefined ? null : { start: start, end: end, value: value };
}
else {
return { start: start, end: end, value: sideDirections[firstDirection] };
}
}
var openingBracketRegEx = /\s*\(\s*/gy;
var closingBracketRegEx = /\s*\)\s*/gy;
var closingBracketOrCommaRegEx = /\s*(\)|,)\s*/gy;
function parseArgumentsList(text, start, argument) {
openingBracketRegEx.lastIndex = start;
var openingBracket = openingBracketRegEx.exec(text);
if (!openingBracket) {
return null;
}
var end = openingBracketRegEx.lastIndex;
var value = [];
closingBracketRegEx.lastIndex = end;
var closingBracket = closingBracketRegEx.exec(text);
if (closingBracket) {
return { start: start, end: end, value: value };
}
for (var index = 0; true; index++) {
var arg = argument(text, end, index);
if (!arg) {
return null;
}
end = arg.end;
value.push(arg);
closingBracketOrCommaRegEx.lastIndex = end;
var closingBracketOrComma = closingBracketOrCommaRegEx.exec(text);
if (closingBracketOrComma) {
end = closingBracketOrCommaRegEx.lastIndex;
if (closingBracketOrComma[1] === ",") {
continue;
}
else if (closingBracketOrComma[1] === ")") {
return { start: start, end: end, value: value };
}
}
else {
return null;
}
}
}
function parseColorStop(text, start) {
if (start === void 0) { start = 0; }
var color = parseColor(text, start);
if (!color) {
return null;
}
var end = color.end;
var offset = parsePercentageOrLength(text, end);
if (offset) {
end = offset.end;
return { start: start, end: end, value: { argb: color.value, offset: offset.value } };
}
return { start: start, end: end, value: { argb: color.value } };
}
exports.parseColorStop = parseColorStop;
var linearGradientStartRegEx = /\s*linear-gradient\s*/gy;
function parseLinearGradient(text, start) {
if (start === void 0) { start = 0; }
linearGradientStartRegEx.lastIndex = start;
var lgs = linearGradientStartRegEx.exec(text);
if (!lgs) {
return null;
}
var end = linearGradientStartRegEx.lastIndex;
var angle = Math.PI;
var colors = [];
var parsedArgs = parseArgumentsList(text, end, function (text, start, index) {
if (index === 0) {
var angleArg = parseAngle(text, start) || parseDirection(text, start);
if (angleArg) {
angle = angleArg.value;
return angleArg;
}
}
var colorStop = parseColorStop(text, start);
if (colorStop) {
colors.push(colorStop.value);
return colorStop;
}
return null;
});
if (!parsedArgs) {
return null;
}
end = parsedArgs.end;
return { start: start, end: end, value: { angle: angle, colors: colors } };
}
exports.parseLinearGradient = parseLinearGradient;
var slashRegEx = /\s*(\/)\s*/gy;
function parseSlash(text, start) {
slashRegEx.lastIndex = start;
var slash = slashRegEx.exec(text);
if (!slash) {
return null;
}
var end = slashRegEx.lastIndex;
return { start: start, end: end, value: "/" };
}
function parseBackground(text, start) {
if (start === void 0) { start = 0; }
var value = {};
var end = start;
while (end < text.length) {
var keyword = parseKeyword(text, end);
var color = parseColor(text, end, keyword);
if (color) {
value.color = color.value;
end = color.end;
continue;
}
var repeat = parseRepeat(text, end, keyword);
if (repeat) {
value.repeat = repeat.value;
end = repeat.end;
continue;
}
var position = parseBackgroundPosition(text, end, keyword);
if (position) {
position.value.text = text.substring(position.start, position.end);
value.position = position.value;
end = position.end;
var slash = parseSlash(text, end);
if (slash) {
end = slash.end;
var size = parseBackgroundSize(text, end);
if (!size) {
return null;
}
value.size = size.value;
end = size.end;
}
continue;
}
var url = parseURL(text, end);
if (url) {
value.image = url.value;
end = url.end;
continue;
}
var gradient = parseLinearGradient(text, end);
if (gradient) {
value.image = gradient.value;
end = gradient.end;
continue;
}
return null;
}
return { start: start, end: end, value: value };
}
exports.parseBackground = parseBackground;
var universalSelectorRegEx = /\*/gy;
function parseUniversalSelector(text, start) {
if (start === void 0) { start = 0; }
universalSelectorRegEx.lastIndex = start;
var result = universalSelectorRegEx.exec(text);
if (!result) {
return null;
}
var end = universalSelectorRegEx.lastIndex;
return { start: start, end: end, value: { type: "*" } };
}
exports.parseUniversalSelector = parseUniversalSelector;
var simpleIdentifierSelectorRegEx = /(#|\.|:|\b)([_-\w][_-\w\d]*)/gy;
function parseSimpleIdentifierSelector(text, start) {
if (start === void 0) { start = 0; }
simpleIdentifierSelectorRegEx.lastIndex = start;
var result = simpleIdentifierSelectorRegEx.exec(text);
if (!result) {
return null;
}
var end = simpleIdentifierSelectorRegEx.lastIndex;
var type = result[1];
var identifier = result[2];
var value = { type: type, identifier: identifier };
return { start: start, end: end, value: value };
}
exports.parseSimpleIdentifierSelector = parseSimpleIdentifierSelector;
var attributeSelectorRegEx = /\[\s*([_-\w][_-\w\d]*)\s*(?:(=|\^=|\$=|\*=|\~=|\|=)\s*(?:([_-\w][_-\w\d]*)|"((?:[^\\"]|\\(?:"|n|r|f|\\|0-9a-f))*)"|'((?:[^\\']|\\(?:'|n|r|f|\\|0-9a-f))*)')\s*)?\]/gy;
function parseAttributeSelector(text, start) {
attributeSelectorRegEx.lastIndex = start;
var result = attributeSelectorRegEx.exec(text);
if (!result) {
return null;
}
var end = attributeSelectorRegEx.lastIndex;
var property = result[1];
if (result[2]) {
var test_1 = result[2];
var value = result[3] || result[4] || result[5];
return { start: start, end: end, value: { type: "[]", property: property, test: test_1, value: value } };
}
return { start: start, end: end, value: { type: "[]", property: property } };
}
exports.parseAttributeSelector = parseAttributeSelector;
function parseSimpleSelector(text, start) {
if (start === void 0) { start = 0; }
return parseUniversalSelector(text, start) ||
parseSimpleIdentifierSelector(text, start) ||
parseAttributeSelector(text, start);
}
exports.parseSimpleSelector = parseSimpleSelector;
function parseSimpleSelectorSequence(text, start) {
var simpleSelector = parseSimpleSelector(text, start);
if (!simpleSelector) {
return null;
}
var end = simpleSelector.end;
var value = [];
while (simpleSelector) {
value.push(simpleSelector.value);
end = simpleSelector.end;
simpleSelector = parseSimpleSelector(text, end);
}
return { start: start, end: end, value: value };
}
exports.parseSimpleSelectorSequence = parseSimpleSelectorSequence;
var combinatorRegEx = /\s*(\+|~|>)?\s*/gy;
function parseCombinator(text, start) {
if (start === void 0) { start = 0; }
combinatorRegEx.lastIndex = start;
var result = combinatorRegEx.exec(text);
if (!result) {
return null;
}
var end = combinatorRegEx.lastIndex;
var value = result[1] || " ";
return { start: start, end: end, value: value };
}
exports.parseCombinator = parseCombinator;
var whiteSpaceRegEx = /\s*/gy;
function parseSelector(text, start) {
if (start === void 0) { start = 0; }
var end = start;
whiteSpaceRegEx.lastIndex = end;
var leadingWhiteSpace = whiteSpaceRegEx.exec(text);
if (leadingWhiteSpace) {
end = whiteSpaceRegEx.lastIndex;
}
var value = [];
var combinator;
var expectSimpleSelector = true;
var pair;
do {
var simpleSelectorSequence = parseSimpleSelectorSequence(text, end);
if (!simpleSelectorSequence) {
if (expectSimpleSelector) {
return null;
}
else {
break;
}
}
end = simpleSelectorSequence.end;
if (combinator) {
pair[1] = combinator.value;
}
pair = [simpleSelectorSequence.value, undefined];
value.push(pair);
combinator = parseCombinator(text, end);
if (combinator) {
end = combinator.end;
}
expectSimpleSelector = combinator && combinator.value !== " ";
} while (combinator);
return { start: start, end: end, value: value };
}
exports.parseSelector = parseSelector;
var whitespaceRegEx = /[\s\t\n\r\f]*/gym;
var singleQuoteStringRegEx = /'((?:[^\n\r\f\']|\\(?:\$|\n|[0-9a-fA-F]{1,6}\s?))*)(:?'|$)/gym;
var doubleQuoteStringRegEx = /"((?:[^\n\r\f\"]|\\(?:\$|\n|[0-9a-fA-F]{1,6}\s?))*)(:?"|$)/gym;
var commentRegEx = /(\/\*(?:[^\*]|\*[^\/])*\*\/)/gym;
var numberRegEx = /[\+\-]?(?:\d+\.\d+|\d+|\.\d+)(?:[eE][\+\-]?\d+)?/gym;
var nameRegEx = /-?(?:(?:[a-zA-Z_]|[^\x00-\x7F]|\\(?:\$|\n|[0-9a-fA-F]{1,6}\s?))(?:[a-zA-Z_0-9\-]*|\\(?:\$|\n|[0-9a-fA-F]{1,6}\s?))*)/gym;
var CSS3Parser = (function () {
function CSS3Parser(text) {
this.text = text;
this.nextInputCodePointIndex = 0;
}
CSS3Parser.prototype.tokenize = function () {
var tokens = [];
var inputToken;
do {
inputToken = this.consumeAToken();
tokens.push(inputToken);
} while (inputToken);
return tokens;
};
CSS3Parser.prototype.consumeAToken = function () {
if (this.reconsumedInputToken) {
var result = this.reconsumedInputToken;
this.reconsumedInputToken = null;
return result;
}
var char = this.text[this.nextInputCodePointIndex];
switch (char) {
case "\"": return this.consumeAStringToken();
case "'": return this.consumeAStringToken();
case "(":
case ")":
case ",":
case ":":
case ";":
case "[":
case "]":
case "{":
case "}":
this.nextInputCodePointIndex++;
return char;
case "#": return this.consumeAHashToken() || this.consumeADelimToken();
case " ":
case "\t":
case "\n":
case "\r":
case "\f":
return this.consumeAWhitespace();
case "@": return this.consumeAtKeyword() || this.consumeADelimToken();
case "\\": return this.consumeAnIdentLikeToken() || this.consumeADelimToken();
case "0":
case "1":
case "2":
case "3":
case "4":
case "5":
case "6":
case "7":
case "8":
case "9":
return this.consumeANumericToken();
case "u":
case "U":
if (this.text[this.nextInputCodePointIndex + 1] === "+") {
var thirdChar = this.text[this.nextInputCodePointIndex + 2];
if (thirdChar >= "0" && thirdChar <= "9" || thirdChar === "?") {
throw new Error("Unicode tokens not supported!");
}
}
return this.consumeAnIdentLikeToken() || this.consumeADelimToken();
case "$":
case "*":
case "^":
case "|":
case "~":
return this.consumeAMatchToken() || this.consumeADelimToken();
case "-": return this.consumeANumericToken() || this.consumeAnIdentLikeToken() || this.consumeCDC() || this.consumeADelimToken();
case "+":
case ".":
return this.consumeANumericToken() || this.consumeADelimToken();
case "/": return this.consumeAComment() || this.consumeADelimToken();
case "<": return this.consumeCDO() || this.consumeADelimToken();
case undefined: return undefined;
default: return this.consumeAnIdentLikeToken() || this.consumeADelimToken();
}
};
CSS3Parser.prototype.consumeADelimToken = function () {
return { type: 2, text: this.text[this.nextInputCodePointIndex++] };
};
CSS3Parser.prototype.consumeAWhitespace = function () {
whitespaceRegEx.lastIndex = this.nextInputCodePointIndex;
whitespaceRegEx.exec(this.text);
this.nextInputCodePointIndex = whitespaceRegEx.lastIndex;
return " ";
};
CSS3Parser.prototype.consumeAHashToken = function () {
this.nextInputCodePointIndex++;
var hashName = this.consumeAName();
if (hashName) {
return { type: 12, text: "#" + hashName.text };
}
this.nextInputCodePointIndex--;
return null;
};
CSS3Parser.prototype.consumeCDO = function () {
if (this.text.substr(this.nextInputCodePointIndex, 4) === "<!--") {
this.nextInputCodePointIndex += 4;
return "<!--";
}
return null;
};
CSS3Parser.prototype.consumeCDC = function () {
if (this.text.substr(this.nextInputCodePointIndex, 3) === "-->") {
this.nextInputCodePointIndex += 3;
return "-->";
}
return null;
};
CSS3Parser.prototype.consumeAMatchToken = function () {
if (this.text[this.nextInputCodePointIndex + 1] === "=") {
var token = this.text.substr(this.nextInputCodePointIndex, 2);
this.nextInputCodePointIndex += 2;
return token;
}
return null;
};
CSS3Parser.prototype.consumeANumericToken = function () {
numberRegEx.lastIndex = this.nextInputCodePointIndex;
var result = numberRegEx.exec(this.text);
if (!result) {
return null;
}
this.nextInputCodePointIndex = numberRegEx.lastIndex;
if (this.text[this.nextInputCodePointIndex] === "%") {
return { type: 4, text: result[0] };
}
var name = this.consumeAName();
if (name) {
return { type: 5, text: result[0] + name.text };
}
return { type: 3, text: result[0] };
};
CSS3Parser.prototype.consumeAnIdentLikeToken = function () {
var name = this.consumeAName();
if (!name) {
return null;
}
if (this.text[this.nextInputCodePointIndex] === "(") {
this.nextInputCodePointIndex++;
if (name.text.toLowerCase() === "url") {
return this.consumeAURLToken();
}
return { type: 8, name: name.text, text: name.text + "(" };
}
return name;
};
CSS3Parser.prototype.consumeAStringToken = function () {
var char = this.text[this.nextInputCodePointIndex];
var result;
if (char === "'") {
singleQuoteStringRegEx.lastIndex = this.nextInputCodePointIndex;
result = singleQuoteStringRegEx.exec(this.text);
if (!result) {
return null;
}
this.nextInputCodePointIndex = singleQuoteStringRegEx.lastIndex;
}
else if (char === "\"") {
doubleQuoteStringRegEx.lastIndex = this.nextInputCodePointIndex;
result = doubleQuoteStringRegEx.exec(this.text);
if (!result) {
return null;
}
this.nextInputCodePointIndex = doubleQuoteStringRegEx.lastIndex;
}
return { type: 1, text: result[0] };
};
CSS3Parser.prototype.consumeAURLToken = function () {
var start = this.nextInputCodePointIndex - 3 - 1;
var urlToken = { type: 7, text: undefined };
this.consumeAWhitespace();
if (this.nextInputCodePointIndex >= this.text.length) {
return urlToken;
}
var nextInputCodePoint = this.text[this.nextInputCodePointIndex];
if (nextInputCodePoint === "\"" || nextInputCodePoint === "'") {
var stringToken = this.consumeAStringToken();
urlToken.text = stringToken.text;
this.consumeAWhitespace();
if (this.text[this.nextInputCodePointIndex] === ")" || this.nextInputCodePointIndex >= this.text.length) {
this.nextInputCodePointIndex++;
var end = this.nextInputCodePointIndex;
urlToken.text = this.text.substring(start, end);
return urlToken;
}
else {
return null;
}
}
while (this.nextInputCodePointIndex < this.text.length) {
var char = this.text[this.nextInputCodePointIndex++];
switch (char) {
case ")": return urlToken;
case " ":
case "\t":
case "\n":
case "\r":
case "\f":
this.consumeAWhitespace();
if (this.text[this.nextInputCodePointIndex] === ")") {
this.nextInputCodePointIndex++;
return urlToken;
}
else {
return null;
}
case "\"":
case "\'":
return null;
case "\\":
throw new Error("Escaping not yet supported!");
default:
urlToken.text += char;
}
}
return urlToken;
};
CSS3Parser.prototype.consumeAName = function () {
nameRegEx.lastIndex = this.nextInputCodePointIndex;
var result = nameRegEx.exec(this.text);
if (!result) {
return null;
}
this.nextInputCodePointIndex = nameRegEx.lastIndex;
return { type: 6, text: result[0] };
};
CSS3Parser.prototype.consumeAtKeyword = function () {
this.nextInputCodePointIndex++;
var name = this.consumeAName();
if (name) {
return { type: 11, text: name.text };
}
this.nextInputCodePointIndex--;
return null;
};
CSS3Parser.prototype.consumeAComment = function () {
if (this.text[this.nextInputCodePointIndex + 1] === "*") {
commentRegEx.lastIndex = this.nextInputCodePointIndex;
var result = commentRegEx.exec(this.text);
if (!result) {
return null;
}
this.nextInputCodePointIndex = commentRegEx.lastIndex;
return this.consumeAToken();
}
return null;
};
CSS3Parser.prototype.reconsumeTheCurrentInputToken = function (currentInputToken) {
this.reconsumedInputToken = currentInputToken;
};
CSS3Parser.prototype.parseAStylesheet = function () {
this.topLevelFlag = true;
var stylesheet = {
rules: this.consumeAListOfRules()
};
return stylesheet;
};
CSS3Parser.prototype.consumeAListOfRules = function () {
var rules = [];
var inputToken;
while (inputToken = this.consumeAToken()) {
switch (inputToken) {
case " ": continue;
case "<!--":
case "-->":
if (this.topLevelFlag) {
continue;
}
this.reconsumeTheCurrentInputToken(inputToken);
var atRule = this.consumeAnAtRule();
if (atRule) {
rules.push(atRule);
}
continue;
}
if (inputToken.type === 11) {
this.reconsumeTheCurrentInputToken(inputToken);
var atRule = this.consumeAnAtRule();
if (atRule) {
rules.push(atRule);
}
continue;
}
this.reconsumeTheCurrentInputToken(inputToken);
var qualifiedRule = this.consumeAQualifiedRule();
if (qualifiedRule) {
rules.push(qualifiedRule);
}
}
return rules;
};
CSS3Parser.prototype.consumeAnAtRule = function () {
var inputToken = this.consumeAToken();
var atRule = {
type: "at-rule",
name: inputToken.text,
prelude: [],
block: undefined
};
while (inputToken = this.consumeAToken()) {
if (inputToken === ";") {
return atRule;
}
else if (inputToken === "{") {
atRule.block = this.consumeASimpleBlock(inputToken);
return atRule;
}
else if (inputToken.type === 9 && inputToken.associatedToken === "{") {
atRule.block = inputToken;
return atRule;
}
this.reconsumeTheCurrentInputToken(inputToken);
var component = this.consumeAComponentValue();
if (component) {
atRule.prelude.push(component);
}
}
return atRule;
};
CSS3Parser.prototype.consumeAQualifiedRule = function () {
var qualifiedRule = {
type: "qualified-rule",
prelude: [],
block: undefined
};
var inputToken;
while (inputToken = this.consumeAToken()) {
if (inputToken === "{") {
var block = this.consumeASimpleBlock(inputToken);
qualifiedRule.block = block;
return qualifiedRule;
}
else if (inputToken.type === 9) {
var simpleBlock = inputToken;
if (simpleBlock.associatedToken === "{") {
qualifiedRule.block = simpleBlock;
return qualifiedRule;
}
}
this.reconsumeTheCurrentInputToken(inputToken);
var componentValue = this.consumeAComponentValue();
if (componentValue) {
qualifiedRule.prelude.push(componentValue);
}
}
return null;
};
CSS3Parser.prototype.consumeAComponentValue = function () {
var inputToken = this.consumeAToken();
switch (inputToken) {
case "{":
case "[":
case "(":
this.nextInputCodePointIndex++;
return this.consumeASimpleBlock(inputToken);
}
if (typeof inputToken === "object" && inputToken.type === 8) {
return this.consumeAFunction(inputToken.name);
}
return inputToken;
};
CSS3Parser.prototype.consumeASimpleBlock = function (associatedToken) {
var endianToken = {
"[": "]",
"{": "}",
"(": ")"
}[associatedToken];
var start = this.nextInputCodePointIndex - 1;
var block = {
type: 9,
text: undefined,
associatedToken: associatedToken,
values: []
};
var nextInputToken;
while (nextInputToken = this.text[this.nextInputCodePointIndex]) {
if (nextInputToken === endianToken) {
this.nextInputCodePointIndex++;
var end = this.nextInputCodePointIndex;
block.text = this.text.substring(start, end);
return block;
}
var value = this.consumeAComponentValue();
if (value) {
block.values.push(value);
}
}
block.text = this.text.substring(start);
return block;
};
CSS3Parser.prototype.consumeAFunction = function (name) {
var start = this.nextInputCodePointIndex;
var funcToken = { type: 14, name: name, text: undefined, components: [] };
do {
if (this.nextInputCodePointIndex >= this.text.length) {
funcToken.text = name + "(" + this.text.substring(start);
return funcToken;
}
var nextInputToken = this.text[this.nextInputCodePointIndex];
switch (nextInputToken) {
case ")":
this.nextInputCodePointIndex++;
var end = this.nextInputCodePointIndex;
funcToken.text = name + "(" + this.text.substring(start, end);
return funcToken;
default:
var component = this.consumeAComponentValue();
if (component) {
funcToken.components.push(component);
}
}
} while (true);
};
return CSS3Parser;
}());
exports.CSS3Parser = CSS3Parser;
var CSSNativeScript = (function () {
function CSSNativeScript() {
}
CSSNativeScript.prototype.parseStylesheet = function (stylesheet) {
return {
type: "stylesheet",
stylesheet: {
rules: this.parseRules(stylesheet.rules)
}
};
};
CSSNativeScript.prototype.parseRules = function (rules) {
var _this = this;
return rules.map(function (rule) { return _this.parseRule(rule); });
};
CSSNativeScript.prototype.parseRule = function (rule) {
if (rule.type === "at-rule") {
return this.parseAtRule(rule);
}
else if (rule.type === "qualified-rule") {
return this.parseQualifiedRule(rule);
}
};
CSSNativeScript.prototype.parseAtRule = function (rule) {
if (rule.name === "import") {
return {
import: rule.prelude.map(function (m) { return typeof m === "string" ? m : m.text; }).join("").trim(),
type: "import"
};
}
return;
};
CSSNativeScript.prototype.parseQualifiedRule = function (rule) {
return {
type: "rule",
selectors: this.preludeToSelectorsStringArray(rule.prelude),
declarations: this.ruleBlockToDeclarations(rule.block.values)
};
};
CSSNativeScript.prototype.ruleBlockToDeclarations = function (declarationsInputTokens) {
var declarations = [];
var property = "";
var value = "";
var reading = "property";
for (var i = 0; i < declarationsInputTokens.length; i++) {
var inputToken = declarationsInputTokens[i];
if (reading === "property") {
if (inputToken === ":") {
reading = "value";
}
else if (typeof inputToken === "string") {
property += inputToken;
}
else {
property += inputToken.text;
}
}
else {
if (inputToken === ";") {
property = property.trim();
value = value.trim();
declarations.push({ type: "declaration", property: property, value: value });
property = "";
value = "";
reading = "property";
}
else if (typeof inputToken === "string") {
value += inputToken;
}
else {
value += inputToken.text;
}
}
}
property = property.trim();
value = value.trim();
if (property || value) {
declarations.push({ type: "declaration", property: property, value: value });
}
return declarations;
};
CSSNativeScript.prototype.preludeToSelectorsStringArray = function (prelude) {
var selectors = [];
var selector = "";
prelude.forEach(function (inputToken) {
if (typeof inputToken === "string") {
if (inputToken === ",") {
if (selector) {
selectors.push(selector.trim());
}
selector = "";
}
else {
selector += inputToken;
}
}
else if (typeof inputToken === "object") {
selector += inputToken.text;
}
});
if (selector) {
selectors.push(selector.trim());
}
return selectors;
};
return CSSNativeScript;
}());
exports.CSSNativeScript = CSSNativeScript;
//# sourceMappingURL=parser.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/data/observable-array/observable-array.js":
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", { value: true });
var observable = __webpack_require__("../node_modules/tns-core-modules/data/observable/observable.js");
var types = __webpack_require__("../node_modules/tns-core-modules/utils/types.js");
var ChangeType = (function () {
function ChangeType() {
}
ChangeType.Add = "add";
ChangeType.Delete = "delete";
ChangeType.Update = "update";
ChangeType.Splice = "splice";
return ChangeType;
}());
exports.ChangeType = ChangeType;
var CHANGE = "change";
var ObservableArray = (function (_super) {
__extends(ObservableArray, _super);
function ObservableArray() {
var _this = _super.call(this) || this;
if (arguments.length === 1 && Array.isArray(arguments[0])) {
_this._array = arguments[0].slice();
}
else {
_this._array = Array.apply(null, arguments);
}
_this._addArgs = {
eventName: CHANGE, object: _this,
action: ChangeType.Add,
index: null,
removed: new Array(),
addedCount: 1
};
_this._deleteArgs = {
eventName: CHANGE, object: _this,
action: ChangeType.Delete,
index: null,
removed: null,
addedCount: 0
};
return _this;
}
ObservableArray.prototype.getItem = function (index) {
return this._array[index];
};
ObservableArray.prototype.setItem = function (index, value) {
var oldValue = this._array[index];
this._array[index] = value;
this.notify({
eventName: CHANGE, object: this,
action: ChangeType.Update,
index: index,
removed: [oldValue],
addedCount: 1
});
};
Object.defineProperty(ObservableArray.prototype, "length", {
get: function () {
return this._array.length;
},
set: function (value) {
if (types.isNumber(value) && this._array && this._array.length !== value) {
this.splice(value, this._array.length - value);
}
},
enumerable: true,
configurable: true
});
ObservableArray.prototype.toString = function () {
return this._array.toString();
};
ObservableArray.prototype.toLocaleString = function () {
return this._array.toLocaleString();
};
ObservableArray.prototype.concat = function () {
this._addArgs.index = this._array.length;
var result = this._array.concat.apply(this._array, arguments);
return result;
};
ObservableArray.prototype.join = function (separator) {
return this._array.join(separator);
};
ObservableArray.prototype.pop = function () {
this._deleteArgs.index = this._array.length - 1;
var result = this._array.pop();
this._deleteArgs.removed = [result];
this.notify(this._deleteArgs);
this._notifyLengthChange();
return result;
};
ObservableArray.prototype.push = function () {
this._addArgs.index = this._array.length;
if (arguments.length === 1 && Array.isArray(arguments[0])) {
var source = arguments[0];
for (var i = 0, l = source.length; i < l; i++) {
this._array.push(source[i]);
}
}
else {
this._array.push.apply(this._array, arguments);
}
this._addArgs.addedCount = this._array.length - this._addArgs.index;
this.notify(this._addArgs);
this._notifyLengthChange();
return this._array.length;
};
ObservableArray.prototype._notifyLengthChange = function () {
var lengthChangedData = this._createPropertyChangeData("length", this._array.length);
this.notify(lengthChangedData);
};
ObservableArray.prototype.reverse = function () {
return this._array.reverse();
};
ObservableArray.prototype.shift = function () {
var result = this._array.shift();
this._deleteArgs.index = 0;
this._deleteArgs.removed = [result];
this.notify(this._deleteArgs);
this._notifyLengthChange();
return result;
};
ObservableArray.prototype.slice = function (start, end) {
return this._array.slice(start, end);
};
ObservableArray.prototype.sort = function (compareFn) {
return this._array.sort(compareFn);
};
ObservableArray.prototype.splice = function (start, deleteCount) {
var length = this._array.length;
var result = this._array.splice.apply(this._array, arguments);
this.notify({
eventName: CHANGE, object: this,
action: ChangeType.Splice,
index: start,
removed: result,
addedCount: this._array.length > length ? this._array.length - length : 0
});
if (this._array.length !== length) {
this._notifyLengthChange();
}
return result;
};
ObservableArray.prototype.unshift = function () {
var length = this._array.length;
var result = this._array.unshift.apply(this._array, arguments);
this._addArgs.index = 0;
this._addArgs.addedCount = result - length;
this.notify(this._addArgs);
this._notifyLengthChange();
return result;
};
ObservableArray.prototype.indexOf = function (searchElement, fromIndex) {
var index = fromIndex ? fromIndex : 0;
for (var i = index, l = this._array.length; i < l; i++) {
if (this._array[i] === searchElement) {
return i;
}
}
return -1;
};
ObservableArray.prototype.lastIndexOf = function (searchElement, fromIndex) {
var index = fromIndex ? fromIndex : this._array.length - 1;
for (var i = index; i >= 0; i--) {
if (this._array[i] === searchElement) {
return i;
}
}
return -1;
};
ObservableArray.prototype.every = function (callbackfn, thisArg) {
return this._array.every(callbackfn, thisArg);
};
ObservableArray.prototype.some = function (callbackfn, thisArg) {
return this._array.some(callbackfn, thisArg);
};
ObservableArray.prototype.forEach = function (callbackfn, thisArg) {
this._array.forEach(callbackfn, thisArg);
};
ObservableArray.prototype.map = function (callbackfn, thisArg) {
return this._array.map(callbackfn, thisArg);
};
ObservableArray.prototype.filter = function (callbackfn, thisArg) {
return this._array.filter(callbackfn, thisArg);
};
ObservableArray.prototype.reduce = function (callbackfn, initialValue) {
return initialValue !== undefined ? this._array.reduce(callbackfn, initialValue) : this._array.reduce(callbackfn);
};
ObservableArray.prototype.reduceRight = function (callbackfn, initialValue) {
return initialValue !== undefined ? this._array.reduceRight(callbackfn, initialValue) : this._array.reduceRight(callbackfn);
};
ObservableArray.changeEvent = CHANGE;
return ObservableArray;
}(observable.Observable));
exports.ObservableArray = ObservableArray;
//# sourceMappingURL=observable-array.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/data/observable/observable.js":
/***/ (function(module, exports) {
Object.defineProperty(exports, "__esModule", { value: true });
var _wrappedIndex = 0;
var WrappedValue = (function () {
function WrappedValue(wrapped) {
this.wrapped = wrapped;
}
WrappedValue.unwrap = function (value) {
return (value instanceof WrappedValue) ? value.wrapped : value;
};
WrappedValue.wrap = function (value) {
var w = _wrappedValues[_wrappedIndex++ % 5];
w.wrapped = value;
return w;
};
return WrappedValue;
}());
exports.WrappedValue = WrappedValue;
var _wrappedValues = [
new WrappedValue(null),
new WrappedValue(null),
new WrappedValue(null),
new WrappedValue(null),
new WrappedValue(null)
];
var Observable = (function () {
function Observable() {
this._observers = {};
}
Observable.prototype.get = function (name) {
return this[name];
};
Observable.prototype.set = function (name, value) {
var oldValue = this[name];
if (this[name] === value) {
return;
}
var newValue = WrappedValue.unwrap(value);
this[name] = newValue;
this.notifyPropertyChange(name, newValue, oldValue);
};
Observable.prototype.on = function (eventNames, callback, thisArg) {
this.addEventListener(eventNames, callback, thisArg);
};
Observable.prototype.once = function (event, callback, thisArg) {
var list = this._getEventList(event, true);
list.push({ callback: callback, thisArg: thisArg, once: true });
};
Observable.prototype.off = function (eventNames, callback, thisArg) {
this.removeEventListener(eventNames, callback, thisArg);
};
Observable.prototype.addEventListener = function (eventNames, callback, thisArg) {
if (typeof eventNames !== "string") {
throw new TypeError("Events name(s) must be string.");
}
if (typeof callback !== "function") {
throw new TypeError("callback must be function.");
}
var events = eventNames.split(",");
for (var i = 0, l = events.length; i < l; i++) {
var event_1 = events[i].trim();
var list = this._getEventList(event_1, true);
list.push({
callback: callback,
thisArg: thisArg
});
}
};
Observable.prototype.removeEventListener = function (eventNames, callback, thisArg) {
if (typeof eventNames !== "string") {
throw new TypeError("Events name(s) must be string.");
}
if (callback && typeof callback !== "function") {
throw new TypeError("callback must be function.");
}
var events = eventNames.split(",");
for (var i = 0, l = events.length; i < l; i++) {
var event_2 = events[i].trim();
if (callback) {
var list = this._getEventList(event_2, false);
if (list) {
var index_1 = this._indexOfListener(list, callback, thisArg);
if (index_1 >= 0) {
list.splice(index_1, 1);
}
if (list.length === 0) {
delete this._observers[event_2];
}
}
}
else {
this._observers[event_2] = undefined;
delete this._observers[event_2];
}
}
};
Observable.prototype.notify = function (data) {
var observers = this._observers[data.eventName];
if (!observers) {
return;
}
for (var i = observers.length - 1; i >= 0; i--) {
var entry = observers[i];
if (entry.once) {
observers.splice(i, 1);
}
if (entry.thisArg) {
entry.callback.apply(entry.thisArg, [data]);
}
else {
entry.callback(data);
}
}
};
Observable.prototype.notifyPropertyChange = function (name, value, oldValue) {
this.notify(this._createPropertyChangeData(name, value, oldValue));
};
Observable.prototype.hasListeners = function (eventName) {
return eventName in this._observers;
};
Observable.prototype._createPropertyChangeData = function (propertyName, value, oldValue) {
return { eventName: Observable.propertyChangeEvent, object: this, propertyName: propertyName, value: value, oldValue: oldValue };
};
Observable.prototype._emit = function (eventNames) {
var events = eventNames.split(",");
for (var i = 0, l = events.length; i < l; i++) {
var event_3 = events[i].trim();
this.notify({ eventName: event_3, object: this });
}
};
Observable.prototype._getEventList = function (eventName, createIfNeeded) {
if (!eventName) {
throw new TypeError("EventName must be valid string.");
}
var list = this._observers[eventName];
if (!list && createIfNeeded) {
list = [];
this._observers[eventName] = list;
}
return list;
};
Observable.prototype._indexOfListener = function (list, callback, thisArg) {
for (var i = 0; i < list.length; i++) {
var entry = list[i];
if (thisArg) {
if (entry.callback === callback && entry.thisArg === thisArg) {
return i;
}
}
else {
if (entry.callback === callback) {
return i;
}
}
}
return -1;
};
Observable.propertyChangeEvent = "propertyChange";
return Observable;
}());
exports.Observable = Observable;
var ObservableFromObject = (function (_super) {
__extends(ObservableFromObject, _super);
function ObservableFromObject() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this._map = {};
return _this;
}
ObservableFromObject.prototype.get = function (name) {
return this._map[name];
};
ObservableFromObject.prototype.set = function (name, value) {
var currentValue = this._map[name];
if (currentValue === value) {
return;
}
var newValue = WrappedValue.unwrap(value);
this._map[name] = newValue;
this.notifyPropertyChange(name, newValue, currentValue);
};
return ObservableFromObject;
}(Observable));
function defineNewProperty(target, propertyName) {
Object.defineProperty(target, propertyName, {
get: function () {
return target._map[propertyName];
},
set: function (value) {
target.set(propertyName, value);
},
enumerable: true,
configurable: true
});
}
function addPropertiesFromObject(observable, source, recursive) {
if (recursive === void 0) { recursive = false; }
Object.keys(source).forEach(function (prop) {
var value = source[prop];
if (recursive
&& !Array.isArray(value)
&& value
&& typeof value === "object"
&& !(value instanceof Observable)) {
value = fromObjectRecursive(value);
}
defineNewProperty(observable, prop);
observable.set(prop, value);
});
}
function fromObject(source) {
var observable = new ObservableFromObject();
addPropertiesFromObject(observable, source, false);
return observable;
}
exports.fromObject = fromObject;
function fromObjectRecursive(source) {
var observable = new ObservableFromObject();
addPropertiesFromObject(observable, source, true);
return observable;
}
exports.fromObjectRecursive = fromObjectRecursive;
//# sourceMappingURL=observable.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/debugger/InspectorBackendCommands.js":
/***/ (function(module, exports) {
Object.defineProperty(exports, "__esModule", { value: true });
function DomainDispatcher(domain) {
return function (klass) { return __registerDomainDispatcher(domain, klass); };
}
exports.DomainDispatcher = DomainDispatcher;
var HeapDomain;
(function (HeapDomain) {
var HeapFrontend = (function () {
function HeapFrontend() {
}
HeapFrontend.prototype.garbageCollected = function (collection) {
__inspectorSendEvent(JSON.stringify({ "method": "Heap.garbageCollected", "params": { "collection": collection } }));
};
HeapFrontend.prototype.trackingStart = function (timestamp, snapshotData) {
__inspectorSendEvent(JSON.stringify({ "method": "Heap.trackingStart", "params": { "timestamp": timestamp, "snapshotData": snapshotData } }));
};
HeapFrontend.prototype.trackingComplete = function (timestamp, snapshotData) {
__inspectorSendEvent(JSON.stringify({ "method": "Heap.trackingComplete", "params": { "timestamp": timestamp, "snapshotData": snapshotData } }));
};
return HeapFrontend;
}());
HeapDomain.HeapFrontend = HeapFrontend;
})(HeapDomain = exports.HeapDomain || (exports.HeapDomain = {}));
var DebuggerDomain;
(function (DebuggerDomain) {
var DebuggerFrontend = (function () {
function DebuggerFrontend() {
}
DebuggerFrontend.prototype.globalObjectCleared = function () {
__inspectorSendEvent(JSON.stringify({ "method": "Debugger.globalObjectCleared", "params": {} }));
};
DebuggerFrontend.prototype.scriptParsed = function (scriptId, url, startLine, startColumn, endLine, endColumn, isContentScript, sourceURL, sourceMapURL) {
__inspectorSendEvent(JSON.stringify({ "method": "Debugger.scriptParsed", "params": { "scriptId": scriptId, "url": url, "startLine": startLine, "startColumn": startColumn, "endLine": endLine, "endColumn": endColumn, "isContentScript": isContentScript, "sourceURL": sourceURL, "sourceMapURL": sourceMapURL } }));
};
DebuggerFrontend.prototype.scriptFailedToParse = function (url, scriptSource, startLine, errorLine, errorMessage) {
__inspectorSendEvent(JSON.stringify({ "method": "Debugger.scriptFailedToParse", "params": { "url": url, "scriptSource": scriptSource, "startLine": startLine, "errorLine": errorLine, "errorMessage": errorMessage } }));
};
DebuggerFrontend.prototype.breakpointResolved = function (breakpointId, location) {
__inspectorSendEvent(JSON.stringify({ "method": "Debugger.breakpointResolved", "params": { "breakpointId": breakpointId, "location": location } }));
};
DebuggerFrontend.prototype.paused = function (callFrames, reason, data) {
__inspectorSendEvent(JSON.stringify({ "method": "Debugger.paused", "params": { "callFrames": callFrames, "reason": reason, "data": data } }));
};
DebuggerFrontend.prototype.resumed = function () {
__inspectorSendEvent(JSON.stringify({ "method": "Debugger.resumed", "params": {} }));
};
DebuggerFrontend.prototype.didSampleProbe = function (sample) {
__inspectorSendEvent(JSON.stringify({ "method": "Debugger.didSampleProbe", "params": { "sample": sample } }));
};
DebuggerFrontend.prototype.playBreakpointActionSound = function (breakpointActionId) {
__inspectorSendEvent(JSON.stringify({ "method": "Debugger.playBreakpointActionSound", "params": { "breakpointActionId": breakpointActionId } }));
};
return DebuggerFrontend;
}());
DebuggerDomain.DebuggerFrontend = DebuggerFrontend;
})(DebuggerDomain = exports.DebuggerDomain || (exports.DebuggerDomain = {}));
var RuntimeDomain;
(function (RuntimeDomain) {
;
var RuntimeFrontend = (function () {
function RuntimeFrontend() {
}
RuntimeFrontend.prototype.executionContextCreated = function (context) {
__inspectorSendEvent(JSON.stringify({ "method": "Runtime.executionContextCreated", "params": { "context": context } }));
};
return RuntimeFrontend;
}());
RuntimeDomain.RuntimeFrontend = RuntimeFrontend;
})(RuntimeDomain = exports.RuntimeDomain || (exports.RuntimeDomain = {}));
var ConsoleDomain;
(function (ConsoleDomain) {
var ConsoleFrontend = (function () {
function ConsoleFrontend() {
}
ConsoleFrontend.prototype.messageAdded = function (message) {
__inspectorSendEvent(JSON.stringify({ "method": "Console.messageAdded", "params": { "message": message } }));
};
ConsoleFrontend.prototype.messageRepeatCountUpdated = function (count) {
__inspectorSendEvent(JSON.stringify({ "method": "Console.messageRepeatCountUpdated", "params": { "count": count } }));
};
ConsoleFrontend.prototype.messagesCleared = function () {
__inspectorSendEvent(JSON.stringify({ "method": "Console.messagesCleared", "params": {} }));
};
ConsoleFrontend.prototype.heapSnapshot = function (timestamp, snapshotData, title) {
__inspectorSendEvent(JSON.stringify({ "method": "Console.heapSnapshot", "params": { "timestamp": timestamp, "snapshotData": snapshotData, "title": title } }));
};
return ConsoleFrontend;
}());
ConsoleDomain.ConsoleFrontend = ConsoleFrontend;
})(ConsoleDomain = exports.ConsoleDomain || (exports.ConsoleDomain = {}));
var PageDomain;
(function (PageDomain) {
;
;
var PageFrontend = (function () {
function PageFrontend() {
}
PageFrontend.prototype.domContentEventFired = function (timestamp) {
__inspectorSendEvent(JSON.stringify({ "method": "Page.domContentEventFired", "params": { "timestamp": timestamp } }));
};
PageFrontend.prototype.loadEventFired = function (timestamp) {
__inspectorSendEvent(JSON.stringify({ "method": "Page.loadEventFired", "params": { "timestamp": timestamp } }));
};
PageFrontend.prototype.frameNavigated = function (frame) {
__inspectorSendEvent(JSON.stringify({ "method": "Page.frameNavigated", "params": { "frame": frame } }));
};
PageFrontend.prototype.frameDetached = function (frameId) {
__inspectorSendEvent(JSON.stringify({ "method": "Page.frameDetached", "params": { "frameId": frameId } }));
};
PageFrontend.prototype.frameStartedLoading = function (frameId) {
__inspectorSendEvent(JSON.stringify({ "method": "Page.frameStartedLoading", "params": { "frameId": frameId } }));
};
PageFrontend.prototype.frameStoppedLoading = function (frameId) {
__inspectorSendEvent(JSON.stringify({ "method": "Page.frameStoppedLoading", "params": { "frameId": frameId } }));
};
PageFrontend.prototype.frameScheduledNavigation = function (frameId, delay) {
__inspectorSendEvent(JSON.stringify({ "method": "Page.frameScheduledNavigation", "params": { "frameId": frameId, "delay": delay } }));
};
PageFrontend.prototype.frameClearedScheduledNavigation = function (frameId) {
__inspectorSendEvent(JSON.stringify({ "method": "Page.frameClearedScheduledNavigation", "params": { "frameId": frameId } }));
};
PageFrontend.prototype.javascriptDialogOpening = function (message) {
__inspectorSendEvent(JSON.stringify({ "method": "Page.javascriptDialogOpening", "params": { "message": message } }));
};
PageFrontend.prototype.javascriptDialogClosed = function () {
__inspectorSendEvent(JSON.stringify({ "method": "Page.javascriptDialogClosed", "params": {} }));
};
PageFrontend.prototype.scriptsEnabled = function (isEnabled) {
__inspectorSendEvent(JSON.stringify({ "method": "Page.scriptsEnabled", "params": { "isEnabled": isEnabled } }));
};
return PageFrontend;
}());
PageDomain.PageFrontend = PageFrontend;
})(PageDomain = exports.PageDomain || (exports.PageDomain = {}));
var NetworkDomain;
(function (NetworkDomain) {
var NetworkFrontend = (function () {
function NetworkFrontend() {
}
NetworkFrontend.prototype.requestWillBeSent = function (requestId, frameId, loaderId, documentURL, request, timestamp, initiator, redirectResponse, type) {
__inspectorSendEvent(JSON.stringify({ "method": "Network.requestWillBeSent", "params": { "requestId": requestId, "frameId": frameId, "loaderId": loaderId, "documentURL": documentURL, "request": request, "timestamp": timestamp, "initiator": initiator, "redirectResponse": redirectResponse, "type": type } }));
};
NetworkFrontend.prototype.requestServedFromCache = function (requestId) {
__inspectorSendEvent(JSON.stringify({ "method": "Network.requestServedFromCache", "params": { "requestId": requestId } }));
};
NetworkFrontend.prototype.responseReceived = function (requestId, frameId, loaderId, timestamp, type, response) {
__inspectorSendEvent(JSON.stringify({ "method": "Network.responseReceived", "params": { "requestId": requestId, "frameId": frameId, "loaderId": loaderId, "timestamp": timestamp, "type": type, "response": response } }));
};
NetworkFrontend.prototype.dataReceived = function (requestId, timestamp, dataLength, encodedDataLength) {
__inspectorSendEvent(JSON.stringify({ "method": "Network.dataReceived", "params": { "requestId": requestId, "timestamp": timestamp, "dataLength": dataLength, "encodedDataLength": encodedDataLength } }));
};
NetworkFrontend.prototype.loadingFinished = function (requestId, timestamp, sourceMapURL) {
__inspectorSendEvent(JSON.stringify({ "method": "Network.loadingFinished", "params": { "requestId": requestId, "timestamp": timestamp, "sourceMapURL": sourceMapURL } }));
};
NetworkFrontend.prototype.loadingFailed = function (requestId, timestamp, errorText, canceled) {
__inspectorSendEvent(JSON.stringify({ "method": "Network.loadingFailed", "params": { "requestId": requestId, "timestamp": timestamp, "errorText": errorText, "canceled": canceled } }));
};
NetworkFrontend.prototype.requestServedFromMemoryCache = function (requestId, frameId, loaderId, documentURL, timestamp, initiator, resource) {
__inspectorSendEvent(JSON.stringify({ "method": "Network.requestServedFromMemoryCache", "params": { "requestId": requestId, "frameId": frameId, "loaderId": loaderId, "documentURL": documentURL, "timestamp": timestamp, "initiator": initiator, "resource": resource } }));
};
NetworkFrontend.prototype.webSocketWillSendHandshakeRequest = function (requestId, timestamp, request) {
__inspectorSendEvent(JSON.stringify({ "method": "Network.webSocketWillSendHandshakeRequest", "params": { "requestId": requestId, "timestamp": timestamp, "request": request } }));
};
NetworkFrontend.prototype.webSocketHandshakeResponseReceived = function (requestId, timestamp, response) {
__inspectorSendEvent(JSON.stringify({ "method": "Network.webSocketHandshakeResponseReceived", "params": { "requestId": requestId, "timestamp": timestamp, "response": response } }));
};
NetworkFrontend.prototype.webSocketCreated = function (requestId, url) {
__inspectorSendEvent(JSON.stringify({ "method": "Network.webSocketCreated", "params": { "requestId": requestId, "url": url } }));
};
NetworkFrontend.prototype.webSocketClosed = function (requestId, timestamp) {
__inspectorSendEvent(JSON.stringify({ "method": "Network.webSocketClosed", "params": { "requestId": requestId, "timestamp": timestamp } }));
};
NetworkFrontend.prototype.webSocketFrameReceived = function (requestId, timestamp, response) {
__inspectorSendEvent(JSON.stringify({ "method": "Network.webSocketFrameReceived", "params": { "requestId": requestId, "timestamp": timestamp, "response": response } }));
};
NetworkFrontend.prototype.webSocketFrameError = function (requestId, timestamp, errorMessage) {
__inspectorSendEvent(JSON.stringify({ "method": "Network.webSocketFrameError", "params": { "requestId": requestId, "timestamp": timestamp, "errorMessage": errorMessage } }));
};
NetworkFrontend.prototype.webSocketFrameSent = function (requestId, timestamp, response) {
__inspectorSendEvent(JSON.stringify({ "method": "Network.webSocketFrameSent", "params": { "requestId": requestId, "timestamp": timestamp, "response": response } }));
};
return NetworkFrontend;
}());
NetworkDomain.NetworkFrontend = NetworkFrontend;
})(NetworkDomain = exports.NetworkDomain || (exports.NetworkDomain = {}));
var DOMDomain;
(function (DOMDomain) {
;
;
;
var DOMFrontend = (function () {
function DOMFrontend() {
}
DOMFrontend.prototype.documentUpdated = function () {
__inspectorSendEvent(JSON.stringify({ "method": "DOM.documentUpdated", "params": {} }));
};
DOMFrontend.prototype.setChildNodes = function (parentId, nodes) {
__inspectorSendEvent(JSON.stringify({ "method": "DOM.setChildNodes", "params": { "parentId": parentId, "nodes": nodes } }));
};
DOMFrontend.prototype.attributeModified = function (nodeId, name, value) {
__inspectorSendEvent(JSON.stringify({ "method": "DOM.attributeModified", "params": { "nodeId": nodeId, "name": name, "value": value } }));
};
DOMFrontend.prototype.attributeRemoved = function (nodeId, name) {
__inspectorSendEvent(JSON.stringify({ "method": "DOM.attributeRemoved", "params": { "nodeId": nodeId, "name": name } }));
};
DOMFrontend.prototype.inlineStyleInvalidated = function (nodeIds) {
__inspectorSendEvent(JSON.stringify({ "method": "DOM.inlineStyleInvalidated", "params": { "nodeIds": nodeIds } }));
};
DOMFrontend.prototype.characterDataModified = function (nodeId, characterData) {
__inspectorSendEvent(JSON.stringify({ "method": "DOM.characterDataModified", "params": { "nodeId": nodeId, "characterData": characterData } }));
};
DOMFrontend.prototype.childNodeCountUpdated = function (nodeId, childNodeCount) {
__inspectorSendEvent(JSON.stringify({ "method": "DOM.childNodeCountUpdated", "params": { "nodeId": nodeId, "childNodeCount": childNodeCount } }));
};
DOMFrontend.prototype.childNodeInserted = function (parentNodeId, previousNodeId, node) {
__inspectorSendEvent(JSON.stringify({ "method": "DOM.childNodeInserted", "params": { "parentNodeId": parentNodeId, "previousNodeId": previousNodeId, "node": node } }));
};
DOMFrontend.prototype.childNodeRemoved = function (parentNodeId, nodeId) {
__inspectorSendEvent(JSON.stringify({ "method": "DOM.childNodeRemoved", "params": { "parentNodeId": parentNodeId, "nodeId": nodeId } }));
};
DOMFrontend.prototype.shadowRootPushed = function (hostId, root) {
__inspectorSendEvent(JSON.stringify({ "method": "DOM.shadowRootPushed", "params": { "hostId": hostId, "root": root } }));
};
DOMFrontend.prototype.shadowRootPopped = function (hostId, rootId) {
__inspectorSendEvent(JSON.stringify({ "method": "DOM.shadowRootPopped", "params": { "hostId": hostId, "rootId": rootId } }));
};
DOMFrontend.prototype.pseudoElementAdded = function (parentId, pseudoElement) {
__inspectorSendEvent(JSON.stringify({ "method": "DOM.pseudoElementAdded", "params": { "parentId": parentId, "pseudoElement": pseudoElement } }));
};
DOMFrontend.prototype.pseudoElementRemoved = function (parentId, pseudoElementId) {
__inspectorSendEvent(JSON.stringify({ "method": "DOM.pseudoElementRemoved", "params": { "parentId": parentId, "pseudoElementId": pseudoElementId } }));
};
return DOMFrontend;
}());
DOMDomain.DOMFrontend = DOMFrontend;
})(DOMDomain = exports.DOMDomain || (exports.DOMDomain = {}));
var CSSDomain;
(function (CSSDomain) {
;
var CSSFrontend = (function () {
function CSSFrontend() {
}
CSSFrontend.prototype.mediaQueryResultChanged = function () {
__inspectorSendEvent(JSON.stringify({ "method": "CSS.mediaQueryResultChanged", "params": {} }));
};
CSSFrontend.prototype.fontsUpdated = function () {
__inspectorSendEvent(JSON.stringify({ "method": "CSS.fontsUpdated", "params": {} }));
};
CSSFrontend.prototype.styleSheetChanged = function (styleSheetId) {
__inspectorSendEvent(JSON.stringify({ "method": "CSS.styleSheetChanged", "params": { "styleSheetId": styleSheetId } }));
};
CSSFrontend.prototype.styleSheetAdded = function (header) {
__inspectorSendEvent(JSON.stringify({ "method": "CSS.styleSheetAdded", "params": { "header": header } }));
};
CSSFrontend.prototype.styleSheetRemoved = function (styleSheetId) {
__inspectorSendEvent(JSON.stringify({ "method": "CSS.styleSheetRemoved", "params": { "styleSheetId": styleSheetId } }));
};
CSSFrontend.prototype.layoutEditorChange = function (styleSheetId, changeRange) {
__inspectorSendEvent(JSON.stringify({ "method": "CSS.layoutEditorChange", "params": { "styleSheetId": styleSheetId, "changeRange": changeRange } }));
};
return CSSFrontend;
}());
CSSDomain.CSSFrontend = CSSFrontend;
})(CSSDomain = exports.CSSDomain || (exports.CSSDomain = {}));
//# sourceMappingURL=InspectorBackendCommands.ios.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/debugger/debugger.js":
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global) {Object.defineProperty(exports, "__esModule", { value: true });
var network;
function getNetwork() {
return network;
}
exports.getNetwork = getNetwork;
function setNetwork(newNetwork) {
network = newNetwork;
}
exports.setNetwork = setNetwork;
var dom;
function getDOM() {
return dom;
}
exports.getDOM = getDOM;
function setDOM(newDOM) {
dom = newDOM;
}
exports.setDOM = setDOM;
var css;
function getCSS() {
return css;
}
exports.getCSS = getCSS;
function setCSS(newCSS) {
css = newCSS;
}
exports.setCSS = setCSS;
var NetworkAgent;
(function (NetworkAgent) {
function responseReceived(requestId, result, headers) {
var requestIdStr = requestId.toString();
var mimeType = headers["Content-Type"] || headers["content-type"] || "application/octet-stream";
var contentLengthHeader = headers["Content-Length"] || headers["content-length"];
var contentLength = parseInt(contentLengthHeader, 10);
if (isNaN(contentLength)) {
contentLength = 0;
}
var response = {
url: result.url || "",
status: result.statusCode,
statusText: result.statusText || "",
headers: headers,
mimeType: mimeType,
fromDiskCache: false,
connectionReused: true,
connectionId: 0,
encodedDataLength: contentLength,
securityState: "info"
};
var responseData = {
requestId: requestIdStr,
type: mimeTypeToType(response.mimeType),
response: response,
timestamp: getTimeStamp()
};
global.__inspector.responseReceived(responseData);
global.__inspector.loadingFinished({
requestId: requestIdStr,
timestamp: getTimeStamp(),
encodedDataLength: contentLength
});
var hasTextContent = responseData.type === "Document" || responseData.type === "Script";
var data;
if (!hasTextContent) {
if (responseData.type === "Image") {
var bitmap = result.responseAsImage;
if (bitmap) {
var outputStream = new java.io.ByteArrayOutputStream();
bitmap.compress(android.graphics.Bitmap.CompressFormat.PNG, 100, outputStream);
var base64Image = android.util.Base64.encodeToString(outputStream.toByteArray(), android.util.Base64.DEFAULT);
data = base64Image;
}
}
}
else {
data = result.responseAsString;
}
var successfulRequestData = {
requestId: requestIdStr,
data: data,
hasTextContent: hasTextContent
};
global.__inspector.dataForRequestId(successfulRequestData);
}
NetworkAgent.responseReceived = responseReceived;
function requestWillBeSent(requestId, options) {
var request = {
url: options.url,
method: options.method,
headers: options.headers || {},
postData: options.content ? options.content.toString() : "",
initialPriority: "Medium",
referrerPolicy: "no-referrer-when-downgrade"
};
var requestData = {
requestId: requestId.toString(),
url: request.url,
request: request,
timestamp: getTimeStamp(),
type: "Document",
wallTime: 0
};
global.__inspector.requestWillBeSent(requestData);
}
NetworkAgent.requestWillBeSent = requestWillBeSent;
function getTimeStamp() {
var d = new Date();
return Math.round(d.getTime() / 1000);
}
function mimeTypeToType(mimeType) {
var type = "Document";
if (mimeType) {
if (mimeType.indexOf("image") === 0) {
type = "Image";
}
else if (mimeType.indexOf("javascript") !== -1 || mimeType.indexOf("json") !== -1) {
type = "Script";
}
}
return type;
}
})(NetworkAgent = exports.NetworkAgent || (exports.NetworkAgent = {}));
//# sourceMappingURL=debugger.js.map
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("../node_modules/webpack/buildin/global.js")))
/***/ }),
/***/ "../node_modules/tns-core-modules/debugger/devtools-elements.common.js":
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", { value: true });
var dom_node_1 = __webpack_require__("../node_modules/tns-core-modules/debugger/dom-node.js");
var frameTopmost = function () { return __webpack_require__("../node_modules/tns-core-modules/ui/frame/frame.js").topmost(); };
var unsetValue;
function unsetViewValue(view, name) {
if (!unsetValue) {
unsetValue = __webpack_require__("../node_modules/tns-core-modules/ui/core/properties/properties.js").unsetValue;
}
view[name] = unsetValue;
}
function getViewById(nodeId) {
var node = dom_node_1.getNodeById(nodeId);
var view;
if (node) {
view = node.viewRef.get();
}
return view;
}
function getDocument() {
var topMostFrame = frameTopmost();
if (!topMostFrame) {
return undefined;
}
try {
topMostFrame.ensureDomNode();
}
catch (e) {
console.log("ERROR in getDocument(): " + e);
}
return topMostFrame.domNode.toObject();
}
exports.getDocument = getDocument;
function getComputedStylesForNode(nodeId) {
var view = getViewById(nodeId);
if (view) {
return view.domNode.getComputedProperties();
}
return [];
}
exports.getComputedStylesForNode = getComputedStylesForNode;
function removeNode(nodeId) {
var view = getViewById(nodeId);
if (view) {
var parent_1 = view.parent;
if (parent_1.removeChild) {
parent_1.removeChild(view);
}
else if (parent_1.content === view) {
parent_1.content = null;
}
else {
console.log("Can't remove child from " + parent_1);
}
}
}
exports.removeNode = removeNode;
function setAttributeAsText(nodeId, text, name) {
var view = getViewById(nodeId);
if (view) {
var hasOriginalAttribute = !!name.trim();
if (text) {
var textParts = text.split("=");
if (textParts.length === 2) {
var attrName = textParts[0];
var attrValue = textParts[1].replace(/['"]+/g, "");
if (name !== attrName && hasOriginalAttribute) {
unsetViewValue(view, name);
view[attrName] = attrValue;
}
else {
view[hasOriginalAttribute ? name : attrName] = attrValue;
}
}
}
else {
unsetViewValue(view, name);
}
view.domNode.loadAttributes();
}
}
exports.setAttributeAsText = setAttributeAsText;
//# sourceMappingURL=devtools-elements.common.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/debugger/devtools-elements.js":
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", { value: true });
var devtools_elements_common_1 = __webpack_require__("../node_modules/tns-core-modules/debugger/devtools-elements.common.js");
var dom_node_1 = __webpack_require__("../node_modules/tns-core-modules/debugger/dom-node.js");
function attachDOMInspectorEventCallbacks(DOMDomainFrontend) {
dom_node_1.registerInspectorEvents(DOMDomainFrontend);
var originalChildNodeInserted = DOMDomainFrontend.childNodeInserted;
DOMDomainFrontend.childNodeInserted = function (parentId, lastId, node) {
originalChildNodeInserted(parentId, lastId, node.toObject());
};
}
exports.attachDOMInspectorEventCallbacks = attachDOMInspectorEventCallbacks;
function attachDOMInspectorCommandCallbacks(DOMDomainBackend) {
DOMDomainBackend.getDocument = devtools_elements_common_1.getDocument;
DOMDomainBackend.removeNode = devtools_elements_common_1.removeNode;
DOMDomainBackend.setAttributeAsText = devtools_elements_common_1.setAttributeAsText;
}
exports.attachDOMInspectorCommandCallbacks = attachDOMInspectorCommandCallbacks;
function attachCSSInspectorCommandCallbacks(CSSDomainBackend) {
CSSDomainBackend.getComputedStylesForNode = devtools_elements_common_1.getComputedStylesForNode;
}
exports.attachCSSInspectorCommandCallbacks = attachCSSInspectorCommandCallbacks;
//# sourceMappingURL=devtools-elements.ios.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/debugger/dom-node.js":
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", { value: true });
var registeredDomNodes = {};
var ELEMENT_NODE_TYPE = 1;
var ROOT_NODE_TYPE = 9;
var propertyBlacklist = [
"effectivePaddingLeft",
"effectivePaddingBottom",
"effectivePaddingRight",
"effectivePaddingTop",
"effectiveBorderTopWidth",
"effectiveBorderRightWidth",
"effectiveBorderBottomWidth",
"effectiveBorderLeftWidth",
"effectiveMinWidth",
"effectiveMinHeight",
"effectiveWidth",
"effectiveHeight",
"effectiveMarginLeft",
"effectiveMarginTop",
"effectiveMarginRight",
"effectiveMarginBottom",
"nodeName",
"nodeType",
"decodeWidth",
"decodeHeight",
"ng-reflect-items",
"domNode",
"touchListenerIsSet",
"bindingContext",
"nativeView"
];
function lazy(action) {
var _value;
return function () { return _value || (_value = action()); };
}
var percentLengthToStringLazy = lazy(function () { return __webpack_require__("../node_modules/tns-core-modules/ui/styling/style-properties.js").PercentLength.convertToString; });
var getSetPropertiesLazy = lazy(function () { return __webpack_require__("../node_modules/tns-core-modules/ui/core/properties/properties.js").getSetProperties; });
var getComputedCssValuesLazy = lazy(function () { return __webpack_require__("../node_modules/tns-core-modules/ui/core/properties/properties.js").getComputedCssValues; });
function registerInspectorEvents(inspector) {
inspectorFrontendInstance = inspector;
}
exports.registerInspectorEvents = registerInspectorEvents;
var inspectorFrontendInstance;
function notifyInspector(callback) {
if (inspectorFrontendInstance) {
callback(inspectorFrontendInstance);
}
}
function valueToString(value) {
if (typeof value === "undefined" || value === null) {
return "";
}
else if (typeof value === "object" && value.unit) {
return percentLengthToStringLazy()(value);
}
else {
return value + "";
}
}
function propertyFilter(_a) {
var name = _a[0], value = _a[1];
if (name[0] === "_") {
return false;
}
if (value !== null && typeof value === "object") {
return false;
}
if (propertyBlacklist.indexOf(name) >= 0) {
return false;
}
return true;
}
function registerNode(domNode) {
registeredDomNodes[domNode.nodeId] = domNode;
}
function unregisterNode(domNode) {
delete registeredDomNodes[domNode.nodeId];
}
function getNodeById(id) {
return registeredDomNodes[id];
}
exports.getNodeById = getNodeById;
var DOMNode = (function () {
function DOMNode(view) {
this.nodeValue = "";
this.attributes = [];
this.viewRef = new WeakRef(view);
this.nodeType = view.typeName === "Frame" ? ROOT_NODE_TYPE : ELEMENT_NODE_TYPE;
this.nodeId = view._domId;
this.nodeName = view.typeName;
this.localName = this.nodeName;
this.loadAttributes();
registerNode(this);
}
DOMNode.prototype.loadAttributes = function () {
var _this = this;
this.attributes = [];
getSetPropertiesLazy()(this.viewRef.get())
.filter(propertyFilter)
.forEach(function (pair) { return _this.attributes.push(pair[0], pair[1] + ""); });
};
Object.defineProperty(DOMNode.prototype, "children", {
get: function () {
var view = this.viewRef.get();
if (!view) {
return [];
}
var res = [];
view.eachChild(function (child) {
child.ensureDomNode();
res.push(child.domNode);
return true;
});
return res;
},
enumerable: true,
configurable: true
});
DOMNode.prototype.onChildAdded = function (childView) {
var _this = this;
notifyInspector(function (ins) {
var view = _this.viewRef.get();
var previousChild;
view.eachChild(function (child) {
if (child === childView) {
return false;
}
previousChild = child;
return true;
});
var index = !!previousChild ? previousChild._domId : 0;
childView.ensureDomNode();
ins.childNodeInserted(_this.nodeId, index, childView.domNode);
});
};
DOMNode.prototype.onChildRemoved = function (view) {
var _this = this;
notifyInspector(function (ins) {
ins.childNodeRemoved(_this.nodeId, view._domId);
});
};
DOMNode.prototype.attributeModified = function (name, value) {
var _this = this;
notifyInspector(function (ins) {
if (propertyBlacklist.indexOf(name) < 0) {
ins.attributeModified(_this.nodeId, name, valueToString(value));
}
});
};
DOMNode.prototype.attributeRemoved = function (name) {
var _this = this;
notifyInspector(function (ins) {
ins.attributeRemoved(_this.nodeId, name);
});
};
DOMNode.prototype.getComputedProperties = function () {
var view = this.viewRef.get();
if (!view) {
return [];
}
var result = getComputedCssValuesLazy()(view)
.filter(function (pair) { return pair[0][0] !== "_"; })
.map(function (pair) {
return {
name: pair[0],
value: valueToString(pair[1])
};
});
return result;
};
DOMNode.prototype.dispose = function () {
unregisterNode(this);
this.viewRef.clear();
};
DOMNode.prototype.toObject = function () {
return {
nodeId: this.nodeId,
nodeType: this.nodeType,
nodeName: this.nodeName,
localName: this.localName,
nodeValue: this.nodeValue,
children: this.children.map(function (c) { return c.toObject(); }),
attributes: this.attributes,
backendNodeId: 0
};
};
return DOMNode;
}());
exports.DOMNode = DOMNode;
//# sourceMappingURL=dom-node.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/debugger/webinspector-css.js":
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", { value: true });
var inspectorCommands = __webpack_require__("../node_modules/tns-core-modules/debugger/InspectorBackendCommands.js");
var debuggerDomains = __webpack_require__("../node_modules/tns-core-modules/debugger/debugger.js");
var devtools_elements_1 = __webpack_require__("../node_modules/tns-core-modules/debugger/devtools-elements.js");
var CSSDomainDebugger = (function () {
function CSSDomainDebugger() {
this.events = new inspectorCommands.CSSDomain.CSSFrontend();
this.commands = {};
devtools_elements_1.attachCSSInspectorCommandCallbacks(this.commands);
this.enable();
}
Object.defineProperty(CSSDomainDebugger.prototype, "enabled", {
get: function () {
return this._enabled;
},
enumerable: true,
configurable: true
});
CSSDomainDebugger.prototype.enable = function () {
if (debuggerDomains.getCSS()) {
throw new Error("One CSSDomainDebugger may be enabled at a time.");
}
else {
debuggerDomains.setCSS(this);
}
this._enabled = true;
};
CSSDomainDebugger.prototype.disable = function () {
if (debuggerDomains.getCSS() === this) {
debuggerDomains.setCSS(null);
}
this._enabled = false;
};
CSSDomainDebugger.prototype.getMatchedStylesForNode = function (params) {
return {};
};
CSSDomainDebugger.prototype.getInlineStylesForNode = function (params) {
return {};
};
CSSDomainDebugger.prototype.getComputedStyleForNode = function (params) {
return { computedStyle: this.commands.getComputedStylesForNode(params.nodeId) };
};
CSSDomainDebugger.prototype.getPlatformFontsForNode = function (params) {
return {
fonts: [
{
familyName: "Standard Font",
isCustomFont: false,
glyphCount: 0
}
]
};
};
CSSDomainDebugger.prototype.getStyleSheetText = function (params) {
return null;
};
CSSDomainDebugger = __decorate([
inspectorCommands.DomainDispatcher("CSS")
], CSSDomainDebugger);
return CSSDomainDebugger;
}());
exports.CSSDomainDebugger = CSSDomainDebugger;
//# sourceMappingURL=webinspector-css.ios.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/debugger/webinspector-dom.js":
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", { value: true });
var inspectorCommands = __webpack_require__("../node_modules/tns-core-modules/debugger/InspectorBackendCommands.js");
var debuggerDomains = __webpack_require__("../node_modules/tns-core-modules/debugger/debugger.js");
var devtools_elements_1 = __webpack_require__("../node_modules/tns-core-modules/debugger/devtools-elements.js");
var DOMDomainDebugger = (function () {
function DOMDomainDebugger() {
this.events = new inspectorCommands.DOMDomain.DOMFrontend();
this.commands = {};
devtools_elements_1.attachDOMInspectorEventCallbacks(this.events);
devtools_elements_1.attachDOMInspectorCommandCallbacks(this.commands);
this.enable();
}
Object.defineProperty(DOMDomainDebugger.prototype, "enabled", {
get: function () {
return this._enabled;
},
enumerable: true,
configurable: true
});
DOMDomainDebugger.prototype.enable = function () {
if (debuggerDomains.getDOM()) {
throw new Error("One DOMDomainDebugger may be enabled at a time.");
}
else {
debuggerDomains.setDOM(this);
}
this._enabled = true;
};
DOMDomainDebugger.prototype.disable = function () {
if (debuggerDomains.getDOM() === this) {
debuggerDomains.setDOM(null);
}
this._enabled = false;
};
DOMDomainDebugger.prototype.getDocument = function () {
var domNode = this.commands.getDocument();
return { root: domNode };
};
DOMDomainDebugger.prototype.removeNode = function (params) {
this.commands.removeNode(params.nodeId);
};
DOMDomainDebugger.prototype.setAttributeValue = function (params) {
throw new Error("Method not implemented.");
};
DOMDomainDebugger.prototype.setAttributesAsText = function (params) {
this.commands.setAttributeAsText(params.nodeId, params.text, params.name);
};
DOMDomainDebugger.prototype.removeAttribute = function (params) {
throw new Error("Method not implemented.");
};
DOMDomainDebugger.prototype.performSearch = function (params) {
return null;
};
DOMDomainDebugger.prototype.getSearchResults = function (params) {
return null;
};
DOMDomainDebugger.prototype.discardSearchResults = function (params) {
return;
};
DOMDomainDebugger.prototype.highlightNode = function (params) {
return;
};
DOMDomainDebugger.prototype.hideHighlight = function () {
return;
};
DOMDomainDebugger.prototype.resolveNode = function (params) {
return null;
};
DOMDomainDebugger = __decorate([
inspectorCommands.DomainDispatcher("DOM")
], DOMDomainDebugger);
return DOMDomainDebugger;
}());
exports.DOMDomainDebugger = DOMDomainDebugger;
//# sourceMappingURL=webinspector-dom.ios.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/debugger/webinspector-network.js":
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", { value: true });
var inspectorCommands = __webpack_require__("../node_modules/tns-core-modules/debugger/InspectorBackendCommands.js");
var debuggerDomains = __webpack_require__("../node_modules/tns-core-modules/debugger/debugger.js");
function getter(_this, property) {
if (typeof property === "function") {
return property.call(_this);
}
else {
return property;
}
}
var frameId = "NativeScriptMainFrameIdentifier";
var loaderId = "Loader Identifier";
var resources_datas = [];
var documentTypeByMimeType = {
"text/xml": "Document",
"text/plain": "Document",
"text/html": "Document",
"application/xml": "Document",
"application/xhtml+xml": "Document",
"text/css": "Stylesheet",
"text/javascript": "Script",
"text/ecmascript": "Script",
"application/javascript": "Script",
"application/ecmascript": "Script",
"application/x-javascript": "Script",
"application/json": "Script",
"application/x-json": "Script",
"text/x-javascript": "Script",
"text/x-json": "Script",
"text/typescript": "Script"
};
var Request = (function () {
function Request(_networkDomainDebugger, _requestID) {
this._networkDomainDebugger = _networkDomainDebugger;
this._requestID = _requestID;
}
Object.defineProperty(Request.prototype, "mimeType", {
get: function () {
return this._mimeType;
},
set: function (value) {
if (this._mimeType !== value) {
if (!value) {
this._mimeType = "text/plain";
this._resourceType = "Other";
return;
}
this._mimeType = value;
var resourceType = "Other";
if (this._mimeType in documentTypeByMimeType) {
resourceType = documentTypeByMimeType[this._mimeType];
}
if (this._mimeType.indexOf("image/") !== -1) {
resourceType = "Image";
}
if (this._mimeType.indexOf("font/") !== -1) {
resourceType = "Font";
}
this._resourceType = resourceType;
}
},
enumerable: true,
configurable: true
});
Object.defineProperty(Request.prototype, "requestID", {
get: function () {
return this._requestID;
},
enumerable: true,
configurable: true
});
Object.defineProperty(Request.prototype, "hasTextContent", {
get: function () {
return ["Document", "Stylesheet", "Script", "XHR"].indexOf(this._resourceType) !== -1;
},
enumerable: true,
configurable: true
});
Object.defineProperty(Request.prototype, "data", {
get: function () {
return this._data;
},
set: function (value) {
if (this._data !== value) {
this._data = value;
}
},
enumerable: true,
configurable: true
});
Object.defineProperty(Request.prototype, "resourceType", {
get: function () {
return this._resourceType;
},
set: function (value) {
if (this._resourceType !== value) {
this._resourceType = value;
}
},
enumerable: true,
configurable: true
});
Request.prototype.responseReceived = function (response) {
if (this._networkDomainDebugger.enabled) {
this._networkDomainDebugger.events.responseReceived(this.requestID, frameId, loaderId, __inspectorTimestamp(), this.resourceType, response);
}
};
Request.prototype.loadingFinished = function () {
if (this._networkDomainDebugger.enabled) {
this._networkDomainDebugger.events.loadingFinished(this.requestID, __inspectorTimestamp());
}
};
Request.prototype.requestWillBeSent = function (request) {
if (this._networkDomainDebugger.enabled) {
this._networkDomainDebugger.events.requestWillBeSent(this.requestID, frameId, loaderId, request.url, request, __inspectorTimestamp(), { type: "Script" });
}
};
return Request;
}());
exports.Request = Request;
var NetworkDomainDebugger = (function () {
function NetworkDomainDebugger() {
this.events = new inspectorCommands.NetworkDomain.NetworkFrontend();
this.enable();
}
NetworkDomainDebugger_1 = NetworkDomainDebugger;
Object.defineProperty(NetworkDomainDebugger.prototype, "enabled", {
get: function () {
return this._enabled;
},
enumerable: true,
configurable: true
});
NetworkDomainDebugger.prototype.enable = function () {
if (debuggerDomains.getNetwork()) {
throw new Error("One NetworkDomainDebugger may be enabled at a time.");
}
else {
debuggerDomains.setNetwork(this);
}
this._enabled = true;
};
NetworkDomainDebugger.prototype.disable = function () {
if (debuggerDomains.getNetwork() === this) {
debuggerDomains.setNetwork(null);
}
this._enabled = false;
};
NetworkDomainDebugger.prototype.setExtraHTTPHeaders = function (params) {
};
NetworkDomainDebugger.prototype.getResponseBody = function (params) {
var resource_data = resources_datas[params.requestId];
var body = resource_data.hasTextContent ? NSString.alloc().initWithDataEncoding(resource_data.data, 4).toString() :
resource_data.data.base64EncodedStringWithOptions(0);
if (resource_data) {
return {
body: body,
base64Encoded: !resource_data.hasTextContent
};
}
};
NetworkDomainDebugger.prototype.canClearBrowserCache = function () {
return {
result: false
};
};
NetworkDomainDebugger.prototype.clearBrowserCache = function () {
};
NetworkDomainDebugger.prototype.canClearBrowserCookies = function () {
return {
result: false
};
};
NetworkDomainDebugger.prototype.clearBrowserCookies = function () {
};
NetworkDomainDebugger.prototype.setCacheDisabled = function (params) {
};
NetworkDomainDebugger.prototype.loadResource = function (params) {
var appPath = getter(NSBundle, NSBundle.mainBundle).bundlePath;
var pathUrl = params.url.replace("file://", appPath);
var fileManager = getter(NSFileManager, NSFileManager.defaultManager);
var data = fileManager.fileExistsAtPath(pathUrl) ? fileManager.contentsAtPath(pathUrl) : undefined;
var content = data ? NSString.alloc().initWithDataEncoding(data, NSUTF8StringEncoding) : "";
return {
content: content.toString(),
mimeType: "application/octet-stream",
status: 200
};
};
NetworkDomainDebugger.prototype.create = function () {
var id = (++NetworkDomainDebugger_1.idSequence).toString();
var resourceData = new Request(this, id);
resources_datas[id] = resourceData;
return resourceData;
};
var NetworkDomainDebugger_1;
NetworkDomainDebugger.idSequence = 0;
NetworkDomainDebugger = NetworkDomainDebugger_1 = __decorate([
inspectorCommands.DomainDispatcher("Network")
], NetworkDomainDebugger);
return NetworkDomainDebugger;
}());
exports.NetworkDomainDebugger = NetworkDomainDebugger;
var RuntimeDomainDebugger = (function () {
function RuntimeDomainDebugger() {
__inspectorSendEvent("{\"method\":\"Runtime.executionContextCreated\",\"params\":{\"context\":{\"id\":1,\"origin\":\"http://main.xml\",\"name\":\"\",\"auxData\":{\"isDefault\":true,\"frameId\":\"" + frameId + "\"}}}}");
}
RuntimeDomainDebugger.prototype.compileScript = function () {
return {};
};
RuntimeDomainDebugger = __decorate([
inspectorCommands.DomainDispatcher("Runtime")
], RuntimeDomainDebugger);
return RuntimeDomainDebugger;
}());
exports.RuntimeDomainDebugger = RuntimeDomainDebugger;
//# sourceMappingURL=webinspector-network.ios.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/fetch/fetch.js":
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global) {(function () {
'use strict';
exports.XMLHttpRequest = global.XMLHttpRequest;
exports.FormData = global.FormData;
if (!exports.XMLHttpRequest) {
var xhr = __webpack_require__("../node_modules/tns-core-modules/xhr/xhr.js");
exports.XMLHttpRequest = xhr.XMLHttpRequest;
exports.FormData = xhr.FormData;
}
function normalizeName(name) {
if (typeof name !== 'string') {
name = name.toString();
}
if (/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(name)) {
throw new TypeError('Invalid character in header field name')
}
return name.toLowerCase()
}
function normalizeValue(value) {
if (typeof value !== 'string') {
value = value.toString();
}
return value
}
function Headers(headers) {
this.map = {}
if (headers instanceof Headers) {
headers.forEach(function (value, name) {
this.append(name, value)
}, this)
} else if (headers) {
Object.getOwnPropertyNames(headers).forEach(function (name) {
this.append(name, headers[name])
}, this)
}
}
Headers.prototype.append = function (name, value) {
name = normalizeName(name)
value = normalizeValue(value)
var list = this.map[name]
if (!list) {
list = []
this.map[name] = list
}
list.push(value)
}
Headers.prototype['delete'] = function (name) {
delete this.map[normalizeName(name)]
}
Headers.prototype.get = function (name) {
var values = this.map[normalizeName(name)]
return values ? values[0] : null
}
Headers.prototype.getAll = function (name) {
return this.map[normalizeName(name)] || []
}
Headers.prototype.has = function (name) {
return this.map.hasOwnProperty(normalizeName(name))
}
Headers.prototype.set = function (name, value) {
this.map[normalizeName(name)] = [normalizeValue(value)]
}
Headers.prototype.forEach = function (callback, thisArg) {
Object.getOwnPropertyNames(this.map).forEach(function (name) {
this.map[name].forEach(function (value) {
callback.call(thisArg, value, name, this)
}, this)
}, this)
}
function consumed(body) {
if (body.bodyUsed) {
return Promise.reject(new TypeError('Already read'))
}
body.bodyUsed = true
}
function fileReaderReady(reader) {
return new Promise(function (resolve, reject) {
reader.onload = function () {
resolve(reader.result)
}
reader.onerror = function () {
reject(reader.error)
}
})
}
function readBlobAsArrayBuffer(blob) {
var reader = new FileReader()
reader.readAsArrayBuffer(blob)
return fileReaderReady(reader)
}
function readBlobAsText(blob) {
var reader = new FileReader()
reader.readAsText(blob)
return fileReaderReady(reader)
}
var support = {
blob: 'FileReader' in exports && 'Blob' in exports && (function () {
try {
new Blob();
return true
} catch (e) {
return false
}
})(),
formData: 'FormData' in exports
}
function Body() {
this.bodyUsed = false
this._initBody = function (body) {
this._bodyInit = body
if (typeof body === 'string') {
this._bodyText = body
} else if (support.blob && Blob.prototype.isPrototypeOf(body)) {
this._bodyBlob = body
} else if (support.formData && exports.FormData.prototype.isPrototypeOf(body)) {
this._bodyFormData = body
} else if (!body) {
this._bodyText = ''
} else {
throw new Error('unsupported BodyInit type')
}
}
if (support.blob) {
this.blob = function () {
var rejected = consumed(this)
if (rejected) {
return rejected
}
if (this._bodyBlob) {
return Promise.resolve(this._bodyBlob)
} else if (this._bodyFormData) {
throw new Error('could not read FormData body as blob')
} else {
return Promise.resolve(new Blob([this._bodyText]))
}
}
this.arrayBuffer = function () {
return this.blob().then(readBlobAsArrayBuffer)
}
this.text = function () {
var rejected = consumed(this)
if (rejected) {
return rejected
}
if (this._bodyBlob) {
return readBlobAsText(this._bodyBlob)
} else if (this._bodyFormData) {
throw new Error('could not read FormData body as text')
} else {
return Promise.resolve(this._bodyText)
}
}
} else {
this.text = function () {
var rejected = consumed(this)
return rejected ? rejected : Promise.resolve(this._bodyText)
}
}
if (support.formData) {
this.formData = function () {
return this.text().then(decode)
}
}
this.json = function () {
return this.text().then(JSON.parse)
}
return this
}
// HTTP methods whose capitalization should be normalized
var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT']
function normalizeMethod(method) {
var upcased = method.toUpperCase()
return (methods.indexOf(upcased) > -1) ? upcased : method
}
function Request(url, options) {
options = options || {}
this.url = url
this.credentials = options.credentials || 'omit'
this.headers = new Headers(options.headers)
this.method = normalizeMethod(options.method || 'GET')
this.mode = options.mode || null
this.referrer = null
if ((this.method === 'GET' || this.method === 'HEAD') && options.body) {
throw new TypeError('Body not allowed for GET or HEAD requests')
}
this._initBody(options.body)
}
function decode(body) {
var form = new exports.FormData()
body.trim().split('&').forEach(function (bytes) {
if (bytes) {
var split = bytes.split('=')
var name = split.shift().replace(/\+/g, ' ')
var value = split.join('=').replace(/\+/g, ' ')
form.append(decodeURIComponent(name), decodeURIComponent(value))
}
})
return form
}
function headers(xhr) {
var head = new Headers()
var pairs = xhr.getAllResponseHeaders().trim().split('\n')
pairs.forEach(function (header) {
var split = header.trim().split(':')
var key = split.shift().trim()
var value = split.join(':').trim()
head.append(key, value)
})
return head
}
Body.call(Request.prototype)
function Response(bodyInit, options) {
if (!options) {
options = {}
}
this._initBody(bodyInit)
this.type = 'default'
this.url = null
this.status = options.status
this.ok = this.status >= 200 && this.status < 300
this.statusText = options.statusText
this.headers = options.headers instanceof Headers ? options.headers : new Headers(options.headers)
this.url = options.url || ''
}
Body.call(Response.prototype)
exports.Headers = Headers;
exports.Request = Request;
exports.Response = Response;
exports.fetch = function (input, init) {
// TODO: Request constructor should accept input, init
var request
if (Request.prototype.isPrototypeOf(input) && !init) {
request = input
} else {
request = new Request(input, init)
}
return new Promise(function (resolve, reject) {
var xhr = new exports.XMLHttpRequest()
function responseURL() {
if ('responseURL' in xhr) {
return xhr.responseURL
}
// Avoid security warnings on getResponseHeader when not allowed by CORS
if (/^X-Request-URL:/m.test(xhr.getAllResponseHeaders())) {
return xhr.getResponseHeader('X-Request-URL')
}
return;
}
xhr.onload = function () {
var status = (xhr.status === 1223) ? 204 : xhr.status
if (status < 100 || status > 599) {
reject(new TypeError('Network request failed'))
return
}
var options = {
status: status,
statusText: xhr.statusText,
headers: headers(xhr),
url: responseURL()
}
//var body = 'response' in xhr ? xhr.response : xhr.responseText;
resolve(new Response(xhr.responseText, options))
}
xhr.onerror = function (error) {
reject(new TypeError(['Network request failed:', error.message].join(' ')))
}
xhr.open(request.method, request.url, true)
if (request.credentials === 'include') {
xhr.withCredentials = true
}
if ('responseType' in xhr && support.blob) {
xhr.responseType = 'blob'
}
request.headers.forEach(function (value, name) {
xhr.setRequestHeader(name, value)
})
xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit)
})
}
exports.fetch.polyfill = true
})();
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("../node_modules/webpack/buildin/global.js")))
/***/ }),
/***/ "../node_modules/tns-core-modules/file-system/file-name-resolver/file-name-resolver.js":
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", { value: true });
var platform_1 = __webpack_require__("../node_modules/tns-core-modules/platform/platform.js");
var file_system_1 = __webpack_require__("../node_modules/tns-core-modules/file-system/file-system.js");
var trace = __webpack_require__("../node_modules/tns-core-modules/trace/trace.js");
var appCommonModule = __webpack_require__("../node_modules/tns-core-modules/application/application-common.js");
var MIN_WH = "minWH";
var MIN_W = "minW";
var MIN_H = "minH";
var PRIORITY_STEP = 10000;
var minWidthHeightQualifier = {
isMatch: function (value) {
return value.indexOf(MIN_WH) === 0;
},
getMatchValue: function (value, context) {
var numVal = parseInt(value.substr(MIN_WH.length));
if (isNaN(numVal)) {
return -1;
}
var actualLength = Math.min(context.width, context.height);
if (actualLength < numVal) {
return -1;
}
return PRIORITY_STEP - (actualLength - numVal);
}
};
var minWidthQualifier = {
isMatch: function (value) {
return value.indexOf(MIN_W) === 0 && value.indexOf(MIN_WH) < 0;
},
getMatchValue: function (value, context) {
var numVal = parseInt(value.substr(MIN_W.length));
if (isNaN(numVal)) {
return -1;
}
var actualWidth = context.width;
if (actualWidth < numVal) {
return -1;
}
return PRIORITY_STEP - (actualWidth - numVal);
}
};
var minHeightQualifier = {
isMatch: function (value) {
return value.indexOf(MIN_H) === 0 && value.indexOf(MIN_WH) < 0;
},
getMatchValue: function (value, context) {
var numVal = parseInt(value.substr(MIN_H.length));
if (isNaN(numVal)) {
return -1;
}
var actualHeight = context.height;
if (actualHeight < numVal) {
return -1;
}
return PRIORITY_STEP - (actualHeight - numVal);
}
};
var platformQualifier = {
isMatch: function (value) {
return value === "android" ||
value === "ios";
},
getMatchValue: function (value, context) {
return value === context.os.toLowerCase() ? 1 : -1;
}
};
var orientationQualifier = {
isMatch: function (value) {
return value === "land" ||
value === "port";
},
getMatchValue: function (value, context) {
var isLandscape = (context.width > context.height) ? 1 : -1;
return (value === "land") ? isLandscape : -isLandscape;
}
};
var supportedQualifiers = [
minWidthHeightQualifier,
minWidthQualifier,
minHeightQualifier,
orientationQualifier,
platformQualifier
];
var FileNameResolver = (function () {
function FileNameResolver(context) {
this._cache = {};
this._context = context;
}
FileNameResolver.prototype.resolveFileName = function (path, ext) {
var key = path + ext;
var result = this._cache[key];
if (result === undefined) {
result = this.resolveFileNameImpl(path, ext);
this._cache[key] = result;
}
return result;
};
FileNameResolver.prototype.clearCache = function () {
this._cache = {};
};
FileNameResolver.prototype.resolveFileNameImpl = function (path, ext) {
var result = null;
path = file_system_1.path.normalize(path);
ext = "." + ext;
var candidates = this.getFileCandidatesFromFolder(path, ext);
result = _findFileMatch(path, ext, candidates, this._context);
return result;
};
FileNameResolver.prototype.getFileCandidatesFromFolder = function (path, ext) {
var candidates = new Array();
var folderPath = path.substring(0, path.lastIndexOf(file_system_1.path.separator) + 1);
if (file_system_1.Folder.exists(folderPath)) {
var folder = file_system_1.Folder.fromPath(folderPath);
folder.eachEntity(function (e) {
if (e instanceof file_system_1.File) {
var file = e;
if (file.path.indexOf(path) === 0 && file.extension === ext) {
candidates.push(file.path);
}
}
return true;
});
}
else {
if (trace.isEnabled()) {
trace.write("Could not find folder " + folderPath + " when loading " + path + ext, trace.categories.Navigation);
}
}
return candidates;
};
return FileNameResolver;
}());
exports.FileNameResolver = FileNameResolver;
function _findFileMatch(path, ext, candidates, context) {
var bestValue = -1;
var result = null;
for (var i = 0; i < candidates.length; i++) {
var filePath = candidates[i];
var qualifiersStr = filePath.substr(path.length, filePath.length - path.length - ext.length);
var qualifiers = qualifiersStr.split(".");
var value = checkQualifiers(qualifiers, context);
if (value >= 0 && value > bestValue) {
bestValue = value;
result = candidates[i];
}
}
return result;
}
exports._findFileMatch = _findFileMatch;
function checkQualifiers(qualifiers, context) {
var result = 0;
for (var i = 0; i < qualifiers.length; i++) {
if (qualifiers[i]) {
var value = checkQualifier(qualifiers[i], context);
if (value < 0) {
return -1;
}
result += value;
}
}
return result;
}
function checkQualifier(value, context) {
for (var i = 0; i < supportedQualifiers.length; i++) {
if (supportedQualifiers[i].isMatch(value)) {
var result = supportedQualifiers[i].getMatchValue(value, context);
if (result > 0) {
result += (supportedQualifiers.length - i) * PRIORITY_STEP;
}
return result;
}
}
return -1;
}
var resolverInstance;
function resolveFileName(path, ext) {
if (!resolverInstance) {
resolverInstance = new FileNameResolver({
width: platform_1.screen.mainScreen.widthDIPs,
height: platform_1.screen.mainScreen.heightDIPs,
os: platform_1.device.os,
deviceType: platform_1.device.deviceType
});
}
return resolverInstance.resolveFileName(path, ext);
}
exports.resolveFileName = resolveFileName;
appCommonModule.on("cssChanged", function (args) { return resolverInstance = undefined; });
appCommonModule.on("livesync", function (args) { return resolverInstance && resolverInstance.clearCache(); });
//# sourceMappingURL=file-name-resolver.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/file-system/file-system-access.js":
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", { value: true });
var text_1 = __webpack_require__("../node_modules/tns-core-modules/text/text.js");
var utils_1 = __webpack_require__("../node_modules/tns-core-modules/utils/utils.js");
var FileSystemAccess = (function () {
function FileSystemAccess() {
}
FileSystemAccess.prototype.getLastModified = function (path) {
var fileManager = utils_1.ios.getter(NSFileManager, NSFileManager.defaultManager);
var attributes = fileManager.attributesOfItemAtPathError(path);
if (attributes) {
return attributes.objectForKey("NSFileModificationDate");
}
else {
return new Date();
}
};
FileSystemAccess.prototype.getFileSize = function (path) {
var fileManager = utils_1.ios.getter(NSFileManager, NSFileManager.defaultManager);
var attributes = fileManager.attributesOfItemAtPathError(path);
if (attributes) {
return attributes.objectForKey("NSFileSize");
}
else {
return 0;
}
};
FileSystemAccess.prototype.getParent = function (path, onError) {
try {
var fileManager = utils_1.ios.getter(NSFileManager, NSFileManager.defaultManager);
var nsString = NSString.stringWithString(path);
var parentPath = nsString.stringByDeletingLastPathComponent;
var name_1 = fileManager.displayNameAtPath(parentPath);
return {
path: parentPath.toString(),
name: name_1
};
}
catch (exception) {
if (onError) {
onError(exception);
}
return undefined;
}
};
FileSystemAccess.prototype.getFile = function (path, onError) {
try {
var fileManager = utils_1.ios.getter(NSFileManager, NSFileManager.defaultManager);
var exists = fileManager.fileExistsAtPath(path);
if (!exists) {
var parentPath = this.getParent(path, onError).path;
if (!fileManager.createDirectoryAtPathWithIntermediateDirectoriesAttributesError(parentPath, true, null)
|| !fileManager.createFileAtPathContentsAttributes(path, null, null)) {
if (onError) {
onError(new Error("Failed to create file at path '" + path + "'"));
}
return undefined;
}
}
var fileName = fileManager.displayNameAtPath(path);
return {
path: path,
name: fileName,
extension: this.getFileExtension(path)
};
}
catch (exception) {
if (onError) {
onError(exception);
}
return undefined;
}
};
FileSystemAccess.prototype.getFolder = function (path, onError) {
try {
var fileManager = utils_1.ios.getter(NSFileManager, NSFileManager.defaultManager);
var exists = this.folderExists(path);
if (!exists) {
try {
fileManager.createDirectoryAtPathWithIntermediateDirectoriesAttributesError(path, true, null);
}
catch (ex) {
if (onError) {
onError(new Error("Failed to create folder at path '" + path + "': " + ex));
}
return undefined;
}
}
var dirName = fileManager.displayNameAtPath(path);
return {
path: path,
name: dirName
};
}
catch (ex) {
if (onError) {
onError(new Error("Failed to create folder at path '" + path + "'"));
}
return undefined;
}
};
FileSystemAccess.prototype.getExistingFolder = function (path, onError) {
try {
var fileManager = utils_1.ios.getter(NSFileManager, NSFileManager.defaultManager);
var exists = this.folderExists(path);
if (exists) {
var dirName = fileManager.displayNameAtPath(path);
return {
path: path,
name: dirName
};
}
return undefined;
}
catch (ex) {
if (onError) {
onError(new Error("Failed to get folder at path '" + path + "'"));
}
return undefined;
}
};
FileSystemAccess.prototype.eachEntity = function (path, onEntity, onError) {
if (!onEntity) {
return;
}
this.enumEntities(path, onEntity, onError);
};
FileSystemAccess.prototype.getEntities = function (path, onError) {
var fileInfos = new Array();
var onEntity = function (entity) {
fileInfos.push(entity);
return true;
};
var errorOccurred;
var localError = function (error) {
if (onError) {
onError(error);
}
errorOccurred = true;
};
this.enumEntities(path, onEntity, localError);
if (!errorOccurred) {
return fileInfos;
}
return null;
};
FileSystemAccess.prototype.fileExists = function (path) {
var result = this.exists(path);
return result.exists;
};
FileSystemAccess.prototype.folderExists = function (path) {
var result = this.exists(path);
return result.exists && result.isDirectory;
};
FileSystemAccess.prototype.exists = function (path) {
var fileManager = utils_1.ios.getter(NSFileManager, NSFileManager.defaultManager);
var isDirectory = new interop.Reference(interop.types.bool, false);
var exists = fileManager.fileExistsAtPathIsDirectory(path, isDirectory);
return { exists: exists, isDirectory: isDirectory.value };
};
FileSystemAccess.prototype.concatPath = function (left, right) {
return NSString.pathWithComponents([left, right]).toString();
};
FileSystemAccess.prototype.deleteFile = function (path, onError) {
this.deleteEntity(path, onError);
};
FileSystemAccess.prototype.deleteFolder = function (path, onError) {
this.deleteEntity(path, onError);
};
FileSystemAccess.prototype.emptyFolder = function (path, onError) {
var fileManager = utils_1.ios.getter(NSFileManager, NSFileManager.defaultManager);
var entities = this.getEntities(path, onError);
if (!entities) {
return;
}
for (var i = 0; i < entities.length; i++) {
try {
fileManager.removeItemAtPathError(entities[i].path);
}
catch (ex) {
if (onError) {
onError(new Error("Failed to empty folder '" + path + "': " + ex));
}
return;
}
}
};
FileSystemAccess.prototype.rename = function (path, newPath, onError) {
var fileManager = utils_1.ios.getter(NSFileManager, NSFileManager.defaultManager);
try {
fileManager.moveItemAtPathToPathError(path, newPath);
}
catch (ex) {
if (onError) {
onError(new Error("Failed to rename '" + path + "' to '" + newPath + "': " + ex));
}
}
};
FileSystemAccess.prototype.getLogicalRootPath = function () {
var mainBundlePath = utils_1.ios.getter(NSBundle, NSBundle.mainBundle).bundlePath;
var resolvedPath = NSString.stringWithString(mainBundlePath).stringByResolvingSymlinksInPath;
return resolvedPath;
};
FileSystemAccess.prototype.getDocumentsFolderPath = function () {
return this.getKnownPath(9);
};
FileSystemAccess.prototype.getTempFolderPath = function () {
return this.getKnownPath(13);
};
FileSystemAccess.prototype.getCurrentAppPath = function () {
return utils_1.ios.getCurrentAppPath();
};
FileSystemAccess.prototype.readText = function (path, onError, encoding) {
var actualEncoding = encoding || text_1.encoding.UTF_8;
try {
var nsString = NSString.stringWithContentsOfFileEncodingError(path, actualEncoding);
return nsString.toString();
}
catch (ex) {
if (onError) {
onError(new Error("Failed to read file at path '" + path + "': " + ex));
}
}
};
FileSystemAccess.prototype.read = function (path, onError) {
try {
return NSData.dataWithContentsOfFile(path);
}
catch (ex) {
if (onError) {
onError(new Error("Failed to read file at path '" + path + "': " + ex));
}
}
};
FileSystemAccess.prototype.writeText = function (path, content, onError, encoding) {
var nsString = NSString.stringWithString(content);
var actualEncoding = encoding || text_1.encoding.UTF_8;
try {
nsString.writeToFileAtomicallyEncodingError(path, false, actualEncoding);
}
catch (ex) {
if (onError) {
onError(new Error("Failed to write to file '" + path + "': " + ex));
}
}
};
FileSystemAccess.prototype.write = function (path, content, onError) {
try {
content.writeToFileAtomically(path, true);
}
catch (ex) {
if (onError) {
onError(new Error("Failed to write to file '" + path + "': " + ex));
}
}
};
FileSystemAccess.prototype.getKnownPath = function (folderType) {
var fileManager = utils_1.ios.getter(NSFileManager, NSFileManager.defaultManager);
var paths = fileManager.URLsForDirectoryInDomains(folderType, 1);
var url = paths.objectAtIndex(0);
return url.path;
};
FileSystemAccess.prototype.getFileExtension = function (path) {
var dotIndex = path.lastIndexOf(".");
if (dotIndex && dotIndex >= 0 && dotIndex < path.length) {
return path.substring(dotIndex);
}
return "";
};
FileSystemAccess.prototype.deleteEntity = function (path, onError) {
var fileManager = utils_1.ios.getter(NSFileManager, NSFileManager.defaultManager);
try {
fileManager.removeItemAtPathError(path);
}
catch (ex) {
if (onError) {
onError(new Error("Failed to delete file at path '" + path + "': " + ex));
}
}
};
FileSystemAccess.prototype.enumEntities = function (path, callback, onError) {
try {
var fileManager = utils_1.ios.getter(NSFileManager, NSFileManager.defaultManager);
var files = void 0;
try {
files = fileManager.contentsOfDirectoryAtPathError(path);
}
catch (ex) {
if (onError) {
onError(new Error("Failed to enum files for folder '" + path + "': " + ex));
}
return;
}
for (var i = 0; i < files.count; i++) {
var file = files.objectAtIndex(i);
var info = {
path: this.concatPath(path, file),
name: file,
extension: ""
};
if (!this.folderExists(this.joinPath(path, file))) {
info.extension = this.getFileExtension(info.path);
}
var retVal = callback(info);
if (retVal === false) {
break;
}
}
}
catch (ex) {
if (onError) {
onError(ex);
}
}
};
FileSystemAccess.prototype.getPathSeparator = function () {
return "/";
};
FileSystemAccess.prototype.normalizePath = function (path) {
var nsString = NSString.stringWithString(path);
var normalized = nsString.stringByStandardizingPath;
return normalized;
};
FileSystemAccess.prototype.joinPath = function (left, right) {
var nsString = NSString.stringWithString(left);
return nsString.stringByAppendingPathComponent(right);
};
FileSystemAccess.prototype.joinPaths = function (paths) {
return utils_1.ios.joinPaths.apply(utils_1.ios, paths);
};
return FileSystemAccess;
}());
exports.FileSystemAccess = FileSystemAccess;
//# sourceMappingURL=file-system-access.ios.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/file-system/file-system.js":
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", { value: true });
var file_access_module = __webpack_require__("../node_modules/tns-core-modules/file-system/file-system-access.js");
var profiling_1 = __webpack_require__("../node_modules/tns-core-modules/profiling/profiling.js");
var fileAccess;
var getFileAccess = function () {
if (!fileAccess) {
fileAccess = new file_access_module.FileSystemAccess();
}
return fileAccess;
};
var platform;
function ensurePlatform() {
if (!platform) {
platform = __webpack_require__("../node_modules/tns-core-modules/platform/platform.js");
}
}
var createFile = function (info) {
var file = new File();
file._path = info.path;
file._name = info.name;
file._extension = info.extension;
return file;
};
var createFolder = function (info) {
var documents = knownFolders.documents();
if (info.path === documents.path) {
return documents;
}
var temp = knownFolders.temp();
if (info.path === temp.path) {
return temp;
}
var folder = new Folder();
folder._path = info.path;
folder._name = info.name;
return folder;
};
var FileSystemEntity = (function () {
function FileSystemEntity() {
}
Object.defineProperty(FileSystemEntity.prototype, "parent", {
get: function () {
var onError = function (error) {
throw error;
};
var folderInfo = getFileAccess().getParent(this.path, onError);
if (!folderInfo) {
return undefined;
}
return createFolder(folderInfo);
},
enumerable: true,
configurable: true
});
FileSystemEntity.prototype.remove = function () {
var _this = this;
return new Promise(function (resolve, reject) {
var hasError = false;
var localError = function (error) {
hasError = true;
reject(error);
};
_this.removeSync(localError);
if (!hasError) {
resolve();
}
});
};
FileSystemEntity.prototype.removeSync = function (onError) {
if (this._isKnown) {
if (onError) {
onError({ message: "Cannot delete known folder." });
}
return;
}
var fileAccess = getFileAccess();
if (this instanceof File) {
fileAccess.deleteFile(this.path, onError);
}
else if (this instanceof Folder) {
fileAccess.deleteFolder(this.path, onError);
}
};
FileSystemEntity.prototype.rename = function (newName) {
var _this = this;
return new Promise(function (resolve, reject) {
var hasError = false;
var localError = function (error) {
hasError = true;
reject(error);
};
_this.renameSync(newName, localError);
if (!hasError) {
resolve();
}
});
};
FileSystemEntity.prototype.renameSync = function (newName, onError) {
if (this._isKnown) {
if (onError) {
onError(new Error("Cannot rename known folder."));
}
return;
}
var parentFolder = this.parent;
if (!parentFolder) {
if (onError) {
onError(new Error("No parent folder."));
}
return;
}
var fileAccess = getFileAccess();
var path = parentFolder.path;
var newPath = fileAccess.joinPath(path, newName);
var localError = function (error) {
if (onError) {
onError(error);
}
return null;
};
fileAccess.rename(this.path, newPath, localError);
this._path = newPath;
this._name = newName;
if (this instanceof File) {
this._extension = fileAccess.getFileExtension(newPath);
}
};
Object.defineProperty(FileSystemEntity.prototype, "name", {
get: function () {
return this._name;
},
enumerable: true,
configurable: true
});
Object.defineProperty(FileSystemEntity.prototype, "path", {
get: function () {
return this._path;
},
enumerable: true,
configurable: true
});
Object.defineProperty(FileSystemEntity.prototype, "lastModified", {
get: function () {
var value = this._lastModified;
if (!this._lastModified) {
value = this._lastModified = getFileAccess().getLastModified(this.path);
}
return value;
},
enumerable: true,
configurable: true
});
return FileSystemEntity;
}());
exports.FileSystemEntity = FileSystemEntity;
var File = (function (_super) {
__extends(File, _super);
function File() {
return _super !== null && _super.apply(this, arguments) || this;
}
File.fromPath = function (path) {
var onError = function (error) {
throw error;
};
var fileInfo = getFileAccess().getFile(path, onError);
if (!fileInfo) {
return undefined;
}
return createFile(fileInfo);
};
File.exists = function (path) {
return getFileAccess().fileExists(path);
};
Object.defineProperty(File.prototype, "extension", {
get: function () {
return this._extension;
},
enumerable: true,
configurable: true
});
Object.defineProperty(File.prototype, "isLocked", {
get: function () {
return !!this._locked;
},
enumerable: true,
configurable: true
});
Object.defineProperty(File.prototype, "size", {
get: function () {
return getFileAccess().getFileSize(this.path);
},
enumerable: true,
configurable: true
});
File.prototype.readSync = function (onError) {
this.checkAccess();
this._locked = true;
var that = this;
var localError = function (error) {
that._locked = false;
if (onError) {
onError(error);
}
};
var content = getFileAccess().read(this.path, localError);
this._locked = false;
return content;
};
File.prototype.writeSync = function (content, onError) {
this.checkAccess();
try {
this._locked = true;
var that = this;
var localError = function (error) {
that._locked = false;
if (onError) {
onError(error);
}
};
getFileAccess().write(this.path, content, localError);
}
finally {
this._locked = false;
}
};
File.prototype.readText = function (encoding) {
var _this = this;
return new Promise(function (resolve, reject) {
var hasError = false;
var localError = function (error) {
hasError = true;
reject(error);
};
var content = _this.readTextSync(localError, encoding);
if (!hasError) {
resolve(content);
}
});
};
File.prototype.readTextSync = function (onError, encoding) {
this.checkAccess();
this._locked = true;
var that = this;
var localError = function (error) {
that._locked = false;
if (onError) {
onError(error);
}
};
var content = getFileAccess().readText(this.path, localError, encoding);
this._locked = false;
return content;
};
File.prototype.writeText = function (content, encoding) {
var _this = this;
return new Promise(function (resolve, reject) {
var hasError = false;
var localError = function (error) {
hasError = true;
reject(error);
};
_this.writeTextSync(content, localError, encoding);
if (!hasError) {
resolve();
}
});
};
File.prototype.writeTextSync = function (content, onError, encoding) {
this.checkAccess();
try {
this._locked = true;
var that = this;
var localError = function (error) {
that._locked = false;
if (onError) {
onError(error);
}
};
getFileAccess().writeText(this.path, content, localError, encoding);
}
finally {
this._locked = false;
}
};
File.prototype.checkAccess = function () {
if (this.isLocked) {
throw new Error("Cannot access a locked file.");
}
};
__decorate([
profiling_1.profile
], File.prototype, "readTextSync", null);
return File;
}(FileSystemEntity));
exports.File = File;
var Folder = (function (_super) {
__extends(Folder, _super);
function Folder() {
return _super !== null && _super.apply(this, arguments) || this;
}
Folder.fromPath = function (path) {
var onError = function (error) {
throw error;
};
var folderInfo = getFileAccess().getFolder(path, onError);
if (!folderInfo) {
return undefined;
}
return createFolder(folderInfo);
};
Folder.exists = function (path) {
return getFileAccess().folderExists(path);
};
Folder.prototype.contains = function (name) {
var fileAccess = getFileAccess();
var path = fileAccess.joinPath(this.path, name);
if (fileAccess.fileExists(path)) {
return true;
}
return fileAccess.folderExists(path);
};
Folder.prototype.clear = function () {
var _this = this;
return new Promise(function (resolve, reject) {
var hasError = false;
var onError = function (error) {
hasError = true;
reject(error);
};
_this.clearSync(onError);
if (!hasError) {
resolve();
}
});
};
Folder.prototype.clearSync = function (onError) {
getFileAccess().emptyFolder(this.path, onError);
};
Object.defineProperty(Folder.prototype, "isKnown", {
get: function () {
return this._isKnown;
},
enumerable: true,
configurable: true
});
Folder.prototype.getFile = function (name) {
var fileAccess = getFileAccess();
var path = fileAccess.joinPath(this.path, name);
var onError = function (error) {
throw error;
};
var fileInfo = fileAccess.getFile(path, onError);
if (!fileInfo) {
return undefined;
}
return createFile(fileInfo);
};
Folder.prototype.getFolder = function (name) {
var fileAccess = getFileAccess();
var path = fileAccess.joinPath(this.path, name);
var onError = function (error) {
throw error;
};
var folderInfo = fileAccess.getFolder(path, onError);
if (!folderInfo) {
return undefined;
}
return createFolder(folderInfo);
};
Folder.prototype.getEntities = function () {
var _this = this;
return new Promise(function (resolve, reject) {
var hasError = false;
var localError = function (error) {
hasError = true;
reject(error);
};
var entities = _this.getEntitiesSync(localError);
if (!hasError) {
resolve(entities);
}
});
};
Folder.prototype.getEntitiesSync = function (onError) {
var fileInfos = getFileAccess().getEntities(this.path, onError);
if (!fileInfos) {
return null;
}
var entities = new Array();
var i;
for (i = 0; i < fileInfos.length; i++) {
if (fileInfos[i].extension) {
entities.push(createFile(fileInfos[i]));
}
else {
entities.push(createFolder(fileInfos[i]));
}
}
return entities;
};
Folder.prototype.eachEntity = function (onEntity) {
if (!onEntity) {
return;
}
var onSuccess = function (fileInfo) {
var entity;
if (fileInfo.extension) {
entity = createFile(fileInfo);
}
else {
entity = createFolder(fileInfo);
}
return onEntity(entity);
};
var onError = function (error) {
throw error;
};
getFileAccess().eachEntity(this.path, onSuccess, onError);
};
return Folder;
}(FileSystemEntity));
exports.Folder = Folder;
var knownFolders;
(function (knownFolders) {
var _documents;
var _temp;
var _app;
knownFolders.documents = function () {
if (!_documents) {
var path = getFileAccess().getDocumentsFolderPath();
_documents = new Folder();
_documents._path = path;
_documents._isKnown = true;
}
return _documents;
};
knownFolders.temp = function () {
if (!_temp) {
var path = getFileAccess().getTempFolderPath();
_temp = new Folder();
_temp._path = path;
_temp._isKnown = true;
}
return _temp;
};
knownFolders.currentApp = function () {
if (!_app) {
var path = getFileAccess().getCurrentAppPath();
_app = new Folder();
_app._path = path;
_app._isKnown = true;
}
return _app;
};
var ios;
(function (ios) {
function _checkPlatform(knownFolderName) {
ensurePlatform();
if (!platform.isIOS) {
throw new Error("The \"" + knownFolderName + "\" known folder is available on iOS only!");
}
}
var _library;
ios.library = function () {
_checkPlatform("library");
if (!_library) {
var existingFolderInfo = getExistingFolderInfo(5);
if (existingFolderInfo) {
_library = existingFolderInfo.folder;
_library._path = existingFolderInfo.path;
_library._isKnown = true;
}
}
return _library;
};
var _developer;
ios.developer = function () {
_checkPlatform("developer");
if (!_developer) {
var existingFolderInfo = getExistingFolderInfo(6);
if (existingFolderInfo) {
_developer = existingFolderInfo.folder;
_developer._path = existingFolderInfo.path;
_developer._isKnown = true;
}
}
return _developer;
};
var _desktop;
ios.desktop = function () {
_checkPlatform("desktop");
if (!_desktop) {
var existingFolderInfo = getExistingFolderInfo(12);
if (existingFolderInfo) {
_desktop = existingFolderInfo.folder;
_desktop._path = existingFolderInfo.path;
_desktop._isKnown = true;
}
}
return _desktop;
};
var _downloads;
ios.downloads = function () {
_checkPlatform("downloads");
if (!_downloads) {
var existingFolderInfo = getExistingFolderInfo(15);
if (existingFolderInfo) {
_downloads = existingFolderInfo.folder;
_downloads._path = existingFolderInfo.path;
_downloads._isKnown = true;
}
}
return _downloads;
};
var _movies;
ios.movies = function () {
_checkPlatform("movies");
if (!_movies) {
var existingFolderInfo = getExistingFolderInfo(17);
if (existingFolderInfo) {
_movies = existingFolderInfo.folder;
_movies._path = existingFolderInfo.path;
_movies._isKnown = true;
}
}
return _movies;
};
var _music;
ios.music = function () {
_checkPlatform("music");
if (!_music) {
var existingFolderInfo = getExistingFolderInfo(18);
if (existingFolderInfo) {
_music = existingFolderInfo.folder;
_music._path = existingFolderInfo.path;
_music._isKnown = true;
}
}
return _music;
};
var _pictures;
ios.pictures = function () {
_checkPlatform("pictures");
if (!_pictures) {
var existingFolderInfo = getExistingFolderInfo(19);
if (existingFolderInfo) {
_pictures = existingFolderInfo.folder;
_pictures._path = existingFolderInfo.path;
_pictures._isKnown = true;
}
}
return _pictures;
};
var _sharedPublic;
ios.sharedPublic = function () {
_checkPlatform("sharedPublic");
if (!_sharedPublic) {
var existingFolderInfo = getExistingFolderInfo(21);
if (existingFolderInfo) {
_sharedPublic = existingFolderInfo.folder;
_sharedPublic._path = existingFolderInfo.path;
_sharedPublic._isKnown = true;
}
}
return _sharedPublic;
};
function getExistingFolderInfo(pathDirectory) {
var fileAccess = getFileAccess();
var folderPath = fileAccess.getKnownPath(pathDirectory);
var folderInfo = fileAccess.getExistingFolder(folderPath);
if (folderInfo) {
return {
folder: createFolder(folderInfo),
path: folderPath
};
}
return undefined;
}
})(ios = knownFolders.ios || (knownFolders.ios = {}));
})(knownFolders = exports.knownFolders || (exports.knownFolders = {}));
var path;
(function (path_1) {
function normalize(path) {
return getFileAccess().normalizePath(path);
}
path_1.normalize = normalize;
function join() {
var paths = [];
for (var _i = 0; _i < arguments.length; _i++) {
paths[_i] = arguments[_i];
}
var fileAccess = getFileAccess();
return fileAccess.joinPaths(paths);
}
path_1.join = join;
path_1.separator = getFileAccess().getPathSeparator();
})(path = exports.path || (exports.path = {}));
//# sourceMappingURL=file-system.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/globals/globals.js":
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global) {Object.defineProperty(exports, "__esModule", { value: true });
__webpack_require__("../node_modules/tns-core-modules/globals/ts-helpers.js");
global.moduleMerge = function (sourceExports, destExports) {
for (var key in sourceExports) {
destExports[key] = sourceExports[key];
}
};
var modules = new Map();
global.moduleResolvers = [global.require];
global.registerModule = function (name, loader) {
modules.set(name, loader);
};
var defaultExtensionMap = { ".js": ".js", ".ts": ".js", ".css": ".css", ".scss": ".css", ".xml": ".xml", ".less": ".css", ".sass": ".css" };
global.registerWebpackModules = function registerWebpackModules(context, extensionMap) {
if (extensionMap === void 0) { extensionMap = {}; }
context.keys().forEach(function (key) {
var extDotIndex = key.lastIndexOf(".");
var base = key.substr(0, extDotIndex);
var originalExt = key.substr(extDotIndex);
var registerExt = extensionMap[originalExt] || defaultExtensionMap[originalExt] || originalExt;
var isSourceFile = originalExt !== registerExt;
var registerName = base + registerExt;
if (registerName.startsWith("./") && registerName.endsWith(".js")) {
var jsNickNames = [
registerName.substr(2, registerName.length - 5),
registerName.substr(0, registerName.length - 3),
registerName.substr(2),
];
jsNickNames.forEach(function (jsNickName) {
if (isSourceFile || !global.moduleExists(jsNickName)) {
global.registerModule(jsNickName, function () { return context(key); });
}
});
}
if (isSourceFile || !global.moduleExists(registerName)) {
global.registerModule(registerName, function () { return context(key); });
}
});
};
global.moduleExists = function (name) {
return modules.has(name);
};
global.loadModule = function (name) {
var loader = modules.get(name);
if (loader) {
return loader();
}
var _loop_1 = function (resolver) {
var result = resolver(name);
if (result) {
modules.set(name, function () { return result; });
return { value: result };
}
};
for (var _i = 0, _a = global.moduleResolvers; _i < _a.length; _i++) {
var resolver = _a[_i];
var state_1 = _loop_1(resolver);
if (typeof state_1 === "object")
return state_1.value;
}
};
global.zonedCallback = function (callback) {
if (global.zone) {
return global.zone.bind(callback);
}
if (global.Zone) {
return global.Zone.current.wrap(callback);
}
else {
return callback;
}
};
global.registerModule("timer", function () { return __webpack_require__("../node_modules/tns-core-modules/timer/timer.js"); });
global.registerModule("ui/dialogs", function () { return __webpack_require__("../node_modules/tns-core-modules/ui/dialogs/dialogs.js"); });
global.registerModule("xhr", function () { return __webpack_require__("../node_modules/tns-core-modules/xhr/xhr.js"); });
global.registerModule("fetch", function () { return __webpack_require__("../node_modules/tns-core-modules/fetch/fetch.js"); });
global.System = {
import: function (path) {
return new Promise(function (resolve, reject) {
try {
resolve(global.require(path));
}
catch (e) {
reject(e);
}
});
}
};
function registerOnGlobalContext(name, module) {
Object.defineProperty(global, name, {
get: function () {
var m = global.loadModule(module);
var resolvedValue = m[name];
Object.defineProperty(this, name, { value: resolvedValue, configurable: true, writable: true });
return resolvedValue;
},
configurable: true
});
}
var snapshotGlobals;
function install() {
if (global.__snapshot || global.__snapshotEnabled) {
if (!snapshotGlobals) {
var timer = __webpack_require__("../node_modules/tns-core-modules/timer/timer.js");
var dialogs = __webpack_require__("../node_modules/tns-core-modules/ui/dialogs/dialogs.js");
var xhr = __webpack_require__("../node_modules/tns-core-modules/xhr/xhr.js");
var fetch = __webpack_require__("../node_modules/tns-core-modules/fetch/fetch.js");
snapshotGlobals = snapshotGlobals || {
setTimeout: timer.setTimeout,
clearTimeout: timer.clearTimeout,
setInterval: timer.setInterval,
clearInterval: timer.clearInterval,
alert: dialogs.alert,
confirm: dialogs.confirm,
prompt: dialogs.prompt,
login: dialogs.login,
action: dialogs.action,
XMLHttpRequest: xhr.XMLHttpRequest,
FormData: xhr.FormData,
fetch: fetch.fetch,
Headers: fetch.Headers,
Request: fetch.Request,
Response: fetch.Response,
};
}
var consoleModule = __webpack_require__("../node_modules/tns-core-modules/console/console.js").Console;
global.console = global.console || new consoleModule();
Object.assign(global, snapshotGlobals);
}
else {
registerOnGlobalContext("setTimeout", "timer");
registerOnGlobalContext("clearTimeout", "timer");
registerOnGlobalContext("setInterval", "timer");
registerOnGlobalContext("clearInterval", "timer");
registerOnGlobalContext("alert", "ui/dialogs");
registerOnGlobalContext("confirm", "ui/dialogs");
registerOnGlobalContext("prompt", "ui/dialogs");
registerOnGlobalContext("login", "ui/dialogs");
registerOnGlobalContext("action", "ui/dialogs");
registerOnGlobalContext("XMLHttpRequest", "xhr");
registerOnGlobalContext("FormData", "xhr");
registerOnGlobalContext("fetch", "fetch");
registerOnGlobalContext("Headers", "fetch");
registerOnGlobalContext("Request", "fetch");
registerOnGlobalContext("Response", "fetch");
}
}
exports.install = install;
install();
function Deprecated(target, key, descriptor) {
if (descriptor) {
var originalMethod = descriptor.value;
descriptor.value = function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
console.log(key.toString() + " is deprecated");
return originalMethod.apply(this, args);
};
return descriptor;
}
else {
console.log((target && target.name || target) + " is deprecated");
return target;
}
}
exports.Deprecated = Deprecated;
global.Deprecated = Deprecated;
function Experimental(target, key, descriptor) {
if (descriptor) {
var originalMethod = descriptor.value;
descriptor.value = function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
console.log(key.toString() + " is experimental");
return originalMethod.apply(this, args);
};
return descriptor;
}
else {
console.log((target && target.name || target) + " is experimental");
return target;
}
}
exports.Experimental = Experimental;
global.Experimental = Experimental;
//# sourceMappingURL=globals.js.map
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("../node_modules/webpack/buildin/global.js")))
/***/ }),
/***/ "../node_modules/tns-core-modules/globals/ts-helpers.js":
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global) {Object.defineProperty(exports, "__esModule", { value: true });
if (!global.__extends) {
global.__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 tslib = __webpack_require__("../node_modules/tslib/tslib.es6.js");
for (var _i = 0, _a = Object.keys(tslib); _i < _a.length; _i++) {
var fnName = _a[_i];
if (typeof tslib[fnName] !== "function") {
continue;
}
if (fnName in global) {
continue;
}
global[fnName] = tslib[fnName];
}
//# sourceMappingURL=ts-helpers.js.map
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("../node_modules/webpack/buildin/global.js")))
/***/ }),
/***/ "../node_modules/tns-core-modules/http/http-request/http-request-common.js":
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", { value: true });
function getFilenameFromUrl(url) {
var fs = __webpack_require__("../node_modules/tns-core-modules/file-system/file-system.js");
var slashPos = url.lastIndexOf("/") + 1;
var questionMarkPos = url.lastIndexOf("?");
var actualFileName;
if (questionMarkPos !== -1) {
actualFileName = url.substring(slashPos, questionMarkPos);
}
else {
actualFileName = url.substring(slashPos);
}
var result = fs.path.join(fs.knownFolders.documents().path, actualFileName);
return result;
}
exports.getFilenameFromUrl = getFilenameFromUrl;
//# sourceMappingURL=http-request-common.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/http/http-request/http-request.js":
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", { value: true });
var types = __webpack_require__("../node_modules/tns-core-modules/utils/types.js");
var utils = __webpack_require__("../node_modules/tns-core-modules/utils/utils.js");
var domainDebugger = __webpack_require__("../node_modules/tns-core-modules/debugger/debugger.js");
var http_request_common_1 = __webpack_require__("../node_modules/tns-core-modules/http/http-request/http-request-common.js");
var getter = utils.ios.getter;
var HttpResponseEncoding;
(function (HttpResponseEncoding) {
HttpResponseEncoding[HttpResponseEncoding["UTF8"] = 0] = "UTF8";
HttpResponseEncoding[HttpResponseEncoding["GBK"] = 1] = "GBK";
})(HttpResponseEncoding = exports.HttpResponseEncoding || (exports.HttpResponseEncoding = {}));
var currentDevice = getter(UIDevice, UIDevice.currentDevice);
var device = currentDevice.userInterfaceIdiom === 0 ? "Phone" : "Pad";
var osVersion = currentDevice.systemVersion;
var GET = "GET";
var USER_AGENT_HEADER = "User-Agent";
var USER_AGENT = "Mozilla/5.0 (i" + device + "; CPU OS " + osVersion.replace(".", "_") + " like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/" + osVersion + " Mobile/10A5355d Safari/8536.25";
var sessionConfig = getter(NSURLSessionConfiguration, NSURLSessionConfiguration.defaultSessionConfiguration);
var queue = getter(NSOperationQueue, NSOperationQueue.mainQueue);
function parseJSON(source) {
var src = source.trim();
if (src.lastIndexOf(")") === src.length - 1) {
return JSON.parse(src.substring(src.indexOf("(") + 1, src.lastIndexOf(")")));
}
return JSON.parse(src);
}
var NSURLSessionTaskDelegateImpl = (function (_super) {
__extends(NSURLSessionTaskDelegateImpl, _super);
function NSURLSessionTaskDelegateImpl() {
return _super !== null && _super.apply(this, arguments) || this;
}
NSURLSessionTaskDelegateImpl.prototype.URLSessionTaskWillPerformHTTPRedirectionNewRequestCompletionHandler = function (session, task, response, request, completionHandler) {
completionHandler(null);
};
NSURLSessionTaskDelegateImpl.ObjCProtocols = [NSURLSessionTaskDelegate];
return NSURLSessionTaskDelegateImpl;
}(NSObject));
var sessionTaskDelegateInstance = NSURLSessionTaskDelegateImpl.new();
var defaultSession;
function ensureDefaultSession() {
if (!defaultSession) {
defaultSession = NSURLSession.sessionWithConfigurationDelegateDelegateQueue(sessionConfig, null, queue);
}
}
var sessionNotFollowingRedirects;
function ensureSessionNotFollowingRedirects() {
if (!sessionNotFollowingRedirects) {
sessionNotFollowingRedirects = NSURLSession.sessionWithConfigurationDelegateDelegateQueue(sessionConfig, sessionTaskDelegateInstance, queue);
}
}
var imageSource;
function ensureImageSource() {
if (!imageSource) {
imageSource = __webpack_require__("../node_modules/tns-core-modules/image-source/image-source.js");
}
}
var fs;
function ensureFileSystem() {
if (!fs) {
fs = __webpack_require__("../node_modules/tns-core-modules/file-system/file-system.js");
}
}
function request(options) {
return new Promise(function (resolve, reject) {
if (!options.url) {
reject(new Error("Request url was empty."));
return;
}
try {
var network = domainDebugger.getNetwork();
var debugRequest_1 = network && network.create();
var urlRequest = NSMutableURLRequest.requestWithURL(NSURL.URLWithString(options.url));
urlRequest.HTTPMethod = types.isDefined(options.method) ? options.method : GET;
urlRequest.setValueForHTTPHeaderField(USER_AGENT, USER_AGENT_HEADER);
if (options.headers) {
for (var header in options.headers) {
urlRequest.setValueForHTTPHeaderField(options.headers[header] + "", header);
}
}
if (types.isString(options.content) || options.content instanceof FormData) {
urlRequest.HTTPBody = NSString.stringWithString(options.content.toString()).dataUsingEncoding(4);
}
if (types.isNumber(options.timeout)) {
urlRequest.timeoutInterval = options.timeout / 1000;
}
var session = void 0;
if (types.isBoolean(options.dontFollowRedirects) && options.dontFollowRedirects) {
ensureSessionNotFollowingRedirects();
session = sessionNotFollowingRedirects;
}
else {
ensureDefaultSession();
session = defaultSession;
}
var dataTask = session.dataTaskWithRequestCompletionHandler(urlRequest, function (data, response, error) {
if (error) {
reject(new Error(error.localizedDescription));
}
else {
var headers_1 = {};
if (response && response.allHeaderFields) {
var headerFields = response.allHeaderFields;
headerFields.enumerateKeysAndObjectsUsingBlock(function (key, value, stop) {
addHeader(headers_1, key, value);
});
}
if (debugRequest_1) {
debugRequest_1.mimeType = response.MIMEType;
debugRequest_1.data = data;
var debugResponse = {
url: options.url,
status: response.statusCode,
statusText: NSHTTPURLResponse.localizedStringForStatusCode(response.statusCode),
headers: headers_1,
mimeType: response.MIMEType,
fromDiskCache: false
};
debugRequest_1.responseReceived(debugResponse);
debugRequest_1.loadingFinished();
}
resolve({
content: {
raw: data,
toString: function (encoding) { return NSDataToString(data, encoding); },
toJSON: function (encoding) { return parseJSON(NSDataToString(data, encoding)); },
toImage: function () {
ensureImageSource();
return new Promise(function (resolve, reject) {
UIImage.tns_decodeImageWithDataCompletion(data, function (image) {
if (image) {
resolve(imageSource.fromNativeSource(image));
}
else {
reject(new Error("Response content may not be converted to an Image"));
}
});
});
},
toFile: function (destinationFilePath) {
ensureFileSystem();
if (!destinationFilePath) {
destinationFilePath = http_request_common_1.getFilenameFromUrl(options.url);
}
if (data instanceof NSData) {
var file = fs.File.fromPath(destinationFilePath);
data.writeToFileAtomically(destinationFilePath, true);
return file;
}
else {
reject(new Error("Cannot save file with path: " + destinationFilePath + "."));
}
}
},
statusCode: response.statusCode,
headers: headers_1
});
}
});
if (options.url && debugRequest_1) {
var request_1 = {
url: options.url,
method: "GET",
headers: options.headers
};
debugRequest_1.requestWillBeSent(request_1);
}
dataTask.resume();
}
catch (ex) {
reject(ex);
}
});
}
exports.request = request;
function NSDataToString(data, encoding) {
var code = 4;
if (encoding === HttpResponseEncoding.GBK) {
code = 1586;
}
return NSString.alloc().initWithDataEncoding(data, code).toString();
}
function addHeader(headers, key, value) {
if (!headers[key]) {
headers[key] = value;
}
else if (Array.isArray(headers[key])) {
headers[key].push(value);
}
else {
var values = [headers[key]];
values.push(value);
headers[key] = values;
}
}
exports.addHeader = addHeader;
//# sourceMappingURL=http-request.ios.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/http/http.js":
/***/ (function(module, exports, __webpack_require__) {
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
Object.defineProperty(exports, "__esModule", { value: true });
var httpRequest = __webpack_require__("../node_modules/tns-core-modules/http/http-request/http-request.js");
__export(__webpack_require__("../node_modules/tns-core-modules/http/http-request/http-request.js"));
function getString(arg) {
return new Promise(function (resolve, reject) {
httpRequest.request(typeof arg === "string" ? { url: arg, method: "GET" } : arg)
.then(function (r) {
try {
var str = r.content.toString();
resolve(str);
}
catch (e) {
reject(e);
}
}, function (e) { return reject(e); });
});
}
exports.getString = getString;
function getJSON(arg) {
return new Promise(function (resolve, reject) {
httpRequest.request(typeof arg === "string" ? { url: arg, method: "GET" } : arg)
.then(function (r) {
try {
var json = r.content.toJSON();
resolve(json);
}
catch (e) {
reject(e);
}
}, function (e) { return reject(e); });
});
}
exports.getJSON = getJSON;
function getImage(arg) {
return new Promise(function (resolve, reject) {
httpRequest.request(typeof arg === "string" ? { url: arg, method: "GET" } : arg)
.then(function (r) {
try {
resolve(r.content.toImage());
}
catch (err) {
reject(err);
}
}, function (err) {
reject(err);
});
});
}
exports.getImage = getImage;
function getFile(arg, destinationFilePath) {
return new Promise(function (resolve, reject) {
httpRequest.request(typeof arg === "string" ? { url: arg, method: "GET" } : arg)
.then(function (r) {
try {
var file = r.content.toFile(destinationFilePath);
resolve(file);
}
catch (e) {
reject(e);
}
}, function (e) { return reject(e); });
});
}
exports.getFile = getFile;
//# sourceMappingURL=http.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/image-asset/image-asset-common.js":
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", { value: true });
var observable = __webpack_require__("../node_modules/tns-core-modules/data/observable/observable.js");
var platform = __webpack_require__("../node_modules/tns-core-modules/platform/platform.js");
var ImageAsset = (function (_super) {
__extends(ImageAsset, _super);
function ImageAsset() {
var _this = _super.call(this) || this;
_this._options = { keepAspectRatio: true, autoScaleFactor: true };
return _this;
}
Object.defineProperty(ImageAsset.prototype, "options", {
get: function () {
return this._options;
},
set: function (value) {
this._options = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ImageAsset.prototype, "nativeImage", {
get: function () {
return this._nativeImage;
},
set: function (value) {
this._nativeImage = value;
},
enumerable: true,
configurable: true
});
ImageAsset.prototype.getImageAsync = function (callback) {
};
return ImageAsset;
}(observable.Observable));
exports.ImageAsset = ImageAsset;
function getAspectSafeDimensions(sourceWidth, sourceHeight, reqWidth, reqHeight) {
var widthCoef = sourceWidth / reqWidth;
var heightCoef = sourceHeight / reqHeight;
var aspectCoef = Math.min(widthCoef, heightCoef);
return {
width: Math.floor(sourceWidth / aspectCoef),
height: Math.floor(sourceHeight / aspectCoef)
};
}
exports.getAspectSafeDimensions = getAspectSafeDimensions;
function getRequestedImageSize(src, options) {
var screen = platform.screen.mainScreen;
var reqWidth = options.width || Math.min(src.width, screen.widthPixels);
var reqHeight = options.height || Math.min(src.height, screen.heightPixels);
if (options && options.keepAspectRatio) {
var safeAspectSize = getAspectSafeDimensions(src.width, src.height, reqWidth, reqHeight);
reqWidth = safeAspectSize.width;
reqHeight = safeAspectSize.height;
}
return {
width: reqWidth,
height: reqHeight
};
}
exports.getRequestedImageSize = getRequestedImageSize;
//# sourceMappingURL=image-asset-common.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/image-asset/image-asset.js":
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global) {Object.defineProperty(exports, "__esModule", { value: true });
var common = __webpack_require__("../node_modules/tns-core-modules/image-asset/image-asset-common.js");
var file_system_1 = __webpack_require__("../node_modules/tns-core-modules/file-system/file-system.js");
global.moduleMerge(common, exports);
var ImageAsset = (function (_super) {
__extends(ImageAsset, _super);
function ImageAsset(asset) {
var _this = _super.call(this) || this;
if (typeof asset === "string") {
if (asset.indexOf("~/") === 0) {
asset = file_system_1.path.join(file_system_1.knownFolders.currentApp().path, asset.replace("~/", ""));
}
_this.nativeImage = UIImage.imageWithContentsOfFile(asset);
}
else if (asset instanceof UIImage) {
_this.nativeImage = asset;
}
else {
_this.ios = asset;
}
return _this;
}
Object.defineProperty(ImageAsset.prototype, "ios", {
get: function () {
return this._ios;
},
set: function (value) {
this._ios = value;
},
enumerable: true,
configurable: true
});
ImageAsset.prototype.getImageAsync = function (callback) {
var _this = this;
if (!this.ios && !this.nativeImage) {
callback(null, "Asset cannot be found.");
}
var srcWidth = this.nativeImage ? this.nativeImage.size.width : this.ios.pixelWidth;
var srcHeight = this.nativeImage ? this.nativeImage.size.height : this.ios.pixelHeight;
var requestedSize = common.getRequestedImageSize({ width: srcWidth, height: srcHeight }, this.options);
if (this.nativeImage) {
var newSize = CGSizeMake(requestedSize.width, requestedSize.height);
var resizedImage = this.scaleImage(this.nativeImage, newSize);
callback(resizedImage, null);
return;
}
var imageRequestOptions = PHImageRequestOptions.alloc().init();
imageRequestOptions.deliveryMode = 1;
imageRequestOptions.networkAccessAllowed = true;
PHImageManager.defaultManager().requestImageForAssetTargetSizeContentModeOptionsResultHandler(this.ios, requestedSize, 0, imageRequestOptions, function (image, imageResultInfo) {
if (image) {
var resultImage = _this.scaleImage(image, requestedSize);
callback(resultImage, null);
}
else {
callback(null, imageResultInfo.valueForKey(PHImageErrorKey));
}
});
};
ImageAsset.prototype.scaleImage = function (image, requestedSize) {
var scaleFactor = this.options && this.options.autoScaleFactor === false ? 1.0 : 0.0;
UIGraphicsBeginImageContextWithOptions(requestedSize, false, scaleFactor);
image.drawInRect(CGRectMake(0, 0, requestedSize.width, requestedSize.height));
var resultImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return resultImage;
};
return ImageAsset;
}(common.ImageAsset));
exports.ImageAsset = ImageAsset;
//# sourceMappingURL=image-asset.ios.js.map
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("../node_modules/webpack/buildin/global.js")))
/***/ }),
/***/ "../node_modules/tns-core-modules/image-source/image-source.js":
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", { value: true });
var file_system_1 = __webpack_require__("../node_modules/tns-core-modules/file-system/file-system.js");
var utils_1 = __webpack_require__("../node_modules/tns-core-modules/utils/utils.js");
exports.isFileOrResourcePath = utils_1.isFileOrResourcePath;
var http;
function ensureHttp() {
if (!http) {
http = __webpack_require__("../node_modules/tns-core-modules/http/http.js");
}
}
var ImageSource = (function () {
function ImageSource() {
}
ImageSource.prototype.fromAsset = function (asset) {
return new Promise(function (resolve, reject) {
asset.getImageAsync(function (image, err) {
if (image) {
resolve(fromNativeSource(image));
}
else {
reject(err);
}
});
});
};
ImageSource.prototype.loadFromResource = function (name) {
this.ios = UIImage.tns_safeImageNamed(name) || UIImage.tns_safeImageNamed(name + ".jpg");
return this.ios != null;
};
ImageSource.prototype.fromResource = function (name) {
var _this = this;
return new Promise(function (resolve, reject) {
try {
UIImage.tns_safeDecodeImageNamedCompletion(name, function (image) {
if (image) {
_this.ios = image;
resolve(true);
}
else {
UIImage.tns_safeDecodeImageNamedCompletion(name + ".jpg", function (image) {
_this.ios = image;
resolve(true);
});
}
});
}
catch (ex) {
reject(ex);
}
});
};
ImageSource.prototype.loadFromFile = function (path) {
this.ios = UIImage.imageWithContentsOfFile(getFileName(path));
return this.ios != null;
};
ImageSource.prototype.fromFile = function (path) {
var _this = this;
return new Promise(function (resolve, reject) {
try {
UIImage.tns_decodeImageWidthContentsOfFileCompletion(getFileName(path), function (image) {
_this.ios = image;
resolve(true);
});
}
catch (ex) {
reject(ex);
}
});
};
ImageSource.prototype.loadFromData = function (data) {
this.ios = UIImage.imageWithData(data);
return this.ios != null;
};
ImageSource.prototype.fromData = function (data) {
var _this = this;
return new Promise(function (resolve, reject) {
try {
UIImage.tns_decodeImageWithDataCompletion(data, function (image) {
_this.ios = image;
resolve(true);
});
}
catch (ex) {
reject(ex);
}
});
};
ImageSource.prototype.loadFromBase64 = function (source) {
if (typeof source === "string") {
var data = NSData.alloc().initWithBase64EncodedStringOptions(source, 1);
this.ios = UIImage.imageWithData(data);
}
return this.ios != null;
};
ImageSource.prototype.fromBase64 = function (source) {
var _this = this;
return new Promise(function (resolve, reject) {
try {
var data = NSData.alloc().initWithBase64EncodedStringOptions(source, 1);
UIImage.imageWithData["async"](UIImage, [data]).then(function (image) {
_this.ios = image;
resolve(true);
});
}
catch (ex) {
reject(ex);
}
});
};
ImageSource.prototype.setNativeSource = function (source) {
if (source && !(source instanceof UIImage)) {
throw new Error("The method setNativeSource() expects UIImage instance.");
}
this.ios = source;
};
ImageSource.prototype.saveToFile = function (path, format, quality) {
if (!this.ios) {
return false;
}
if (quality) {
quality = (quality - 0) / (100 - 0);
}
var data = getImageData(this.ios, format, quality);
if (data) {
return NSFileManager.defaultManager.createFileAtPathContentsAttributes(path, data, null);
}
return false;
};
ImageSource.prototype.toBase64String = function (format, quality) {
var res = null;
if (!this.ios) {
return res;
}
if (quality) {
quality = (quality - 0) / (100 - 0);
}
var data = getImageData(this.ios, format, quality);
if (data) {
res = data.base64Encoding();
}
return res;
};
Object.defineProperty(ImageSource.prototype, "height", {
get: function () {
if (this.ios) {
return this.ios.size.height;
}
return NaN;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ImageSource.prototype, "width", {
get: function () {
if (this.ios) {
return this.ios.size.width;
}
return NaN;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ImageSource.prototype, "rotationAngle", {
get: function () {
return NaN;
},
enumerable: true,
configurable: true
});
return ImageSource;
}());
exports.ImageSource = ImageSource;
function getFileName(path) {
var fileName = typeof path === "string" ? path.trim() : "";
if (fileName.indexOf("~/") === 0) {
fileName = file_system_1.path.join(file_system_1.knownFolders.currentApp().path, fileName.replace("~/", ""));
}
return fileName;
}
function getImageData(instance, format, quality) {
if (quality === void 0) { quality = 0.9; }
var data = null;
switch (format) {
case "png":
data = UIImagePNGRepresentation(instance);
break;
case "jpeg":
case "jpg":
data = UIImageJPEGRepresentation(instance, quality);
break;
}
return data;
}
function fromAsset(asset) {
var image = new ImageSource();
return image.fromAsset(asset);
}
exports.fromAsset = fromAsset;
function fromResource(name) {
var image = new ImageSource();
return image.loadFromResource(name) ? image : null;
}
exports.fromResource = fromResource;
function fromFile(path) {
var image = new ImageSource();
return image.loadFromFile(path) ? image : null;
}
exports.fromFile = fromFile;
function fromData(data) {
var image = new ImageSource();
return image.loadFromData(data) ? image : null;
}
exports.fromData = fromData;
function fromBase64(source) {
var image = new ImageSource();
return image.loadFromBase64(source) ? image : null;
}
exports.fromBase64 = fromBase64;
function fromNativeSource(source) {
var imageSource = new ImageSource();
imageSource.setNativeSource(source);
return imageSource;
}
exports.fromNativeSource = fromNativeSource;
function fromUrl(url) {
console.log("imageSource.fromUrl(url) is deprecated; use http.getImage(url) instead");
ensureHttp();
return http.getImage(url);
}
exports.fromUrl = fromUrl;
function fromFileOrResource(path) {
if (!utils_1.isFileOrResourcePath(path)) {
throw new Error("Path \"" + "\" is not a valid file or resource.");
}
if (path.indexOf(utils_1.RESOURCE_PREFIX) === 0) {
return fromResource(path.substr(utils_1.RESOURCE_PREFIX.length));
}
return fromFile(path);
}
exports.fromFileOrResource = fromFileOrResource;
//# sourceMappingURL=image-source.ios.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/inspector_modules.js":
/***/ (function(module, exports, __webpack_require__) {
console.log("Loading inspector modules...");
__webpack_require__("../node_modules/tns-core-modules/globals/ts-helpers.js");
__webpack_require__("../node_modules/tns-core-modules/debugger/webinspector-network.js");
__webpack_require__("../node_modules/tns-core-modules/debugger/webinspector-dom.js");
__webpack_require__("../node_modules/tns-core-modules/debugger/webinspector-css.js");
console.log("Finished loading inspector modules.");
//# sourceMappingURL=inspector_modules.ios.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/js-libs/easysax/easysax.js":
/***/ (function(module, exports, __webpack_require__) {
 /*
new function() {
var parser = new EasySAXParser();
parser.ns('rss', { // or false
rss: 'http://purl.org/rss/1.0/',
atom: 'http://www.w3.org/2005/Atom',
xhtml: 'http://www.w3.org/1999/xhtml',
media: 'http://search.yahoo.com/mrss/'
});
parser.on('error', function(msg) {
//console.log(msg)
});
parser.on('startNode', function(elem, attr, uq, tagend, getStrNode) {
attr();
return;
if (tagend) {
console.log(' '+str)
} else {
console.log('+ '+str)
};
});
parser.on('endNode', function(elem, uq, tagstart, str) {
return;
if (!tagstart) console.log('- ' + str)
});
parser.on('textNode', function(s, uq) {
uq(s);
return
console.log(' '+s)
});
parser.on('cdata', function(data) {
});
parser.on('comment', function(text) {
//console.log('--'+text+'--')
});
//parser.on('question', function() {}); // <? ... ?>
//parser.on('attention', function() {}); // <!XXXXX zzzz="eeee">
console.time('easysax');
for(var z=1000;z--;) {
parser.parse(xml)
};
console.timeEnd('easysax');
};
*/
// << ------------------------------------------------------------------------ >> //
if (true /*&& this == exports*/) {
module.exports.EasySAXParser = EasySAXParser;
};
function EasySAXParser() {
'use strict';
if (!this) return null;
this.angularSyntax = false;
function nullFunc() {};
this.onTextNode = nullFunc;
this.onStartNode = nullFunc;
this.onEndNode = nullFunc;
this.onCDATA = nullFunc;
this.onError = nullFunc;
this.onComment = null;
this.onQuestion = null;
this.onAttention = null;
this.is_onComment = this.is_onQuestion = this.is_onAttention = false;
this.isNamespace = false;
this.useNS = null;
this.default_xmlns = null;
this.xmlns = null;
this.nsmatrix = {xmlns: this.xmlns};
this.hasSurmiseNS = false;
;
this.attr_string = ''; // строка атрибутов
this.attr_posstart = 0; //
this.attr_res; // закешированный результат разбора атрибутов , null - разбор не проводился, object - хеш атрибутов, true - нет атрибутов, false - невалидный xml
}
EasySAXParser.prototype.on = function(name, cb) {
if (typeof cb !== 'function') {
if (cb !== null) return;
};
switch(name) {
case 'error': this.onError = cb || nullFunc; break;
case 'startNode': this.onStartNode = cb || nullFunc; break;
case 'endNode': this.onEndNode = cb || nullFunc; break;
case 'textNode': this.onTextNode = cb || nullFunc; break;
case 'cdata': this.onCDATA = cb || nullFunc; break;
case 'comment': this.onComment = cb; this.is_onComment = !!cb; break;
case 'question': this.onQuestion = cb; this.is_onQuestion = !!cb; break; // <? .... ?>
case 'attention': this.onAttention = cb; this.is_onAttention = !!cb; break; // <!XXXXX zzzz="eeee">
};
};
EasySAXParser.prototype.ns = function(root, ns) {
if (!root || typeof root !== 'string' || !ns) {
return;
};
var u, x = {}, ok, v, i;
for(i in ns) {
v = ns[i];
if (typeof v === 'string') {
if (root === v) ok = true;
x[i] = v;
};
};
if (ok) {
this.isNamespace = true;
this.default_xmlns = root;
this.useNS = x;
};
};
EasySAXParser.prototype.parse = function(xml) {
if (typeof xml !== 'string') {
return;
};
if (this.isNamespace) {
this.nsmatrix = {xmlns: this.default_xmlns};
parse(xml);
this.nsmatrix = false;
} else {
parse(xml);
};
this.attr_res = true;
};
// -----------------------------------------------------
var xharsQuot={constructor: false, hasOwnProperty: false, isPrototypeOf: false, propertyIsEnumerable: false, toLocaleString: false, toString: false, valueOf: false
, quot: '"'
, QUOT: '"'
, amp: '&'
, AMP: '&'
, nbsp: '\u00A0'
, apos: '\''
, lt: '<'
, LT: '<'
, gt: '>'
, GT: '>'
, copy: '\u00A9'
, laquo: '\u00AB'
, raquo: '\u00BB'
, reg: '\u00AE'
, deg: '\u00B0'
, plusmn: '\u00B1'
, sup2: '\u00B2'
, sup3: '\u00B3'
, micro: '\u00B5'
, para: '\u00B6'
};
function rpEntities(s, d, x, z) {
if (z) {
return xharsQuot[z] || '\x01';
};
if (d) {
return String.fromCharCode(d);
};
return String.fromCharCode(parseInt(x, 16));
};
function unEntities(s, i) {
s = String(s);
if (s.length > 3 && s.indexOf('&') !== -1) {
if (s.indexOf('&gt;') !== -1) s = s.replace(/&gt;/g, '>');
if (s.indexOf('&lt;') !== -1) s = s.replace(/&lt;/g, '<');
if (s.indexOf('&quot;') !== -1) s = s.replace(/&quot;/g, '"');
if (s.indexOf('&') !== -1) {
s = s.replace(/&#(\d+);|&#x([0123456789abcdef]+);|&(\w+);/ig, rpEntities);
};
};
return s;
};
EasySAXParser.prototype.allowedAngularAttributeChars = function(w) {
if (!this.angularSyntax) {
return false;
} else {
return (
w === 40 || // (
w === 41 || // )
w === 91 || // [
w === 93 || // ]
w === 94 || // ^
w === 35 // #
);
}
};
/*
парсит атрибуты по требованию. Важно! - функция не генерирует исключения.
если была ошибка разбора возврашается false
если атрибутов нет и разбор удачен то возврашается true
если есть атрибуты то возврашается обьект(хеш)
*/
EasySAXParser.prototype.getAttrs = function() {
if (this.attr_res !== null) {
return this.attr_res;
};
/*
if (xxtest !== u && attr_string.indexOf(xxtest) === -1) {
/ *
// для ускорения
if (getAttrs('html').type == 'html') {
...
};
* /
return true;
};
*/
var u
, res = {}
, s = this.attr_string
, i = this.attr_posstart
, l = s.length
, attr_list = this.hasSurmiseNS ? [] : false
, name, value = ''
, ok = false
, noValueAttribute = false
, j, w, nn, n
, hasNewMatrix
, alias, newalias
;
aa:
for(; i < l; i++) {
w = s.charCodeAt(i);
if (w===32 || (w<14 && w > 8) ) { // \f\n\r\t\v
continue
};
// Check for valid attribute start char
if ((w < 65 && !this.allowedAngularAttributeChars(w)) ||
w > 122 || (w > 90 && w < 97 && !this.allowedAngularAttributeChars(w)) ) { // ожидаем символ
return this.attr_res = false; // error. invalid char
};
for(j = i + 1; j < l; j++) { // проверяем все символы имени атрибута
w = s.charCodeAt(j);
if (w > 96 && w < 123 || w > 64 && w < 91 || w > 47 && w < 59 || w === 45 || w === 95 || w === 46 /* https://github.com/telerik/xPlatCore/issues/179 */) {
if (noValueAttribute) {
j--; //Started next attribute. Get back and break out of the loop.
break;
} else {
continue;
}
};
if (this.allowedAngularAttributeChars(w)) {
continue;
}
if (w === 32 || (w > 8 && w < 14) ) { // \f\n\r\t\v пробел
noValueAttribute = true;
continue;
} else if (w === 61) { // "=" == 61
noValueAttribute = false;
break;
} else {
//console.log('error 2');
if (!noValueAttribute)
return this.attr_res = false; // error. invalid char
};
break;
};
name = s.substring(i, j).trim();
ok = true;
if (name === 'xmlns:xmlns') {
//console.log('error 6')
return this.attr_res = false; // error. invalid name
};
w = s.charCodeAt(j+1);
while (w = s.charCodeAt(j+1)) {
if (w===32 || (w > 8 && w<14) ) { // \f\n\r\t\v пробел
j++;
} else {
break;
}
}
if (!noValueAttribute) {
if (w === 34) { // '"'
j = s.indexOf('"', i = j+2 );
} else {
if (w === 39) {
j = s.indexOf('\'', i = j+2 );
} else { // "'"
return this.attr_res = false; // error. invalid char
};
};
}
if (j === -1) {
//console.log('error 4')
return this.attr_res = false; // error. invalid char
};
if (j+1 < l && !noValueAttribute) {
w = s.charCodeAt(j+1);
if (w > 32 || w < 9 || (w < 32 && w > 13)) {
// error. invalid char
//console.log('error 5')
return this.attr_res = false;
};
};
if (noValueAttribute) {
value = '';
} else {
value = s.substring(i, j);
}
//i = j + 1; // след. семвол уже проверен потому проверять нужно следуюший
i = j; // след. семвол уже проверен потому проверять нужно следуюший
if (this.isNamespace) { //
if (this.hasSurmiseNS) {
// есть подозрение что в атрибутах присутствует xmlns
if (newalias = name === 'xmlns' ? 'xmlns' : name.charCodeAt(0) === 120 && name.substr(0, 6) === 'xmlns:' && name.substr(6) ) {
alias = this.useNS[unEntities(value)];
if (alias) {
if (this.nsmatrix[newalias] !== alias) {
if (!hasNewMatrix) {
hasNewMatrix = true;
nn = {}; for (n in this.nsmatrix) nn[n] = this.nsmatrix[n];
this.nsmatrix = nn;
};
this.nsmatrix[newalias] = alias;
};
} else {
if (this.nsmatrix[newalias]) {
if (!hasNewMatrix) {
hasNewMatrix = true;
nn = {}; for (n in this.nsmatrix) nn[n] = this.nsmatrix[n];
this.nsmatrix = nn;
};
this.nsmatrix[newalias] = false;
};
};
res[name] = value;
continue;
};
attr_list.push(name, value);
continue;
};
w = name.length;
while(--w) {
if (name.charCodeAt(w) === 58) { // ':'
if (w = this.nsmatrix[name.substring(0, w)] ) {
res[w + name.substr(w)] = value;
};
continue aa;
// 'xml:base' ???
};
};
};
res[name] = value;
noValueAttribute = false;
};
if (!ok) {
return this.attr_res = true; // атрибутов нет, ошибок тоже нет
};
if (this.hasSurmiseNS) {
bb:
for (i = 0, l = attr_list.length; i < l; i++) {
name = attr_list[i++];
w = name.length;
while(--w) { // name.indexOf(':')
if (name.charCodeAt(w) === 58) { // ':'
if (w = this.nsmatrix[name.substring(0, w)]) {
res[w + name.substr(w)] = attr_list[i];
};
continue bb;
break;
};
};
res[name] = attr_list[i];
};
};
return this.attr_res = res;
};
// xml - string
EasySAXParser.prototype.parse = function(xml) {
var u
, xml = String(xml)
, nodestack = []
, stacknsmatrix = []
//, string_node
, elem
, tagend = false
, tagstart = false
, j = 0, i = 0, k = 0, len
, x, y, q, w
, xmlns
, stopIndex = 0
, stop // используется при разборе "namespace" . если встретился неизвестное пространство то события не генерируются
, _nsmatrix
, ok
, pos = 0, ln = 0, lnStart = -2, lnEnd = -1
;
len = xml.length;
function getStringNode() {
return xml.substring(i, j+1)
};
function findLineAndColumnFromPos() {
while (lnStart < lnEnd && lnEnd < pos) {
lnStart = lnEnd;
lnEnd = xml.indexOf("\n", lnEnd + 1);
++ln;
}
return { line: ln, column: pos - lnStart };
}
function position(p) {
pos = p;
return findLineAndColumnFromPos;
}
while(j !== -1) {
stop = stopIndex > 0;
if (xml.charCodeAt(j) === 60) { // "<"
i = j;
} else {
i = xml.indexOf('<', j);
};
if (i === -1) { // конец разбора
if (nodestack.length) {
this.onError('end file', position(j));
return;
};
return;
};
if (j !== i && !stop) {
ok = this.onTextNode(xml.substring(j, i), unEntities, position(j));
if (ok === false) return;
};
w = xml.charCodeAt(i+1);
if (w === 33) { // "!"
w = xml.charCodeAt(i+2);
if (w === 91 && xml.substr(i+3, 6) === 'CDATA[') { // 91 == "["
j = xml.indexOf(']]>', i);
if (j === -1) {
this.onError('cdata', position(i));
return;
};
//x = xml.substring(i+9, j);
if (!stop) {
ok = this.onCDATA(xml.substring(i+9, j), false, position(i));
if (ok === false) return;
};
j += 3;
continue;
};
if (w === 45 && xml.charCodeAt(i+3) === 45) { // 45 == "-"
j = xml.indexOf('-->', i);
if (j === -1) {
this.onError('expected -->', position(i));
return;
};
if (this.is_onComment && !stop) {
ok = this.onComment(xml.substring(i+4, j), unEntities, position(i));
if (ok === false) return;
};
j += 3;
continue;
};
j = xml.indexOf('>', i+1);
if (j === -1) {
this.onError('expected ">"', position(i + 1));
return;
};
if (this.is_onAttention && !stop) {
ok = this.onAttention(xml.substring(i, j+1), unEntities, position(i));
if (ok === false) return;
};
j += 1;
continue;
} else {
if (w === 63) { // "?"
j = xml.indexOf('?>', i);
if (j === -1) { // error
this.onError('...?>', position(i));
return;
};
if (this.is_onQuestion) {
ok = this.onQuestion(xml.substring(i, j+2), position(i));
if (ok === false) return;
};
j += 2;
continue;
};
};
var inside=false;
for (k=i,j=-1;k<len;k++) {
var c = xml.charCodeAt(k);
if (!inside) {
if (c === 34) { // '"'
inside = c;
}
else if (c === 39) { // "'"
inside = c;
}
else if (c === 62) { // <
j = k; break;
}
} else {
if (c === inside) { inside = false; }
}
}
if (j == -1) { // error
this.onError('...>', position(i + 1));
return;
};
this.attr_res = true; // атрибутов нет
//if (xml.charCodeAt(i+1) === 47) { // </...
if (w === 47) { // </...
tagstart = false;
tagend = true;
// проверяем что должен быть закрыт тотже тег что и открывался
x = elem = nodestack.pop();
q = i + 2 + x.length;
//console.log()
if (xml.substring(i+2, q) !== x) {
this.onError('close tagname', position(i + 2));
return;
};
// проверим что в закрываюшем теге нет лишнего
for(; q < j; q++) {
w = xml.charCodeAt(q);
if (w===32 || (w > 8 && w<14) ) { // \f\n\r\t\v пробел
continue;
};
this.onError('close tag', position(i + 2));
return;
};
} else {
if (xml.charCodeAt(j-1) === 47) { // .../>
x = elem = xml.substring(i+1, j-1);
tagstart = true;
tagend = true;
} else {
x = elem = xml.substring(i+1, j);
tagstart = true;
tagend = false;
};
if ( !(w > 96 && w < 123 || w > 64 && w <91) ) {
this.onError('first char nodeName', position(i + 1));
return;
};
for(q = 1, y = x.length; q < y; q++) {
w = x.charCodeAt(q);
if (w > 96 && w < 123 || w > 64 && w < 91 || w > 47 && w < 59 || w === 45 || w === 95 || w === 46 /* https://github.com/telerik/xPlatCore/issues/179 */) {
continue;
};
if (w===32 || (w<14 && w > 8)) { // \f\n\r\t\v пробел
elem = x.substring(0, q)
this.attr_res = null; // возможно есть атирибуты
break;
};
this.onError('invalid nodeName', position(i + 1));
return;
};
if (!tagend) {
nodestack.push(elem);
};
};
if (this.isNamespace) {
if (stop) {
if (tagend) {
if (!tagstart) {
if (--stopIndex === 0) {
this.nsmatrix = stacknsmatrix.pop();
};
};
} else {
stopIndex += 1;
};
j += 1;
continue;
};
_nsmatrix = this.nsmatrix;
if (!tagend) {
stacknsmatrix.push(this.nsmatrix);
if (this.attr_res !== true) {
if (this.hasSurmiseNS = x.indexOf('xmlns', q) !== -1) {
this.attr_string = x;
this.attr_posstart = q;
this.getAttrs();
this.hasSurmiseNS = false;
};
};
};
w = elem.indexOf(':');
if (w !== -1) {
xmlns = this.nsmatrix[elem.substring(0, w)];
elem = elem.substr(w+1);
} else {
xmlns = this.nsmatrix.xmlns;
};
if (!xmlns) {
if (tagend) {
if (tagstart) {
this.nsmatrix = _nsmatrix;
} else {
this.nsmatrix = stacknsmatrix.pop();
};
} else {
stopIndex = 1; // первый элемент для которого не определено пространство имен
this.attr_res = true;
};
j += 1;
continue;
};
elem = xmlns + ':' + elem;
};
//string_node = xml.substring(i, j+1); // текст ноды как есть
if (tagstart) { // is_onStartNode
this.attr_string = x;
this.attr_posstart = q;
var that = this;
ok = this.onStartNode(elem, function() { return that.getAttrs() }, unEntities, tagend
, getStringNode, position(i)
);
if (ok === false) {
return;
};
this.attr_res = true;
};
if (tagend) {
ok = this.onEndNode(elem, unEntities, tagstart
, getStringNode, position(i)
);
if (ok === false) {
return;
};
if (this.isNamespace) {
if (tagstart) {
this.nsmatrix = _nsmatrix;
} else {
this.nsmatrix = stacknsmatrix.pop();
};
};
};
j += 1;
};
};
/***/ }),
/***/ "../node_modules/tns-core-modules/js-libs/esprima/esprima.js":
/***/ (function(module, exports) {
/*
Copyright (C) 2013 Ariya Hidayat <ariya.hidayat@gmail.com>
Copyright (C) 2013 Thaddee Tyl <thaddee.tyl@gmail.com>
Copyright (C) 2012 Ariya Hidayat <ariya.hidayat@gmail.com>
Copyright (C) 2012 Mathias Bynens <mathias@qiwi.be>
Copyright (C) 2012 Joost-Wim Boekesteijn <joost-wim@boekesteijn.nl>
Copyright (C) 2012 Kris Kowal <kris.kowal@cixar.com>
Copyright (C) 2012 Yusuke Suzuki <utatane.tea@gmail.com>
Copyright (C) 2012 Arpad Borsos <arpad.borsos@googlemail.com>
Copyright (C) 2011 Ariya Hidayat <ariya.hidayat@gmail.com>
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
(function (global) {
'use strict';
var Token,
TokenName,
Syntax,
Messages,
source,
index,
length,
delegate,
lookahead,
state;
Token = {
BooleanLiteral: 1,
EOF: 2,
Identifier: 3,
Keyword: 4,
NullLiteral: 5,
NumericLiteral: 6,
Punctuator: 7,
StringLiteral: 8
};
TokenName = {};
TokenName[Token.BooleanLiteral] = 'Boolean';
TokenName[Token.EOF] = '<end>';
TokenName[Token.Identifier] = 'Identifier';
TokenName[Token.Keyword] = 'Keyword';
TokenName[Token.NullLiteral] = 'Null';
TokenName[Token.NumericLiteral] = 'Numeric';
TokenName[Token.Punctuator] = 'Punctuator';
TokenName[Token.StringLiteral] = 'String';
Syntax = {
ArrayExpression: 'ArrayExpression',
BinaryExpression: 'BinaryExpression',
CallExpression: 'CallExpression',
ConditionalExpression: 'ConditionalExpression',
EmptyStatement: 'EmptyStatement',
ExpressionStatement: 'ExpressionStatement',
Identifier: 'Identifier',
Literal: 'Literal',
LabeledStatement: 'LabeledStatement',
LogicalExpression: 'LogicalExpression',
MemberExpression: 'MemberExpression',
ObjectExpression: 'ObjectExpression',
Program: 'Program',
Property: 'Property',
ThisExpression: 'ThisExpression',
UnaryExpression: 'UnaryExpression'
};
// Error messages should be identical to V8.
Messages = {
UnexpectedToken: 'Unexpected token %0',
UnknownLabel: 'Undefined label \'%0\'',
Redeclaration: '%0 \'%1\' has already been declared'
};
// Ensure the condition is true, otherwise throw an error.
// This is only to have a better contract semantic, i.e. another safety net
// to catch a logic error. The condition shall be fulfilled in normal case.
// Do NOT use this to enforce a certain condition on any user input.
function assert(condition, message) {
if (!condition) {
throw new Error('ASSERT: ' + message);
}
}
function isDecimalDigit(ch) {
return (ch >= 48 && ch <= 57); // 0..9
}
// 7.2 White Space
function isWhiteSpace(ch) {
return (ch === 32) || // space
(ch === 9) || // tab
(ch === 0xB) ||
(ch === 0xC) ||
(ch === 0xA0) ||
(ch >= 0x1680 && '\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\uFEFF'.indexOf(String.fromCharCode(ch)) > 0);
}
// 7.3 Line Terminators
function isLineTerminator(ch) {
return (ch === 10) || (ch === 13) || (ch === 0x2028) || (ch === 0x2029);
}
// 7.6 Identifier Names and Identifiers
function isIdentifierStart(ch) {
return (ch === 36) || (ch === 95) || // $ (dollar) and _ (underscore)
(ch >= 65 && ch <= 90) || // A..Z
(ch >= 97 && ch <= 122); // a..z
}
function isIdentifierPart(ch) {
return (ch === 36) || (ch === 95) || // $ (dollar) and _ (underscore)
(ch >= 65 && ch <= 90) || // A..Z
(ch >= 97 && ch <= 122) || // a..z
(ch >= 48 && ch <= 57); // 0..9
}
// 7.6.1.1 Keywords
function isKeyword(id) {
return (id === 'this')
}
// 7.4 Comments
function skipWhitespace() {
while (index < length && isWhiteSpace(source.charCodeAt(index))) {
++index;
}
}
function getIdentifier() {
var start, ch;
start = index++;
while (index < length) {
ch = source.charCodeAt(index);
if (isIdentifierPart(ch)) {
++index;
} else {
break;
}
}
return source.slice(start, index);
}
function scanIdentifier() {
var start, id, type;
start = index;
id = getIdentifier();
// There is no keyword or literal with only one character.
// Thus, it must be an identifier.
if (id.length === 1) {
type = Token.Identifier;
} else if (isKeyword(id)) {
type = Token.Keyword;
} else if (id === 'null') {
type = Token.NullLiteral;
} else if (id === 'true' || id === 'false') {
type = Token.BooleanLiteral;
} else {
type = Token.Identifier;
}
return {
type: type,
value: id,
range: [start, index]
};
}
// 7.7 Punctuators
function scanPunctuator() {
var start = index,
code = source.charCodeAt(index),
code2,
ch1 = source[index],
ch2;
switch (code) {
// Check for most common single-character punctuators.
case 46: // . dot
case 40: // ( open bracket
case 41: // ) close bracket
case 59: // ; semicolon
case 44: // , comma
case 123: // { open curly brace
case 125: // } close curly brace
case 91: // [
case 93: // ]
case 58: // :
case 63: // ?
++index;
return {
type: Token.Punctuator,
value: String.fromCharCode(code),
range: [start, index]
};
default:
code2 = source.charCodeAt(index + 1);
// '=' (char #61) marks an assignment or comparison operator.
if (code2 === 61) {
switch (code) {
case 37: // %
case 38: // &
case 42: // *:
case 43: // +
case 45: // -
case 47: // /
case 60: // <
case 62: // >
case 124: // |
index += 2;
return {
type: Token.Punctuator,
value: String.fromCharCode(code) + String.fromCharCode(code2),
range: [start, index]
};
case 33: // !
case 61: // =
index += 2;
// !== and ===
if (source.charCodeAt(index) === 61) {
++index;
}
return {
type: Token.Punctuator,
value: source.slice(start, index),
range: [start, index]
};
default:
break;
}
}
break;
}
// Peek more characters.
ch2 = source[index + 1];
// Other 2-character punctuators: && ||
if (ch1 === ch2 && ('&|'.indexOf(ch1) >= 0)) {
index += 2;
return {
type: Token.Punctuator,
value: ch1 + ch2,
range: [start, index]
};
}
if ('<>=!+-*%&|^/'.indexOf(ch1) >= 0) {
++index;
return {
type: Token.Punctuator,
value: ch1,
range: [start, index]
};
}
throwError({}, Messages.UnexpectedToken, 'ILLEGAL');
}
// 7.8.3 Numeric Literals
function scanNumericLiteral() {
var number, start, ch;
ch = source[index];
assert(isDecimalDigit(ch.charCodeAt(0)) || (ch === '.'),
'Numeric literal must start with a decimal digit or a decimal point');
start = index;
number = '';
if (ch !== '.') {
number = source[index++];
ch = source[index];
// Hex number starts with '0x'.
// Octal number starts with '0'.
if (number === '0') {
// decimal number starts with '0' such as '09' is illegal.
if (ch && isDecimalDigit(ch.charCodeAt(0))) {
throwError({}, Messages.UnexpectedToken, 'ILLEGAL');
}
}
while (isDecimalDigit(source.charCodeAt(index))) {
number += source[index++];
}
ch = source[index];
}
if (ch === '.') {
number += source[index++];
while (isDecimalDigit(source.charCodeAt(index))) {
number += source[index++];
}
ch = source[index];
}
if (ch === 'e' || ch === 'E') {
number += source[index++];
ch = source[index];
if (ch === '+' || ch === '-') {
number += source[index++];
}
if (isDecimalDigit(source.charCodeAt(index))) {
while (isDecimalDigit(source.charCodeAt(index))) {
number += source[index++];
}
} else {
throwError({}, Messages.UnexpectedToken, 'ILLEGAL');
}
}
if (isIdentifierStart(source.charCodeAt(index))) {
throwError({}, Messages.UnexpectedToken, 'ILLEGAL');
}
return {
type: Token.NumericLiteral,
value: parseFloat(number),
range: [start, index]
};
}
// 7.8.4 String Literals
function scanStringLiteral() {
var str = '', quote, start, ch, octal = false;
quote = source[index];
assert((quote === '\'' || quote === '"'),
'String literal must starts with a quote');
start = index;
++index;
while (index < length) {
ch = source[index++];
if (ch === quote) {
quote = '';
break;
} else if (ch === '\\') {
ch = source[index++];
if (!ch || !isLineTerminator(ch.charCodeAt(0))) {
switch (ch) {
case 'n':
str += '\n';
break;
case 'r':
str += '\r';
break;
case 't':
str += '\t';
break;
case 'b':
str += '\b';
break;
case 'f':
str += '\f';
break;
case 'v':
str += '\x0B';
break;
default:
str += ch;
break;
}
} else {
if (ch === '\r' && source[index] === '\n') {
++index;
}
}
} else if (isLineTerminator(ch.charCodeAt(0))) {
break;
} else {
str += ch;
}
}
if (quote !== '') {
throwError({}, Messages.UnexpectedToken, 'ILLEGAL');
}
return {
type: Token.StringLiteral,
value: str,
octal: octal,
range: [start, index]
};
}
function isIdentifierName(token) {
return token.type === Token.Identifier ||
token.type === Token.Keyword ||
token.type === Token.BooleanLiteral ||
token.type === Token.NullLiteral;
}
function advance() {
var ch;
skipWhitespace();
if (index >= length) {
return {
type: Token.EOF,
range: [index, index]
};
}
ch = source.charCodeAt(index);
// Very common: ( and ) and ;
if (ch === 40 || ch === 41 || ch === 58) {
return scanPunctuator();
}
// String literal starts with single quote (#39) or double quote (#34).
if (ch === 39 || ch === 34) {
return scanStringLiteral();
}
if (isIdentifierStart(ch)) {
return scanIdentifier();
}
// Dot (.) char #46 can also start a floating-point number, hence the need
// to check the next character.
if (ch === 46) {
if (isDecimalDigit(source.charCodeAt(index + 1))) {
return scanNumericLiteral();
}
return scanPunctuator();
}
if (isDecimalDigit(ch)) {
return scanNumericLiteral();
}
return scanPunctuator();
}
function lex() {
var token;
token = lookahead;
index = token.range[1];
lookahead = advance();
index = token.range[1];
return token;
}
function peek() {
var pos;
pos = index;
lookahead = advance();
index = pos;
}
// Throw an exception
function throwError(token, messageFormat) {
var error,
args = Array.prototype.slice.call(arguments, 2),
msg = messageFormat.replace(
/%(\d)/g,
function (whole, index) {
assert(index < args.length, 'Message reference must be in range');
return args[index];
}
);
error = new Error(msg);
error.index = index;
error.description = msg;
throw error;
}
// Throw an exception because of the token.
function throwUnexpected(token) {
throwError(token, Messages.UnexpectedToken, token.value);
}
// Expect the next token to match the specified punctuator.
// If not, an exception will be thrown.
function expect(value) {
var token = lex();
if (token.type !== Token.Punctuator || token.value !== value) {
throwUnexpected(token);
}
}
// Return true if the next token matches the specified punctuator.
function match(value) {
return lookahead.type === Token.Punctuator && lookahead.value === value;
}
// Return true if the next token matches the specified keyword
function matchKeyword(keyword) {
return lookahead.type === Token.Keyword && lookahead.value === keyword;
}
function consumeSemicolon() {
// Catch the very common case first: immediately a semicolon (char #59).
if (source.charCodeAt(index) === 59) {
lex();
return;
}
skipWhitespace();
if (match(';')) {
lex();
return;
}
if (lookahead.type !== Token.EOF && !match('}')) {
throwUnexpected(lookahead);
}
}
// 11.1.4 Array Initialiser
function parseArrayInitialiser() {
var elements = [];
expect('[');
while (!match(']')) {
if (match(',')) {
lex();
elements.push(null);
} else {
elements.push(parseExpression());
if (!match(']')) {
expect(',');
}
}
}
expect(']');
return delegate.createArrayExpression(elements);
}
// 11.1.5 Object Initialiser
function parseObjectPropertyKey() {
var token;
skipWhitespace();
token = lex();
// Note: This function is called only from parseObjectProperty(), where
// EOF and Punctuator tokens are already filtered out.
if (token.type === Token.StringLiteral || token.type === Token.NumericLiteral) {
return delegate.createLiteral(token);
}
return delegate.createIdentifier(token.value);
}
function parseObjectProperty() {
var token, key;
token = lookahead;
skipWhitespace();
if (token.type === Token.EOF || token.type === Token.Punctuator) {
throwUnexpected(token);
}
key = parseObjectPropertyKey();
expect(':');
return delegate.createProperty('init', key, parseExpression());
}
function parseObjectInitialiser() {
var properties = [];
expect('{');
while (!match('}')) {
properties.push(parseObjectProperty());
if (!match('}')) {
expect(',');
}
}
expect('}');
return delegate.createObjectExpression(properties);
}
// 11.1.6 The Grouping Operator
function parseGroupExpression() {
var expr;
expect('(');
expr = parseExpression();
expect(')');
return expr;
}
// 11.1 Primary Expressions
function parsePrimaryExpression() {
var type, token, expr;
if (match('(')) {
return parseGroupExpression();
}
type = lookahead.type;
if (type === Token.Identifier) {
expr = delegate.createIdentifier(lex().value);
} else if (type === Token.StringLiteral || type === Token.NumericLiteral) {
expr = delegate.createLiteral(lex());
} else if (type === Token.Keyword) {
if (matchKeyword('this')) {
lex();
expr = delegate.createThisExpression();
}
} else if (type === Token.BooleanLiteral) {
token = lex();
token.value = (token.value === 'true');
expr = delegate.createLiteral(token);
} else if (type === Token.NullLiteral) {
token = lex();
token.value = null;
expr = delegate.createLiteral(token);
} else if (match('[')) {
expr = parseArrayInitialiser();
} else if (match('{')) {
expr = parseObjectInitialiser();
}
if (expr) {
return expr;
}
throwUnexpected(lex());
}
// 11.2 Left-Hand-Side Expressions
function parseArguments() {
var args = [];
expect('(');
if (!match(')')) {
while (index < length) {
args.push(parseExpression());
if (match(')')) {
break;
}
expect(',');
}
}
expect(')');
return args;
}
function parseNonComputedProperty() {
var token;
token = lex();
if (!isIdentifierName(token)) {
throwUnexpected(token);
}
return delegate.createIdentifier(token.value);
}
function parseNonComputedMember() {
expect('.');
return parseNonComputedProperty();
}
function parseComputedMember() {
var expr;
expect('[');
expr = parseExpression();
expect(']');
return expr;
}
function parseLeftHandSideExpression() {
var expr, args, property;
expr = parsePrimaryExpression();
while (true) {
if (match('[')) {
property = parseComputedMember();
expr = delegate.createMemberExpression('[', expr, property);
} else if (match('.')) {
property = parseNonComputedMember();
expr = delegate.createMemberExpression('.', expr, property);
} else if (match('(')) {
args = parseArguments();
expr = delegate.createCallExpression(expr, args);
} else {
break;
}
}
return expr;
}
// 11.3 Postfix Expressions
var parsePostfixExpression = parseLeftHandSideExpression;
// 11.4 Unary Operators
function parseUnaryExpression() {
var token, expr;
if (lookahead.type !== Token.Punctuator && lookahead.type !== Token.Keyword) {
expr = parsePostfixExpression();
} else if (match('+') || match('-') || match('!')) {
token = lex();
expr = parseUnaryExpression();
expr = delegate.createUnaryExpression(token.value, expr);
} else if (matchKeyword('delete') || matchKeyword('void') || matchKeyword('typeof')) {
throwError({}, Messages.UnexpectedToken);
} else {
expr = parsePostfixExpression();
}
return expr;
}
function binaryPrecedence(token) {
var prec = 0;
if (token.type !== Token.Punctuator && token.type !== Token.Keyword) {
return 0;
}
switch (token.value) {
case '||':
prec = 1;
break;
case '&&':
prec = 2;
break;
case '==':
case '!=':
case '===':
case '!==':
prec = 6;
break;
case '<':
case '>':
case '<=':
case '>=':
case 'instanceof':
prec = 7;
break;
case 'in':
prec = 7;
break;
case '+':
case '-':
prec = 9;
break;
case '*':
case '/':
case '%':
prec = 11;
break;
default:
break;
}
return prec;
}
// 11.5 Multiplicative Operators
// 11.6 Additive Operators
// 11.7 Bitwise Shift Operators
// 11.8 Relational Operators
// 11.9 Equality Operators
// 11.10 Binary Bitwise Operators
// 11.11 Binary Logical Operators
function parseBinaryExpression() {
var expr, token, prec, stack, right, operator, left, i;
left = parseUnaryExpression();
token = lookahead;
prec = binaryPrecedence(token);
if (prec === 0) {
return left;
}
token.prec = prec;
lex();
right = parseUnaryExpression();
stack = [left, token, right];
while ((prec = binaryPrecedence(lookahead)) > 0) {
// Reduce: make a binary expression from the three topmost entries.
while ((stack.length > 2) && (prec <= stack[stack.length - 2].prec)) {
right = stack.pop();
operator = stack.pop().value;
left = stack.pop();
expr = delegate.createBinaryExpression(operator, left, right);
stack.push(expr);
}
// Shift.
token = lex();
token.prec = prec;
stack.push(token);
expr = parseUnaryExpression();
stack.push(expr);
}
// Final reduce to clean-up the stack.
i = stack.length - 1;
expr = stack[i];
while (i > 1) {
expr = delegate.createBinaryExpression(stack[i - 1].value, stack[i - 2], expr);
i -= 2;
}
return expr;
}
// 11.12 Conditional Operator
function parseConditionalExpression() {
var expr, consequent, alternate;
expr = parseBinaryExpression();
if (match('?')) {
lex();
consequent = parseConditionalExpression();
expect(':');
alternate = parseConditionalExpression();
expr = delegate.createConditionalExpression(expr, consequent, alternate);
}
return expr;
}
// Simplification since we do not support AssignmentExpression.
var parseExpression = parseConditionalExpression;
// Polymer Syntax extensions
// Filter ::
// Identifier
// Identifier "(" ")"
// Identifier "(" FilterArguments ")"
function parseFilter() {
var identifier, args;
identifier = lex();
if (identifier.type !== Token.Identifier) {
throwUnexpected(identifier);
}
args = match('(') ? parseArguments() : [];
return delegate.createFilter(identifier.value, args);
}
// Filters ::
// "|" Filter
// Filters "|" Filter
function parseFilters() {
while (match('|')) {
lex();
parseFilter();
}
}
// TopLevel ::
// LabelledExpressions
// AsExpression
// InExpression
// FilterExpression
// AsExpression ::
// FilterExpression as Identifier
// InExpression ::
// Identifier, Identifier in FilterExpression
// Identifier in FilterExpression
// FilterExpression ::
// Expression
// Expression Filters
function parseTopLevel() {
skipWhitespace();
peek();
var expr = parseExpression();
if (expr) {
if (lookahead.value === ',' || lookahead.value == 'in' &&
expr.type === Syntax.Identifier) {
parseInExpression(expr);
} else {
parseFilters();
if (lookahead.value === 'as') {
parseAsExpression(expr);
} else {
delegate.createTopLevel(expr);
}
}
}
if (lookahead.type !== Token.EOF) {
throwUnexpected(lookahead);
}
}
function parseAsExpression(expr) {
lex(); // as
var identifier = lex().value;
delegate.createAsExpression(expr, identifier);
}
function parseInExpression(identifier) {
var indexName;
if (lookahead.value === ',') {
lex();
if (lookahead.type !== Token.Identifier)
throwUnexpected(lookahead);
indexName = lex().value;
}
lex(); // in
var expr = parseExpression();
parseFilters();
delegate.createInExpression(identifier.name, indexName, expr);
}
function parse(code, inDelegate) {
delegate = inDelegate;
source = code;
index = 0;
length = source.length;
lookahead = null;
state = {
labelSet: {}
};
return parseTopLevel();
}
global.esprima = {
parse: parse
};
})(module.exports);
/***/ }),
/***/ "../node_modules/tns-core-modules/js-libs/polymer-expressions/path-parser.js":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/*
* Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
* This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
* The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
* The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
*/
function detectEval() {
// Don't test for eval if we're running in a Chrome App environment.
// We check for APIs set that only exist in a Chrome App context.
if (typeof chrome !== 'undefined' && chrome.app && chrome.app.runtime) {
return false;
}
// Firefox OS Apps do not allow eval. This feature detection is very hacky
// but even if some other platform adds support for this function this code
// will continue to work.
if (typeof navigator != 'undefined' && navigator.getDeviceStorage) {
return false;
}
try {
var f = new Function('', 'return true;');
return f();
} catch (ex) {
return false;
}
}
var hasEval = detectEval();
function isIndex(s) {
return +s === s >>> 0 && s !== '';
}
function toNumber(s) {
return +s;
}
function isObject(obj) {
return obj === Object(obj);
}
var numberIsNaN = Number.isNaN || function (value) {
return typeof value === 'number' && isNaN(value);
}
function areSameValue(left, right) {
if (left === right)
return left !== 0 || 1 / left === 1 / right;
if (numberIsNaN(left) && numberIsNaN(right))
return true;
return left !== left && right !== right;
}
var createObject = ('__proto__' in {}) ?
function (obj) { return obj; } :
function (obj) {
var proto = obj.__proto__;
if (!proto)
return obj;
var newObject = Object.create(proto);
Object.getOwnPropertyNames(obj).forEach(function (name) {
Object.defineProperty(newObject, name,
Object.getOwnPropertyDescriptor(obj, name));
});
return newObject;
};
var identStart = '[\$_a-zA-Z]';
var identPart = '[\$_a-zA-Z0-9]';
var identRegExp = new RegExp('^' + identStart + '+' + identPart + '*' + '$');
function getPathCharType(char) {
if (char === undefined)
return 'eof';
var code = char.charCodeAt(0);
switch (code) {
case 0x5B: // [
case 0x5D: // ]
case 0x2E: // .
case 0x22: // "
case 0x27: // '
case 0x30: // 0
return char;
case 0x5F: // _
case 0x24: // $
return 'ident';
case 0x20: // Space
case 0x09: // Tab
case 0x0A: // Newline
case 0x0D: // Return
case 0xA0: // No-break space
case 0xFEFF: // Byte Order Mark
case 0x2028: // Line Separator
case 0x2029: // Paragraph Separator
return 'ws';
}
// a-z, A-Z
if ((0x61 <= code && code <= 0x7A) || (0x41 <= code && code <= 0x5A))
return 'ident';
// 1-9
if (0x31 <= code && code <= 0x39)
return 'number';
return 'else';
}
var pathStateMachine = {
'beforePath': {
'ws': ['beforePath'],
'ident': ['inIdent', 'append'],
'[': ['beforeElement'],
'eof': ['afterPath']
},
'inPath': {
'ws': ['inPath'],
'.': ['beforeIdent'],
'[': ['beforeElement'],
'eof': ['afterPath']
},
'beforeIdent': {
'ws': ['beforeIdent'],
'ident': ['inIdent', 'append']
},
'inIdent': {
'ident': ['inIdent', 'append'],
'0': ['inIdent', 'append'],
'number': ['inIdent', 'append'],
'ws': ['inPath', 'push'],
'.': ['beforeIdent', 'push'],
'[': ['beforeElement', 'push'],
'eof': ['afterPath', 'push']
},
'beforeElement': {
'ws': ['beforeElement'],
'0': ['afterZero', 'append'],
'number': ['inIndex', 'append'],
"'": ['inSingleQuote', 'append', ''],
'"': ['inDoubleQuote', 'append', '']
},
'afterZero': {
'ws': ['afterElement', 'push'],
']': ['inPath', 'push']
},
'inIndex': {
'0': ['inIndex', 'append'],
'number': ['inIndex', 'append'],
'ws': ['afterElement'],
']': ['inPath', 'push']
},
'inSingleQuote': {
"'": ['afterElement'],
'eof': ['error'],
'else': ['inSingleQuote', 'append']
},
'inDoubleQuote': {
'"': ['afterElement'],
'eof': ['error'],
'else': ['inDoubleQuote', 'append']
},
'afterElement': {
'ws': ['afterElement'],
']': ['inPath', 'push']
}
}
function noop() { }
function parsePath(path) {
var keys = [];
var index = -1;
var c, newChar, key, type, transition, action, typeMap, mode = 'beforePath';
var actions = {
push: function () {
if (key === undefined)
return;
keys.push(key);
key = undefined;
},
append: function () {
if (key === undefined)
key = newChar
else
key += newChar;
}
};
function maybeUnescapeQuote() {
if (index >= path.length)
return;
var nextChar = path[index + 1];
if ((mode == 'inSingleQuote' && nextChar == "'") ||
(mode == 'inDoubleQuote' && nextChar == '"')) {
index++;
newChar = nextChar;
actions.append();
return true;
}
}
while (mode) {
index++;
c = path[index];
if (c == '\\' && maybeUnescapeQuote(mode))
continue;
type = getPathCharType(c);
typeMap = pathStateMachine[mode];
transition = typeMap[type] || typeMap['else'] || 'error';
if (transition == 'error')
return; // parse error;
mode = transition[0];
action = actions[transition[1]] || noop;
newChar = transition[2] === undefined ? c : transition[2];
action();
if (mode === 'afterPath') {
return keys;
}
}
return; // parse error
}
function isIdent(s) {
return identRegExp.test(s);
}
var constructorIsPrivate = {};
function Path(parts, privateToken) {
if (privateToken !== constructorIsPrivate)
throw Error('Use Path.get to retrieve path objects');
for (var i = 0; i < parts.length; i++) {
this.push(String(parts[i]));
}
if (hasEval && this.length) {
this.getValueFrom = this.compiledGetValueFromFn();
}
}
// TODO(rafaelw): Make simple LRU cache
var pathCache = {};
function getPath(pathString) {
if (pathString instanceof Path)
return pathString;
if (pathString == null || pathString.length == 0)
pathString = '';
if (typeof pathString != 'string') {
if (isIndex(pathString.length)) {
// Constructed with array-like (pre-parsed) keys
return new Path(pathString, constructorIsPrivate);
}
pathString = String(pathString);
}
var path = pathCache[pathString];
if (path)
return path;
var parts = parsePath(pathString);
if (!parts)
return invalidPath;
var path = new Path(parts, constructorIsPrivate);
pathCache[pathString] = path;
return path;
}
Path.get = getPath;
function formatAccessor(key) {
if (isIndex(key)) {
return '[' + key + ']';
} else {
return '["' + key.replace(/"/g, '\\"') + '"]';
}
}
Path.prototype = createObject({
__proto__: [],
valid: true,
toString: function () {
var pathString = '';
for (var i = 0; i < this.length; i++) {
var key = this[i];
if (isIdent(key)) {
pathString += i ? '.' + key : key;
} else {
pathString += formatAccessor(key);
}
}
return pathString;
},
getValueFrom: function (obj, directObserver) {
for (var i = 0; i < this.length; i++) {
if (obj == null)
return;
obj = obj[this[i]];
}
return obj;
},
iterateObjects: function (obj, observe) {
for (var i = 0; i < this.length; i++) {
if (i)
obj = obj[this[i - 1]];
if (!isObject(obj))
return;
observe(obj, this[i]);
}
},
compiledGetValueFromFn: function () {
var str = '';
var pathString = 'obj';
str += 'if (obj != null';
var i = 0;
var key;
for (; i < (this.length - 1) ; i++) {
key = this[i];
pathString += isIdent(key) ? '.' + key : formatAccessor(key);
str += ' &&\n ' + pathString + ' != null';
}
str += ')\n';
var key = this[i];
pathString += isIdent(key) ? '.' + key : formatAccessor(key);
str += ' return ' + pathString + ';\nelse\n return undefined;';
return new Function('obj', str);
},
setValueFrom: function (obj, value) {
if (!this.length)
return false;
for (var i = 0; i < this.length - 1; i++) {
if (!isObject(obj))
return false;
obj = obj[this[i]];
}
if (!isObject(obj))
return false;
obj[this[i]] = value;
return true;
}
});
var invalidPath = new Path('', constructorIsPrivate);
invalidPath.valid = false;
invalidPath.getValueFrom = invalidPath.setValueFrom = function () { };
exports.Path = Path;
/***/ }),
/***/ "../node_modules/tns-core-modules/js-libs/polymer-expressions/polymer-expressions.js":
/***/ (function(module, exports, __webpack_require__) {
// Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
// This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
// The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
// The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
// Code distributed by Google as part of the polymer project is also
// subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
var esprima = __webpack_require__("../node_modules/tns-core-modules/js-libs/esprima/esprima.js").esprima;
var Path = __webpack_require__("../node_modules/tns-core-modules/js-libs/polymer-expressions/path-parser.js").Path;
(function (global) {
'use strict';
// TODO(rafaelw): Implement simple LRU.
var expressionParseCache = Object.create(null);
function getExpression(expressionText) {
var expression = expressionParseCache[expressionText];
if (!expression) {
var delegate = new ASTDelegate();
esprima.parse(expressionText, delegate);
expression = new Expression(delegate);
expressionParseCache[expressionText] = expression;
}
return expression;
}
function Literal(value) {
this.value = value;
this.valueFn_ = undefined;
}
Literal.prototype = {
valueFn: function () {
if (!this.valueFn_) {
var value = this.value;
this.valueFn_ = function () {
return value;
}
}
return this.valueFn_;
}
}
function IdentPath(name) {
this.name = name;
this.path = Path.get(name);
}
IdentPath.prototype = {
valueFn: function () {
if (!this.valueFn_) {
var name = this.name;
var path = this.path;
this.valueFn_ = function (model, observer, changedModel) {
if (observer)
observer.addPath(model, path);
if (changedModel) {
var result = path.getValueFrom(changedModel);
if (result !== undefined) {
return result;
}
}
return path.getValueFrom(model);
}
}
return this.valueFn_;
},
setValue: function (model, newValue) {
if (this.path.length == 1) {
model = findScope(model, this.path[0]);
}
return this.path.setValueFrom(model, newValue);
}
};
function MemberExpression(object, property, accessor) {
this.computed = accessor == '[';
this.dynamicDeps = typeof object == 'function' ||
object.dynamicDeps ||
(this.computed && !(property instanceof Literal));
this.simplePath =
!this.dynamicDeps &&
(property instanceof IdentPath || property instanceof Literal) &&
(object instanceof MemberExpression || object instanceof IdentPath);
this.object = this.simplePath ? object : getFn(object);
this.property = !this.computed || this.simplePath ?
property : getFn(property);
}
MemberExpression.prototype = {
get fullPath() {
if (!this.fullPath_) {
var parts = this.object instanceof MemberExpression ?
this.object.fullPath.slice() : [this.object.name];
parts.push(this.property instanceof IdentPath ?
this.property.name : this.property.value);
this.fullPath_ = Path.get(parts);
}
return this.fullPath_;
},
valueFn: function () {
if (!this.valueFn_) {
var object = this.object;
if (this.simplePath) {
var path = this.fullPath;
this.valueFn_ = function (model, observer) {
if (observer)
observer.addPath(model, path);
return path.getValueFrom(model);
};
} else if (!this.computed) {
var path = Path.get(this.property.name);
this.valueFn_ = function (model, observer, filterRegistry) {
var context = object(model, observer, filterRegistry);
if (observer)
observer.addPath(context, path);
return path.getValueFrom(context);
}
} else {
// Computed property.
var property = this.property;
this.valueFn_ = function (model, observer, filterRegistry) {
var context = object(model, observer, filterRegistry);
var propName = property(model, observer, filterRegistry);
if (observer)
observer.addPath(context, [propName]);
return context ? context[propName] : undefined;
};
}
}
return this.valueFn_;
},
setValue: function (model, newValue) {
if (this.simplePath) {
this.fullPath.setValueFrom(model, newValue);
return newValue;
}
var object = this.object(model);
var propName = this.property instanceof IdentPath ? this.property.name :
this.property(model);
return object[propName] = newValue;
}
};
function Filter(name, args) {
this.name = name;
this.args = [];
for (var i = 0; i < args.length; i++) {
this.args[i] = getFn(args[i]);
}
}
Filter.prototype = {
transform: function (model, observer, filterRegistry, toModelDirection,
initialArgs) {
var fn = filterRegistry[this.name];
var context = model;
if (fn) {
context = undefined;
} else {
fn = context[this.name];
if (!fn) {
console.error('Cannot find function or filter: ' + this.name);
return;
}
}
// If toModelDirection is falsey, then the "normal" (dom-bound) direction
// is used. Otherwise, it looks for a 'toModel' property function on the
// object.
if (toModelDirection) {
fn = fn.toModel;
} else if (typeof fn.toView == 'function') {
fn = fn.toView;
}
if (typeof fn != 'function') {
console.error('Cannot find function or filter: ' + this.name);
return;
}
var args = initialArgs || [];
for (var i = 0; i < this.args.length; i++) {
args.push(getFn(this.args[i])(model, observer, filterRegistry));
}
return fn.apply(context, args);
}
};
function notImplemented() { throw Error('Not Implemented'); }
var unaryOperators = {
'+': function (v) { return +v; },
'-': function (v) { return -v; },
'!': function (v) { return !v; }
};
var binaryOperators = {
'+': function (l, r) { return l + r; },
'-': function (l, r) { return l - r; },
'*': function (l, r) { return l * r; },
'/': function (l, r) { return l / r; },
'%': function (l, r) { return l % r; },
'<': function (l, r) { return l < r; },
'>': function (l, r) { return l > r; },
'<=': function (l, r) { return l <= r; },
'>=': function (l, r) { return l >= r; },
'==': function (l, r) { return l == r; },
'!=': function (l, r) { return l != r; },
'===': function (l, r) { return l === r; },
'!==': function (l, r) { return l !== r; },
'&&': function (l, r) { return l && r; },
'||': function (l, r) { return l || r; },
};
function getFn(arg) {
return typeof arg == 'function' ? arg : arg.valueFn();
}
function ASTDelegate() {
this.expression = null;
this.filters = [];
this.deps = {};
this.currentPath = undefined;
this.scopeIdent = undefined;
this.indexIdent = undefined;
this.dynamicDeps = false;
}
ASTDelegate.prototype = {
createUnaryExpression: function (op, argument) {
if (!unaryOperators[op])
throw Error('Disallowed operator: ' + op);
argument = getFn(argument);
return function (model, observer, filterRegistry) {
return unaryOperators[op](argument(model, observer, filterRegistry));
};
},
createBinaryExpression: function (op, left, right) {
if (!binaryOperators[op])
throw Error('Disallowed operator: ' + op);
left = getFn(left);
right = getFn(right);
switch (op) {
case '||':
this.dynamicDeps = true;
return function (model, observer, filterRegistry) {
return left(model, observer, filterRegistry) ||
right(model, observer, filterRegistry);
};
case '&&':
this.dynamicDeps = true;
return function (model, observer, filterRegistry) {
return left(model, observer, filterRegistry) &&
right(model, observer, filterRegistry);
};
}
return function (model, observer, filterRegistry) {
return binaryOperators[op](left(model, observer, filterRegistry),
right(model, observer, filterRegistry));
};
},
createConditionalExpression: function (test, consequent, alternate) {
test = getFn(test);
consequent = getFn(consequent);
alternate = getFn(alternate);
this.dynamicDeps = true;
return function (model, observer, filterRegistry) {
return test(model, observer, filterRegistry) ?
consequent(model, observer, filterRegistry) :
alternate(model, observer, filterRegistry);
}
},
createIdentifier: function (name) {
var ident = new IdentPath(name);
ident.type = 'Identifier';
return ident;
},
createMemberExpression: function (accessor, object, property) {
var ex = new MemberExpression(object, property, accessor);
if (ex.dynamicDeps)
this.dynamicDeps = true;
return ex;
},
createCallExpression: function (expression, args) {
if (!(expression instanceof IdentPath))
throw Error('Only identifier function invocations are allowed');
var filter = new Filter(expression.name, args);
return function (model, observer, filterRegistry) {
return filter.transform(model, observer, filterRegistry, false);
};
},
createLiteral: function (token) {
return new Literal(token.value);
},
createArrayExpression: function (elements) {
for (var i = 0; i < elements.length; i++)
elements[i] = getFn(elements[i]);
return function (model, observer, filterRegistry) {
var arr = []
for (var i = 0; i < elements.length; i++)
arr.push(elements[i](model, observer, filterRegistry));
return arr;
}
},
createProperty: function (kind, key, value) {
return {
key: key instanceof IdentPath ? key.name : key.value,
value: value
};
},
createObjectExpression: function (properties) {
for (var i = 0; i < properties.length; i++)
properties[i].value = getFn(properties[i].value);
return function (model, observer, filterRegistry) {
var obj = {};
for (var i = 0; i < properties.length; i++)
obj[properties[i].key] =
properties[i].value(model, observer, filterRegistry);
return obj;
}
},
createFilter: function (name, args) {
this.filters.push(new Filter(name, args));
},
createAsExpression: function (expression, scopeIdent) {
this.expression = expression;
this.scopeIdent = scopeIdent;
},
createInExpression: function (scopeIdent, indexIdent, expression) {
this.expression = expression;
this.scopeIdent = scopeIdent;
this.indexIdent = indexIdent;
},
createTopLevel: function (expression) {
this.expression = expression;
},
createThisExpression: notImplemented
}
function Expression(delegate) {
this.scopeIdent = delegate.scopeIdent;
this.indexIdent = delegate.indexIdent;
if (!delegate.expression)
throw Error('No expression found.');
this.expression = delegate.expression;
getFn(this.expression); // forces enumeration of path dependencies
this.filters = delegate.filters;
this.dynamicDeps = delegate.dynamicDeps;
}
Expression.prototype = {
getValue: function (model, isBackConvert, changedModel, observer) {
var value = getFn(this.expression)(model.context, observer, changedModel);
for (var i = 0; i < this.filters.length; i++) {
value = this.filters[i].transform(model.context, observer, model.context, isBackConvert, [value]);
}
return value;
},
setValue: function (model, newValue, filterRegistry) {
var count = this.filters ? this.filters.length : 0;
while (count-- > 0) {
newValue = this.filters[count].transform(model, undefined,
filterRegistry, true, [newValue]);
}
if (this.expression.setValue)
return this.expression.setValue(model, newValue);
}
}
/**
* Converts a style property name to a css property name. For example:
* "WebkitUserSelect" to "-webkit-user-select"
*/
function convertStylePropertyName(name) {
return String(name).replace(/[A-Z]/g, function (c) {
return '-' + c.toLowerCase();
});
}
var parentScopeName = '@' + Math.random().toString(36).slice(2);
// Single ident paths must bind directly to the appropriate scope object.
// I.e. Pushed values in two-bindings need to be assigned to the actual model
// object.
function findScope(model, prop) {
while (model[parentScopeName] &&
!Object.prototype.hasOwnProperty.call(model, prop)) {
model = model[parentScopeName];
}
return model;
}
function isLiteralExpression(pathString) {
switch (pathString) {
case '':
return false;
case 'false':
case 'null':
case 'true':
return true;
}
if (!isNaN(Number(pathString)))
return true;
return false;
};
function PolymerExpressions() { }
PolymerExpressions.prototype = {
// "built-in" filters
styleObject: function (value) {
var parts = [];
for (var key in value) {
parts.push(convertStylePropertyName(key) + ': ' + value[key]);
}
return parts.join('; ');
},
tokenList: function (value) {
var tokens = [];
for (var key in value) {
if (value[key])
tokens.push(key);
}
return tokens.join(' ');
},
// binding delegate API
prepareInstancePositionChanged: function (template) {
var indexIdent = template.polymerExpressionIndexIdent_;
if (!indexIdent)
return;
return function (templateInstance, index) {
templateInstance.model[indexIdent] = index;
};
},
prepareInstanceModel: function (template) {
var scopeName = template.polymerExpressionScopeIdent_;
if (!scopeName)
return;
var parentScope = template.templateInstance ?
template.templateInstance.model :
template.model;
var indexName = template.polymerExpressionIndexIdent_;
return function (model) {
return createScopeObject(parentScope, model, scopeName, indexName);
};
}
};
var createScopeObject = ('__proto__' in {}) ?
function (parentScope, model, scopeName, indexName) {
var scope = {};
scope[scopeName] = model;
scope[indexName] = undefined;
scope[parentScopeName] = parentScope;
scope.__proto__ = parentScope;
return scope;
} :
function (parentScope, model, scopeName, indexName) {
var scope = Object.create(parentScope);
Object.defineProperty(scope, scopeName,
{ value: model, configurable: true, writable: true });
Object.defineProperty(scope, indexName,
{ value: undefined, configurable: true, writable: true });
Object.defineProperty(scope, parentScopeName,
{ value: parentScope, configurable: true, writable: true });
return scope;
};
global.PolymerExpressions = PolymerExpressions;
PolymerExpressions.getExpression = getExpression;
})(module.exports);
/***/ }),
/***/ "../node_modules/tns-core-modules/matrix/matrix.js":
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", { value: true });
var number_utils_1 = __webpack_require__("../node_modules/tns-core-modules/utils/number-utils.js");
exports.getTransformMatrix = function (_a) {
var property = _a.property, value = _a.value;
return TRANSFORM_MATRIXES[property](value);
};
var TRANSFORM_MATRIXES = {
"scale": function (_a) {
var x = _a.x, y = _a.y;
return [
x, 0, 0,
0, y, 0,
0, 0, 1,
];
},
"translate": function (_a) {
var x = _a.x, y = _a.y;
return [
1, 0, x,
0, 1, y,
0, 0, 1,
];
},
"rotate": function (angleInDeg) {
var angleInRad = number_utils_1.degreesToRadians(angleInDeg);
return [
Math.cos(angleInRad), -Math.sin(angleInRad), 0,
Math.sin(angleInRad), Math.cos(angleInRad), 0,
0, 0, 1,
];
},
};
exports.matrixArrayToCssMatrix = function (m) { return [
m[0], m[3], m[1],
m[4], m[2], m[5],
]; };
function multiplyAffine2d(m1, m2) {
return [
m1[0] * m2[0] + m1[1] * m2[3],
m1[0] * m2[1] + m1[1] * m2[4],
m1[0] * m2[2] + m1[1] * m2[5] + m1[2],
m1[3] * m2[0] + m1[4] * m2[3],
m1[3] * m2[1] + m1[4] * m2[4],
m1[3] * m2[2] + m1[4] * m2[5] + m1[5]
];
}
exports.multiplyAffine2d = multiplyAffine2d;
function decompose2DTransformMatrix(matrix) {
verifyTransformMatrix(matrix);
var _a = matrix.slice(), A = _a[0], B = _a[1], C = _a[2], D = _a[3], E = _a[4], F = _a[5];
var determinant = A * D - B * C;
var translate = { x: E || 0, y: F || 0 };
var rotate = 0;
var scale = { x: 1, y: 1 };
if (A || B) {
var R = Math.sqrt(A * A + B * B);
rotate = B > 0 ? Math.acos(A / R) : -Math.acos(A / R);
scale = { x: R, y: determinant / R };
}
else if (C || D) {
var R = Math.sqrt(C * C + D * D);
rotate = Math.PI / 2 - (D > 0 ? Math.acos(-C / R) : -Math.acos(C / R));
scale = { x: determinant / R, y: R };
}
rotate = number_utils_1.radiansToDegrees(rotate);
return { translate: translate, rotate: rotate, scale: scale };
}
exports.decompose2DTransformMatrix = decompose2DTransformMatrix;
function verifyTransformMatrix(matrix) {
if (matrix.length < 6) {
throw new Error("Transform matrix should be 2x3.");
}
}
//# sourceMappingURL=matrix.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/platform/platform.js":
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", { value: true });
var utils = __webpack_require__("../node_modules/tns-core-modules/utils/utils.js");
var platformNames;
(function (platformNames) {
platformNames.android = "Android";
platformNames.ios = "iOS";
})(platformNames = exports.platformNames || (exports.platformNames = {}));
var Device = (function () {
function Device() {
}
Object.defineProperty(Device.prototype, "manufacturer", {
get: function () {
return "Apple";
},
enumerable: true,
configurable: true
});
Object.defineProperty(Device.prototype, "os", {
get: function () {
return platformNames.ios;
},
enumerable: true,
configurable: true
});
Object.defineProperty(Device.prototype, "osVersion", {
get: function () {
if (!this._osVersion) {
this._osVersion = utils.ios.getter(UIDevice, UIDevice.currentDevice).systemVersion;
}
return this._osVersion;
},
enumerable: true,
configurable: true
});
Object.defineProperty(Device.prototype, "model", {
get: function () {
if (!this._model) {
this._model = utils.ios.getter(UIDevice, UIDevice.currentDevice).model;
}
return this._model;
},
enumerable: true,
configurable: true
});
Object.defineProperty(Device.prototype, "sdkVersion", {
get: function () {
if (!this._sdkVersion) {
this._sdkVersion = utils.ios.getter(UIDevice, UIDevice.currentDevice).systemVersion;
}
return this._sdkVersion;
},
enumerable: true,
configurable: true
});
Object.defineProperty(Device.prototype, "deviceType", {
get: function () {
if (!this._deviceType) {
if (utils.ios.getter(UIDevice, UIDevice.currentDevice).userInterfaceIdiom === 0) {
this._deviceType = "Phone";
}
else {
this._deviceType = "Tablet";
}
}
return this._deviceType;
},
enumerable: true,
configurable: true
});
Object.defineProperty(Device.prototype, "uuid", {
get: function () {
var userDefaults = utils.ios.getter(NSUserDefaults, NSUserDefaults.standardUserDefaults);
var uuid_key = "TNSUUID";
var app_uuid = userDefaults.stringForKey(uuid_key);
if (!app_uuid) {
app_uuid = NSUUID.UUID().UUIDString;
userDefaults.setObjectForKey(app_uuid, uuid_key);
userDefaults.synchronize();
}
return app_uuid;
},
enumerable: true,
configurable: true
});
Object.defineProperty(Device.prototype, "language", {
get: function () {
if (!this._language) {
var languages = utils.ios.getter(NSLocale, NSLocale.preferredLanguages);
this._language = languages[0];
}
return this._language;
},
enumerable: true,
configurable: true
});
Object.defineProperty(Device.prototype, "region", {
get: function () {
if (!this._region) {
this._region = utils.ios.getter(NSLocale, NSLocale.currentLocale).objectForKey(NSLocaleCountryCode);
}
return this._region;
},
enumerable: true,
configurable: true
});
return Device;
}());
var MainScreen = (function () {
function MainScreen() {
}
Object.defineProperty(MainScreen.prototype, "screen", {
get: function () {
if (!this._screen) {
this._screen = utils.ios.getter(UIScreen, UIScreen.mainScreen);
}
return this._screen;
},
enumerable: true,
configurable: true
});
Object.defineProperty(MainScreen.prototype, "widthPixels", {
get: function () {
return this.widthDIPs * this.scale;
},
enumerable: true,
configurable: true
});
Object.defineProperty(MainScreen.prototype, "heightPixels", {
get: function () {
return this.heightDIPs * this.scale;
},
enumerable: true,
configurable: true
});
Object.defineProperty(MainScreen.prototype, "scale", {
get: function () {
return this.screen.scale;
},
enumerable: true,
configurable: true
});
Object.defineProperty(MainScreen.prototype, "widthDIPs", {
get: function () {
return this.screen.bounds.size.width;
},
enumerable: true,
configurable: true
});
Object.defineProperty(MainScreen.prototype, "heightDIPs", {
get: function () {
return this.screen.bounds.size.height;
},
enumerable: true,
configurable: true
});
return MainScreen;
}());
exports.device = new Device();
var screen;
(function (screen) {
screen.mainScreen = new MainScreen();
})(screen = exports.screen || (exports.screen = {}));
exports.isIOS = true;
//# sourceMappingURL=platform.ios.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/profiling/profiling.js":
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global) {Object.defineProperty(exports, "__esModule", { value: true });
function uptime() {
return global.android ? org.nativescript.Process.getUpTime() : global.__tns_uptime();
}
exports.uptime = uptime;
function log(message) {
if (global.__nslog) {
global.__nslog("CONSOLE LOG: " + message);
}
console.log(message);
}
exports.log = log;
var timers = {};
var anyGlobal = global;
var profileNames = [];
exports.time = global.__time || Date.now;
function start(name) {
var info = timers[name];
if (info) {
info.currentStart = exports.time();
info.runCount++;
}
else {
info = {
totalTime: 0,
count: 0,
currentStart: exports.time(),
runCount: 1
};
timers[name] = info;
profileNames.push(name);
}
}
exports.start = start;
function stop(name) {
var info = timers[name];
if (!info) {
throw new Error("No timer started: " + name);
}
if (info.runCount) {
info.runCount--;
if (info.runCount) {
info.count++;
}
else {
info.lastTime = exports.time() - info.currentStart;
info.totalTime += info.lastTime;
info.count++;
info.currentStart = 0;
}
}
else {
throw new Error("Timer " + name + " paused more times than started.");
}
return info;
}
exports.stop = stop;
function timer(name) {
return timers[name];
}
exports.timer = timer;
function print(name) {
var info = timers[name];
if (!info) {
throw new Error("No timer started: " + name);
}
console.log("---- [" + name + "] STOP total: " + info.totalTime + " count:" + info.count);
return info;
}
exports.print = print;
function isRunning(name) {
var info = timers[name];
return !!(info && info.runCount);
}
exports.isRunning = isRunning;
function countersProfileFunctionFactory(fn, name, type) {
if (type === void 0) { type = 1; }
profileNames.push(name);
return function () {
start(name);
try {
return fn.apply(this, arguments);
}
finally {
stop(name);
}
};
}
function timelineProfileFunctionFactory(fn, name, type) {
if (type === void 0) { type = 1; }
return type === 1 ? function () {
var start = exports.time();
try {
return fn.apply(this, arguments);
}
finally {
var end = exports.time();
console.log("Timeline: Modules: " + name + " " + this + " (" + start + "ms. - " + end + "ms.)");
}
} : function () {
var start = exports.time();
try {
return fn.apply(this, arguments);
}
finally {
var end = exports.time();
console.log("Timeline: Modules: " + name + " (" + start + "ms. - " + end + "ms.)");
}
};
}
var Level;
(function (Level) {
Level[Level["none"] = 0] = "none";
Level[Level["lifecycle"] = 1] = "lifecycle";
Level[Level["timeline"] = 2] = "timeline";
})(Level = exports.Level || (exports.Level = {}));
var tracingLevel = Level.none;
var profileFunctionFactory;
function enable(mode) {
if (mode === void 0) { mode = "counters"; }
profileFunctionFactory = mode && {
counters: countersProfileFunctionFactory,
timeline: timelineProfileFunctionFactory
}[mode];
tracingLevel = {
lifecycle: Level.lifecycle,
timeline: Level.timeline,
}[mode] || Level.none;
}
exports.enable = enable;
try {
var appConfig = __webpack_require__("./package.json");
if (appConfig && appConfig.profiling) {
enable(appConfig.profiling);
}
}
catch (e1) {
try {
console.log("Profiling startup failed to figure out defaults from package.json, error: " + e1);
}
catch (e2) {
}
}
function disable() {
profileFunctionFactory = undefined;
}
exports.disable = disable;
function profileFunction(fn, customName) {
return profileFunctionFactory(fn, customName || fn.name);
}
var profileMethodUnnamed = function (target, key, descriptor) {
if (descriptor === undefined) {
descriptor = Object.getOwnPropertyDescriptor(target, key);
}
var originalMethod = descriptor.value;
var className = "";
if (target && target.constructor && target.constructor.name) {
className = target.constructor.name + ".";
}
var name = className + key;
descriptor.value = profileFunctionFactory(originalMethod, name, 1);
return descriptor;
};
var profileStaticMethodUnnamed = function (ctor, key, descriptor) {
if (descriptor === undefined) {
descriptor = Object.getOwnPropertyDescriptor(ctor, key);
}
var originalMethod = descriptor.value;
var className = "";
if (ctor && ctor.name) {
className = ctor.name + ".";
}
var name = className + key;
descriptor.value = profileFunctionFactory(originalMethod, name, 0);
return descriptor;
};
function profileMethodNamed(name) {
return function (target, key, descriptor) {
if (descriptor === undefined) {
descriptor = Object.getOwnPropertyDescriptor(target, key);
}
var originalMethod = descriptor.value;
descriptor.value = profileFunctionFactory(originalMethod, name);
return descriptor;
};
}
var voidMethodDecorator = function () {
};
function profile(nameFnOrTarget, fnOrKey, descriptor) {
if (typeof nameFnOrTarget === "object" && (typeof fnOrKey === "string" || typeof fnOrKey === "symbol")) {
if (!profileFunctionFactory) {
return;
}
return profileMethodUnnamed(nameFnOrTarget, fnOrKey, descriptor);
}
else if (typeof nameFnOrTarget === "function" && (typeof fnOrKey === "string" || typeof fnOrKey === "symbol")) {
if (!profileFunctionFactory) {
return;
}
return profileStaticMethodUnnamed(nameFnOrTarget, fnOrKey, descriptor);
}
else if (typeof nameFnOrTarget === "string" && typeof fnOrKey === "function") {
if (!profileFunctionFactory) {
return fnOrKey;
}
return profileFunction(fnOrKey, nameFnOrTarget);
}
else if (typeof nameFnOrTarget === "function") {
if (!profileFunctionFactory) {
return nameFnOrTarget;
}
return profileFunction(nameFnOrTarget);
}
else if (typeof nameFnOrTarget === "string") {
if (!profileFunctionFactory) {
return voidMethodDecorator;
}
return profileMethodNamed(nameFnOrTarget);
}
else {
if (!profileFunctionFactory) {
return voidMethodDecorator;
}
return profileMethodUnnamed;
}
}
exports.profile = profile;
function dumpProfiles() {
profileNames.forEach(function (name) {
var info = timers[name];
if (info) {
console.log("---- [" + name + "] STOP total: " + info.totalTime + " count:" + info.count);
}
else {
console.log("---- [" + name + "] Never called");
}
});
}
exports.dumpProfiles = dumpProfiles;
function resetProfiles() {
profileNames.forEach(function (name) {
var info = timers[name];
if (info) {
if (info.runCount) {
console.log("---- timer with name [" + name + "] is currently running and won't be reset");
}
else {
timers[name] = undefined;
}
}
});
}
exports.resetProfiles = resetProfiles;
function startCPUProfile(name) {
if (anyGlobal.android) {
__startCPUProfiler(name);
}
}
exports.startCPUProfile = startCPUProfile;
function stopCPUProfile(name) {
if (anyGlobal.android) {
__stopCPUProfiler(name);
}
}
exports.stopCPUProfile = stopCPUProfile;
function level() {
return tracingLevel;
}
exports.level = level;
function trace(message, start, end) {
log("Timeline: Modules: " + message + " (" + start + "ms. - " + end + "ms.)");
}
exports.trace = trace;
//# sourceMappingURL=profiling.js.map
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("../node_modules/webpack/buildin/global.js")))
/***/ }),
/***/ "../node_modules/tns-core-modules/text/formatted-string.js":
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", { value: true });
var span_1 = __webpack_require__("../node_modules/tns-core-modules/text/span.js");
exports.Span = span_1.Span;
var observable_1 = __webpack_require__("../node_modules/tns-core-modules/data/observable/observable.js");
var observable_array_1 = __webpack_require__("../node_modules/tns-core-modules/data/observable-array/observable-array.js");
var view_1 = __webpack_require__("../node_modules/tns-core-modules/ui/core/view/view.js");
var knownCollections;
(function (knownCollections) {
knownCollections.spans = "spans";
})(knownCollections = exports.knownCollections || (exports.knownCollections = {}));
var CHILD_SPAN = "Span";
var FormattedString = (function (_super) {
__extends(FormattedString, _super);
function FormattedString() {
var _this = _super.call(this) || this;
_this._spans = new observable_array_1.ObservableArray();
_this._spans.addEventListener(observable_array_1.ObservableArray.changeEvent, _this.onSpansCollectionChanged, _this);
return _this;
}
Object.defineProperty(FormattedString.prototype, "fontFamily", {
get: function () {
return this.style.fontFamily;
},
set: function (value) {
this.style.fontFamily = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(FormattedString.prototype, "fontSize", {
get: function () {
return this.style.fontSize;
},
set: function (value) {
this.style.fontSize = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(FormattedString.prototype, "fontStyle", {
get: function () {
return this.style.fontStyle;
},
set: function (value) {
this.style.fontStyle = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(FormattedString.prototype, "fontWeight", {
get: function () {
return this.style.fontWeight;
},
set: function (value) {
this.style.fontWeight = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(FormattedString.prototype, "textDecoration", {
get: function () {
return this.style.textDecoration;
},
set: function (value) {
this.style.textDecoration = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(FormattedString.prototype, "color", {
get: function () {
return this.style.color;
},
set: function (value) {
this.style.color = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(FormattedString.prototype, "backgroundColor", {
get: function () {
return this.style.backgroundColor;
},
set: function (value) {
this.style.backgroundColor = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(FormattedString.prototype, "spans", {
get: function () {
if (!this._spans) {
this._spans = new observable_array_1.ObservableArray();
}
return this._spans;
},
enumerable: true,
configurable: true
});
FormattedString.prototype.toString = function () {
var result = "";
for (var i = 0, length_1 = this._spans.length; i < length_1; i++) {
result += this._spans.getItem(i).text;
}
return result;
};
FormattedString.prototype._addArrayFromBuilder = function (name, value) {
if (name === knownCollections.spans) {
this.spans.push(value);
}
};
FormattedString.prototype._addChildFromBuilder = function (name, value) {
if (name === CHILD_SPAN) {
this.spans.push(value);
}
};
FormattedString.prototype.onSpansCollectionChanged = function (eventData) {
if (eventData.addedCount > 0) {
for (var i = 0; i < eventData.addedCount; i++) {
var span = eventData.object.getItem(eventData.index + i);
this._addView(span);
this.addPropertyChangeHandler(span);
}
}
if (eventData.removed && eventData.removed.length > 0) {
for (var p = 0; p < eventData.removed.length; p++) {
var span = eventData.removed[p];
this.removePropertyChangeHandler(span);
this._removeView(span);
}
}
this.notifyPropertyChange(".", this);
};
FormattedString.prototype.addPropertyChangeHandler = function (span) {
var style = span.style;
span.on(observable_1.Observable.propertyChangeEvent, this.onPropertyChange, this);
style.on("fontFamilyChange", this.onPropertyChange, this);
style.on("fontSizeChange", this.onPropertyChange, this);
style.on("fontStyleChange", this.onPropertyChange, this);
style.on("fontWeightChange", this.onPropertyChange, this);
style.on("textDecorationChange", this.onPropertyChange, this);
style.on("colorChange", this.onPropertyChange, this);
style.on("backgroundColorChange", this.onPropertyChange, this);
};
FormattedString.prototype.removePropertyChangeHandler = function (span) {
var style = span.style;
span.off(observable_1.Observable.propertyChangeEvent, this.onPropertyChange, this);
style.off("fontFamilyChange", this.onPropertyChange, this);
style.off("fontSizeChange", this.onPropertyChange, this);
style.off("fontStyleChange", this.onPropertyChange, this);
style.off("fontWeightChange", this.onPropertyChange, this);
style.off("textDecorationChange", this.onPropertyChange, this);
style.off("colorChange", this.onPropertyChange, this);
style.off("backgroundColorChange", this.onPropertyChange, this);
};
FormattedString.prototype.onPropertyChange = function (data) {
this.notifyPropertyChange(data.propertyName, this);
};
FormattedString.prototype.eachChild = function (callback) {
this.spans.forEach(function (v, i, arr) { return callback(v); });
};
return FormattedString;
}(view_1.ViewBase));
exports.FormattedString = FormattedString;
//# sourceMappingURL=formatted-string.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/text/span.js":
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", { value: true });
var view_1 = __webpack_require__("../node_modules/tns-core-modules/ui/core/view/view.js");
var Span = (function (_super) {
__extends(Span, _super);
function Span() {
return _super !== null && _super.apply(this, arguments) || this;
}
Object.defineProperty(Span.prototype, "fontFamily", {
get: function () {
return this.style.fontFamily;
},
set: function (value) {
this.style.fontFamily = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(Span.prototype, "fontSize", {
get: function () {
return this.style.fontSize;
},
set: function (value) {
this.style.fontSize = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(Span.prototype, "fontStyle", {
get: function () {
return this.style.fontStyle;
},
set: function (value) {
this.style.fontStyle = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(Span.prototype, "fontWeight", {
get: function () {
return this.style.fontWeight;
},
set: function (value) {
this.style.fontWeight = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(Span.prototype, "textDecoration", {
get: function () {
return this.style.textDecoration;
},
set: function (value) {
this.style.textDecoration = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(Span.prototype, "color", {
get: function () {
return this.style.color;
},
set: function (value) {
this.style.color = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(Span.prototype, "backgroundColor", {
get: function () {
return this.style.backgroundColor;
},
set: function (value) {
this.style.backgroundColor = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(Span.prototype, "text", {
get: function () {
return this._text;
},
set: function (value) {
if (this._text !== value) {
this._text = value;
this.notifyPropertyChange("text", value);
}
},
enumerable: true,
configurable: true
});
Span.prototype._setTextInternal = function (value) {
this._text = value;
};
return Span;
}(view_1.ViewBase));
exports.Span = Span;
//# sourceMappingURL=span.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/text/text.js":
/***/ (function(module, exports) {
Object.defineProperty(exports, "__esModule", { value: true });
var encoding;
(function (encoding) {
encoding.ISO_8859_1 = 5;
encoding.US_ASCII = 1;
encoding.UTF_16 = 10;
encoding.UTF_16BE = 0x90000100;
encoding.UTF_16LE = 0x94000100;
encoding.UTF_8 = 4;
})(encoding = exports.encoding || (exports.encoding = {}));
//# sourceMappingURL=text.ios.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/timer/timer.js":
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", { value: true });
var utils = __webpack_require__("../node_modules/tns-core-modules/utils/utils.js");
var timeoutCallbacks = new Map();
var timerId = 0;
var TimerTargetImpl = (function (_super) {
__extends(TimerTargetImpl, _super);
function TimerTargetImpl() {
return _super !== null && _super.apply(this, arguments) || this;
}
TimerTargetImpl.initWithCallback = function (callback, id, shouldRepeat) {
var handler = TimerTargetImpl.new();
handler.callback = callback;
handler.id = id;
handler.shouldRepeat = shouldRepeat;
return handler;
};
TimerTargetImpl.prototype.tick = function (timer) {
if (!this.disposed) {
this.callback();
}
if (!this.shouldRepeat) {
this.unregister();
}
};
TimerTargetImpl.prototype.unregister = function () {
if (!this.disposed) {
this.disposed = true;
var timer = timeoutCallbacks.get(this.id).k;
timer.invalidate();
timeoutCallbacks.delete(this.id);
}
};
TimerTargetImpl.ObjCExposedMethods = {
"tick": { returns: interop.types.void, params: [NSTimer] }
};
return TimerTargetImpl;
}(NSObject));
function createTimerAndGetId(callback, milliseconds, shouldRepeat) {
timerId++;
var id = timerId;
var timerTarget = TimerTargetImpl.initWithCallback(callback, id, shouldRepeat);
var timer = NSTimer.scheduledTimerWithTimeIntervalTargetSelectorUserInfoRepeats(milliseconds / 1000, timerTarget, "tick", null, shouldRepeat);
utils.ios.getter(NSRunLoop, NSRunLoop.currentRunLoop).addTimerForMode(timer, NSRunLoopCommonModes);
var pair = { k: timer, v: timerTarget };
timeoutCallbacks.set(id, pair);
return id;
}
function setTimeout(callback, milliseconds) {
if (milliseconds === void 0) { milliseconds = 0; }
var args = [];
for (var _i = 2; _i < arguments.length; _i++) {
args[_i - 2] = arguments[_i];
}
var invoke = function () { return callback.apply(void 0, args); };
return createTimerAndGetId(zonedCallback(invoke), milliseconds, false);
}
exports.setTimeout = setTimeout;
function clearTimeout(id) {
var pair = timeoutCallbacks.get(id);
if (pair) {
pair.v.unregister();
}
}
exports.clearTimeout = clearTimeout;
function setInterval(callback, milliseconds) {
if (milliseconds === void 0) { milliseconds = 0; }
var args = [];
for (var _i = 2; _i < arguments.length; _i++) {
args[_i - 2] = arguments[_i];
}
var invoke = function () { return callback.apply(void 0, args); };
return createTimerAndGetId(zonedCallback(invoke), milliseconds, true);
}
exports.setInterval = setInterval;
exports.clearInterval = clearTimeout;
//# sourceMappingURL=timer.ios.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/trace/trace.js":
/***/ (function(module, exports) {
Object.defineProperty(exports, "__esModule", { value: true });
var enabled = false;
var _categories = {};
var _writers = [];
var _eventListeners = [];
var _errorHandler;
function enable() {
enabled = true;
}
exports.enable = enable;
function disable() {
enabled = false;
}
exports.disable = disable;
function isEnabled() {
return enabled;
}
exports.isEnabled = isEnabled;
function isCategorySet(category) {
return category in _categories;
}
exports.isCategorySet = isCategorySet;
function addWriter(writer) {
_writers.push(writer);
}
exports.addWriter = addWriter;
function removeWriter(writer) {
var index = _writers.indexOf(writer);
if (index >= 0) {
_writers.splice(index, 1);
}
}
exports.removeWriter = removeWriter;
function clearWriters() {
if (_writers.length > 0) {
_writers.splice(0, _writers.length);
}
}
exports.clearWriters = clearWriters;
function setCategories(categories) {
_categories = {};
addCategories(categories);
}
exports.setCategories = setCategories;
function addCategories(categories) {
var split = categories.split(",");
for (var i = 0; i < split.length; i++) {
_categories[split[i].trim()] = true;
}
}
exports.addCategories = addCategories;
function write(message, category, type) {
var i;
if (type === messageType.error) {
for (i = 0; i < _writers.length; i++) {
_writers[i].write(message, category, type);
}
return;
}
if (!enabled) {
return;
}
if (!(category in _categories)) {
return;
}
for (i = 0; i < _writers.length; i++) {
_writers[i].write(message, category, type);
}
}
exports.write = write;
function notifyEvent(object, name, data) {
if (!enabled) {
return;
}
var i, listener, filters;
for (i = 0; i < _eventListeners.length; i++) {
listener = _eventListeners[i];
if (listener.filter) {
filters = listener.filter.split(",");
filters.forEach(function (value) {
if (value.trim() === name) {
listener.on(object, name, data);
}
});
}
else {
listener.on(object, name, data);
}
}
}
exports.notifyEvent = notifyEvent;
function addEventListener(listener) {
_eventListeners.push(listener);
}
exports.addEventListener = addEventListener;
function removeEventListener(listener) {
var index = _eventListeners.indexOf(listener);
if (index >= 0) {
_eventListeners.splice(index, 1);
}
}
exports.removeEventListener = removeEventListener;
var messageType;
(function (messageType) {
messageType.log = 0;
messageType.info = 1;
messageType.warn = 2;
messageType.error = 3;
})(messageType = exports.messageType || (exports.messageType = {}));
var categories;
(function (categories) {
categories.VisualTreeEvents = "VisualTreeEvents";
categories.Layout = "Layout";
categories.Style = "Style";
categories.ViewHierarchy = "ViewHierarchy";
categories.NativeLifecycle = "NativeLifecycle";
categories.Debug = "Debug";
categories.Navigation = "Navigation";
categories.Test = "Test";
categories.Binding = "Binding";
categories.BindingError = "BindingError";
categories.Error = "Error";
categories.Animation = "Animation";
categories.Transition = "Transition";
categories.All = categories.VisualTreeEvents + "," + categories.Layout + "," + categories.Style + "," + categories.ViewHierarchy + "," + categories.NativeLifecycle + "," + categories.Debug + "," + categories.Navigation + "," + categories.Test + "," + categories.Binding + "," + categories.Error + "," + categories.Animation + "," + categories.Transition;
categories.separator = ",";
function concat() {
var i;
var result;
for (i = 0; i < arguments.length; i++) {
if (!result) {
result = arguments[i];
continue;
}
result = result.concat(categories.separator, arguments[i]);
}
return result;
}
categories.concat = concat;
})(categories = exports.categories || (exports.categories = {}));
var ConsoleWriter = (function () {
function ConsoleWriter() {
}
ConsoleWriter.prototype.write = function (message, category, type) {
if (!console) {
return;
}
var msgType;
if (type === undefined) {
msgType = messageType.log;
}
else {
msgType = type;
}
switch (msgType) {
case messageType.log:
console.log(category + ": " + message);
break;
case messageType.info:
console.info(category + ": " + message);
break;
case messageType.warn:
console.warn(category + ": " + message);
break;
case messageType.error:
console.error(category + ": " + message);
break;
}
};
return ConsoleWriter;
}());
addWriter(new ConsoleWriter());
var DefaultErrorHandler = (function () {
function DefaultErrorHandler() {
}
DefaultErrorHandler.prototype.handlerError = function (error) {
throw error;
};
return DefaultErrorHandler;
}());
exports.DefaultErrorHandler = DefaultErrorHandler;
setErrorHandler(new DefaultErrorHandler());
function getErrorHandler() {
return _errorHandler;
}
exports.getErrorHandler = getErrorHandler;
function setErrorHandler(handler) {
_errorHandler = handler;
}
exports.setErrorHandler = setErrorHandler;
function error(error) {
if (!_errorHandler) {
return;
}
if (typeof error === "string") {
error = new Error(error);
}
_errorHandler.handlerError(error);
}
exports.error = error;
//# sourceMappingURL=trace.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/ui/action-bar/action-bar-common.js":
/***/ (function(module, exports, __webpack_require__) {
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
Object.defineProperty(exports, "__esModule", { value: true });
var profiling_1 = __webpack_require__("../node_modules/tns-core-modules/profiling/profiling.js");
__export(__webpack_require__("../node_modules/tns-core-modules/ui/core/view/view.js"));
var view_1 = __webpack_require__("../node_modules/tns-core-modules/ui/core/view/view.js");
var knownCollections;
(function (knownCollections) {
knownCollections.actionItems = "actionItems";
})(knownCollections = exports.knownCollections || (exports.knownCollections = {}));
var ActionBarBase = (function (_super) {
__extends(ActionBarBase, _super);
function ActionBarBase() {
var _this = _super.call(this) || this;
_this._actionItems = new ActionItems(_this);
return _this;
}
Object.defineProperty(ActionBarBase.prototype, "navigationButton", {
get: function () {
return this._navigationButton;
},
set: function (value) {
if (this._navigationButton !== value) {
if (this._navigationButton) {
this._removeView(this._navigationButton);
this._navigationButton.actionBar = undefined;
}
this._navigationButton = value;
if (this._navigationButton) {
this._navigationButton.actionBar = this;
this._addView(this._navigationButton);
}
this.update();
}
},
enumerable: true,
configurable: true
});
Object.defineProperty(ActionBarBase.prototype, "actionItems", {
get: function () {
return this._actionItems;
},
set: function (value) {
throw new Error("actionItems property is read-only");
},
enumerable: true,
configurable: true
});
Object.defineProperty(ActionBarBase.prototype, "titleView", {
get: function () {
return this._titleView;
},
set: function (value) {
if (this._titleView !== value) {
if (this._titleView) {
this._removeView(this._titleView);
this._titleView.style[view_1.horizontalAlignmentProperty.cssName] = view_1.unsetValue;
this._titleView.style[view_1.verticalAlignmentProperty.cssName] = view_1.unsetValue;
}
this._titleView = value;
if (value) {
this._addView(value);
var style = value.style;
if (!view_1.horizontalAlignmentProperty.isSet(style)) {
style[view_1.horizontalAlignmentProperty.cssName] = "center";
}
if (!view_1.verticalAlignmentProperty.isSet(style)) {
style[view_1.verticalAlignmentProperty.cssName] = "middle";
}
}
this.update();
}
},
enumerable: true,
configurable: true
});
Object.defineProperty(ActionBarBase.prototype, "ios", {
get: function () {
return undefined;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ActionBarBase.prototype, "android", {
get: function () {
return undefined;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ActionBarBase.prototype, "_childrenCount", {
get: function () {
var actionViewsCount = 0;
this._actionItems.getItems().forEach(function (actionItem) {
if (actionItem.actionView) {
actionViewsCount++;
}
});
return actionViewsCount + (this.titleView ? 1 : 0);
},
enumerable: true,
configurable: true
});
ActionBarBase.prototype.update = function () {
};
ActionBarBase.prototype._onTitlePropertyChanged = function () {
};
ActionBarBase.prototype._addArrayFromBuilder = function (name, value) {
if (name === "actionItems") {
this.actionItems.setItems(value);
}
};
ActionBarBase.prototype.eachChildView = function (callback) {
var titleView = this.titleView;
if (titleView) {
callback(titleView);
}
};
ActionBarBase.prototype.eachChild = function (callback) {
var titleView = this.titleView;
if (titleView) {
callback(titleView);
}
var navigationButton = this._navigationButton;
if (navigationButton) {
callback(navigationButton);
}
this.actionItems.getItems().forEach(function (actionItem) {
callback(actionItem);
});
};
ActionBarBase.prototype._isEmpty = function () {
if (this.title ||
this.titleView ||
(this.android && this.android.icon) ||
this.navigationButton ||
this.actionItems.getItems().length > 0) {
return false;
}
return true;
};
ActionBarBase = __decorate([
view_1.CSSType("ActionBar")
], ActionBarBase);
return ActionBarBase;
}(view_1.View));
exports.ActionBarBase = ActionBarBase;
var ActionItems = (function () {
function ActionItems(actionBar) {
this._items = new Array();
this._actionBar = actionBar;
}
ActionItems.prototype.addItem = function (item) {
if (!item) {
throw new Error("Cannot add empty item");
}
this._items.push(item);
item.actionBar = this._actionBar;
this._actionBar._addView(item);
this.invalidate();
};
ActionItems.prototype.removeItem = function (item) {
if (!item) {
throw new Error("Cannot remove empty item");
}
var itemIndex = this._items.indexOf(item);
if (itemIndex < 0) {
throw new Error("Cannot find item to remove");
}
this._items.splice(itemIndex, 1);
this._actionBar._removeView(item);
item.actionBar = undefined;
this.invalidate();
};
ActionItems.prototype.getItems = function () {
return this._items.slice();
};
ActionItems.prototype.getVisibleItems = function () {
var visibleItems = [];
this._items.forEach(function (item) {
if (isVisible(item)) {
visibleItems.push(item);
}
});
return visibleItems;
};
ActionItems.prototype.getItemAt = function (index) {
if (index < 0 || index >= this._items.length) {
return undefined;
}
return this._items[index];
};
ActionItems.prototype.setItems = function (items) {
while (this._items.length > 0) {
this.removeItem(this._items[this._items.length - 1]);
}
for (var i = 0; i < items.length; i++) {
this.addItem(items[i]);
}
this.invalidate();
};
ActionItems.prototype.invalidate = function () {
if (this._actionBar) {
this._actionBar.update();
}
};
return ActionItems;
}());
exports.ActionItems = ActionItems;
var ActionItemBase = (function (_super) {
__extends(ActionItemBase, _super);
function ActionItemBase() {
return _super !== null && _super.apply(this, arguments) || this;
}
Object.defineProperty(ActionItemBase.prototype, "actionView", {
get: function () {
return this._actionView;
},
set: function (value) {
if (this._actionView !== value) {
if (this._actionView) {
this._actionView.style[view_1.horizontalAlignmentProperty.cssName] = view_1.unsetValue;
this._actionView.style[view_1.verticalAlignmentProperty.cssName] = view_1.unsetValue;
this._removeView(this._actionView);
}
this._actionView = value;
if (this._actionView) {
this._addView(this._actionView);
}
if (this._actionBar) {
this._actionBar.update();
}
}
},
enumerable: true,
configurable: true
});
Object.defineProperty(ActionItemBase.prototype, "actionBar", {
get: function () {
return this._actionBar;
},
set: function (value) {
if (value !== this._actionBar) {
this._actionBar = value;
}
},
enumerable: true,
configurable: true
});
ActionItemBase.prototype.onLoaded = function () {
if (this._actionView) {
this._actionView.style[view_1.horizontalAlignmentProperty.cssName] = "center";
this._actionView.style[view_1.verticalAlignmentProperty.cssName] = "middle";
}
_super.prototype.onLoaded.call(this);
};
ActionItemBase.prototype._raiseTap = function () {
this._emit(ActionItemBase.tapEvent);
};
ActionItemBase.prototype._addChildFromBuilder = function (name, value) {
this.actionView = value;
};
ActionItemBase.prototype._onVisibilityChanged = function (visibility) {
if (this.actionBar) {
this.actionBar.update();
}
};
ActionItemBase.prototype.eachChild = function (callback) {
if (this._actionView) {
callback(this._actionView);
}
};
ActionItemBase.tapEvent = "tap";
__decorate([
profiling_1.profile
], ActionItemBase.prototype, "onLoaded", null);
return ActionItemBase;
}(view_1.ViewBase));
exports.ActionItemBase = ActionItemBase;
function isVisible(item) {
return item.visibility === "visible";
}
exports.isVisible = isVisible;
function onTitlePropertyChanged(actionBar, oldValue, newValue) {
actionBar._onTitlePropertyChanged();
}
exports.titleProperty = new view_1.Property({ name: "title", valueChanged: onTitlePropertyChanged });
exports.titleProperty.register(ActionBarBase);
function onItemChanged(item, oldValue, newValue) {
if (item.actionBar) {
item.actionBar.update();
}
}
function onVisibilityChanged(item, oldValue, newValue) {
item._onVisibilityChanged(newValue);
}
function traceMissingIcon(icon) {
view_1.traceWrite("Could not load action bar icon: " + icon, view_1.traceCategories.Error, view_1.traceMessageType.error);
}
exports.traceMissingIcon = traceMissingIcon;
exports.iosIconRenderingModeProperty = new view_1.Property({ name: "iosIconRenderingMode", defaultValue: "alwaysOriginal" });
exports.iosIconRenderingModeProperty.register(ActionBarBase);
exports.textProperty = new view_1.Property({ name: "text", defaultValue: "", valueChanged: onItemChanged });
exports.textProperty.register(ActionItemBase);
exports.iconProperty = new view_1.Property({ name: "icon", valueChanged: onItemChanged });
exports.iconProperty.register(ActionItemBase);
exports.visibilityProperty = new view_1.Property({ name: "visibility", defaultValue: "visible", valueChanged: onVisibilityChanged });
exports.visibilityProperty.register(ActionItemBase);
exports.flatProperty = new view_1.Property({ name: "flat", defaultValue: false, valueConverter: view_1.booleanConverter });
exports.flatProperty.register(ActionBarBase);
//# sourceMappingURL=action-bar-common.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/ui/action-bar/action-bar.js":
/***/ (function(module, exports, __webpack_require__) {
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
Object.defineProperty(exports, "__esModule", { value: true });
var action_bar_common_1 = __webpack_require__("../node_modules/tns-core-modules/ui/action-bar/action-bar-common.js");
var image_source_1 = __webpack_require__("../node_modules/tns-core-modules/image-source/image-source.js");
var utils_1 = __webpack_require__("../node_modules/tns-core-modules/utils/utils.js");
__export(__webpack_require__("../node_modules/tns-core-modules/ui/action-bar/action-bar-common.js"));
var majorVersion = utils_1.ios.MajorVersion;
var UNSPECIFIED = action_bar_common_1.layout.makeMeasureSpec(0, action_bar_common_1.layout.UNSPECIFIED);
function loadActionIconFromFileOrResource(icon) {
var img = image_source_1.fromFileOrResource(icon);
if (img && img.ios) {
return img.ios;
}
else {
action_bar_common_1.traceMissingIcon(icon);
return null;
}
}
var TapBarItemHandlerImpl = (function (_super) {
__extends(TapBarItemHandlerImpl, _super);
function TapBarItemHandlerImpl() {
return _super !== null && _super.apply(this, arguments) || this;
}
TapBarItemHandlerImpl.initWithOwner = function (owner) {
var handler = TapBarItemHandlerImpl.new();
handler._owner = owner;
return handler;
};
TapBarItemHandlerImpl.prototype.tap = function (args) {
var owner = this._owner.get();
if (owner) {
owner._raiseTap();
}
};
TapBarItemHandlerImpl.ObjCExposedMethods = {
"tap": { returns: interop.types.void, params: [interop.types.id] }
};
return TapBarItemHandlerImpl;
}(NSObject));
var ActionItem = (function (_super) {
__extends(ActionItem, _super);
function ActionItem() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this._ios = {
position: "left",
systemIcon: undefined
};
return _this;
}
Object.defineProperty(ActionItem.prototype, "ios", {
get: function () {
return this._ios;
},
set: function (value) {
throw new Error("ActionItem.ios is read-only");
},
enumerable: true,
configurable: true
});
return ActionItem;
}(action_bar_common_1.ActionItemBase));
exports.ActionItem = ActionItem;
var NavigationButton = (function (_super) {
__extends(NavigationButton, _super);
function NavigationButton() {
return _super !== null && _super.apply(this, arguments) || this;
}
NavigationButton.prototype._onVisibilityChanged = function (visibility) {
if (this._navigationItem) {
var visible = visibility === "visible";
this._navigationItem.setHidesBackButtonAnimated(!visible, true);
}
};
return NavigationButton;
}(ActionItem));
exports.NavigationButton = NavigationButton;
var ActionBar = (function (_super) {
__extends(ActionBar, _super);
function ActionBar() {
return _super !== null && _super.apply(this, arguments) || this;
}
Object.defineProperty(ActionBar.prototype, "ios", {
get: function () {
var page = this.page;
if (!page || !page.parent) {
return;
}
var viewController = page.ios;
if (viewController.navigationController !== null) {
return viewController.navigationController.navigationBar;
}
return null;
},
enumerable: true,
configurable: true
});
ActionBar.prototype.createNativeView = function () {
return this.ios;
};
ActionBar.prototype._addChildFromBuilder = function (name, value) {
if (value instanceof NavigationButton) {
this.navigationButton = value;
}
else if (value instanceof ActionItem) {
this.actionItems.addItem(value);
}
else if (value instanceof action_bar_common_1.View) {
this.titleView = value;
}
};
Object.defineProperty(ActionBar.prototype, "_getActualSize", {
get: function () {
var navBar = this.ios;
if (!navBar) {
return { width: 0, height: 0 };
}
var frame = navBar.frame;
var size = frame.size;
var width = action_bar_common_1.layout.toDevicePixels(size.width);
var height = action_bar_common_1.layout.toDevicePixels(size.height);
return { width: width, height: height };
},
enumerable: true,
configurable: true
});
ActionBar.prototype.layoutInternal = function () {
var _a = this._getActualSize, width = _a.width, height = _a.height;
var widthSpec = action_bar_common_1.layout.makeMeasureSpec(width, action_bar_common_1.layout.EXACTLY);
var heightSpec = action_bar_common_1.layout.makeMeasureSpec(height, action_bar_common_1.layout.EXACTLY);
this.measure(widthSpec, heightSpec);
this.layout(0, 0, width, height, false);
};
ActionBar.prototype._getIconRenderingMode = function () {
switch (this.iosIconRenderingMode) {
case "alwaysOriginal":
return 1;
case "alwaysTemplate":
return 2;
case "automatic":
default:
return 1;
}
};
ActionBar.prototype.update = function () {
var page = this.page;
if (!page || !page.frame) {
return;
}
var viewController = page.ios;
var navigationItem = viewController.navigationItem;
var navController = viewController.navigationController;
if (!navController) {
return;
}
var navigationBar = navController.navigationBar;
var previousController;
navigationItem.title = this.title;
var titleView = this.titleView;
if (titleView && titleView.ios) {
navigationItem.titleView = titleView.ios;
}
else {
navigationItem.titleView = null;
}
var indexOfViewController = navController.viewControllers.indexOfObject(viewController);
if (indexOfViewController > 0 && indexOfViewController < navController.viewControllers.count) {
previousController = navController.viewControllers[indexOfViewController - 1];
}
if (previousController) {
if (this.navigationButton) {
var tapHandler = TapBarItemHandlerImpl.initWithOwner(new WeakRef(this.navigationButton));
var barButtonItem = UIBarButtonItem.alloc().initWithTitleStyleTargetAction(this.navigationButton.text + "", 0, tapHandler, "tap");
previousController.navigationItem.backBarButtonItem = barButtonItem;
}
else {
previousController.navigationItem.backBarButtonItem = null;
}
}
var img;
if (this.navigationButton && action_bar_common_1.isVisible(this.navigationButton) && this.navigationButton.icon) {
img = loadActionIconFromFileOrResource(this.navigationButton.icon);
}
if (img) {
var image = img.imageWithRenderingMode(1);
navigationBar.backIndicatorImage = image;
navigationBar.backIndicatorTransitionMaskImage = image;
}
else {
navigationBar.backIndicatorImage = null;
navigationBar.backIndicatorTransitionMaskImage = null;
}
if (this.navigationButton) {
this.navigationButton._navigationItem = navigationItem;
navigationItem.setHidesBackButtonAnimated(!action_bar_common_1.isVisible(this.navigationButton), false);
}
this.populateMenuItems(navigationItem);
this.updateColors(navigationBar);
this.updateFlatness(navigationBar);
if (!this.isLayoutValid) {
this.layoutInternal();
}
};
ActionBar.prototype.populateMenuItems = function (navigationItem) {
var items = this.actionItems.getVisibleItems();
var leftBarItems = [];
var rightBarItems = [];
for (var i = 0; i < items.length; i++) {
var barButtonItem = this.createBarButtonItem(items[i]);
if (items[i].ios.position === "left") {
leftBarItems.push(barButtonItem);
}
else {
rightBarItems.splice(0, 0, barButtonItem);
}
}
navigationItem.setLeftBarButtonItemsAnimated(leftBarItems, false);
navigationItem.setRightBarButtonItemsAnimated(rightBarItems, false);
if (leftBarItems.length > 0) {
navigationItem.leftItemsSupplementBackButton = true;
}
};
ActionBar.prototype.createBarButtonItem = function (item) {
var tapHandler = TapBarItemHandlerImpl.initWithOwner(new WeakRef(item));
item.handler = tapHandler;
var barButtonItem;
if (item.actionView && item.actionView.ios) {
var recognizer = UITapGestureRecognizer.alloc().initWithTargetAction(tapHandler, "tap");
item.actionView.ios.addGestureRecognizer(recognizer);
barButtonItem = UIBarButtonItem.alloc().initWithCustomView(item.actionView.ios);
}
else if (item.ios.systemIcon !== undefined) {
var id = item.ios.systemIcon;
if (typeof id === "string") {
id = parseInt(id);
}
barButtonItem = UIBarButtonItem.alloc().initWithBarButtonSystemItemTargetAction(id, tapHandler, "tap");
}
else if (item.icon) {
var img = loadActionIconFromFileOrResource(item.icon);
var image = img.imageWithRenderingMode(this._getIconRenderingMode());
barButtonItem = UIBarButtonItem.alloc().initWithImageStyleTargetAction(image, 0, tapHandler, "tap");
}
else {
barButtonItem = UIBarButtonItem.alloc().initWithTitleStyleTargetAction(item.text + "", 0, tapHandler, "tap");
}
if (item.text) {
barButtonItem.isAccessibilityElement = true;
barButtonItem.accessibilityLabel = item.text;
barButtonItem.accessibilityTraits = UIAccessibilityTraitButton;
}
return barButtonItem;
};
ActionBar.prototype.updateColors = function (navBar) {
var color = this.color;
this.setColor(navBar, color);
var bgColor = this.backgroundColor;
navBar.barTintColor = bgColor ? bgColor.ios : null;
};
ActionBar.prototype.setColor = function (navBar, color) {
var _a, _b;
if (color) {
navBar.titleTextAttributes = (_a = {}, _a[NSForegroundColorAttributeName] = color.ios, _a);
navBar.largeTitleTextAttributes = (_b = {}, _b[NSForegroundColorAttributeName] = color.ios, _b);
navBar.tintColor = color.ios;
}
else {
navBar.titleTextAttributes = null;
navBar.largeTitleTextAttributes = null;
navBar.tintColor = null;
}
};
ActionBar.prototype._onTitlePropertyChanged = function () {
var page = this.page;
if (!page) {
return;
}
if (page.frame) {
page.frame._updateActionBar();
}
var navigationItem = page.ios.navigationItem;
navigationItem.title = this.title;
};
ActionBar.prototype.updateFlatness = function (navBar) {
if (this.flat) {
navBar.setBackgroundImageForBarMetrics(UIImage.new(), 0);
navBar.shadowImage = UIImage.new();
navBar.translucent = false;
}
else {
navBar.setBackgroundImageForBarMetrics(null, null);
navBar.shadowImage = null;
navBar.translucent = true;
}
};
ActionBar.prototype.onMeasure = function (widthMeasureSpec, heightMeasureSpec) {
var _this = this;
var width = action_bar_common_1.layout.getMeasureSpecSize(widthMeasureSpec);
var height = action_bar_common_1.layout.getMeasureSpecSize(heightMeasureSpec);
if (this.titleView) {
action_bar_common_1.View.measureChild(this, this.titleView, UNSPECIFIED, UNSPECIFIED);
}
this.actionItems.getItems().forEach(function (actionItem) {
var actionView = actionItem.actionView;
if (actionView) {
action_bar_common_1.View.measureChild(_this, actionView, UNSPECIFIED, UNSPECIFIED);
}
});
this.setMeasuredDimension(width, height);
};
ActionBar.prototype.onLayout = function (left, top, right, bottom) {
var _this = this;
var titleView = this.titleView;
if (titleView) {
if (majorVersion > 10) {
action_bar_common_1.View.layoutChild(this, titleView, 0, 0, titleView.getMeasuredWidth(), titleView.getMeasuredHeight());
}
else {
action_bar_common_1.View.layoutChild(this, titleView, 0, 0, right - left, bottom - top);
}
}
this.actionItems.getItems().forEach(function (actionItem) {
var actionView = actionItem.actionView;
if (actionView && actionView.ios) {
var measuredWidth = actionView.getMeasuredWidth();
var measuredHeight = actionView.getMeasuredHeight();
action_bar_common_1.View.layoutChild(_this, actionView, 0, 0, measuredWidth, measuredHeight);
}
});
_super.prototype.onLayout.call(this, left, top, right, bottom);
};
ActionBar.prototype.layoutNativeView = function (left, top, right, bottom) {
return;
};
Object.defineProperty(ActionBar.prototype, "navBar", {
get: function () {
var page = this.page;
if (!page || !page.frame) {
return undefined;
}
return page.frame.ios.controller.navigationBar;
},
enumerable: true,
configurable: true
});
ActionBar.prototype[action_bar_common_1.colorProperty.getDefault] = function () {
return null;
};
ActionBar.prototype[action_bar_common_1.colorProperty.setNative] = function (color) {
var navBar = this.navBar;
this.setColor(navBar, color);
};
ActionBar.prototype[action_bar_common_1.backgroundColorProperty.getDefault] = function () {
return null;
};
ActionBar.prototype[action_bar_common_1.backgroundColorProperty.setNative] = function (value) {
var navBar = this.navBar;
if (navBar) {
var color = value instanceof action_bar_common_1.Color ? value.ios : value;
navBar.barTintColor = color;
}
};
ActionBar.prototype[action_bar_common_1.backgroundInternalProperty.getDefault] = function () {
return null;
};
ActionBar.prototype[action_bar_common_1.backgroundInternalProperty.setNative] = function (value) {
};
ActionBar.prototype[action_bar_common_1.flatProperty.setNative] = function (value) {
var navBar = this.navBar;
if (navBar) {
this.updateFlatness(navBar);
}
};
ActionBar.prototype[action_bar_common_1.iosIconRenderingModeProperty.getDefault] = function () {
return "alwaysOriginal";
};
ActionBar.prototype[action_bar_common_1.iosIconRenderingModeProperty.setNative] = function (value) {
this.update();
};
return ActionBar;
}(action_bar_common_1.ActionBarBase));
exports.ActionBar = ActionBar;
//# sourceMappingURL=action-bar.ios.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/ui/activity-indicator/activity-indicator-common.js":
/***/ (function(module, exports, __webpack_require__) {
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
Object.defineProperty(exports, "__esModule", { value: true });
var view_1 = __webpack_require__("../node_modules/tns-core-modules/ui/core/view/view.js");
__export(__webpack_require__("../node_modules/tns-core-modules/ui/core/view/view.js"));
var ActivityIndicatorBase = (function (_super) {
__extends(ActivityIndicatorBase, _super);
function ActivityIndicatorBase() {
return _super !== null && _super.apply(this, arguments) || this;
}
ActivityIndicatorBase = __decorate([
view_1.CSSType("ActivityIndicator")
], ActivityIndicatorBase);
return ActivityIndicatorBase;
}(view_1.View));
exports.ActivityIndicatorBase = ActivityIndicatorBase;
ActivityIndicatorBase.prototype.recycleNativeView = "auto";
exports.busyProperty = new view_1.Property({ name: "busy", defaultValue: false, valueConverter: view_1.booleanConverter });
exports.busyProperty.register(ActivityIndicatorBase);
//# sourceMappingURL=activity-indicator-common.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/ui/activity-indicator/activity-indicator.js":
/***/ (function(module, exports, __webpack_require__) {
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
Object.defineProperty(exports, "__esModule", { value: true });
var activity_indicator_common_1 = __webpack_require__("../node_modules/tns-core-modules/ui/activity-indicator/activity-indicator-common.js");
__export(__webpack_require__("../node_modules/tns-core-modules/ui/activity-indicator/activity-indicator-common.js"));
var ActivityIndicator = (function (_super) {
__extends(ActivityIndicator, _super);
function ActivityIndicator() {
return _super !== null && _super.apply(this, arguments) || this;
}
ActivityIndicator.prototype.createNativeView = function () {
var view = UIActivityIndicatorView.alloc().initWithActivityIndicatorStyle(2);
view.hidesWhenStopped = true;
return view;
};
Object.defineProperty(ActivityIndicator.prototype, "ios", {
get: function () {
return this.nativeViewProtected;
},
enumerable: true,
configurable: true
});
ActivityIndicator.prototype[activity_indicator_common_1.busyProperty.getDefault] = function () {
if (this.nativeViewProtected.isAnimating) {
return this.nativeViewProtected.isAnimating();
}
else {
return this.nativeViewProtected.animating;
}
};
ActivityIndicator.prototype[activity_indicator_common_1.busyProperty.setNative] = function (value) {
var nativeView = this.nativeViewProtected;
if (value) {
nativeView.startAnimating();
}
else {
nativeView.stopAnimating();
}
if (nativeView.hidesWhenStopped) {
this.requestLayout();
}
};
ActivityIndicator.prototype[activity_indicator_common_1.colorProperty.getDefault] = function () {
return this.nativeViewProtected.color;
};
ActivityIndicator.prototype[activity_indicator_common_1.colorProperty.setNative] = function (value) {
this.nativeViewProtected.color = value instanceof activity_indicator_common_1.Color ? value.ios : value;
};
return ActivityIndicator;
}(activity_indicator_common_1.ActivityIndicatorBase));
exports.ActivityIndicator = ActivityIndicator;
//# sourceMappingURL=activity-indicator.ios.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/ui/animation/animation-common.js":
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", { value: true });
var color_1 = __webpack_require__("../node_modules/tns-core-modules/color/color.js");
exports.Color = color_1.Color;
var trace_1 = __webpack_require__("../node_modules/tns-core-modules/trace/trace.js");
exports.traceEnabled = trace_1.isEnabled;
exports.traceWrite = trace_1.write;
exports.traceCategories = trace_1.categories;
exports.traceType = trace_1.messageType;
var Properties;
(function (Properties) {
Properties.opacity = "opacity";
Properties.backgroundColor = "backgroundColor";
Properties.translate = "translate";
Properties.rotate = "rotate";
Properties.scale = "scale";
})(Properties = exports.Properties || (exports.Properties = {}));
var CubicBezierAnimationCurve = (function () {
function CubicBezierAnimationCurve(x1, y1, x2, y2) {
this.x1 = x1;
this.y1 = y1;
this.x2 = x2;
this.y2 = y2;
}
return CubicBezierAnimationCurve;
}());
exports.CubicBezierAnimationCurve = CubicBezierAnimationCurve;
var AnimationBase = (function () {
function AnimationBase(animationDefinitions, playSequentially) {
if (!animationDefinitions || animationDefinitions.length === 0) {
throw new Error("No animation definitions specified");
}
if (trace_1.isEnabled()) {
trace_1.write("Analyzing " + animationDefinitions.length + " animation definitions...", trace_1.categories.Animation);
}
this._propertyAnimations = new Array();
for (var i = 0, length_1 = animationDefinitions.length; i < length_1; i++) {
if (animationDefinitions[i].curve) {
animationDefinitions[i].curve = this._resolveAnimationCurve(animationDefinitions[i].curve);
}
this._propertyAnimations = this._propertyAnimations.concat(AnimationBase._createPropertyAnimations(animationDefinitions[i]));
}
if (this._propertyAnimations.length === 0) {
throw new Error("Nothing to animate.");
}
if (trace_1.isEnabled()) {
trace_1.write("Created " + this._propertyAnimations.length + " individual property animations.", trace_1.categories.Animation);
}
this._playSequentially = playSequentially;
}
AnimationBase.prototype._rejectAlreadyPlaying = function () {
var reason = "Animation is already playing.";
trace_1.write(reason, trace_1.categories.Animation, trace_1.messageType.warn);
return new Promise(function (resolve, reject) {
reject(reason);
});
};
AnimationBase.prototype.play = function () {
var _this_1 = this;
var animationFinishedPromise = new Promise(function (resolve, reject) {
_this_1._resolve = resolve;
_this_1._reject = reject;
});
this.fixupAnimationPromise(animationFinishedPromise);
this._isPlaying = true;
return animationFinishedPromise;
};
AnimationBase.prototype.fixupAnimationPromise = function (promise) {
var _this = this;
promise.cancel = function () {
_this.cancel();
};
var _then = promise.then;
promise.then = function () {
var r = _then.apply(promise, arguments);
_this.fixupAnimationPromise(r);
return r;
};
var _catch = promise.catch;
promise.catch = function () {
var r = _catch.apply(promise, arguments);
_this.fixupAnimationPromise(r);
return r;
};
};
AnimationBase.prototype.cancel = function () {
};
Object.defineProperty(AnimationBase.prototype, "isPlaying", {
get: function () {
return this._isPlaying;
},
enumerable: true,
configurable: true
});
AnimationBase.prototype._resolveAnimationFinishedPromise = function () {
this._isPlaying = false;
this._resolve();
};
AnimationBase.prototype._rejectAnimationFinishedPromise = function () {
this._isPlaying = false;
this._reject(new Error("Animation cancelled."));
};
AnimationBase._createPropertyAnimations = function (animationDefinition) {
if (!animationDefinition.target) {
throw new Error("No animation target specified.");
}
for (var item in animationDefinition) {
if (animationDefinition[item] === undefined) {
continue;
}
if ((item === Properties.opacity ||
item === Properties.rotate ||
item === "duration" ||
item === "delay" ||
item === "iterations") && typeof animationDefinition[item] !== "number") {
throw new Error("Property " + item + " must be valid number. Value: " + animationDefinition[item]);
}
else if ((item === Properties.scale || item === Properties.translate) &&
(typeof animationDefinition[item].x !== "number" || typeof animationDefinition[item].y !== "number")) {
throw new Error("Property " + item + " must be valid Pair. Value: " + animationDefinition[item]);
}
else if (item === Properties.backgroundColor && !color_1.Color.isValid(animationDefinition.backgroundColor)) {
throw new Error("Property " + item + " must be valid color. Value: " + animationDefinition[item]);
}
}
var propertyAnimations = new Array();
if (animationDefinition.opacity !== undefined) {
propertyAnimations.push({
target: animationDefinition.target,
property: Properties.opacity,
value: animationDefinition.opacity,
duration: animationDefinition.duration,
delay: animationDefinition.delay,
iterations: animationDefinition.iterations,
curve: animationDefinition.curve
});
}
if (animationDefinition.backgroundColor !== undefined) {
propertyAnimations.push({
target: animationDefinition.target,
property: Properties.backgroundColor,
value: typeof animationDefinition.backgroundColor === "string" ?
new color_1.Color(animationDefinition.backgroundColor) : animationDefinition.backgroundColor,
duration: animationDefinition.duration,
delay: animationDefinition.delay,
iterations: animationDefinition.iterations,
curve: animationDefinition.curve
});
}
if (animationDefinition.translate !== undefined) {
propertyAnimations.push({
target: animationDefinition.target,
property: Properties.translate,
value: animationDefinition.translate,
duration: animationDefinition.duration,
delay: animationDefinition.delay,
iterations: animationDefinition.iterations,
curve: animationDefinition.curve
});
}
if (animationDefinition.scale !== undefined) {
propertyAnimations.push({
target: animationDefinition.target,
property: Properties.scale,
value: animationDefinition.scale,
duration: animationDefinition.duration,
delay: animationDefinition.delay,
iterations: animationDefinition.iterations,
curve: animationDefinition.curve
});
}
if (animationDefinition.rotate !== undefined) {
propertyAnimations.push({
target: animationDefinition.target,
property: Properties.rotate,
value: animationDefinition.rotate,
duration: animationDefinition.duration,
delay: animationDefinition.delay,
iterations: animationDefinition.iterations,
curve: animationDefinition.curve
});
}
if (propertyAnimations.length === 0) {
throw new Error("No animation property specified.");
}
return propertyAnimations;
};
AnimationBase._getAnimationInfo = function (animation) {
return JSON.stringify({
target: animation.target.id,
property: animation.property,
value: animation.value,
duration: animation.duration,
delay: animation.delay,
iterations: animation.iterations,
curve: animation.curve
});
};
return AnimationBase;
}());
exports.AnimationBase = AnimationBase;
//# sourceMappingURL=animation-common.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/ui/animation/animation.js":
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global) {function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
Object.defineProperty(exports, "__esModule", { value: true });
var animation_common_1 = __webpack_require__("../node_modules/tns-core-modules/ui/animation/animation-common.js");
var style_properties_1 = __webpack_require__("../node_modules/tns-core-modules/ui/styling/style-properties.js");
var utils_1 = __webpack_require__("../node_modules/tns-core-modules/utils/utils.js");
__export(__webpack_require__("../node_modules/tns-core-modules/ui/animation/animation-common.js"));
var getter = utils_1.ios.getter;
var _transform = "_transform";
var _skip = "_skip";
var FLT_MAX = 340282346638528859811704183484516925440.000000;
var AnimationInfo = (function () {
function AnimationInfo() {
}
return AnimationInfo;
}());
var AnimationDelegateImpl = (function (_super) {
__extends(AnimationDelegateImpl, _super);
function AnimationDelegateImpl() {
return _super !== null && _super.apply(this, arguments) || this;
}
AnimationDelegateImpl.initWithFinishedCallback = function (finishedCallback, propertyAnimation, valueSource) {
var delegate = AnimationDelegateImpl.new();
delegate._finishedCallback = finishedCallback;
delegate._propertyAnimation = propertyAnimation;
delegate._valueSource = valueSource;
return delegate;
};
AnimationDelegateImpl.prototype.animationDidStart = function (anim) {
var value = this._propertyAnimation.value;
var setLocal = this._valueSource === "animation";
var targetStyle = this._propertyAnimation.target.style;
this._propertyAnimation.target._suspendPresentationLayerUpdates();
switch (this._propertyAnimation.property) {
case animation_common_1.Properties.backgroundColor:
targetStyle[setLocal ? style_properties_1.backgroundColorProperty.name : style_properties_1.backgroundColorProperty.keyframe] = value;
break;
case animation_common_1.Properties.opacity:
targetStyle[setLocal ? style_properties_1.opacityProperty.name : style_properties_1.opacityProperty.keyframe] = value;
break;
case animation_common_1.Properties.rotate:
targetStyle[setLocal ? style_properties_1.rotateProperty.name : style_properties_1.rotateProperty.keyframe] = value;
break;
case animation_common_1.Properties.translate:
targetStyle[setLocal ? style_properties_1.translateXProperty.name : style_properties_1.translateXProperty.keyframe] = value.x;
targetStyle[setLocal ? style_properties_1.translateYProperty.name : style_properties_1.translateYProperty.keyframe] = value.y;
break;
case animation_common_1.Properties.scale:
targetStyle[setLocal ? style_properties_1.scaleXProperty.name : style_properties_1.scaleXProperty.keyframe] = value.x === 0 ? 0.001 : value.x;
targetStyle[setLocal ? style_properties_1.scaleYProperty.name : style_properties_1.scaleYProperty.keyframe] = value.y === 0 ? 0.001 : value.y;
break;
case _transform:
if (value[animation_common_1.Properties.translate] !== undefined) {
targetStyle[setLocal ? style_properties_1.translateXProperty.name : style_properties_1.translateXProperty.keyframe] = value[animation_common_1.Properties.translate].x;
targetStyle[setLocal ? style_properties_1.translateYProperty.name : style_properties_1.translateYProperty.keyframe] = value[animation_common_1.Properties.translate].y;
}
if (value[animation_common_1.Properties.scale] !== undefined) {
var x = value[animation_common_1.Properties.scale].x;
var y = value[animation_common_1.Properties.scale].y;
targetStyle[setLocal ? style_properties_1.scaleXProperty.name : style_properties_1.scaleXProperty.keyframe] = x === 0 ? 0.001 : x;
targetStyle[setLocal ? style_properties_1.scaleYProperty.name : style_properties_1.scaleYProperty.keyframe] = y === 0 ? 0.001 : y;
}
break;
}
this._propertyAnimation.target._resumePresentationLayerUpdates();
};
AnimationDelegateImpl.prototype.animationDidStopFinished = function (anim, finished) {
if (this._finishedCallback) {
this._finishedCallback(!finished);
}
if (finished && this.nextAnimation) {
this.nextAnimation();
}
};
AnimationDelegateImpl.ObjCProtocols = global.CAAnimationDelegate ? [global.CAAnimationDelegate] : [];
return AnimationDelegateImpl;
}(NSObject));
function _resolveAnimationCurve(curve) {
switch (curve) {
case "easeIn":
return CAMediaTimingFunction.functionWithName(kCAMediaTimingFunctionEaseIn);
case "easeOut":
return CAMediaTimingFunction.functionWithName(kCAMediaTimingFunctionEaseOut);
case "easeInOut":
return CAMediaTimingFunction.functionWithName(kCAMediaTimingFunctionEaseInEaseOut);
case "linear":
return CAMediaTimingFunction.functionWithName(kCAMediaTimingFunctionLinear);
case "spring":
return curve;
case "ease":
return CAMediaTimingFunction.functionWithControlPoints(0.25, 0.1, 0.25, 1.0);
default:
if (curve instanceof CAMediaTimingFunction) {
return curve;
}
else if (curve instanceof animation_common_1.CubicBezierAnimationCurve) {
var animationCurve = curve;
return CAMediaTimingFunction.functionWithControlPoints(animationCurve.x1, animationCurve.y1, animationCurve.x2, animationCurve.y2);
}
else {
throw new Error("Invalid animation curve: " + curve);
}
}
}
exports._resolveAnimationCurve = _resolveAnimationCurve;
var Animation = (function (_super) {
__extends(Animation, _super);
function Animation(animationDefinitions, playSequentially) {
var _this = _super.call(this, animationDefinitions, playSequentially) || this;
_this._valueSource = "animation";
if (animationDefinitions.length > 0 && animationDefinitions[0].valueSource !== undefined) {
_this._valueSource = animationDefinitions[0].valueSource;
}
if (!playSequentially) {
if (animation_common_1.traceEnabled()) {
animation_common_1.traceWrite("Non-merged Property Animations: " + _this._propertyAnimations.length, animation_common_1.traceCategories.Animation);
}
_this._mergedPropertyAnimations = Animation._mergeAffineTransformAnimations(_this._propertyAnimations);
if (animation_common_1.traceEnabled()) {
animation_common_1.traceWrite("Merged Property Animations: " + _this._mergedPropertyAnimations.length, animation_common_1.traceCategories.Animation);
}
}
else {
_this._mergedPropertyAnimations = _this._propertyAnimations;
}
var that = _this;
var animationFinishedCallback = function (cancelled) {
if (that._playSequentially) {
if (cancelled) {
that._rejectAnimationFinishedPromise();
}
else {
that._resolveAnimationFinishedPromise();
}
}
else {
if (cancelled) {
that._cancelledAnimations++;
}
else {
that._finishedAnimations++;
}
if (that._cancelledAnimations > 0 && (that._cancelledAnimations + that._finishedAnimations) === that._mergedPropertyAnimations.length) {
if (animation_common_1.traceEnabled()) {
animation_common_1.traceWrite(that._cancelledAnimations + " animations cancelled.", animation_common_1.traceCategories.Animation);
}
that._rejectAnimationFinishedPromise();
}
else if (that._finishedAnimations === that._mergedPropertyAnimations.length) {
if (animation_common_1.traceEnabled()) {
animation_common_1.traceWrite(that._finishedAnimations + " animations finished.", animation_common_1.traceCategories.Animation);
}
that._resolveAnimationFinishedPromise();
}
}
};
_this._iOSAnimationFunction = Animation._createiOSAnimationFunction(_this._mergedPropertyAnimations, 0, _this._playSequentially, _this._valueSource, animationFinishedCallback);
return _this;
}
Animation.prototype.play = function () {
if (this.isPlaying) {
return this._rejectAlreadyPlaying();
}
var animationFinishedPromise = _super.prototype.play.call(this);
this._finishedAnimations = 0;
this._cancelledAnimations = 0;
this._iOSAnimationFunction();
return animationFinishedPromise;
};
Animation.prototype.cancel = function () {
if (!this.isPlaying) {
animation_common_1.traceWrite("Animation is not currently playing.", animation_common_1.traceCategories.Animation, animation_common_1.traceType.warn);
return;
}
var i = 0;
var length = this._mergedPropertyAnimations.length;
for (; i < length; i++) {
var propertyAnimation = this._mergedPropertyAnimations[i];
propertyAnimation.target.nativeViewProtected.layer.removeAllAnimations();
if (propertyAnimation._propertyResetCallback) {
propertyAnimation._propertyResetCallback(propertyAnimation._originalValue, this._valueSource);
}
}
};
Animation.prototype._resolveAnimationCurve = function (curve) {
return _resolveAnimationCurve(curve);
};
Animation._createiOSAnimationFunction = function (propertyAnimations, index, playSequentially, valueSource, finishedCallback) {
return function (cancelled) {
if (cancelled && finishedCallback) {
if (animation_common_1.traceEnabled()) {
animation_common_1.traceWrite("Animation " + (index - 1).toString() + " was cancelled. Will skip the rest of animations and call finishedCallback(true).", animation_common_1.traceCategories.Animation);
}
finishedCallback(cancelled);
return;
}
var animation = propertyAnimations[index];
var args = Animation._getNativeAnimationArguments(animation, valueSource);
if (animation.curve === "spring") {
Animation._createNativeSpringAnimation(propertyAnimations, index, playSequentially, args, animation, valueSource, finishedCallback);
}
else {
Animation._createNativeAnimation(propertyAnimations, index, playSequentially, args, animation, valueSource, finishedCallback);
}
};
};
Animation._getNativeAnimationArguments = function (animation, valueSource) {
var nativeView = animation.target.nativeViewProtected;
var propertyNameToAnimate = animation.property;
var value = animation.value;
var originalValue;
var tempRotate = (animation.target.rotate || 0) * Math.PI / 180;
var abs;
var setLocal = valueSource === "animation";
switch (animation.property) {
case animation_common_1.Properties.backgroundColor:
animation._originalValue = animation.target.backgroundColor;
animation._propertyResetCallback = function (value, valueSource) {
animation.target.style[setLocal ? style_properties_1.backgroundColorProperty.name : style_properties_1.backgroundColorProperty.keyframe] = value;
};
originalValue = nativeView.layer.backgroundColor;
if (nativeView instanceof UILabel) {
nativeView.setValueForKey(getter(UIColor, UIColor.clearColor), "backgroundColor");
}
value = value.CGColor;
break;
case animation_common_1.Properties.opacity:
animation._originalValue = animation.target.opacity;
animation._propertyResetCallback = function (value, valueSource) {
animation.target.style[setLocal ? style_properties_1.opacityProperty.name : style_properties_1.opacityProperty.keyframe] = value;
};
originalValue = nativeView.layer.opacity;
break;
case animation_common_1.Properties.rotate:
animation._originalValue = animation.target.rotate !== undefined ? animation.target.rotate : 0;
animation._propertyResetCallback = function (value, valueSource) {
animation.target.style[setLocal ? style_properties_1.rotateProperty.name : style_properties_1.rotateProperty.keyframe] = value;
};
propertyNameToAnimate = "transform.rotation";
originalValue = nativeView.layer.valueForKeyPath("transform.rotation");
if (animation.target.rotate !== undefined && animation.target.rotate !== 0 && Math.floor(value / 360) - value / 360 === 0) {
originalValue = animation.target.rotate * Math.PI / 180;
}
value = value * Math.PI / 180;
abs = fabs(originalValue - value);
if (abs < 0.001 && originalValue !== tempRotate) {
originalValue = tempRotate;
}
break;
case animation_common_1.Properties.translate:
animation._originalValue = { x: animation.target.translateX, y: animation.target.translateY };
animation._propertyResetCallback = function (value, valueSource) {
animation.target.style[setLocal ? style_properties_1.translateXProperty.name : style_properties_1.translateXProperty.keyframe] = value.x;
animation.target.style[setLocal ? style_properties_1.translateYProperty.name : style_properties_1.translateYProperty.keyframe] = value.y;
};
propertyNameToAnimate = "transform";
originalValue = NSValue.valueWithCATransform3D(nativeView.layer.transform);
value = NSValue.valueWithCATransform3D(CATransform3DTranslate(nativeView.layer.transform, value.x, value.y, 0));
break;
case animation_common_1.Properties.scale:
if (value.x === 0) {
value.x = 0.001;
}
if (value.y === 0) {
value.y = 0.001;
}
animation._originalValue = { x: animation.target.scaleX, y: animation.target.scaleY };
animation._propertyResetCallback = function (value, valueSource) {
animation.target.style[setLocal ? style_properties_1.scaleXProperty.name : style_properties_1.scaleXProperty.keyframe] = value.x;
animation.target.style[setLocal ? style_properties_1.scaleYProperty.name : style_properties_1.scaleYProperty.keyframe] = value.y;
};
propertyNameToAnimate = "transform";
originalValue = NSValue.valueWithCATransform3D(nativeView.layer.transform);
value = NSValue.valueWithCATransform3D(CATransform3DScale(nativeView.layer.transform, value.x, value.y, 1));
break;
case _transform:
originalValue = NSValue.valueWithCATransform3D(nativeView.layer.transform);
animation._originalValue = {
xs: animation.target.scaleX, ys: animation.target.scaleY,
xt: animation.target.translateX, yt: animation.target.translateY
};
animation._propertyResetCallback = function (value, valueSource) {
animation.target.style[setLocal ? style_properties_1.translateXProperty.name : style_properties_1.translateXProperty.keyframe] = value.xt;
animation.target.style[setLocal ? style_properties_1.translateYProperty.name : style_properties_1.translateYProperty.keyframe] = value.yt;
animation.target.style[setLocal ? style_properties_1.scaleXProperty.name : style_properties_1.scaleXProperty.keyframe] = value.xs;
animation.target.style[setLocal ? style_properties_1.scaleYProperty.name : style_properties_1.scaleYProperty.keyframe] = value.ys;
};
propertyNameToAnimate = "transform";
value = NSValue.valueWithCATransform3D(Animation._createNativeAffineTransform(animation));
break;
default:
throw new Error("Cannot animate " + animation.property);
}
var duration = 0.3;
if (animation.duration !== undefined) {
duration = animation.duration / 1000.0;
}
var delay = undefined;
if (animation.delay) {
delay = animation.delay / 1000.0;
}
var repeatCount = undefined;
if (animation.iterations !== undefined) {
if (animation.iterations === Number.POSITIVE_INFINITY) {
repeatCount = FLT_MAX;
}
else {
repeatCount = animation.iterations;
}
}
return {
propertyNameToAnimate: propertyNameToAnimate,
fromValue: originalValue,
toValue: value,
duration: duration,
repeatCount: repeatCount,
delay: delay
};
};
Animation._createNativeAnimation = function (propertyAnimations, index, playSequentially, args, animation, valueSource, finishedCallback) {
var nativeView = animation.target.nativeViewProtected;
var nativeAnimation = CABasicAnimation.animationWithKeyPath(args.propertyNameToAnimate);
nativeAnimation.fromValue = args.fromValue;
nativeAnimation.toValue = args.toValue;
nativeAnimation.duration = args.duration;
if (args.repeatCount !== undefined) {
nativeAnimation.repeatCount = args.repeatCount;
}
if (args.delay !== undefined) {
nativeAnimation.beginTime = CACurrentMediaTime() + args.delay;
}
if (animation.curve !== undefined) {
nativeAnimation.timingFunction = animation.curve;
}
var animationDelegate = AnimationDelegateImpl.initWithFinishedCallback(finishedCallback, animation, valueSource);
nativeAnimation.setValueForKey(animationDelegate, "delegate");
nativeView.layer.addAnimationForKey(nativeAnimation, args.propertyNameToAnimate);
var callback = undefined;
if (index + 1 < propertyAnimations.length) {
callback = Animation._createiOSAnimationFunction(propertyAnimations, index + 1, playSequentially, valueSource, finishedCallback);
if (!playSequentially) {
callback();
}
else {
animationDelegate.nextAnimation = callback;
}
}
};
Animation._createNativeSpringAnimation = function (propertyAnimations, index, playSequentially, args, animation, valueSource, finishedCallback) {
var nativeView = animation.target.nativeViewProtected;
var callback = undefined;
var nextAnimation;
if (index + 1 < propertyAnimations.length) {
callback = Animation._createiOSAnimationFunction(propertyAnimations, index + 1, playSequentially, valueSource, finishedCallback);
if (!playSequentially) {
callback();
}
else {
nextAnimation = callback;
}
}
var delay = 0;
if (args.delay) {
delay = args.delay;
}
UIView.animateWithDurationDelayUsingSpringWithDampingInitialSpringVelocityOptionsAnimationsCompletion(args.duration, delay, 0.2, 0, 196608, function () {
if (args.repeatCount !== undefined) {
UIView.setAnimationRepeatCount(args.repeatCount);
}
switch (animation.property) {
case animation_common_1.Properties.backgroundColor:
animation.target.backgroundColor = args.toValue;
break;
case animation_common_1.Properties.opacity:
animation.target.opacity = args.toValue;
break;
case animation_common_1.Properties.rotate:
nativeView.layer.setValueForKey(args.toValue, args.propertyNameToAnimate);
break;
case _transform:
animation._originalValue = nativeView.layer.transform;
nativeView.layer.setValueForKey(args.toValue, args.propertyNameToAnimate);
animation._propertyResetCallback = function (value) {
nativeView.layer.transform = value;
};
break;
}
}, function (finished) {
if (finished) {
if (animation.property === _transform) {
if (animation.value[animation_common_1.Properties.translate] !== undefined) {
animation.target.translateX = animation.value[animation_common_1.Properties.translate].x;
animation.target.translateY = animation.value[animation_common_1.Properties.translate].y;
}
if (animation.value[animation_common_1.Properties.scale] !== undefined) {
animation.target.scaleX = animation.value[animation_common_1.Properties.scale].x;
animation.target.scaleY = animation.value[animation_common_1.Properties.scale].y;
}
}
}
else {
if (animation._propertyResetCallback) {
animation._propertyResetCallback(animation._originalValue);
}
}
if (finishedCallback) {
var cancelled = !finished;
finishedCallback(cancelled);
}
if (finished && nextAnimation) {
nextAnimation();
}
});
};
Animation._createNativeAffineTransform = function (animation) {
var value = animation.value;
var result = CATransform3DIdentity;
if (value[animation_common_1.Properties.translate] !== undefined) {
var x = value[animation_common_1.Properties.translate].x;
var y = value[animation_common_1.Properties.translate].y;
result = CATransform3DTranslate(result, x, y, 0);
}
if (value[animation_common_1.Properties.scale] !== undefined) {
var x = value[animation_common_1.Properties.scale].x;
var y = value[animation_common_1.Properties.scale].y;
result = CATransform3DScale(result, x === 0 ? 0.001 : x, y === 0 ? 0.001 : y, 1);
}
return result;
};
Animation._isAffineTransform = function (property) {
return property === _transform
|| property === animation_common_1.Properties.translate
|| property === animation_common_1.Properties.scale;
};
Animation._canBeMerged = function (animation1, animation2) {
var result = Animation._isAffineTransform(animation1.property) &&
Animation._isAffineTransform(animation2.property) &&
animation1.target === animation2.target &&
animation1.duration === animation2.duration &&
animation1.delay === animation2.delay &&
animation1.iterations === animation2.iterations &&
animation1.curve === animation2.curve;
return result;
};
Animation._mergeAffineTransformAnimations = function (propertyAnimations) {
var result = new Array();
var i = 0;
var j;
var length = propertyAnimations.length;
for (; i < length; i++) {
if (propertyAnimations[i][_skip]) {
continue;
}
if (!Animation._isAffineTransform(propertyAnimations[i].property)) {
result.push(propertyAnimations[i]);
}
else {
var newTransformAnimation = {
target: propertyAnimations[i].target,
property: _transform,
value: {},
duration: propertyAnimations[i].duration,
delay: propertyAnimations[i].delay,
iterations: propertyAnimations[i].iterations,
curve: propertyAnimations[i].curve
};
if (animation_common_1.traceEnabled()) {
animation_common_1.traceWrite("Curve: " + propertyAnimations[i].curve, animation_common_1.traceCategories.Animation);
}
newTransformAnimation.value[propertyAnimations[i].property] = propertyAnimations[i].value;
if (animation_common_1.traceEnabled()) {
animation_common_1.traceWrite("Created new transform animation: " + Animation._getAnimationInfo(newTransformAnimation), animation_common_1.traceCategories.Animation);
}
j = i + 1;
if (j < length) {
for (; j < length; j++) {
if (Animation._canBeMerged(propertyAnimations[i], propertyAnimations[j])) {
if (animation_common_1.traceEnabled()) {
animation_common_1.traceWrite("Merging animations: " + Animation._getAnimationInfo(newTransformAnimation) + " + " + Animation._getAnimationInfo(propertyAnimations[j]) + ";", animation_common_1.traceCategories.Animation);
}
newTransformAnimation.value[propertyAnimations[j].property] = propertyAnimations[j].value;
propertyAnimations[j][_skip] = true;
}
}
}
result.push(newTransformAnimation);
}
}
return result;
};
return Animation;
}(animation_common_1.AnimationBase));
exports.Animation = Animation;
function _getTransformMismatchErrorMessage(view) {
var result = CGAffineTransformIdentity;
var tx = view.translateX;
var ty = view.translateY;
result = CGAffineTransformTranslate(result, tx, ty);
result = CGAffineTransformRotate(result, (view.rotate || 0) * Math.PI / 180);
result = CGAffineTransformScale(result, view.scaleX || 1, view.scaleY || 1);
var viewTransform = NSStringFromCGAffineTransform(result);
var nativeTransform = NSStringFromCGAffineTransform(view.nativeViewProtected.transform);
if (viewTransform !== nativeTransform) {
return "View and Native transforms do not match. View: " + viewTransform + "; Native: " + nativeTransform;
}
return undefined;
}
exports._getTransformMismatchErrorMessage = _getTransformMismatchErrorMessage;
//# sourceMappingURL=animation.ios.js.map
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("../node_modules/webpack/buildin/global.js")))
/***/ }),
/***/ "../node_modules/tns-core-modules/ui/animation/keyframe-animation.js":
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", { value: true });
var enums_1 = __webpack_require__("../node_modules/tns-core-modules/ui/enums/enums.js");
var trace_1 = __webpack_require__("../node_modules/tns-core-modules/trace/trace.js");
var properties_1 = __webpack_require__("../node_modules/tns-core-modules/ui/core/properties/properties.js");
var animation_1 = __webpack_require__("../node_modules/tns-core-modules/ui/animation/animation.js");
var style_properties_1 = __webpack_require__("../node_modules/tns-core-modules/ui/styling/style-properties.js");
var Keyframes = (function () {
function Keyframes() {
}
return Keyframes;
}());
exports.Keyframes = Keyframes;
var UnparsedKeyframe = (function () {
function UnparsedKeyframe() {
}
return UnparsedKeyframe;
}());
exports.UnparsedKeyframe = UnparsedKeyframe;
var KeyframeDeclaration = (function () {
function KeyframeDeclaration() {
}
return KeyframeDeclaration;
}());
exports.KeyframeDeclaration = KeyframeDeclaration;
var KeyframeInfo = (function () {
function KeyframeInfo() {
this.curve = enums_1.AnimationCurve.ease;
}
return KeyframeInfo;
}());
exports.KeyframeInfo = KeyframeInfo;
var KeyframeAnimationInfo = (function () {
function KeyframeAnimationInfo() {
this.name = "";
this.duration = 0.3;
this.delay = 0;
this.iterations = 1;
this.curve = "ease";
this.isForwards = false;
this.isReverse = false;
}
return KeyframeAnimationInfo;
}());
exports.KeyframeAnimationInfo = KeyframeAnimationInfo;
var KeyframeAnimation = (function () {
function KeyframeAnimation() {
this.delay = 0;
this.iterations = 1;
}
KeyframeAnimation.keyframeAnimationFromInfo = function (info) {
var length = info.keyframes.length;
var animations = new Array();
var startDuration = 0;
if (info.isReverse) {
for (var index_1 = length - 1; index_1 >= 0; index_1--) {
var keyframe = info.keyframes[index_1];
startDuration = KeyframeAnimation.parseKeyframe(info, keyframe, animations, startDuration);
}
}
else {
for (var index_2 = 0; index_2 < length; index_2++) {
var keyframe = info.keyframes[index_2];
startDuration = KeyframeAnimation.parseKeyframe(info, keyframe, animations, startDuration);
}
for (var index_3 = length - 1; index_3 > 0; index_3--) {
var a1 = animations[index_3];
var a2 = animations[index_3 - 1];
if (a2["curve"] !== undefined) {
a1["curve"] = a2["curve"];
a2["curve"] = undefined;
}
}
}
animations.map(function (a) { return a["curve"] ? a : Object.assign(a, { curve: info.curve }); });
var animation = new KeyframeAnimation();
animation.delay = info.delay;
animation.iterations = info.iterations;
animation.animations = animations;
animation._isForwards = info.isForwards;
return animation;
};
KeyframeAnimation.parseKeyframe = function (info, keyframe, animations, startDuration) {
var animation = {};
for (var _i = 0, _a = keyframe.declarations; _i < _a.length; _i++) {
var declaration = _a[_i];
animation[declaration.property] = declaration.value;
}
var duration = keyframe.duration;
if (duration === 0) {
duration = 0.01;
}
else {
duration = (info.duration * duration) - startDuration;
startDuration += duration;
}
animation.duration = info.isReverse ? info.duration - duration : duration;
animation.curve = keyframe.curve;
animation.forceLayer = true;
animation.valueSource = "keyframe";
animations.push(animation);
return startDuration;
};
Object.defineProperty(KeyframeAnimation.prototype, "isPlaying", {
get: function () {
return this._isPlaying;
},
enumerable: true,
configurable: true
});
KeyframeAnimation.prototype.cancel = function () {
if (!this.isPlaying) {
trace_1.write("Keyframe animation is already playing.", trace_1.categories.Animation, trace_1.messageType.warn);
return;
}
this._isPlaying = false;
for (var i = this._nativeAnimations.length - 1; i >= 0; i--) {
var animation = this._nativeAnimations[i];
if (animation.isPlaying) {
animation.cancel();
}
}
if (this._nativeAnimations.length > 0) {
var animation = this._nativeAnimations[0];
this._resetAnimationValues(this._target, animation);
}
this._resetAnimations();
};
KeyframeAnimation.prototype.play = function (view) {
var _this = this;
if (this._isPlaying) {
trace_1.write("Keyframe animation is already playing.", trace_1.categories.Animation, trace_1.messageType.warn);
return new Promise(function (resolve) {
resolve();
});
}
var animationFinishedPromise = new Promise(function (resolve) {
_this._resolve = resolve;
});
this._isPlaying = true;
this._nativeAnimations = new Array();
this._target = view;
if (this.delay !== 0) {
setTimeout(function () { return _this.animate(view, 0, _this.iterations); }, this.delay);
}
else {
this.animate(view, 0, this.iterations);
}
return animationFinishedPromise;
};
KeyframeAnimation.prototype.animate = function (view, index, iterations) {
var _this = this;
if (!this._isPlaying) {
return;
}
if (index === 0) {
var animation = this.animations[0];
if ("backgroundColor" in animation) {
view.style[style_properties_1.backgroundColorProperty.keyframe] = animation.backgroundColor;
}
if ("scale" in animation) {
view.style[style_properties_1.scaleXProperty.keyframe] = animation.scale.x;
view.style[style_properties_1.scaleYProperty.keyframe] = animation.scale.y;
}
if ("translate" in animation) {
view.style[style_properties_1.translateXProperty.keyframe] = animation.translate.x;
view.style[style_properties_1.translateYProperty.keyframe] = animation.translate.y;
}
if ("rotate" in animation) {
view.style[style_properties_1.rotateProperty.keyframe] = animation.rotate;
}
if ("opacity" in animation) {
view.style[style_properties_1.opacityProperty.keyframe] = animation.opacity;
}
setTimeout(function () { return _this.animate(view, 1, iterations); }, 1);
}
else if (index < 0 || index >= this.animations.length) {
iterations -= 1;
if (iterations > 0) {
this.animate(view, 0, iterations);
}
else {
if (this._isForwards === false) {
var animation = this.animations[this.animations.length - 1];
this._resetAnimationValues(view, animation);
}
this._resolveAnimationFinishedPromise();
}
}
else {
var animation = void 0;
var cachedAnimation = this._nativeAnimations[index - 1];
if (cachedAnimation) {
animation = cachedAnimation;
}
else {
var animationDef = this.animations[index];
animationDef.target = view;
animation = new animation_1.Animation([animationDef]);
this._nativeAnimations.push(animation);
}
var isLastIteration = iterations - 1 <= 0;
animation.play(isLastIteration).then(function () {
_this.animate(view, index + 1, iterations);
}, function (error) {
trace_1.write(typeof error === "string" ? error : error.message, trace_1.categories.Animation, trace_1.messageType.warn);
}).catch(function (error) {
trace_1.write(typeof error === "string" ? error : error.message, trace_1.categories.Animation, trace_1.messageType.warn);
});
}
};
KeyframeAnimation.prototype._resolveAnimationFinishedPromise = function () {
this._nativeAnimations = new Array();
this._isPlaying = false;
this._target = null;
this._resolve();
};
KeyframeAnimation.prototype._resetAnimations = function () {
this._nativeAnimations = new Array();
this._isPlaying = false;
this._target = null;
};
KeyframeAnimation.prototype._resetAnimationValues = function (view, animation) {
if ("backgroundColor" in animation) {
view.style[style_properties_1.backgroundColorProperty.keyframe] = properties_1.unsetValue;
}
if ("scale" in animation) {
view.style[style_properties_1.scaleXProperty.keyframe] = properties_1.unsetValue;
view.style[style_properties_1.scaleYProperty.keyframe] = properties_1.unsetValue;
}
if ("translate" in animation) {
view.style[style_properties_1.translateXProperty.keyframe] = properties_1.unsetValue;
view.style[style_properties_1.translateYProperty.keyframe] = properties_1.unsetValue;
}
if ("rotate" in animation) {
view.style[style_properties_1.rotateProperty.keyframe] = properties_1.unsetValue;
}
if ("opacity" in animation) {
view.style[style_properties_1.opacityProperty.keyframe] = properties_1.unsetValue;
}
};
return KeyframeAnimation;
}());
exports.KeyframeAnimation = KeyframeAnimation;
//# sourceMappingURL=keyframe-animation.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/ui/border/border.js":
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", { value: true });
var content_view_1 = __webpack_require__("../node_modules/tns-core-modules/ui/content-view/content-view.js");
var Border = (function (_super) {
__extends(Border, _super);
function Border() {
return _super !== null && _super.apply(this, arguments) || this;
}
Object.defineProperty(Border.prototype, "cornerRadius", {
get: function () {
if (typeof this.borderRadius === "number") {
return this.borderRadius;
}
return 0;
},
set: function (value) {
this.borderRadius = value;
},
enumerable: true,
configurable: true
});
Border.prototype.onMeasure = function (widthMeasureSpec, heightMeasureSpec) {
var width = content_view_1.layout.getMeasureSpecSize(widthMeasureSpec);
var widthMode = content_view_1.layout.getMeasureSpecMode(widthMeasureSpec);
var height = content_view_1.layout.getMeasureSpecSize(heightMeasureSpec);
var heightMode = content_view_1.layout.getMeasureSpecMode(heightMeasureSpec);
var horizontalBorderLength = this.effectiveBorderLeftWidth + this.effectiveBorderRightWidth;
var verticalBorderLength = this.effectiveBorderTopWidth + this.effectiveBorderBottomWidth;
var result = content_view_1.View.measureChild(this, this.layoutView, content_view_1.layout.makeMeasureSpec(width - horizontalBorderLength, widthMode), content_view_1.layout.makeMeasureSpec(height - verticalBorderLength, heightMode));
var widthAndState = content_view_1.View.resolveSizeAndState(result.measuredWidth + horizontalBorderLength, width, widthMode, 0);
var heightAndState = content_view_1.View.resolveSizeAndState(result.measuredHeight + verticalBorderLength, height, heightMode, 0);
this.setMeasuredDimension(widthAndState, heightAndState);
};
Border.prototype.onLayout = function (left, top, right, bottom) {
var horizontalBorderLength = this.effectiveBorderLeftWidth + this.effectiveBorderRightWidth;
var verticalBorderLength = this.effectiveBorderTopWidth + this.effectiveBorderBottomWidth;
content_view_1.View.layoutChild(this, this.layoutView, this.effectiveBorderLeftWidth, this.effectiveBorderTopWidth, right - left - horizontalBorderLength, bottom - top - verticalBorderLength);
};
Border = __decorate([
Deprecated,
content_view_1.CSSType("Border")
], Border);
return Border;
}(content_view_1.ContentView));
exports.Border = Border;
Border.prototype.recycleNativeView = "auto";
//# sourceMappingURL=border.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/ui/builder/binding-builder.js":
/***/ (function(module, exports) {
Object.defineProperty(exports, "__esModule", { value: true });
var expressionSymbolsRegex = /[\+\-\*\/%\?:<>=!\|&\(\)^~]/;
var bindingConstants;
(function (bindingConstants) {
bindingConstants.sourceProperty = "sourceProperty";
bindingConstants.targetProperty = "targetProperty";
bindingConstants.expression = "expression";
bindingConstants.twoWay = "twoWay";
bindingConstants.source = "source";
bindingConstants.bindingValueKey = "$value";
bindingConstants.parentValueKey = "$parent";
bindingConstants.parentsValueKey = "$parents";
bindingConstants.newPropertyValueKey = "$newPropertyValue";
})(bindingConstants = exports.bindingConstants || (exports.bindingConstants = {}));
;
var hasEqualSignRegex = /=+/;
var equalSignComparisionOperatorsRegex = /(==|===|>=|<=|!=|!==)/;
exports.parentsRegex = /\$parents\s*\[\s*(['"]*)\w*\1\s*\]/g;
function isNamedParam(value) {
var equalSignIndex = value.search(hasEqualSignRegex);
if (equalSignIndex > -1) {
var equalSignSurround = value.substr(equalSignIndex > 0 ? equalSignIndex - 1 : 0, 3);
if (equalSignSurround.search(equalSignComparisionOperatorsRegex) === -1) {
return true;
}
}
return false;
}
function areNamedParams(params) {
var i;
for (i = 0; i < params.length; i++) {
if (isNamedParam(params[i])) {
return true;
}
}
return false;
}
var namedParamConstants = {
propName: "propName",
propValue: "propValue"
};
function getPropertyNameValuePair(param, knownOptions, callback) {
var nameValuePair = {};
var propertyName = param.substr(0, param.indexOf("=")).trim();
var propertyValue = param.substr(param.indexOf("=") + 1).trim();
if (knownOptions) {
if (!propertyName) {
propertyName = knownOptions.defaultProperty;
}
else {
propertyName = propertyName in knownOptions ? propertyName : null;
}
}
if (propertyName) {
if (callback) {
nameValuePair = callback(propertyName, propertyValue);
}
else {
nameValuePair[namedParamConstants.propName] = propertyName;
nameValuePair[namedParamConstants.propValue] = propertyValue;
}
return nameValuePair;
}
return null;
}
function parseNamedProperties(parameterList, knownOptions, callback) {
var result = {};
var i;
for (i = 0; i < parameterList.length; i++) {
var nameValuePair = getPropertyNameValuePair(parameterList[i], knownOptions, callback);
if (nameValuePair) {
result[nameValuePair[namedParamConstants.propName]] = nameValuePair[namedParamConstants.propValue];
}
}
return result;
}
function getParamsArray(value) {
var result = [];
var i;
var skipComma = 0;
var indexReached = 0;
var singleQuoteBlock, doubleQuoteBlock = false;
for (i = 0; i < value.length; i++) {
if (value[i] === "\"") {
doubleQuoteBlock = !doubleQuoteBlock;
}
if (value[i] === "'") {
singleQuoteBlock = !singleQuoteBlock;
}
if (value[i] === "(" || value[i] === "[") {
skipComma++;
}
if (value[i] === ")" || value[i] === "]") {
skipComma--;
}
if (value[i] === "," && skipComma === 0 && !(singleQuoteBlock || doubleQuoteBlock)) {
result.push(value.substr(indexReached, i - indexReached));
indexReached = i + 1;
}
}
result.push(value.substr(indexReached));
return result;
}
function isExpression(expression) {
if (expression.search(expressionSymbolsRegex) > -1) {
var parentsMatches = expression.match(exports.parentsRegex);
if (parentsMatches) {
var restOfExpression = expression.substr(expression.indexOf(parentsMatches[0]) + parentsMatches[0].length);
if (!(restOfExpression.search(expressionSymbolsRegex) > -1)) {
return false;
}
}
return true;
}
return false;
}
function getBindingOptions(name, value) {
var namedParams = [];
var params = getParamsArray(value);
if (!areNamedParams(params)) {
if (params.length === 1) {
var trimmedValue = params[0].trim();
var sourceProp;
if (isExpression(trimmedValue)) {
sourceProp = bindingConstants.bindingValueKey;
namedParams.push(bindingConstants.expression + " = " + trimmedValue);
}
else {
sourceProp = trimmedValue;
}
namedParams.push(bindingConstants.sourceProperty + " = " + sourceProp);
namedParams.push(bindingConstants.twoWay + " = true");
}
else {
namedParams.push(bindingConstants.sourceProperty + " = " + params[0].trim());
namedParams.push(bindingConstants.expression + " = " + params[1].trim());
var twoWay = params[2] ? params[2].toLowerCase().trim() === "true" : true;
namedParams.push(bindingConstants.twoWay + " = " + twoWay);
}
}
else {
namedParams = params;
}
var bindingPropertyHandler = function (prop, value) {
var result = {};
result[namedParamConstants.propName] = prop;
if (prop === bindingConstants.twoWay) {
if (value === "true") {
result[namedParamConstants.propValue] = true;
}
else {
result[namedParamConstants.propValue] = false;
}
}
else {
result[namedParamConstants.propValue] = value;
}
return result;
};
var bindingOptionsParameters = parseNamedProperties(namedParams, xmlBindingProperties, bindingPropertyHandler);
var bindOptions = {
targetProperty: name
};
for (var prop in bindingOptionsParameters) {
if (bindingOptionsParameters.hasOwnProperty(prop)) {
bindOptions[prop] = bindingOptionsParameters[prop];
}
}
if (bindOptions[bindingConstants.twoWay] === undefined) {
bindOptions[bindingConstants.twoWay] = true;
}
return bindOptions;
}
exports.getBindingOptions = getBindingOptions;
var xmlBindingProperties = {
sourceProperty: true,
expression: true,
twoWay: true,
source: true,
defaultProperty: bindingConstants.sourceProperty
};
//# sourceMappingURL=binding-builder.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/ui/builder/builder.js":
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global) {Object.defineProperty(exports, "__esModule", { value: true });
var debug_1 = __webpack_require__("../node_modules/tns-core-modules/utils/debug.js");
var xml = __webpack_require__("../node_modules/tns-core-modules/xml/xml.js");
var file_system_1 = __webpack_require__("../node_modules/tns-core-modules/file-system/file-system.js");
var types_1 = __webpack_require__("../node_modules/tns-core-modules/utils/types.js");
var component_builder_1 = __webpack_require__("../node_modules/tns-core-modules/ui/builder/component-builder/component-builder.js");
var platform_1 = __webpack_require__("../node_modules/tns-core-modules/platform/platform.js");
var file_name_resolver_1 = __webpack_require__("../node_modules/tns-core-modules/file-system/file-name-resolver/file-name-resolver.js");
var profiling_1 = __webpack_require__("../node_modules/tns-core-modules/profiling/profiling.js");
var ios = platform_1.platformNames.ios.toLowerCase();
var android = platform_1.platformNames.android.toLowerCase();
var defaultNameSpaceMatcher = /tns\.xsd$/i;
var trace;
function ensureTrace() {
if (!trace) {
trace = __webpack_require__("../node_modules/tns-core-modules/trace/trace.js");
}
}
function parse(value, context) {
if (typeof value === "function") {
return value();
}
else {
var exports_1 = context ? getExports(context) : undefined;
var componentModule = parseInternal(value, exports_1);
return componentModule && componentModule.component;
}
}
exports.parse = parse;
function parseMultipleTemplates(value, context) {
var dummyComponent = "<ListView><ListView.itemTemplates>" + value + "</ListView.itemTemplates></ListView>";
return parseInternal(dummyComponent, context).component["itemTemplates"];
}
exports.parseMultipleTemplates = parseMultipleTemplates;
function load(pathOrOptions, context) {
var componentModule;
if (!context) {
if (typeof pathOrOptions === "string") {
componentModule = loadInternal(pathOrOptions);
}
else {
componentModule = loadCustomComponent(pathOrOptions.path, pathOrOptions.name, pathOrOptions.attributes, pathOrOptions.exports, pathOrOptions.page, true);
}
}
else {
var path_1 = pathOrOptions;
componentModule = loadInternal(path_1, context);
}
return componentModule && componentModule.component;
}
exports.load = load;
function loadPage(moduleNamePath, fileName, context) {
var componentModule = loadInternal(fileName, context, moduleNamePath);
var componentView = componentModule && componentModule.component;
markAsModuleRoot(componentView, moduleNamePath);
return componentView;
}
exports.loadPage = loadPage;
var loadModule = profiling_1.profile("loadModule", function (moduleNamePath, entry) {
if (global.moduleExists(entry.moduleName)) {
return global.loadModule(entry.moduleName);
}
else {
var moduleExportsResolvedPath = file_name_resolver_1.resolveFileName(moduleNamePath, "js");
if (moduleExportsResolvedPath) {
moduleExportsResolvedPath = moduleExportsResolvedPath.substr(0, moduleExportsResolvedPath.length - 3);
return global.loadModule(moduleExportsResolvedPath);
}
}
return null;
});
var viewFromBuilder = profiling_1.profile("viewFromBuilder", function (moduleNamePath, moduleExports) {
var fileName = file_name_resolver_1.resolveFileName(moduleNamePath, "xml");
return loadPage(moduleNamePath, fileName, moduleExports);
});
exports.createViewFromEntry = profiling_1.profile("createViewFromEntry", function (entry) {
if (entry.create) {
return createView(entry);
}
else if (entry.moduleName) {
var currentAppPath = file_system_1.knownFolders.currentApp().path;
var moduleNamePath = file_system_1.path.join(currentAppPath, entry.moduleName);
var moduleExports = loadModule(moduleNamePath, entry);
if (moduleExports && moduleExports.createPage) {
return moduleCreateView(moduleNamePath, moduleExports);
}
else {
return viewFromBuilder(moduleNamePath, moduleExports);
}
}
throw new Error("Failed to load page XML file for module: " + entry.moduleName);
});
var createView = profiling_1.profile("entry.create", function (entry) {
var view = entry.create();
if (!view) {
throw new Error("Failed to create Page with entry.create() function.");
}
return view;
});
var moduleCreateView = profiling_1.profile("module.createView", function (moduleNamePath, moduleExports) {
var view = moduleExports.createPage();
var cssFileName = file_name_resolver_1.resolveFileName(moduleNamePath, "css");
if (cssFileName) {
view.addCssFile(cssFileName);
}
return view;
});
function markAsModuleRoot(componentView, moduleNamePath) {
var lastIndexOfSeparator = moduleNamePath.lastIndexOf(file_system_1.path.separator);
var moduleName = moduleNamePath.substring(lastIndexOfSeparator + 1);
componentView._moduleName = moduleName;
}
function loadInternal(fileName, context, moduleNamePath) {
var componentModule;
var appPath = file_system_1.knownFolders.currentApp().path;
var filePathRelativeToApp = (moduleNamePath && moduleNamePath.startsWith(appPath) ? "./" + moduleNamePath.substr(appPath.length + 1) : moduleNamePath) + ".xml";
if (global.moduleExists(filePathRelativeToApp)) {
var text = global.loadModule(filePathRelativeToApp);
componentModule = parseInternal(text, context, fileName, moduleNamePath);
}
else if (fileName && file_system_1.File.exists(fileName)) {
var file = file_system_1.File.fromPath(fileName);
var text_1 = file.readTextSync(function (error) { throw new Error("Error loading file " + fileName + " :" + error.message); });
componentModule = parseInternal(text_1, context, fileName, moduleNamePath);
}
if (componentModule && componentModule.component) {
componentModule.component.exports = context;
}
return componentModule;
}
function loadCustomComponent(componentPath, componentName, attributes, context, parentPage, isRootComponent, moduleNamePath) {
if (isRootComponent === void 0) { isRootComponent = true; }
if (!parentPage && context) {
parentPage = context["_parentPage"];
delete context["_parentPage"];
}
var result;
componentPath = componentPath.replace("~/", "");
var moduleName = componentPath + "/" + componentName;
var xmlModuleName = moduleName + ".xml";
var fullComponentPathFilePathWithoutExt = componentPath;
if (!file_system_1.File.exists(componentPath) || componentPath === "." || componentPath === "./") {
fullComponentPathFilePathWithoutExt = file_system_1.path.join(file_system_1.knownFolders.currentApp().path, componentPath, componentName);
}
var xmlFilePath = file_name_resolver_1.resolveFileName(fullComponentPathFilePathWithoutExt, "xml");
if (xmlFilePath || global.moduleExists(xmlModuleName)) {
var subExports = context;
if (global.moduleExists(moduleName)) {
subExports = global.loadModule(moduleName);
}
else {
var jsFilePath = file_name_resolver_1.resolveFileName(fullComponentPathFilePathWithoutExt, "js");
if (jsFilePath) {
subExports = global.loadModule(jsFilePath);
}
}
if (!subExports) {
subExports = {};
}
subExports["_parentPage"] = parentPage;
result = xmlFilePath ?
loadInternal(xmlFilePath, subExports) :
loadInternal(xmlFilePath, subExports, moduleName);
if (types_1.isDefined(result) && types_1.isDefined(result.component) && types_1.isDefined(attributes)) {
for (var attr in attributes) {
component_builder_1.setPropertyValue(result.component, subExports, context, attr, attributes[attr]);
}
}
}
else {
result = component_builder_1.getComponentModule(componentName, componentPath, attributes, context, moduleNamePath, isRootComponent);
}
var cssModulePath = fullComponentPathFilePathWithoutExt + ".css";
if (cssModulePath.startsWith("/")) {
var app = file_system_1.knownFolders.currentApp().path + "/";
if (cssModulePath.startsWith(app)) {
cssModulePath = "./" + cssModulePath.substr(app.length);
}
}
if (global.moduleExists(cssModulePath)) {
parentPage.addCssFile(cssModulePath);
}
else {
var cssFilePath = file_name_resolver_1.resolveFileName(fullComponentPathFilePathWithoutExt, "css");
if (cssFilePath) {
if (parentPage && typeof parentPage.addCssFile === "function") {
parentPage.addCssFile(cssFilePath);
}
else {
ensureTrace();
trace.write("CSS file found but no page specified. Please specify page in the options!", trace.categories.Error, trace.messageType.error);
}
}
}
return result;
}
function getExports(instance) {
var isView = !!instance._domId;
if (!isView) {
return instance.exports || instance;
}
var exportObject = instance.exports;
var parent = instance.parent;
while (exportObject === undefined && parent) {
exportObject = parent.exports;
parent = parent.parent;
}
return exportObject;
}
function parseInternal(value, context, uri, moduleNamePath) {
var start;
var ui;
var errorFormat = (debug_1.debug && uri) ? xml2ui.SourceErrorFormat(uri) : xml2ui.PositionErrorFormat;
var componentSourceTracker = (debug_1.debug && uri) ? xml2ui.ComponentSourceTracker(uri) : function () {
};
(start = new xml2ui.XmlStringParser(errorFormat))
.pipe(new xml2ui.PlatformFilter())
.pipe(new xml2ui.XmlStateParser(ui = new xml2ui.ComponentParser(context, errorFormat, componentSourceTracker, moduleNamePath)));
start.parse(value);
return ui.rootComponentModule;
}
var xml2ui;
(function (xml2ui) {
var XmlProducerBase = (function () {
function XmlProducerBase() {
}
XmlProducerBase.prototype.pipe = function (next) {
this._next = next;
return next;
};
XmlProducerBase.prototype.next = function (args) {
this._next.parse(args);
};
return XmlProducerBase;
}());
xml2ui.XmlProducerBase = XmlProducerBase;
var XmlStringParser = (function (_super) {
__extends(XmlStringParser, _super);
function XmlStringParser(error) {
var _this = _super.call(this) || this;
_this.error = error || PositionErrorFormat;
return _this;
}
XmlStringParser.prototype.parse = function (value) {
var _this = this;
var xmlParser = new xml.XmlParser(function (args) {
try {
_this.next(args);
}
catch (e) {
throw _this.error(e, args.position);
}
}, function (e, p) {
throw _this.error(e, p);
}, true);
if (types_1.isString(value)) {
xmlParser.parse(value);
}
};
return XmlStringParser;
}(XmlProducerBase));
xml2ui.XmlStringParser = XmlStringParser;
function PositionErrorFormat(e, p) {
return new debug_1.ScopeError(e, "Parsing XML at " + p.line + ":" + p.column);
}
xml2ui.PositionErrorFormat = PositionErrorFormat;
function SourceErrorFormat(uri) {
return function (e, p) {
var source = p ? new debug_1.Source(uri, p.line, p.column) : new debug_1.Source(uri, -1, -1);
e = new debug_1.SourceError(e, source, "Building UI from XML.");
return e;
};
}
xml2ui.SourceErrorFormat = SourceErrorFormat;
function ComponentSourceTracker(uri) {
return function (component, p) {
if (!debug_1.Source.get(component)) {
var source = p ? new debug_1.Source(uri, p.line, p.column) : new debug_1.Source(uri, -1, -1);
debug_1.Source.set(component, source);
}
};
}
xml2ui.ComponentSourceTracker = ComponentSourceTracker;
var PlatformFilter = (function (_super) {
__extends(PlatformFilter, _super);
function PlatformFilter() {
return _super !== null && _super.apply(this, arguments) || this;
}
PlatformFilter.prototype.parse = function (args) {
if (args.eventType === xml.ParserEventType.StartElement) {
if (PlatformFilter.isPlatform(args.elementName)) {
if (this.currentPlatformContext) {
throw new Error("Already in '" + this.currentPlatformContext + "' platform context and cannot switch to '" + args.elementName + "' platform! Platform tags cannot be nested.");
}
this.currentPlatformContext = args.elementName;
return;
}
}
if (args.eventType === xml.ParserEventType.EndElement) {
if (PlatformFilter.isPlatform(args.elementName)) {
this.currentPlatformContext = undefined;
return;
}
}
if (this.currentPlatformContext && !PlatformFilter.isCurentPlatform(this.currentPlatformContext)) {
return;
}
this.next(args);
};
PlatformFilter.isPlatform = function (value) {
if (value) {
var toLower = value.toLowerCase();
return toLower === android || toLower === ios;
}
return false;
};
PlatformFilter.isCurentPlatform = function (value) {
return value && value.toLowerCase() === platform_1.device.os.toLowerCase();
};
return PlatformFilter;
}(XmlProducerBase));
xml2ui.PlatformFilter = PlatformFilter;
var XmlArgsReplay = (function (_super) {
__extends(XmlArgsReplay, _super);
function XmlArgsReplay(args, errorFormat) {
var _this = _super.call(this) || this;
_this.args = args;
_this.error = errorFormat;
return _this;
}
XmlArgsReplay.prototype.replay = function () {
var _this = this;
this.args.forEach(function (args) {
try {
_this.next(args);
}
catch (e) {
throw _this.error(e, args.position);
}
});
};
return XmlArgsReplay;
}(XmlProducerBase));
xml2ui.XmlArgsReplay = XmlArgsReplay;
var XmlStateParser = (function () {
function XmlStateParser(state) {
this.state = state;
}
XmlStateParser.prototype.parse = function (args) {
this.state = this.state.parse(args);
};
return XmlStateParser;
}());
xml2ui.XmlStateParser = XmlStateParser;
var TemplateParser = (function () {
function TemplateParser(parent, templateProperty, setTemplateProperty) {
if (setTemplateProperty === void 0) { setTemplateProperty = true; }
this.parent = parent;
this._context = templateProperty.context;
this._recordedXmlStream = new Array();
this._templateProperty = templateProperty;
this._nestingLevel = 0;
this._state = 0;
this._setTemplateProperty = setTemplateProperty;
}
TemplateParser.prototype.parse = function (args) {
if (args.eventType === xml.ParserEventType.StartElement) {
this.parseStartElement(args.prefix, args.namespace, args.elementName, args.attributes);
}
else if (args.eventType === xml.ParserEventType.EndElement) {
this.parseEndElement(args.prefix, args.elementName);
}
this._recordedXmlStream.push(args);
return this._state === 2 ? this.parent : this;
};
Object.defineProperty(TemplateParser.prototype, "elementName", {
get: function () {
return this._templateProperty.elementName;
},
enumerable: true,
configurable: true
});
TemplateParser.prototype.parseStartElement = function (prefix, namespace, elementName, attributes) {
if (this._state === 0) {
this._state = 1;
}
else if (this._state === 2) {
throw new Error("Template must have exactly one root element but multiple elements were found.");
}
this._nestingLevel++;
};
TemplateParser.prototype.parseEndElement = function (prefix, elementName) {
if (this._state === 0) {
throw new Error("Template must have exactly one root element but none was found.");
}
else if (this._state === 2) {
throw new Error("No more closing elements expected for this template.");
}
this._nestingLevel--;
if (this._nestingLevel === 0) {
this._state = 2;
if (this._setTemplateProperty && this._templateProperty.name in this._templateProperty.parent.component) {
var template = this.buildTemplate();
this._templateProperty.parent.component[this._templateProperty.name] = template;
}
}
};
TemplateParser.prototype.buildTemplate = function () {
var _this = this;
var context = this._context;
var errorFormat = this._templateProperty.errorFormat;
var sourceTracker = this._templateProperty.sourceTracker;
var template = profiling_1.profile("Template()", function () {
var start;
var ui;
(start = new xml2ui.XmlArgsReplay(_this._recordedXmlStream, errorFormat))
.pipe(new XmlStateParser(ui = new ComponentParser(context, errorFormat, sourceTracker)));
start.replay();
return ui.rootComponentModule.component;
});
return template;
};
return TemplateParser;
}());
xml2ui.TemplateParser = TemplateParser;
var MultiTemplateParser = (function () {
function MultiTemplateParser(parent, templateProperty) {
this.parent = parent;
this.templateProperty = templateProperty;
this._childParsers = new Array();
}
Object.defineProperty(MultiTemplateParser.prototype, "value", {
get: function () { return this._value; },
enumerable: true,
configurable: true
});
MultiTemplateParser.prototype.parse = function (args) {
if (args.eventType === xml.ParserEventType.StartElement && args.elementName === "template") {
var childParser = new TemplateParser(this, this.templateProperty, false);
childParser["key"] = args.attributes["key"];
this._childParsers.push(childParser);
return childParser;
}
if (args.eventType === xml.ParserEventType.EndElement) {
var name_1 = ComponentParser.getComplexPropertyName(args.elementName);
if (name_1 === this.templateProperty.name) {
var templates = new Array();
for (var i = 0; i < this._childParsers.length; i++) {
templates.push({
key: this._childParsers[i]["key"],
createView: this._childParsers[i].buildTemplate()
});
}
this._value = templates;
return this.parent.parse(args);
}
}
return this;
};
return MultiTemplateParser;
}());
xml2ui.MultiTemplateParser = MultiTemplateParser;
var ComponentParser = (function () {
function ComponentParser(context, errorFormat, sourceTracker, moduleNamePath) {
this.moduleNamePath = moduleNamePath;
this.parents = new Array();
this.complexProperties = new Array();
this.context = context;
this.error = errorFormat;
this.sourceTracker = sourceTracker;
}
ComponentParser.prototype.buildComponent = function (args) {
if (args.prefix && args.namespace) {
return loadCustomComponent(args.namespace, args.elementName, args.attributes, this.context, this.currentRootView, !this.currentRootView, this.moduleNamePath);
}
else {
var namespace = args.namespace;
if (defaultNameSpaceMatcher.test(namespace || "")) {
namespace = undefined;
}
return component_builder_1.getComponentModule(args.elementName, namespace, args.attributes, this.context, this.moduleNamePath, !this.currentRootView);
}
};
ComponentParser.prototype.parse = function (args) {
var parent = this.parents[this.parents.length - 1];
var complexProperty = this.complexProperties[this.complexProperties.length - 1];
if (args.eventType === xml.ParserEventType.StartElement) {
if (ComponentParser.isComplexProperty(args.elementName)) {
var name = ComponentParser.getComplexPropertyName(args.elementName);
var complexProperty_1 = {
parent: parent,
name: name,
items: []
};
this.complexProperties.push(complexProperty_1);
if (ComponentParser.isKnownTemplate(name, parent.exports)) {
return new TemplateParser(this, {
context: (parent ? getExports(parent.component) : null) || this.context,
parent: parent,
name: name,
elementName: args.elementName,
templateItems: [],
errorFormat: this.error,
sourceTracker: this.sourceTracker
});
}
if (ComponentParser.isKnownMultiTemplate(name, parent.exports)) {
var parser = new MultiTemplateParser(this, {
context: (parent ? getExports(parent.component) : null) || this.context,
parent: parent,
name: name,
elementName: args.elementName,
templateItems: [],
errorFormat: this.error,
sourceTracker: this.sourceTracker
});
complexProperty_1.parser = parser;
return parser;
}
}
else {
var componentModule = this.buildComponent(args);
if (componentModule) {
this.sourceTracker(componentModule.component, args.position);
if (parent) {
if (complexProperty) {
ComponentParser.addToComplexProperty(parent, complexProperty, componentModule);
}
else if (parent.component._addChildFromBuilder) {
parent.component._addChildFromBuilder(args.elementName, componentModule.component);
}
}
else if (this.parents.length === 0) {
this.rootComponentModule = componentModule;
if (this.rootComponentModule) {
this.currentRootView = this.rootComponentModule.component;
if (this.currentRootView.exports) {
this.context = this.currentRootView.exports;
}
}
}
this.parents.push(componentModule);
}
}
}
else if (args.eventType === xml.ParserEventType.EndElement) {
if (ComponentParser.isComplexProperty(args.elementName)) {
if (complexProperty) {
if (complexProperty.parser) {
parent.component[complexProperty.name] = complexProperty.parser.value;
}
else if (parent && parent.component._addArrayFromBuilder) {
parent.component._addArrayFromBuilder(complexProperty.name, complexProperty.items);
complexProperty.items = [];
}
}
this.complexProperties.pop();
}
else {
this.parents.pop();
}
}
return this;
};
ComponentParser.isComplexProperty = function (name) {
return types_1.isString(name) && name.indexOf(".") !== -1;
};
ComponentParser.getComplexPropertyName = function (fullName) {
var name;
if (types_1.isString(fullName)) {
var names = fullName.split(".");
name = names[names.length - 1];
}
return name;
};
ComponentParser.isKnownTemplate = function (name, exports) {
return ComponentParser.KNOWNTEMPLATES in exports && exports[ComponentParser.KNOWNTEMPLATES] && name in exports[ComponentParser.KNOWNTEMPLATES];
};
ComponentParser.isKnownMultiTemplate = function (name, exports) {
return ComponentParser.KNOWNMULTITEMPLATES in exports && exports[ComponentParser.KNOWNMULTITEMPLATES] && name in exports[ComponentParser.KNOWNMULTITEMPLATES];
};
ComponentParser.addToComplexProperty = function (parent, complexProperty, elementModule) {
var parentComponent = parent.component;
if (ComponentParser.isKnownCollection(complexProperty.name, parent.exports)) {
complexProperty.items.push(elementModule.component);
}
else if (parentComponent._addChildFromBuilder) {
parentComponent._addChildFromBuilder(complexProperty.name, elementModule.component);
}
else {
parentComponent[complexProperty.name] = elementModule.component;
}
};
ComponentParser.isKnownCollection = function (name, context) {
return ComponentParser.KNOWNCOLLECTIONS in context && context[ComponentParser.KNOWNCOLLECTIONS] && name in context[ComponentParser.KNOWNCOLLECTIONS];
};
ComponentParser.KNOWNCOLLECTIONS = "knownCollections";
ComponentParser.KNOWNTEMPLATES = "knownTemplates";
ComponentParser.KNOWNMULTITEMPLATES = "knownMultiTemplates";
__decorate([
profiling_1.profile
], ComponentParser.prototype, "buildComponent", null);
return ComponentParser;
}());
xml2ui.ComponentParser = ComponentParser;
})(xml2ui || (xml2ui = {}));
//# sourceMappingURL=builder.js.map
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("../node_modules/webpack/buildin/global.js")))
/***/ }),
/***/ "../node_modules/tns-core-modules/ui/builder/component-builder/component-builder.js":
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global) {Object.defineProperty(exports, "__esModule", { value: true });
var bindable_1 = __webpack_require__("../node_modules/tns-core-modules/ui/core/bindable/bindable.js");
var file_system_1 = __webpack_require__("../node_modules/tns-core-modules/file-system/file-system.js");
var binding_builder_1 = __webpack_require__("../node_modules/tns-core-modules/ui/builder/binding-builder.js");
var file_name_resolver_1 = __webpack_require__("../node_modules/tns-core-modules/file-system/file-name-resolver/file-name-resolver.js");
var profiling_1 = __webpack_require__("../node_modules/tns-core-modules/profiling/profiling.js");
var platform = __webpack_require__("../node_modules/tns-core-modules/platform/platform.js");
var filesystem = __webpack_require__("../node_modules/tns-core-modules/file-system/file-system.js");
var UI_PATH = "ui/";
var MODULES = {
"TabViewItem": "ui/tab-view",
"FormattedString": "text/formatted-string",
"Span": "text/span",
"ActionItem": "ui/action-bar",
"NavigationButton": "ui/action-bar",
"SegmentedBarItem": "ui/segmented-bar",
};
var CODEFILE = "codeFile";
var CSSFILE = "cssFile";
var IMPORT = "import";
var createComponentInstance = profiling_1.profile("createComponentInstance", function (elementName, namespace) {
var instance;
var instanceModule;
var moduleId = MODULES[elementName] || UI_PATH +
(elementName.toLowerCase().indexOf("layout") !== -1 ? "layouts/" : "") +
elementName.split(/(?=[A-Z])/).join("-").toLowerCase();
try {
if (typeof namespace === "string") {
if (global.moduleExists(namespace)) {
moduleId = namespace;
}
else {
var pathInsideTNSModules = file_system_1.path.join(file_system_1.knownFolders.currentApp().path, "tns_modules", namespace);
try {
instanceModule = global.require(pathInsideTNSModules);
moduleId = pathInsideTNSModules;
}
catch (e) {
moduleId = file_system_1.path.join(file_system_1.knownFolders.currentApp().path, namespace);
}
}
}
if (!instanceModule) {
instanceModule = global.loadModule(moduleId);
}
var instanceType = instanceModule[elementName] || Object;
instance = new instanceType();
}
catch (ex) {
var debug = __webpack_require__("../node_modules/tns-core-modules/utils/debug.js");
throw new debug.ScopeError(ex, "Module '" + moduleId + "' not found for element '" + (namespace ? namespace + ":" : "") + elementName + "'.");
}
return { instance: instance, instanceModule: instanceModule };
});
var getComponentModuleExports = profiling_1.profile("getComponentModuleExports", function (instance, moduleExports, attributes) {
if (attributes) {
if (attributes[IMPORT]) {
var importPath = attributes[IMPORT].trim();
if (importPath.indexOf("~/") === 0) {
importPath = file_system_1.path.join(file_system_1.knownFolders.currentApp().path, importPath.replace("~/", ""));
}
moduleExports = global.loadModule(importPath);
instance.exports = moduleExports;
}
if (attributes[CODEFILE]) {
var codeFilePath = attributes[CODEFILE].trim();
if (codeFilePath.indexOf("~/") === 0) {
codeFilePath = file_system_1.path.join(file_system_1.knownFolders.currentApp().path, codeFilePath.replace("~/", ""));
}
var codeFilePathWithExt = codeFilePath.indexOf(".js") !== -1 ? codeFilePath : codeFilePath + ".js";
if (file_system_1.File.exists(codeFilePathWithExt)) {
moduleExports = global.loadModule(codeFilePath);
instance.exports = moduleExports;
}
else {
throw new Error("Code file with path \"" + codeFilePathWithExt + "\" cannot be found!");
}
}
}
return moduleExports;
});
var applyComponentCss = profiling_1.profile("applyComponentCss", function (instance, moduleNamePath, attributes) {
var cssApplied = false;
if (attributes) {
if (attributes[CSSFILE] && typeof instance.addCssFile === "function") {
var cssFilePath = attributes[CSSFILE].trim();
if (cssFilePath.indexOf("~/") === 0) {
cssFilePath = file_system_1.path.join(file_system_1.knownFolders.currentApp().path, cssFilePath.replace("~/", ""));
}
if (file_system_1.File.exists(cssFilePath)) {
instance.addCssFile(cssFilePath);
cssApplied = true;
}
else {
throw new Error("Css file with path \"" + cssFilePath + "\" cannot be found!");
}
}
}
if (typeof instance.addCssFile === "function") {
if (moduleNamePath && !cssApplied) {
var appPath = filesystem.knownFolders.currentApp().path;
var cssPathRelativeToApp = (moduleNamePath.startsWith(appPath) ? "./" + moduleNamePath.substr(appPath.length + 1) : moduleNamePath) + ".css";
if (global.moduleExists(cssPathRelativeToApp)) {
instance.addCssFile(cssPathRelativeToApp);
}
var cssFilePath = file_name_resolver_1.resolveFileName(moduleNamePath, "css");
if (cssFilePath) {
instance.addCssFile(cssFilePath);
cssApplied = true;
}
}
}
});
var applyComponentAttributes = profiling_1.profile("applyComponentAttributes", function (instance, instanceModule, moduleExports, attributes) {
if (instance && instanceModule) {
for (var attr in attributes) {
var attrValue = attributes[attr];
if (attr.indexOf(":") !== -1) {
var platformName = attr.split(":")[0].trim();
if (platformName.toLowerCase() === platform.device.os.toLowerCase()) {
attr = attr.split(":")[1].trim();
}
else {
continue;
}
}
if (attr.indexOf(".") !== -1) {
var subObj = instance;
var properties = attr.split(".");
var subPropName = properties[properties.length - 1];
for (var i = 0; i < properties.length - 1; i++) {
if (subObj !== undefined && subObj !== null) {
subObj = subObj[properties[i]];
}
}
if (subObj !== undefined && subObj !== null) {
setPropertyValue(subObj, instanceModule, moduleExports, subPropName, attrValue);
}
}
else {
setPropertyValue(instance, instanceModule, moduleExports, attr, attrValue);
}
}
}
});
function getComponentModule(elementName, namespace, attributes, moduleExports, moduleNamePath, isRootComponent) {
elementName = elementName.split("-").map(function (s) { return s[0].toUpperCase() + s.substring(1); }).join("");
var _a = createComponentInstance(elementName, namespace), instance = _a.instance, instanceModule = _a.instanceModule;
moduleExports = getComponentModuleExports(instance, moduleExports, attributes);
if (isRootComponent) {
applyComponentCss(instance, moduleNamePath, attributes);
}
applyComponentAttributes(instance, instanceModule, moduleExports, attributes);
var componentModule;
if (instance && instanceModule) {
componentModule = { component: instance, exports: instanceModule };
}
return componentModule;
}
exports.getComponentModule = getComponentModule;
function setPropertyValue(instance, instanceModule, exports, propertyName, propertyValue) {
if (isBinding(propertyValue) && instance.bind) {
var bindOptions = binding_builder_1.getBindingOptions(propertyName, getBindingExpressionFromAttribute(propertyValue));
instance.bind({
sourceProperty: bindOptions[binding_builder_1.bindingConstants.sourceProperty],
targetProperty: bindOptions[binding_builder_1.bindingConstants.targetProperty],
expression: bindOptions[binding_builder_1.bindingConstants.expression],
twoWay: bindOptions[binding_builder_1.bindingConstants.twoWay]
}, bindOptions[binding_builder_1.bindingConstants.source]);
}
else if (bindable_1.isEventOrGesture(propertyName, instance)) {
var handler = exports && exports[propertyValue];
if (typeof handler === "function") {
instance.on(propertyName, handler);
}
}
else if (isKnownFunction(propertyName, instance) && exports && typeof exports[propertyValue] === "function") {
instance[propertyName] = exports[propertyValue];
}
else {
instance[propertyName] = propertyValue;
}
}
exports.setPropertyValue = setPropertyValue;
function getBindingExpressionFromAttribute(value) {
return value.replace("{{", "").replace("}}", "").trim();
}
function isBinding(value) {
var isBinding;
if (typeof value === "string") {
var str = value.trim();
isBinding = str.indexOf("{{") === 0 && str.lastIndexOf("}}") === str.length - 2;
}
return isBinding;
}
var KNOWN_FUNCTIONS = "knownFunctions";
function isKnownFunction(name, instance) {
return instance.constructor
&& KNOWN_FUNCTIONS in instance.constructor
&& instance.constructor[KNOWN_FUNCTIONS].indexOf(name) !== -1;
}
//# sourceMappingURL=component-builder.js.map
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("../node_modules/webpack/buildin/global.js")))
/***/ }),
/***/ "../node_modules/tns-core-modules/ui/button/button-common.js":
/***/ (function(module, exports, __webpack_require__) {
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
Object.defineProperty(exports, "__esModule", { value: true });
var text_base_1 = __webpack_require__("../node_modules/tns-core-modules/ui/text-base/text-base.js");
__export(__webpack_require__("../node_modules/tns-core-modules/ui/text-base/text-base.js"));
var ButtonBase = (function (_super) {
__extends(ButtonBase, _super);
function ButtonBase() {
return _super !== null && _super.apply(this, arguments) || this;
}
Object.defineProperty(ButtonBase.prototype, "textWrap", {
get: function () {
return this.style.whiteSpace === "normal";
},
set: function (value) {
if (typeof value === "string") {
value = text_base_1.booleanConverter(value);
}
this.style.whiteSpace = value ? "normal" : "nowrap";
},
enumerable: true,
configurable: true
});
ButtonBase.tapEvent = "tap";
ButtonBase = __decorate([
text_base_1.CSSType("Button")
], ButtonBase);
return ButtonBase;
}(text_base_1.TextBase));
exports.ButtonBase = ButtonBase;
ButtonBase.prototype.recycleNativeView = "auto";
//# sourceMappingURL=button-common.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/ui/button/button.js":
/***/ (function(module, exports, __webpack_require__) {
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
Object.defineProperty(exports, "__esModule", { value: true });
var control_state_change_1 = __webpack_require__("../node_modules/tns-core-modules/ui/core/control-state-change/control-state-change.js");
var button_common_1 = __webpack_require__("../node_modules/tns-core-modules/ui/button/button-common.js");
__export(__webpack_require__("../node_modules/tns-core-modules/ui/button/button-common.js"));
var Button = (function (_super) {
__extends(Button, _super);
function Button() {
return _super !== null && _super.apply(this, arguments) || this;
}
Button.prototype.createNativeView = function () {
return UIButton.buttonWithType(1);
};
Button.prototype.initNativeView = function () {
_super.prototype.initNativeView.call(this);
var nativeView = this.nativeViewProtected;
this._tapHandler = TapHandlerImpl.initWithOwner(new WeakRef(this));
nativeView.addTargetActionForControlEvents(this._tapHandler, "tap", 64);
};
Button.prototype.disposeNativeView = function () {
this._tapHandler = null;
_super.prototype.disposeNativeView.call(this);
};
Object.defineProperty(Button.prototype, "ios", {
get: function () {
return this.nativeViewProtected;
},
enumerable: true,
configurable: true
});
Button.prototype.onUnloaded = function () {
_super.prototype.onUnloaded.call(this);
if (this._stateChangedHandler) {
this._stateChangedHandler.stop();
}
};
Button.prototype._updateHandler = function (subscribe) {
var _this = this;
if (subscribe) {
if (!this._stateChangedHandler) {
this._stateChangedHandler = new control_state_change_1.ControlStateChangeListener(this.nativeViewProtected, function (s) {
_this._goToVisualState(s);
});
}
this._stateChangedHandler.start();
}
else {
this._stateChangedHandler.stop();
}
};
Button.prototype[button_common_1.borderTopWidthProperty.getDefault] = function () {
return {
value: this.nativeViewProtected.contentEdgeInsets.top,
unit: "px"
};
};
Button.prototype[button_common_1.borderTopWidthProperty.setNative] = function (value) {
var inset = this.nativeViewProtected.contentEdgeInsets;
var top = button_common_1.layout.toDeviceIndependentPixels(this.effectivePaddingTop + this.effectiveBorderTopWidth);
this.nativeViewProtected.contentEdgeInsets = { top: top, left: inset.left, bottom: inset.bottom, right: inset.right };
};
Button.prototype[button_common_1.borderRightWidthProperty.getDefault] = function () {
return {
value: this.nativeViewProtected.contentEdgeInsets.right,
unit: "px"
};
};
Button.prototype[button_common_1.borderRightWidthProperty.setNative] = function (value) {
var inset = this.nativeViewProtected.contentEdgeInsets;
var right = button_common_1.layout.toDeviceIndependentPixels(this.effectivePaddingRight + this.effectiveBorderRightWidth);
this.nativeViewProtected.contentEdgeInsets = { top: inset.top, left: inset.left, bottom: inset.bottom, right: right };
};
Button.prototype[button_common_1.borderBottomWidthProperty.getDefault] = function () {
return {
value: this.nativeViewProtected.contentEdgeInsets.bottom,
unit: "px"
};
};
Button.prototype[button_common_1.borderBottomWidthProperty.setNative] = function (value) {
var inset = this.nativeViewProtected.contentEdgeInsets;
var bottom = button_common_1.layout.toDeviceIndependentPixels(this.effectivePaddingBottom + this.effectiveBorderBottomWidth);
this.nativeViewProtected.contentEdgeInsets = { top: inset.top, left: inset.left, bottom: bottom, right: inset.right };
};
Button.prototype[button_common_1.borderLeftWidthProperty.getDefault] = function () {
return {
value: this.nativeViewProtected.contentEdgeInsets.left,
unit: "px"
};
};
Button.prototype[button_common_1.borderLeftWidthProperty.setNative] = function (value) {
var inset = this.nativeViewProtected.contentEdgeInsets;
var left = button_common_1.layout.toDeviceIndependentPixels(this.effectivePaddingLeft + this.effectiveBorderLeftWidth);
this.nativeViewProtected.contentEdgeInsets = { top: inset.top, left: left, bottom: inset.bottom, right: inset.right };
};
Button.prototype[button_common_1.paddingTopProperty.getDefault] = function () {
return {
value: this.nativeViewProtected.contentEdgeInsets.top,
unit: "px"
};
};
Button.prototype[button_common_1.paddingTopProperty.setNative] = function (value) {
var inset = this.nativeViewProtected.contentEdgeInsets;
var top = button_common_1.layout.toDeviceIndependentPixels(this.effectivePaddingTop + this.effectiveBorderTopWidth);
this.nativeViewProtected.contentEdgeInsets = { top: top, left: inset.left, bottom: inset.bottom, right: inset.right };
};
Button.prototype[button_common_1.paddingRightProperty.getDefault] = function () {
return {
value: this.nativeViewProtected.contentEdgeInsets.right,
unit: "px"
};
};
Button.prototype[button_common_1.paddingRightProperty.setNative] = function (value) {
var inset = this.nativeViewProtected.contentEdgeInsets;
var right = button_common_1.layout.toDeviceIndependentPixels(this.effectivePaddingRight + this.effectiveBorderRightWidth);
this.nativeViewProtected.contentEdgeInsets = { top: inset.top, left: inset.left, bottom: inset.bottom, right: right };
};
Button.prototype[button_common_1.paddingBottomProperty.getDefault] = function () {
return {
value: this.nativeViewProtected.contentEdgeInsets.bottom,
unit: "px"
};
};
Button.prototype[button_common_1.paddingBottomProperty.setNative] = function (value) {
var inset = this.nativeViewProtected.contentEdgeInsets;
var bottom = button_common_1.layout.toDeviceIndependentPixels(this.effectivePaddingBottom + this.effectiveBorderBottomWidth);
this.nativeViewProtected.contentEdgeInsets = { top: inset.top, left: inset.left, bottom: bottom, right: inset.right };
};
Button.prototype[button_common_1.paddingLeftProperty.getDefault] = function () {
return {
value: this.nativeViewProtected.contentEdgeInsets.left,
unit: "px"
};
};
Button.prototype[button_common_1.paddingLeftProperty.setNative] = function (value) {
var inset = this.nativeViewProtected.contentEdgeInsets;
var left = button_common_1.layout.toDeviceIndependentPixels(this.effectivePaddingLeft + this.effectiveBorderLeftWidth);
this.nativeViewProtected.contentEdgeInsets = { top: inset.top, left: left, bottom: inset.bottom, right: inset.right };
};
Button.prototype[button_common_1.textAlignmentProperty.setNative] = function (value) {
switch (value) {
case "left":
this.nativeViewProtected.titleLabel.textAlignment = 0;
this.nativeViewProtected.contentHorizontalAlignment = 1;
break;
case "initial":
case "center":
this.nativeViewProtected.titleLabel.textAlignment = 1;
this.nativeViewProtected.contentHorizontalAlignment = 0;
break;
case "right":
this.nativeViewProtected.titleLabel.textAlignment = 2;
this.nativeViewProtected.contentHorizontalAlignment = 2;
break;
}
};
Button.prototype[button_common_1.whiteSpaceProperty.setNative] = function (value) {
var nativeView = this.nativeViewProtected.titleLabel;
switch (value) {
case "normal":
nativeView.lineBreakMode = 0;
nativeView.numberOfLines = 0;
break;
case "nowrap":
case "initial":
nativeView.lineBreakMode = 5;
nativeView.numberOfLines = 1;
break;
}
};
Button.prototype.onMeasure = function (widthMeasureSpec, heightMeasureSpec) {
if (!this.textWrap) {
return _super.prototype.onMeasure.call(this, widthMeasureSpec, heightMeasureSpec);
}
var nativeView = this.nativeViewProtected;
if (nativeView) {
var width = button_common_1.layout.getMeasureSpecSize(widthMeasureSpec);
var widthMode = button_common_1.layout.getMeasureSpecMode(widthMeasureSpec);
var height = button_common_1.layout.getMeasureSpecSize(heightMeasureSpec);
var heightMode = button_common_1.layout.getMeasureSpecMode(heightMeasureSpec);
var horizontalPadding = this.effectivePaddingLeft + this.effectiveBorderLeftWidth + this.effectivePaddingRight + this.effectiveBorderRightWidth;
var verticalPadding = this.effectivePaddingTop + this.effectiveBorderTopWidth + this.effectivePaddingBottom + this.effectiveBorderBottomWidth;
if (verticalPadding === 0) {
verticalPadding = button_common_1.layout.toDevicePixels(12);
}
var desiredSize = button_common_1.layout.measureNativeView(nativeView.titleLabel, width - horizontalPadding, widthMode, height - verticalPadding, heightMode);
desiredSize.width = desiredSize.width + horizontalPadding;
desiredSize.height = desiredSize.height + verticalPadding;
var measureWidth = Math.max(desiredSize.width, this.effectiveMinWidth);
var measureHeight = Math.max(desiredSize.height, this.effectiveMinHeight);
var widthAndState = button_common_1.View.resolveSizeAndState(measureWidth, width, widthMode, 0);
var heightAndState = button_common_1.View.resolveSizeAndState(measureHeight, height, heightMode, 0);
this.setMeasuredDimension(widthAndState, heightAndState);
}
};
__decorate([
button_common_1.PseudoClassHandler("normal", "highlighted", "pressed", "active")
], Button.prototype, "_updateHandler", null);
return Button;
}(button_common_1.ButtonBase));
exports.Button = Button;
var TapHandlerImpl = (function (_super) {
__extends(TapHandlerImpl, _super);
function TapHandlerImpl() {
return _super !== null && _super.apply(this, arguments) || this;
}
TapHandlerImpl.initWithOwner = function (owner) {
var handler = TapHandlerImpl.new();
handler._owner = owner;
return handler;
};
TapHandlerImpl.prototype.tap = function (args) {
var owner = this._owner.get();
if (owner) {
owner._emit(button_common_1.ButtonBase.tapEvent);
}
};
TapHandlerImpl.ObjCExposedMethods = {
"tap": { returns: interop.types.void, params: [interop.types.id] }
};
return TapHandlerImpl;
}(NSObject));
//# sourceMappingURL=button.ios.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/ui/content-view/content-view.js":
/***/ (function(module, exports, __webpack_require__) {
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
Object.defineProperty(exports, "__esModule", { value: true });
var view_1 = __webpack_require__("../node_modules/tns-core-modules/ui/core/view/view.js");
__export(__webpack_require__("../node_modules/tns-core-modules/ui/core/view/view.js"));
var ContentView = (function (_super) {
__extends(ContentView, _super);
function ContentView() {
return _super !== null && _super.apply(this, arguments) || this;
}
Object.defineProperty(ContentView.prototype, "content", {
get: function () {
return this._content;
},
set: function (value) {
var oldView = this._content;
if (this._content) {
this._removeView(this._content);
}
this._content = value;
if (this._content) {
this._addView(this._content);
}
this._onContentChanged(oldView, value);
if (view_1.isIOS && oldView !== value) {
this.requestLayout();
}
},
enumerable: true,
configurable: true
});
Object.defineProperty(ContentView.prototype, "layoutView", {
get: function () {
var result;
if (this._content) {
var first_1 = true;
this._content._eachLayoutView(function (child) {
if (first_1) {
first_1 = false;
result = child;
}
else {
throw new Error("More than one layout child inside a ContentView");
}
});
}
return result;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ContentView.prototype, "_childrenCount", {
get: function () {
return this._content ? 1 : 0;
},
enumerable: true,
configurable: true
});
ContentView.prototype._onContentChanged = function (oldView, newView) {
};
ContentView.prototype._addChildFromBuilder = function (name, value) {
if (value instanceof view_1.View) {
this.content = value;
}
};
ContentView.prototype.eachChildView = function (callback) {
var content = this._content;
if (content) {
callback(content);
}
};
ContentView.prototype.onMeasure = function (widthMeasureSpec, heightMeasureSpec) {
var result = view_1.View.measureChild(this, this.layoutView, widthMeasureSpec, heightMeasureSpec);
var width = view_1.layout.getMeasureSpecSize(widthMeasureSpec);
var widthMode = view_1.layout.getMeasureSpecMode(widthMeasureSpec);
var height = view_1.layout.getMeasureSpecSize(heightMeasureSpec);
var heightMode = view_1.layout.getMeasureSpecMode(heightMeasureSpec);
var measureWidth = Math.max(result.measuredWidth, this.effectiveMinWidth);
var measureHeight = Math.max(result.measuredHeight, this.effectiveMinHeight);
var widthAndState = view_1.View.resolveSizeAndState(measureWidth, width, widthMode, 0);
var heightAndState = view_1.View.resolveSizeAndState(measureHeight, height, heightMode, 0);
this.setMeasuredDimension(widthAndState, heightAndState);
};
ContentView.prototype.onLayout = function (left, top, right, bottom) {
view_1.View.layoutChild(this, this.layoutView, 0, 0, right - left, bottom - top);
};
return ContentView;
}(view_1.CustomLayoutView));
exports.ContentView = ContentView;
ContentView.prototype.recycleNativeView = "auto";
//# sourceMappingURL=content-view.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/ui/core/bindable/bindable.js":
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global) {Object.defineProperty(exports, "__esModule", { value: true });
var properties_1 = __webpack_require__("../node_modules/tns-core-modules/ui/core/properties/properties.js");
var observable_1 = __webpack_require__("../node_modules/tns-core-modules/data/observable/observable.js");
exports.Observable = observable_1.Observable;
exports.WrappedValue = observable_1.WrappedValue;
var weak_event_listener_1 = __webpack_require__("../node_modules/tns-core-modules/ui/core/weak-event-listener/weak-event-listener.js");
var binding_builder_1 = __webpack_require__("../node_modules/tns-core-modules/ui/builder/binding-builder.js");
var utils_1 = __webpack_require__("../node_modules/tns-core-modules/utils/utils.js");
var trace_1 = __webpack_require__("../node_modules/tns-core-modules/trace/trace.js");
exports.traceEnabled = trace_1.isEnabled;
exports.traceWrite = trace_1.write;
exports.traceError = trace_1.error;
exports.traceCategories = trace_1.categories;
exports.traceNotifyEvent = trace_1.notifyEvent;
exports.isCategorySet = trace_1.isCategorySet;
exports.traceMessageType = trace_1.messageType;
var types = __webpack_require__("../node_modules/tns-core-modules/utils/types.js");
var applicationCommon = __webpack_require__("../node_modules/tns-core-modules/application/application-common.js");
var polymerExpressions = __webpack_require__("../node_modules/tns-core-modules/js-libs/polymer-expressions/polymer-expressions.js");
var contextKey = "context";
var paramsRegex = /\[\s*(['"])*(\w*)\1\s*\]/;
var bc = binding_builder_1.bindingConstants;
var emptyArray = [];
var propertiesCache = {};
function getProperties(property) {
if (!property) {
return emptyArray;
}
var result = propertiesCache[property];
if (result) {
return result;
}
var parentsMatches = property.match(binding_builder_1.parentsRegex);
result = property.replace(binding_builder_1.parentsRegex, "parentsMatch")
.replace(/\]/g, "")
.split(/\.|\[/);
var parentsMatchesCounter = 0;
for (var i = 0, resultLength = result.length; i < resultLength; i++) {
if (result[i] === "parentsMatch") {
result[i] = parentsMatches[parentsMatchesCounter++];
}
}
propertiesCache[property] = result;
return result;
}
function getEventOrGestureName(name) {
return name.indexOf("on") === 0 ? name.substr(2, name.length - 2) : name;
}
exports.getEventOrGestureName = getEventOrGestureName;
function isGesture(eventOrGestureName) {
var t = eventOrGestureName.trim().toLowerCase();
return t === "tap"
|| t === "doubletap"
|| t === "pinch"
|| t === "pan"
|| t === "swipe"
|| t === "rotation"
|| t === "longpress"
|| t === "touch";
}
exports.isGesture = isGesture;
function isEventOrGesture(name, view) {
if (typeof name === "string") {
var eventOrGestureName = getEventOrGestureName(name);
var evt = eventOrGestureName + "Event";
return view.constructor && evt in view.constructor || isGesture(eventOrGestureName.toLowerCase());
}
return false;
}
exports.isEventOrGesture = isEventOrGesture;
var Binding = (function () {
function Binding(target, options) {
this.propertyChangeListeners = new Map();
this.target = new WeakRef(target);
this.options = options;
this.sourceProperties = getProperties(options.sourceProperty);
this.targetOptions = this.resolveOptions(target, getProperties(options.targetProperty));
if (!this.targetOptions) {
throw new Error("Invalid property: " + options.targetProperty + " for target: " + target);
}
if (options.twoWay) {
var target_1 = this.targetOptions.instance.get();
if (target_1 instanceof observable_1.Observable) {
target_1.on(this.targetOptions.property + "Change", this.onTargetPropertyChanged, this);
}
}
}
Binding.prototype.onTargetPropertyChanged = function (data) {
this.updateTwoWay(data.value);
};
Binding.prototype.loadedHandlerVisualTreeBinding = function (args) {
var target = args.object;
target.off("loaded", this.loadedHandlerVisualTreeBinding, this);
var context = target.bindingContext;
if (context !== undefined && context !== null) {
this.update(context);
}
};
;
Binding.prototype.clearSource = function () {
var _this = this;
this.propertyChangeListeners.forEach(function (observable, index, map) {
weak_event_listener_1.removeWeakEventListener(observable, observable_1.Observable.propertyChangeEvent, _this.onSourcePropertyChanged, _this);
});
this.propertyChangeListeners.clear();
if (this.source) {
this.source.clear();
}
if (this.sourceOptions) {
this.sourceOptions.instance.clear();
this.sourceOptions = undefined;
}
};
Binding.prototype.sourceAsObject = function (source) {
var objectType = typeof source;
if (objectType === "number") {
source = new Number(source);
}
else if (objectType === "boolean") {
source = new Boolean(source);
}
else if (objectType === "string") {
source = new String(source);
}
return source;
};
Binding.prototype.bindingContextChanged = function (data) {
var target = this.targetOptions.instance.get();
if (!target) {
this.unbind();
return;
}
var value = data.value;
if (value !== null && value !== undefined) {
this.update(value);
}
else {
this.clearBinding();
}
};
Binding.prototype.bind = function (source) {
var target = this.targetOptions.instance.get();
if (this.sourceIsBindingContext && target instanceof observable_1.Observable && this.targetOptions.property !== "bindingContext") {
target.on("bindingContextChange", this.bindingContextChanged, this);
}
this.update(source);
};
Binding.prototype.update = function (source) {
this.clearSource();
source = this.sourceAsObject(source);
if (!types.isNullOrUndefined(source)) {
this.source = new WeakRef(source);
this.sourceOptions = this.resolveOptions(source, this.sourceProperties);
var sourceValue = this.getSourcePropertyValue();
this.updateTarget(sourceValue);
this.addPropertyChangeListeners(this.source, this.sourceProperties);
}
else if (!this.sourceIsBindingContext) {
var sourceValue = this.getSourcePropertyValue();
this.updateTarget(sourceValue ? sourceValue : source);
}
};
Binding.prototype.unbind = function () {
var target = this.targetOptions.instance.get();
if (target instanceof observable_1.Observable) {
if (this.options.twoWay) {
target.off(this.targetOptions.property + "Change", this.onTargetPropertyChanged, this);
}
if (this.sourceIsBindingContext && this.targetOptions.property !== "bindingContext") {
target.off("bindingContextChange", this.bindingContextChanged, this);
}
}
if (this.targetOptions) {
this.targetOptions = undefined;
}
this.sourceProperties = undefined;
if (!this.source) {
return;
}
this.clearSource();
};
Binding.prototype.resolveObjectsAndProperties = function (source, properties) {
var result = [];
var currentObject = source;
var currentObjectChanged = false;
for (var i = 0, propsArrayLength = properties.length; i < propsArrayLength; i++) {
var property = properties[i];
if (property === bc.bindingValueKey) {
currentObjectChanged = true;
}
if (property === bc.parentValueKey || property.indexOf(bc.parentsValueKey) === 0) {
var parentView = this.getParentView(this.target.get(), property).view;
if (parentView) {
currentObject = parentView.bindingContext;
}
else {
var targetInstance = this.target.get();
targetInstance.off("loaded", this.loadedHandlerVisualTreeBinding, this);
targetInstance.on("loaded", this.loadedHandlerVisualTreeBinding, this);
}
currentObjectChanged = true;
}
if (currentObject) {
result.push({ instance: currentObject, property: property });
}
else {
break;
}
if (!currentObjectChanged && (i < propsArrayLength - 1)) {
currentObject = currentObject ? currentObject[properties[i]] : null;
}
currentObjectChanged = false;
}
return result;
};
Binding.prototype.addPropertyChangeListeners = function (source, sourceProperty, parentProperies) {
var objectsAndProperties = this.resolveObjectsAndProperties(source.get(), sourceProperty);
var prop = parentProperies || "";
for (var i = 0, length_1 = objectsAndProperties.length; i < length_1; i++) {
var propName = objectsAndProperties[i].property;
prop += "$" + propName;
var currentObject = objectsAndProperties[i].instance;
if (!this.propertyChangeListeners.has(prop) && currentObject instanceof observable_1.Observable && currentObject._isViewBase) {
weak_event_listener_1.addWeakEventListener(currentObject, propName + "Change", this.onSourcePropertyChanged, this);
weak_event_listener_1.addWeakEventListener(currentObject, observable_1.Observable.propertyChangeEvent, this.onSourcePropertyChanged, this);
this.propertyChangeListeners.set(prop, currentObject);
}
else if (!this.propertyChangeListeners.has(prop) && currentObject instanceof observable_1.Observable) {
weak_event_listener_1.addWeakEventListener(currentObject, observable_1.Observable.propertyChangeEvent, this.onSourcePropertyChanged, this);
this.propertyChangeListeners.set(prop, currentObject);
}
}
};
Binding.prototype.prepareExpressionForUpdate = function () {
var escapedSourceProperty = utils_1.escapeRegexSymbols(this.options.sourceProperty);
var expRegex = new RegExp(escapedSourceProperty, "g");
var resultExp = this.options.expression.replace(expRegex, bc.newPropertyValueKey);
return resultExp;
};
Binding.prototype.updateTwoWay = function (value) {
if (this.updating || !this.options.twoWay) {
return;
}
var newValue = value;
if (this.options.expression) {
var changedModel = {};
changedModel[bc.bindingValueKey] = value;
changedModel[bc.newPropertyValueKey] = value;
var sourcePropertyName = "";
if (this.sourceOptions) {
sourcePropertyName = this.sourceOptions.property;
}
else if (typeof this.options.sourceProperty === "string" && this.options.sourceProperty.indexOf(".") === -1) {
sourcePropertyName = this.options.sourceProperty;
}
if (sourcePropertyName !== "") {
changedModel[sourcePropertyName] = value;
}
var updateExpression = this.prepareExpressionForUpdate();
this.prepareContextForExpression(changedModel, updateExpression, undefined);
var expressionValue = this._getExpressionValue(updateExpression, true, changedModel);
if (expressionValue instanceof Error) {
trace_1.write(expressionValue.message, trace_1.categories.Binding, trace_1.messageType.error);
}
newValue = expressionValue;
}
this.updateSource(newValue);
};
Binding.prototype._getExpressionValue = function (expression, isBackConvert, changedModel) {
try {
var exp_1 = polymerExpressions.PolymerExpressions.getExpression(expression);
if (exp_1) {
var context_1 = this.source && this.source.get && this.source.get() || global;
var model = {};
var addedProps = [];
var resources = applicationCommon.getResources();
for (var prop in resources) {
if (resources.hasOwnProperty(prop) && !context_1.hasOwnProperty(prop)) {
context_1[prop] = resources[prop];
addedProps.push(prop);
}
}
this.prepareContextForExpression(context_1, expression, addedProps);
model[contextKey] = context_1;
var result = exp_1.getValue(model, isBackConvert, changedModel ? changedModel : model);
var addedPropsLength = addedProps.length;
for (var i = 0; i < addedPropsLength; i++) {
delete context_1[addedProps[i]];
}
addedProps.length = 0;
return result;
}
return new Error(expression + " is not a valid expression.");
}
catch (e) {
var errorMessage = "Run-time error occured in file: " + e.sourceURL + " at line: " + e.line + " and column: " + e.column;
return new Error(errorMessage);
}
};
Binding.prototype.onSourcePropertyChanged = function (data) {
var sourceProps = this.sourceProperties;
var sourcePropsLength = sourceProps.length;
var changedPropertyIndex = sourceProps.indexOf(data.propertyName);
var parentProps = "";
if (changedPropertyIndex > -1) {
parentProps = "$" + sourceProps.slice(0, changedPropertyIndex + 1).join("$");
while (this.propertyChangeListeners.get(parentProps) !== data.object) {
changedPropertyIndex += sourceProps.slice(changedPropertyIndex + 1).indexOf(data.propertyName) + 1;
parentProps = "$" + sourceProps.slice(0, changedPropertyIndex + 1).join("$");
}
}
if (this.options.expression) {
var expressionValue = this._getExpressionValue(this.options.expression, false, undefined);
if (expressionValue instanceof Error) {
trace_1.write(expressionValue.message, trace_1.categories.Binding, trace_1.messageType.error);
}
else {
this.updateTarget(expressionValue);
}
}
else {
if (changedPropertyIndex > -1) {
var props = sourceProps.slice(changedPropertyIndex + 1);
var propsLength = props.length;
if (propsLength > 0) {
var value = data.value;
for (var i = 0; i < propsLength; i++) {
value = value[props[i]];
}
this.updateTarget(value);
}
else if (data.propertyName === this.sourceOptions.property) {
this.updateTarget(data.value);
}
}
}
if (changedPropertyIndex > -1 && changedPropertyIndex < sourcePropsLength - 1) {
var probablyChangedObject = this.propertyChangeListeners.get(parentProps);
if (probablyChangedObject &&
probablyChangedObject !== data.object[sourceProps[changedPropertyIndex]]) {
for (var i = sourcePropsLength - 1; i > changedPropertyIndex; i--) {
var prop = "$" + sourceProps.slice(0, i + 1).join("$");
if (this.propertyChangeListeners.has(prop)) {
weak_event_listener_1.removeWeakEventListener(this.propertyChangeListeners.get(prop), observable_1.Observable.propertyChangeEvent, this.onSourcePropertyChanged, this);
this.propertyChangeListeners.delete(prop);
}
}
var newProps = sourceProps.slice(changedPropertyIndex + 1);
var newObject = data.object[sourceProps[changedPropertyIndex]];
if (!types.isNullOrUndefined(newObject) && typeof newObject === "object") {
this.addPropertyChangeListeners(new WeakRef(newObject), newProps, parentProps);
}
}
}
};
Binding.prototype.prepareContextForExpression = function (model, expression, newProps) {
var parentViewAndIndex;
var parentView;
var addedProps = newProps || [];
if (expression.indexOf(bc.bindingValueKey) > -1) {
model[bc.bindingValueKey] = model;
addedProps.push(bc.bindingValueKey);
}
if (expression.indexOf(bc.parentValueKey) > -1) {
parentView = this.getParentView(this.target.get(), bc.parentValueKey).view;
if (parentView) {
model[bc.parentValueKey] = parentView.bindingContext;
addedProps.push(bc.parentValueKey);
}
}
var parentsArray = expression.match(binding_builder_1.parentsRegex);
if (parentsArray) {
for (var i = 0; i < parentsArray.length; i++) {
parentViewAndIndex = this.getParentView(this.target.get(), parentsArray[i]);
if (parentViewAndIndex.view) {
model[bc.parentsValueKey] = model[bc.parentsValueKey] || {};
model[bc.parentsValueKey][parentViewAndIndex.index] = parentViewAndIndex.view.bindingContext;
addedProps.push(bc.parentsValueKey);
}
}
}
};
Binding.prototype.getSourcePropertyValue = function () {
if (this.options.expression) {
var changedModel = {};
changedModel[bc.bindingValueKey] = this.source ? this.source.get() : undefined;
var expressionValue = this._getExpressionValue(this.options.expression, false, changedModel);
if (expressionValue instanceof Error) {
trace_1.write(expressionValue.message, trace_1.categories.Binding, trace_1.messageType.error);
}
else {
return expressionValue;
}
}
if (this.sourceOptions) {
var sourceOptionsInstance = this.sourceOptions.instance.get();
if (this.sourceOptions.property === bc.bindingValueKey) {
return sourceOptionsInstance;
}
else if ((sourceOptionsInstance instanceof observable_1.Observable) && (this.sourceOptions.property && this.sourceOptions.property !== "")) {
return sourceOptionsInstance.get(this.sourceOptions.property);
}
else if (sourceOptionsInstance && this.sourceOptions.property && this.sourceOptions.property !== "" &&
this.sourceOptions.property in sourceOptionsInstance) {
return sourceOptionsInstance[this.sourceOptions.property];
}
else {
trace_1.write("Property: '" + this.sourceOptions.property + "' is invalid or does not exist. SourceProperty: '" + this.options.sourceProperty + "'", trace_1.categories.Binding, trace_1.messageType.error);
}
}
return null;
};
Binding.prototype.clearBinding = function () {
this.clearSource();
this.updateTarget(properties_1.unsetValue);
};
Binding.prototype.updateTarget = function (value) {
if (this.updating) {
return;
}
this.updateOptions(this.targetOptions, types.isNullOrUndefined(value) ? properties_1.unsetValue : value);
};
Binding.prototype.updateSource = function (value) {
if (this.updating || !this.source || !this.source.get()) {
return;
}
this.updateOptions(this.sourceOptions, value);
};
Binding.prototype.getParentView = function (target, property) {
if (!target) {
return { view: null, index: null };
}
var result;
if (property === bc.parentValueKey) {
result = target.parent;
}
var index = null;
if (property.indexOf(bc.parentsValueKey) === 0) {
result = target.parent;
var indexParams = paramsRegex.exec(property);
if (indexParams && indexParams.length > 1) {
index = indexParams[2];
}
if (!isNaN(index)) {
var indexAsInt = parseInt(index);
while (indexAsInt > 0) {
result = result.parent;
indexAsInt--;
}
}
else if (types.isString(index)) {
while (result && result.typeName !== index) {
result = result.parent;
}
}
}
return { view: result, index: index };
};
Binding.prototype.resolveOptions = function (obj, properties) {
var objectsAndProperties = this.resolveObjectsAndProperties(obj, properties);
if (objectsAndProperties.length > 0) {
var resolvedObj = objectsAndProperties[objectsAndProperties.length - 1].instance;
var prop = objectsAndProperties[objectsAndProperties.length - 1].property;
return {
instance: new WeakRef(this.sourceAsObject(resolvedObj)),
property: prop
};
}
return null;
};
Binding.prototype.updateOptions = function (options, value) {
var optionsInstance;
if (options && options.instance) {
optionsInstance = options.instance.get();
}
if (!optionsInstance) {
return;
}
this.updating = true;
try {
if (isEventOrGesture(options.property, optionsInstance) &&
types.isFunction(value)) {
optionsInstance.off(options.property, null, optionsInstance.bindingContext);
optionsInstance.on(options.property, value, optionsInstance.bindingContext);
}
else if (optionsInstance instanceof observable_1.Observable) {
optionsInstance.set(options.property, value);
}
else {
optionsInstance[options.property] = value;
}
}
catch (ex) {
trace_1.write("Binding error while setting property " + options.property + " of " + optionsInstance + ": " + ex, trace_1.categories.Binding, trace_1.messageType.error);
}
this.updating = false;
};
return Binding;
}());
exports.Binding = Binding;
//# sourceMappingURL=bindable.js.map
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("../node_modules/webpack/buildin/global.js")))
/***/ }),
/***/ "../node_modules/tns-core-modules/ui/core/control-state-change/control-state-change.js":
/***/ (function(module, exports) {
Object.defineProperty(exports, "__esModule", { value: true });
var ObserverClass = (function (_super) {
__extends(ObserverClass, _super);
function ObserverClass() {
return _super !== null && _super.apply(this, arguments) || this;
}
ObserverClass.prototype.observeValueForKeyPathOfObjectChangeContext = function (path) {
if (path === "selected") {
this["_owner"]._onSelectedChanged();
}
else if (path === "enabled") {
this["_owner"]._onEnabledChanged();
}
else if (path === "highlighted") {
this["_owner"]._onHighlightedChanged();
}
};
return ObserverClass;
}(NSObject));
var ControlStateChangeListener = (function () {
function ControlStateChangeListener(control, callback) {
this._observing = false;
this._observer = ObserverClass.alloc();
this._observer["_owner"] = this;
this._control = control;
this._callback = callback;
}
ControlStateChangeListener.prototype.start = function () {
if (!this._observing) {
this._control.addObserverForKeyPathOptionsContext(this._observer, "highlighted", 1, null);
this._observing = true;
this._updateState();
}
};
ControlStateChangeListener.prototype.stop = function () {
if (this._observing) {
this._observing = false;
this._control.removeObserverForKeyPath(this._observer, "highlighted");
}
};
ControlStateChangeListener.prototype._onEnabledChanged = function () {
this._updateState();
};
ControlStateChangeListener.prototype._onSelectedChanged = function () {
this._updateState();
};
ControlStateChangeListener.prototype._onHighlightedChanged = function () {
this._updateState();
};
ControlStateChangeListener.prototype._updateState = function () {
var state = "normal";
if (this._control.highlighted) {
state = "highlighted";
}
this._callback(state);
};
return ControlStateChangeListener;
}());
exports.ControlStateChangeListener = ControlStateChangeListener;
//# sourceMappingURL=control-state-change.ios.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/ui/core/properties/properties.js":
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", { value: true });
var observable_1 = __webpack_require__("../node_modules/tns-core-modules/data/observable/observable.js");
var style_1 = __webpack_require__("../node_modules/tns-core-modules/ui/styling/style/style.js");
exports.Style = style_1.Style;
var profiling_1 = __webpack_require__("../node_modules/tns-core-modules/profiling/profiling.js");
exports.unsetValue = new Object();
var cssPropertyNames = [];
var symbolPropertyMap = {};
var cssSymbolPropertyMap = {};
var inheritableProperties = new Array();
var inheritableCssProperties = new Array();
function print(map) {
var symbols = Object.getOwnPropertySymbols(map);
for (var _i = 0, symbols_1 = symbols; _i < symbols_1.length; _i++) {
var symbol = symbols_1[_i];
var prop = map[symbol];
if (!prop.registered) {
console.log("Property " + prop.name + " not Registered!!!!!");
}
}
}
function _printUnregisteredProperties() {
print(symbolPropertyMap);
print(cssSymbolPropertyMap);
}
exports._printUnregisteredProperties = _printUnregisteredProperties;
function _getProperties() {
return getPropertiesFromMap(symbolPropertyMap);
}
exports._getProperties = _getProperties;
function _getStyleProperties() {
return getPropertiesFromMap(cssSymbolPropertyMap);
}
exports._getStyleProperties = _getStyleProperties;
function getPropertiesFromMap(map) {
var props = [];
Object.getOwnPropertySymbols(map).forEach(function (symbol) { return props.push(map[symbol]); });
return props;
}
var Property = (function () {
function Property(options) {
this.enumerable = true;
this.configurable = true;
var propertyName = options.name;
this.name = propertyName;
var key = Symbol(propertyName + ":propertyKey");
this.key = key;
var getDefault = Symbol(propertyName + ":getDefault");
this.getDefault = getDefault;
var setNative = Symbol(propertyName + ":setNative");
this.setNative = setNative;
var defaultValueKey = Symbol(propertyName + ":nativeDefaultValue");
this.defaultValueKey = defaultValueKey;
var defaultValue = options.defaultValue;
this.defaultValue = defaultValue;
var eventName = propertyName + "Change";
var equalityComparer = options.equalityComparer;
var affectsLayout = options.affectsLayout;
var valueChanged = options.valueChanged;
var valueConverter = options.valueConverter;
var property = this;
this.set = function (boxedValue) {
var reset = boxedValue === exports.unsetValue;
var value;
var wrapped;
if (reset) {
value = defaultValue;
}
else {
wrapped = boxedValue && boxedValue.wrapped;
value = wrapped ? observable_1.WrappedValue.unwrap(boxedValue) : boxedValue;
if (valueConverter && typeof value === "string") {
value = valueConverter(value);
}
}
var oldValue = key in this ? this[key] : defaultValue;
var changed = equalityComparer ? !equalityComparer(oldValue, value) : oldValue !== value;
if (wrapped || changed) {
if (affectsLayout) {
this.requestLayout();
}
if (reset) {
delete this[key];
if (valueChanged) {
valueChanged(this, oldValue, value);
}
if (this[setNative]) {
if (this._suspendNativeUpdatesCount) {
if (this._suspendedUpdates) {
this._suspendedUpdates[propertyName] = property;
}
}
else {
if (defaultValueKey in this) {
this[setNative](this[defaultValueKey]);
delete this[defaultValueKey];
}
else {
this[setNative](defaultValue);
}
}
}
}
else {
this[key] = value;
if (valueChanged) {
valueChanged(this, oldValue, value);
}
if (this[setNative]) {
if (this._suspendNativeUpdatesCount) {
if (this._suspendedUpdates) {
this._suspendedUpdates[propertyName] = property;
}
}
else {
if (!(defaultValueKey in this)) {
this[defaultValueKey] = this[getDefault] ? this[getDefault]() : defaultValue;
}
this[setNative](value);
}
}
}
if (this.hasListeners(eventName)) {
this.notify({ object: this, eventName: eventName, propertyName: propertyName, value: value, oldValue: oldValue });
}
if (this.domNode) {
if (reset) {
this.domNode.attributeRemoved(propertyName);
}
else {
this.domNode.attributeModified(propertyName, value);
}
}
}
};
this.get = function () {
return key in this ? this[key] : defaultValue;
};
this.nativeValueChange = function (owner, value) {
var oldValue = key in owner ? owner[key] : defaultValue;
var changed = equalityComparer ? !equalityComparer(oldValue, value) : oldValue !== value;
if (changed) {
owner[key] = value;
if (valueChanged) {
valueChanged(owner, oldValue, value);
}
if (owner.nativeViewProtected && !(defaultValueKey in owner)) {
owner[defaultValueKey] = owner[getDefault] ? owner[getDefault]() : defaultValue;
}
if (owner.hasListeners(eventName)) {
owner.notify({ object: owner, eventName: eventName, propertyName: propertyName, value: value, oldValue: oldValue });
}
if (affectsLayout) {
owner.requestLayout();
}
if (owner.domNode) {
owner.domNode.attributeModified(propertyName, value);
}
}
};
symbolPropertyMap[key] = this;
}
Property.prototype.register = function (cls) {
if (this.registered) {
throw new Error("Property " + this.name + " already registered.");
}
this.registered = true;
Object.defineProperty(cls.prototype, this.name, this);
};
Property.prototype.isSet = function (instance) {
return this.key in instance;
};
return Property;
}());
exports.Property = Property;
Property.prototype.isStyleProperty = false;
var CoercibleProperty = (function (_super) {
__extends(CoercibleProperty, _super);
function CoercibleProperty(options) {
var _this = _super.call(this, options) || this;
var propertyName = options.name;
var key = _this.key;
var getDefault = _this.getDefault;
var setNative = _this.setNative;
var defaultValueKey = _this.defaultValueKey;
var defaultValue = _this.defaultValue;
var coerceKey = Symbol(propertyName + ":coerceKey");
var eventName = propertyName + "Change";
var affectsLayout = options.affectsLayout;
var equalityComparer = options.equalityComparer;
var valueChanged = options.valueChanged;
var valueConverter = options.valueConverter;
var coerceCallback = options.coerceValue;
var property = _this;
_this.coerce = function (target) {
var originalValue = coerceKey in target ? target[coerceKey] : defaultValue;
target[propertyName] = originalValue;
};
_this.set = function (boxedValue) {
var reset = boxedValue === exports.unsetValue;
var value;
var wrapped;
if (reset) {
value = defaultValue;
delete this[coerceKey];
}
else {
wrapped = boxedValue && boxedValue.wrapped;
value = wrapped ? observable_1.WrappedValue.unwrap(boxedValue) : boxedValue;
if (valueConverter && typeof value === "string") {
value = valueConverter(value);
}
this[coerceKey] = value;
value = coerceCallback(this, value);
}
var oldValue = key in this ? this[key] : defaultValue;
var changed = equalityComparer ? !equalityComparer(oldValue, value) : oldValue !== value;
if (wrapped || changed) {
if (reset) {
delete this[key];
if (valueChanged) {
valueChanged(this, oldValue, value);
}
if (this[setNative]) {
if (this._suspendNativeUpdatesCount) {
if (this._suspendedUpdates) {
this._suspendedUpdates[propertyName] = property;
}
}
else {
if (defaultValueKey in this) {
this[setNative](this[defaultValueKey]);
delete this[defaultValueKey];
}
else {
this[setNative](defaultValue);
}
}
}
}
else {
this[key] = value;
if (valueChanged) {
valueChanged(this, oldValue, value);
}
if (this[setNative]) {
if (this._suspendNativeUpdatesCount) {
if (this._suspendedUpdates) {
this._suspendedUpdates[propertyName] = property;
}
}
else {
if (!(defaultValueKey in this)) {
this[defaultValueKey] = this[getDefault] ? this[getDefault]() : defaultValue;
}
this[setNative](value);
}
}
}
if (this.hasListeners(eventName)) {
this.notify({ object: this, eventName: eventName, propertyName: propertyName, value: value, oldValue: oldValue });
}
if (affectsLayout) {
this.requestLayout();
}
if (this.domNode) {
if (reset) {
this.domNode.attributeRemoved(propertyName);
}
else {
this.domNode.attributeModified(propertyName, value);
}
}
}
};
return _this;
}
return CoercibleProperty;
}(Property));
exports.CoercibleProperty = CoercibleProperty;
var InheritedProperty = (function (_super) {
__extends(InheritedProperty, _super);
function InheritedProperty(options) {
var _this = _super.call(this, options) || this;
var name = options.name;
var key = _this.key;
var defaultValue = options.defaultValue;
var sourceKey = Symbol(name + ":valueSourceKey");
_this.sourceKey = sourceKey;
var setBase = _this.set;
var setFunc = function (valueSource) { return function (value) {
var that = this;
var unboxedValue;
var newValueSource;
if (value === exports.unsetValue) {
var parent_1 = that.parent;
if (parent_1 && parent_1[sourceKey] !== 0) {
unboxedValue = parent_1[name];
newValueSource = 1;
}
else {
unboxedValue = defaultValue;
newValueSource = 0;
}
}
else {
unboxedValue = value;
newValueSource = valueSource;
}
var currentValue = that[key];
setBase.call(that, unboxedValue);
var newValue = that[key];
that[sourceKey] = newValueSource;
if (currentValue !== newValue) {
var reset_1 = newValueSource === 0;
that.eachChild(function (child) {
var childValueSource = child[sourceKey] || 0;
if (reset_1) {
if (childValueSource === 1) {
setFunc.call(child, exports.unsetValue);
}
}
else {
if (childValueSource <= 1) {
setInheritedValue.call(child, newValue);
}
}
return true;
});
}
}; };
var setInheritedValue = setFunc(1);
_this.setInheritedValue = setInheritedValue;
_this.set = setFunc(3);
inheritableProperties.push(_this);
return _this;
}
return InheritedProperty;
}(Property));
exports.InheritedProperty = InheritedProperty;
var CssProperty = (function () {
function CssProperty(options) {
var propertyName = options.name;
this.name = propertyName;
cssPropertyNames.push(options.cssName);
this.cssName = "css:" + options.cssName;
this.cssLocalName = options.cssName;
var key = Symbol(propertyName + ":propertyKey");
this.key = key;
var sourceKey = Symbol(propertyName + ":valueSourceKey");
this.sourceKey = sourceKey;
var getDefault = Symbol(propertyName + ":getDefault");
this.getDefault = getDefault;
var setNative = Symbol(propertyName + ":setNative");
this.setNative = setNative;
var defaultValueKey = Symbol(propertyName + ":nativeDefaultValue");
this.defaultValueKey = defaultValueKey;
var defaultValue = options.defaultValue;
this.defaultValue = defaultValue;
var eventName = propertyName + "Change";
var affectsLayout = options.affectsLayout;
var equalityComparer = options.equalityComparer;
var valueChanged = options.valueChanged;
var valueConverter = options.valueConverter;
var property = this;
function setLocalValue(newValue) {
var reset = newValue === exports.unsetValue || newValue === "";
var value;
if (reset) {
value = defaultValue;
delete this[sourceKey];
}
else {
this[sourceKey] = 3;
value = (valueConverter && typeof newValue === "string") ?
valueConverter(newValue) :
newValue;
}
var oldValue = key in this ? this[key] : defaultValue;
var changed = equalityComparer ? !equalityComparer(oldValue, value) : oldValue !== value;
if (changed) {
var view = this.view;
if (reset) {
delete this[key];
if (valueChanged) {
valueChanged(this, oldValue, value);
}
if (view[setNative]) {
if (view._suspendNativeUpdatesCount) {
if (view._suspendedUpdates) {
view._suspendedUpdates[propertyName] = property;
}
}
else {
if (defaultValueKey in this) {
view[setNative](this[defaultValueKey]);
delete this[defaultValueKey];
}
else {
view[setNative](defaultValue);
}
}
}
}
else {
this[key] = value;
if (valueChanged) {
valueChanged(this, oldValue, value);
}
if (view[setNative]) {
if (view._suspendNativeUpdatesCount) {
if (view._suspendedUpdates) {
view._suspendedUpdates[propertyName] = property;
}
}
else {
if (!(defaultValueKey in this)) {
this[defaultValueKey] = view[getDefault] ? view[getDefault]() : defaultValue;
}
view[setNative](value);
}
}
}
if (this.hasListeners(eventName)) {
this.notify({ object: this, eventName: eventName, propertyName: propertyName, value: value, oldValue: oldValue });
}
if (affectsLayout) {
view.requestLayout();
}
}
}
function setCssValue(newValue) {
var currentValueSource = this[sourceKey] || 0;
if (currentValueSource === 3) {
return;
}
var reset = newValue === exports.unsetValue || newValue === "";
var value;
if (reset) {
value = defaultValue;
delete this[sourceKey];
}
else {
value = valueConverter && typeof newValue === "string" ?
valueConverter(newValue) :
newValue;
this[sourceKey] = 2;
}
var oldValue = key in this ? this[key] : defaultValue;
var changed = equalityComparer ? !equalityComparer(oldValue, value) : oldValue !== value;
if (changed) {
var view = this.view;
if (reset) {
delete this[key];
if (valueChanged) {
valueChanged(this, oldValue, value);
}
if (view[setNative]) {
if (view._suspendNativeUpdatesCount) {
if (view._suspendedUpdates) {
view._suspendedUpdates[propertyName] = property;
}
}
else {
if (defaultValueKey in this) {
view[setNative](this[defaultValueKey]);
delete this[defaultValueKey];
}
else {
view[setNative](defaultValue);
}
}
}
}
else {
this[key] = value;
if (valueChanged) {
valueChanged(this, oldValue, value);
}
if (view[setNative]) {
if (view._suspendNativeUpdatesCount) {
if (view._suspendedUpdates) {
view._suspendedUpdates[propertyName] = property;
}
}
else {
if (!(defaultValueKey in this)) {
this[defaultValueKey] = view[getDefault] ? view[getDefault]() : defaultValue;
}
view[setNative](value);
}
}
}
if (this.hasListeners(eventName)) {
this.notify({ object: this, eventName: eventName, propertyName: propertyName, value: value, oldValue: oldValue });
}
if (affectsLayout) {
view.requestLayout();
}
}
}
function get() {
return key in this ? this[key] : defaultValue;
}
this.cssValueDescriptor = {
enumerable: true,
configurable: true,
get: get,
set: setCssValue
};
this.localValueDescriptor = {
enumerable: true,
configurable: true,
get: get,
set: setLocalValue
};
cssSymbolPropertyMap[key] = this;
}
CssProperty.prototype.register = function (cls) {
if (this.registered) {
throw new Error("Property " + this.name + " already registered.");
}
this.registered = true;
Object.defineProperty(cls.prototype, this.name, this.localValueDescriptor);
Object.defineProperty(cls.prototype, this.cssName, this.cssValueDescriptor);
if (this.cssLocalName !== this.cssName) {
Object.defineProperty(cls.prototype, this.cssLocalName, this.localValueDescriptor);
}
};
CssProperty.prototype.isSet = function (instance) {
return this.key in instance;
};
return CssProperty;
}());
exports.CssProperty = CssProperty;
CssProperty.prototype.isStyleProperty = true;
var CssAnimationProperty = (function () {
function CssAnimationProperty(options) {
var valueConverter = options.valueConverter, equalityComparer = options.equalityComparer, valueChanged = options.valueChanged, defaultValue = options.defaultValue;
var propertyName = options.name;
this.name = propertyName;
cssPropertyNames.push(options.cssName);
CssAnimationProperty.properties[propertyName] = this;
if (options.cssName && options.cssName !== propertyName) {
CssAnimationProperty.properties[options.cssName] = this;
}
this._valueConverter = options.valueConverter;
var cssLocalName = (options.cssName || propertyName);
this.cssLocalName = cssLocalName;
var cssName = "css:" + cssLocalName;
this.cssName = cssName;
var keyframeName = "keyframe:" + propertyName;
this.keyframe = keyframeName;
var defaultName = "default:" + propertyName;
var defaultValueKey = Symbol(defaultName);
this.defaultValueKey = defaultValueKey;
this.defaultValue = defaultValue;
var cssValue = Symbol(cssName);
var styleValue = Symbol("local:" + propertyName);
var keyframeValue = Symbol(keyframeName);
var computedValue = Symbol("computed-value:" + propertyName);
this.key = computedValue;
var computedSource = Symbol("computed-source:" + propertyName);
this.source = computedSource;
this.getDefault = Symbol(propertyName + ":getDefault");
var getDefault = this.getDefault;
var setNative = this.setNative = Symbol(propertyName + ":setNative");
var eventName = propertyName + "Change";
var property = this;
function descriptor(symbol, propertySource, enumerable, configurable, getsComputed) {
return {
enumerable: enumerable, configurable: configurable,
get: getsComputed ? function () { return this[computedValue]; } : function () { return this[symbol]; },
set: function (boxedValue) {
var oldValue = this[computedValue];
var oldSource = this[computedSource];
var wasSet = oldSource !== 0;
var reset = boxedValue === exports.unsetValue || boxedValue === "";
if (reset) {
this[symbol] = exports.unsetValue;
if (this[computedSource] === propertySource) {
if (this[styleValue] !== exports.unsetValue) {
this[computedSource] = 3;
this[computedValue] = this[styleValue];
}
else if (this[cssValue] !== exports.unsetValue) {
this[computedSource] = 2;
this[computedValue] = this[cssValue];
}
else {
delete this[computedSource];
delete this[computedValue];
}
}
}
else {
if (valueConverter && typeof boxedValue === "string") {
boxedValue = valueConverter(boxedValue);
}
this[symbol] = boxedValue;
if (this[computedSource] <= propertySource) {
this[computedSource] = propertySource;
this[computedValue] = boxedValue;
}
}
var value = this[computedValue];
var source = this[computedSource];
var isSet = source !== 0;
var computedValueChanged = oldValue !== value && (!equalityComparer || !equalityComparer(oldValue, value));
if (computedValueChanged && valueChanged) {
valueChanged(this, oldValue, value);
}
var view = this.view;
if (view[setNative] && (computedValueChanged || isSet !== wasSet)) {
if (view._suspendNativeUpdatesCount) {
if (view._suspendedUpdates) {
view._suspendedUpdates[propertyName] = property;
}
}
else {
if (isSet) {
if (!wasSet && !(defaultValueKey in this)) {
this[defaultValueKey] = view[getDefault] ? view[getDefault]() : defaultValue;
}
view[setNative](value);
}
else if (wasSet) {
if (defaultValueKey in this) {
view[setNative](this[defaultValueKey]);
}
else {
view[setNative](defaultValue);
}
}
}
}
if (computedValueChanged && this.hasListeners(eventName)) {
this.notify({ object: this, eventName: eventName, propertyName: propertyName, value: value, oldValue: oldValue });
}
}
};
}
var defaultPropertyDescriptor = descriptor(defaultValueKey, 0, false, false, false);
var cssPropertyDescriptor = descriptor(cssValue, 2, false, false, false);
var stylePropertyDescriptor = descriptor(styleValue, 3, true, true, true);
var keyframePropertyDescriptor = descriptor(keyframeValue, 4, false, false, false);
symbolPropertyMap[computedValue] = this;
cssSymbolPropertyMap[computedValue] = this;
this.register = function (cls) {
cls.prototype[computedValue] = options.defaultValue;
cls.prototype[computedSource] = 0;
cls.prototype[cssValue] = exports.unsetValue;
cls.prototype[styleValue] = exports.unsetValue;
cls.prototype[keyframeValue] = exports.unsetValue;
Object.defineProperty(cls.prototype, defaultName, defaultPropertyDescriptor);
Object.defineProperty(cls.prototype, cssName, cssPropertyDescriptor);
Object.defineProperty(cls.prototype, propertyName, stylePropertyDescriptor);
if (options.cssName && options.cssName !== options.name) {
Object.defineProperty(cls.prototype, options.cssName, stylePropertyDescriptor);
}
Object.defineProperty(cls.prototype, keyframeName, keyframePropertyDescriptor);
};
}
CssAnimationProperty.prototype._initDefaultNativeValue = function (target) {
var defaultValueKey = this.defaultValueKey;
if (!(defaultValueKey in target)) {
var view = target.view;
var getDefault = this.getDefault;
target[defaultValueKey] = view[getDefault] ? view[getDefault]() : this.defaultValue;
}
};
CssAnimationProperty._getByCssName = function (name) {
return this.properties[name];
};
CssAnimationProperty._getPropertyNames = function () {
return Object.keys(CssAnimationProperty.properties);
};
CssAnimationProperty.prototype.isSet = function (instance) {
return instance[this.source] !== 0;
};
CssAnimationProperty.properties = {};
return CssAnimationProperty;
}());
exports.CssAnimationProperty = CssAnimationProperty;
CssAnimationProperty.prototype.isStyleProperty = true;
var InheritedCssProperty = (function (_super) {
__extends(InheritedCssProperty, _super);
function InheritedCssProperty(options) {
var _this = _super.call(this, options) || this;
var propertyName = options.name;
var key = _this.key;
var sourceKey = _this.sourceKey;
var getDefault = _this.getDefault;
var setNative = _this.setNative;
var defaultValueKey = _this.defaultValueKey;
var eventName = propertyName + "Change";
var defaultValue = options.defaultValue;
var affectsLayout = options.affectsLayout;
var equalityComparer = options.equalityComparer;
var valueChanged = options.valueChanged;
var valueConverter = options.valueConverter;
var property = _this;
var setFunc = function (valueSource) { return function (boxedValue) {
var reset = boxedValue === exports.unsetValue || boxedValue === "";
var currentValueSource = this[sourceKey] || 0;
if (reset) {
if (valueSource === 2 && currentValueSource === 3) {
return;
}
}
else {
if (currentValueSource > valueSource) {
return;
}
}
var oldValue = key in this ? this[key] : defaultValue;
var view = this.view;
var value;
var unsetNativeValue = false;
if (reset) {
var parent_2 = view.parent;
var style = parent_2 ? parent_2.style : null;
if (style && style[sourceKey] > 0) {
value = style[propertyName];
this[sourceKey] = 1;
this[key] = value;
}
else {
value = defaultValue;
delete this[sourceKey];
delete this[key];
unsetNativeValue = true;
}
}
else {
this[sourceKey] = valueSource;
if (valueConverter && typeof boxedValue === "string") {
value = valueConverter(boxedValue);
}
else {
value = boxedValue;
}
this[key] = value;
}
var changed = equalityComparer ? !equalityComparer(oldValue, value) : oldValue !== value;
if (changed) {
var view_1 = this.view;
if (valueChanged) {
valueChanged(this, oldValue, value);
}
if (view_1[setNative]) {
if (view_1._suspendNativeUpdatesCount) {
if (view_1._suspendedUpdates) {
view_1._suspendedUpdates[propertyName] = property;
}
}
else {
if (unsetNativeValue) {
if (defaultValueKey in this) {
view_1[setNative](this[defaultValueKey]);
delete this[defaultValueKey];
}
else {
view_1[setNative](defaultValue);
}
}
else {
if (!(defaultValueKey in this)) {
this[defaultValueKey] = view_1[getDefault] ? view_1[getDefault]() : defaultValue;
}
view_1[setNative](value);
}
}
}
if (this.hasListeners(eventName)) {
this.notify({ object: this, eventName: eventName, propertyName: propertyName, value: value, oldValue: oldValue });
}
if (affectsLayout) {
view_1.requestLayout();
}
view_1.eachChild(function (child) {
var childStyle = child.style;
var childValueSource = childStyle[sourceKey] || 0;
if (reset) {
if (childValueSource === 1) {
setDefaultFunc.call(childStyle, exports.unsetValue);
}
}
else {
if (childValueSource <= 1) {
setInheritedFunc.call(childStyle, value);
}
}
return true;
});
}
}; };
var setDefaultFunc = setFunc(0);
var setInheritedFunc = setFunc(1);
_this.setInheritedValue = setInheritedFunc;
_this.cssValueDescriptor.set = setFunc(2);
_this.localValueDescriptor.set = setFunc(3);
inheritableCssProperties.push(_this);
return _this;
}
return InheritedCssProperty;
}(CssProperty));
exports.InheritedCssProperty = InheritedCssProperty;
var ShorthandProperty = (function () {
function ShorthandProperty(options) {
this.name = options.name;
var key = Symbol(this.name + ":propertyKey");
this.key = key;
this.cssName = "css:" + options.cssName;
this.cssLocalName = "" + options.cssName;
var converter = options.converter;
function setLocalValue(value) {
var _this = this;
this.view._batchUpdate(function () {
for (var _i = 0, _a = converter(value); _i < _a.length; _i++) {
var _b = _a[_i], p = _b[0], v = _b[1];
_this[p.name] = v;
}
});
}
function setCssValue(value) {
var _this = this;
this.view._batchUpdate(function () {
for (var _i = 0, _a = converter(value); _i < _a.length; _i++) {
var _b = _a[_i], p = _b[0], v = _b[1];
_this[p.cssName] = v;
}
});
}
this.cssValueDescriptor = {
enumerable: true,
configurable: true,
get: options.getter,
set: setCssValue
};
this.localValueDescriptor = {
enumerable: true,
configurable: true,
get: options.getter,
set: setLocalValue
};
this.propertyBagDescriptor = {
enumerable: false,
configurable: true,
set: function (value) {
var _this = this;
converter(value).forEach(function (_a) {
var property = _a[0], value = _a[1];
_this[property.cssLocalName] = value;
});
}
};
cssSymbolPropertyMap[key] = this;
}
ShorthandProperty.prototype.register = function (cls) {
if (this.registered) {
throw new Error("Property " + this.name + " already registered.");
}
this.registered = true;
Object.defineProperty(cls.prototype, this.name, this.localValueDescriptor);
Object.defineProperty(cls.prototype, this.cssName, this.cssValueDescriptor);
if (this.cssLocalName !== this.cssName) {
Object.defineProperty(cls.prototype, this.cssLocalName, this.localValueDescriptor);
}
Object.defineProperty(cls.prototype.PropertyBag, this.cssLocalName, this.propertyBagDescriptor);
};
return ShorthandProperty;
}());
exports.ShorthandProperty = ShorthandProperty;
function inheritablePropertyValuesOn(view) {
var array = new Array();
for (var _i = 0, inheritableProperties_1 = inheritableProperties; _i < inheritableProperties_1.length; _i++) {
var prop = inheritableProperties_1[_i];
var sourceKey = prop.sourceKey;
var valueSource = view[sourceKey] || 0;
if (valueSource !== 0) {
array.push({ property: prop, value: view[prop.name] });
}
}
return array;
}
function inheritableCssPropertyValuesOn(style) {
var array = new Array();
for (var _i = 0, inheritableCssProperties_1 = inheritableCssProperties; _i < inheritableCssProperties_1.length; _i++) {
var prop = inheritableCssProperties_1[_i];
var sourceKey = prop.sourceKey;
var valueSource = style[sourceKey] || 0;
if (valueSource !== 0) {
array.push({ property: prop, value: style[prop.name] });
}
}
return array;
}
exports.initNativeView = profiling_1.profile("\"properties\".initNativeView", function initNativeView(view) {
if (view._suspendedUpdates) {
applyPendingNativeSetters(view);
}
else {
applyAllNativeSetters(view);
}
view._suspendedUpdates = {};
});
function applyPendingNativeSetters(view) {
var suspendedUpdates = view._suspendedUpdates;
for (var propertyName in suspendedUpdates) {
var property = suspendedUpdates[propertyName];
var setNative = property.setNative;
if (view[setNative]) {
var getDefault = property.getDefault, isStyleProperty = property.isStyleProperty, defaultValueKey = property.defaultValueKey, defaultValue = property.defaultValue;
var value = void 0;
if (isStyleProperty) {
var style = view.style;
if (property.isSet(view.style)) {
if (!(defaultValueKey in style)) {
style[defaultValueKey] = view[getDefault] ? view[getDefault]() : defaultValue;
}
value = view.style[propertyName];
}
else {
value = style[defaultValueKey];
}
}
else {
if (property.isSet(view)) {
if (!(defaultValueKey in view)) {
view[defaultValueKey] = view[getDefault] ? view[getDefault]() : defaultValue;
}
value = view[propertyName];
}
else {
value = view[defaultValueKey];
}
}
view[setNative](value);
}
}
}
exports.applyPendingNativeSetters = applyPendingNativeSetters;
function applyAllNativeSetters(view) {
var symbols = Object.getOwnPropertySymbols(view);
for (var _i = 0, symbols_2 = symbols; _i < symbols_2.length; _i++) {
var symbol = symbols_2[_i];
var property = symbolPropertyMap[symbol];
if (!property) {
continue;
}
var setNative = property.setNative;
var getDefault = property.getDefault;
if (setNative in view) {
var defaultValueKey = property.defaultValueKey;
if (!(defaultValueKey in view)) {
view[defaultValueKey] = view[getDefault] ? view[getDefault]() : property.defaultValue;
}
var value = view[symbol];
view[setNative](value);
}
}
var style = view.style;
symbols = Object.getOwnPropertySymbols(style);
for (var _a = 0, symbols_3 = symbols; _a < symbols_3.length; _a++) {
var symbol = symbols_3[_a];
var property = cssSymbolPropertyMap[symbol];
if (!property) {
continue;
}
if (view[property.setNative]) {
var defaultValueKey = property.defaultValueKey;
if (!(defaultValueKey in style)) {
style[defaultValueKey] = view[property.getDefault] ? view[property.getDefault]() : property.defaultValue;
}
var value = style[symbol];
view[property.setNative](value);
}
}
}
exports.applyAllNativeSetters = applyAllNativeSetters;
function resetNativeView(view) {
var symbols = Object.getOwnPropertySymbols(view);
for (var _i = 0, symbols_4 = symbols; _i < symbols_4.length; _i++) {
var symbol = symbols_4[_i];
var property = symbolPropertyMap[symbol];
if (!property) {
continue;
}
if (view[property.setNative]) {
if (property.defaultValueKey in view) {
view[property.setNative](view[property.defaultValueKey]);
delete view[property.defaultValueKey];
}
else {
view[property.setNative](property.defaultValue);
}
}
}
var style = view.style;
symbols = Object.getOwnPropertySymbols(style);
for (var _a = 0, symbols_5 = symbols; _a < symbols_5.length; _a++) {
var symbol = symbols_5[_a];
var property = cssSymbolPropertyMap[symbol];
if (!property) {
continue;
}
if (view[property.setNative]) {
if (property.defaultValueKey in style) {
view[property.setNative](style[property.defaultValueKey]);
delete style[property.defaultValueKey];
}
else {
view[property.setNative](property.defaultValue);
}
}
}
}
exports.resetNativeView = resetNativeView;
function clearInheritedProperties(view) {
for (var _i = 0, inheritableProperties_2 = inheritableProperties; _i < inheritableProperties_2.length; _i++) {
var prop = inheritableProperties_2[_i];
var sourceKey = prop.sourceKey;
if (view[sourceKey] === 1) {
prop.set.call(view, exports.unsetValue);
}
}
var style = view.style;
for (var _a = 0, inheritableCssProperties_2 = inheritableCssProperties; _a < inheritableCssProperties_2.length; _a++) {
var prop = inheritableCssProperties_2[_a];
var sourceKey = prop.sourceKey;
if (style[sourceKey] === 1) {
prop.setInheritedValue.call(style, exports.unsetValue);
}
}
}
exports.clearInheritedProperties = clearInheritedProperties;
function resetCSSProperties(style) {
var symbols = Object.getOwnPropertySymbols(style);
for (var _i = 0, symbols_6 = symbols; _i < symbols_6.length; _i++) {
var symbol = symbols_6[_i];
var cssProperty = void 0;
if (cssProperty = cssSymbolPropertyMap[symbol]) {
style[cssProperty.cssName] = exports.unsetValue;
if (cssProperty instanceof CssAnimationProperty) {
style[cssProperty.keyframe] = exports.unsetValue;
}
}
}
}
exports.resetCSSProperties = resetCSSProperties;
function propagateInheritableProperties(view, child) {
var inheritablePropertyValues = inheritablePropertyValuesOn(view);
for (var _i = 0, inheritablePropertyValues_1 = inheritablePropertyValues; _i < inheritablePropertyValues_1.length; _i++) {
var pair = inheritablePropertyValues_1[_i];
var prop = pair.property;
var sourceKey = prop.sourceKey;
var currentValueSource = child[sourceKey] || 0;
if (currentValueSource <= 1) {
prop.setInheritedValue.call(child, pair.value);
}
}
}
exports.propagateInheritableProperties = propagateInheritableProperties;
function propagateInheritableCssProperties(parentStyle, childStyle) {
var inheritableCssPropertyValues = inheritableCssPropertyValuesOn(parentStyle);
for (var _i = 0, inheritableCssPropertyValues_1 = inheritableCssPropertyValues; _i < inheritableCssPropertyValues_1.length; _i++) {
var pair = inheritableCssPropertyValues_1[_i];
var prop = pair.property;
var sourceKey = prop.sourceKey;
var currentValueSource = childStyle[sourceKey] || 0;
if (currentValueSource <= 1) {
prop.setInheritedValue.call(childStyle, pair.value, 1);
}
}
}
exports.propagateInheritableCssProperties = propagateInheritableCssProperties;
function makeValidator() {
var values = [];
for (var _i = 0; _i < arguments.length; _i++) {
values[_i] = arguments[_i];
}
var set = new Set(values);
return function (value) { return set.has(value); };
}
exports.makeValidator = makeValidator;
function makeParser(isValid) {
return function (value) {
var lower = value && value.toLowerCase();
if (isValid(lower)) {
return lower;
}
else {
throw new Error("Invalid value: " + value);
}
};
}
exports.makeParser = makeParser;
function getSetProperties(view) {
var result = [];
Object.getOwnPropertyNames(view).forEach(function (prop) {
result.push([prop, view[prop]]);
});
var symbols = Object.getOwnPropertySymbols(view);
for (var _i = 0, symbols_7 = symbols; _i < symbols_7.length; _i++) {
var symbol = symbols_7[_i];
var property = symbolPropertyMap[symbol];
if (!property) {
continue;
}
var value = view[property.key];
result.push([property.name, value]);
}
return result;
}
exports.getSetProperties = getSetProperties;
function getComputedCssValues(view) {
var result = [];
var style = view.style;
for (var _i = 0, cssPropertyNames_1 = cssPropertyNames; _i < cssPropertyNames_1.length; _i++) {
var prop = cssPropertyNames_1[_i];
result.push([prop, style[prop]]);
}
result.push(["top", "auto"]);
result.push(["left", "auto"]);
result.push(["bottom", "auto"]);
result.push(["right", "auto"]);
return result;
}
exports.getComputedCssValues = getComputedCssValues;
//# sourceMappingURL=properties.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/ui/core/view-base/view-base.js":
/***/ (function(module, exports, __webpack_require__) {
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
Object.defineProperty(exports, "__esModule", { value: true });
var properties_1 = __webpack_require__("../node_modules/tns-core-modules/ui/core/properties/properties.js");
var debug_1 = __webpack_require__("../node_modules/tns-core-modules/utils/debug.js");
var bindable_1 = __webpack_require__("../node_modules/tns-core-modules/ui/core/bindable/bindable.js");
var platform_1 = __webpack_require__("../node_modules/tns-core-modules/platform/platform.js");
exports.isIOS = platform_1.isIOS;
exports.isAndroid = platform_1.isAndroid;
var utils_1 = __webpack_require__("../node_modules/tns-core-modules/utils/utils.js");
exports.layout = utils_1.layout;
var style_properties_1 = __webpack_require__("../node_modules/tns-core-modules/ui/styling/style-properties.js");
var types = __webpack_require__("../node_modules/tns-core-modules/utils/types.js");
var color_1 = __webpack_require__("../node_modules/tns-core-modules/color/color.js");
exports.Color = color_1.Color;
var profiling_1 = __webpack_require__("../node_modules/tns-core-modules/profiling/profiling.js");
__export(__webpack_require__("../node_modules/tns-core-modules/ui/core/bindable/bindable.js"));
__export(__webpack_require__("../node_modules/tns-core-modules/ui/core/properties/properties.js"));
var ssm = __webpack_require__("../node_modules/tns-core-modules/ui/styling/style-scope.js");
var domNodeModule;
function ensuredomNodeModule() {
if (!domNodeModule) {
domNodeModule = __webpack_require__("../node_modules/tns-core-modules/debugger/dom-node.js");
}
}
var styleScopeModule;
function ensureStyleScopeModule() {
if (!styleScopeModule) {
styleScopeModule = __webpack_require__("../node_modules/tns-core-modules/ui/styling/style-scope.js");
}
}
var defaultBindingSource = {};
function getAncestor(view, criterion) {
var matcher = null;
if (typeof criterion === "string") {
matcher = function (view) { return view.typeName === criterion; };
}
else {
matcher = function (view) { return view instanceof criterion; };
}
for (var parent_1 = view.parent; parent_1 != null; parent_1 = parent_1.parent) {
if (matcher(parent_1)) {
return parent_1;
}
}
return null;
}
exports.getAncestor = getAncestor;
function getViewById(view, id) {
if (!view) {
return undefined;
}
if (view.id === id) {
return view;
}
var retVal;
var descendantsCallback = function (child) {
if (child.id === id) {
retVal = child;
return false;
}
return true;
};
eachDescendant(view, descendantsCallback);
return retVal;
}
exports.getViewById = getViewById;
function eachDescendant(view, callback) {
if (!callback || !view) {
return;
}
var continueIteration;
var localCallback = function (child) {
continueIteration = callback(child);
if (continueIteration) {
child.eachChild(localCallback);
}
return continueIteration;
};
view.eachChild(localCallback);
}
exports.eachDescendant = eachDescendant;
var viewIdCounter = 1;
var Flags;
(function (Flags) {
Flags["superOnLoadedCalled"] = "Loaded";
Flags["superOnUnloadedCalled"] = "Unloaded";
})(Flags || (Flags = {}));
var SuspendType;
(function (SuspendType) {
SuspendType[SuspendType["Incremental"] = 0] = "Incremental";
SuspendType[SuspendType["Loaded"] = 1048576] = "Loaded";
SuspendType[SuspendType["NativeView"] = 2097152] = "NativeView";
SuspendType[SuspendType["UISetup"] = 4194304] = "UISetup";
SuspendType[SuspendType["IncrementalCountMask"] = -7340033] = "IncrementalCountMask";
})(SuspendType || (SuspendType = {}));
(function (SuspendType) {
function toString(type) {
return (type ? "suspended" : "resumed") + "(" +
"Incremental: " + (type & SuspendType.IncrementalCountMask) + ", " +
"Loaded: " + !(type & SuspendType.Loaded) + ", " +
"NativeView: " + !(type & SuspendType.NativeView) + ", " +
"UISetup: " + !(type & SuspendType.UISetup) +
")";
}
SuspendType.toString = toString;
})(SuspendType || (SuspendType = {}));
var ViewBase = (function (_super) {
__extends(ViewBase, _super);
function ViewBase() {
var _this = _super.call(this) || this;
_this._onLoadedCalled = false;
_this._onUnloadedCalled = false;
_this._cssState = new ssm.CssState(_this);
_this.pseudoClassAliases = {
"highlighted": [
"active",
"pressed"
]
};
_this.cssClasses = new Set();
_this.cssPseudoClasses = new Set();
_this._domId = viewIdCounter++;
_this._style = new properties_1.Style(_this);
return _this;
}
Object.defineProperty(ViewBase.prototype, "parentNode", {
get: function () {
return this._templateParent || this.parent;
},
set: function (node) {
this._templateParent = node;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ViewBase.prototype, "nativeView", {
get: function () {
return this.nativeViewProtected;
},
set: function (value) {
this.setNativeView(value);
},
enumerable: true,
configurable: true
});
Object.defineProperty(ViewBase.prototype, "typeName", {
get: function () {
return types.getClass(this);
},
enumerable: true,
configurable: true
});
Object.defineProperty(ViewBase.prototype, "style", {
get: function () {
return this._style;
},
set: function (inlineStyle) {
if (typeof inlineStyle === "string") {
this.setInlineStyle(inlineStyle);
}
else {
throw new Error("View.style property is read-only.");
}
},
enumerable: true,
configurable: true
});
Object.defineProperty(ViewBase.prototype, "android", {
get: function () {
return this._androidView;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ViewBase.prototype, "ios", {
get: function () {
return this._iosView;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ViewBase.prototype, "isLoaded", {
get: function () {
return this._isLoaded;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ViewBase.prototype, "class", {
get: function () {
return this.className;
},
set: function (v) {
this.className = v;
},
enumerable: true,
configurable: true
});
ViewBase.prototype.getViewById = function (id) {
return getViewById(this, id);
};
Object.defineProperty(ViewBase.prototype, "page", {
get: function () {
if (this.parent) {
return this.parent.page;
}
return null;
},
enumerable: true,
configurable: true
});
ViewBase.prototype.ensureDomNode = function () {
if (!this.domNode) {
ensuredomNodeModule();
this.domNode = new domNodeModule.DOMNode(this);
}
};
ViewBase.prototype.set = function (name, value) {
this[name] = bindable_1.WrappedValue.unwrap(value);
};
ViewBase.prototype.onLoaded = function () {
var _this = this;
this.setFlag(Flags.superOnLoadedCalled, true);
if (this._isLoaded) {
return;
}
this._isLoaded = true;
this._cssState.onLoaded();
this._resumeNativeUpdates(SuspendType.Loaded);
this.eachChild(function (child) {
_this.loadView(child);
return true;
});
this._emit("loaded");
};
ViewBase.prototype.onUnloaded = function () {
var _this = this;
this.setFlag(Flags.superOnUnloadedCalled, true);
if (!this._isLoaded) {
return;
}
this._suspendNativeUpdates(SuspendType.Loaded);
this.eachChild(function (child) {
_this.unloadView(child);
return true;
});
this._isLoaded = false;
this._cssState.onUnloaded();
this._emit("unloaded");
};
ViewBase.prototype._suspendNativeUpdates = function (type) {
if (type) {
this._suspendNativeUpdatesCount = this._suspendNativeUpdatesCount | type;
}
else {
this._suspendNativeUpdatesCount++;
}
};
ViewBase.prototype._resumeNativeUpdates = function (type) {
if (type) {
this._suspendNativeUpdatesCount = this._suspendNativeUpdatesCount & ~type;
}
else {
if ((this._suspendNativeUpdatesCount & SuspendType.IncrementalCountMask) === 0) {
throw new Error("Invalid call to " + this + "._resumeNativeUpdates");
}
this._suspendNativeUpdatesCount--;
}
if (!this._suspendNativeUpdatesCount) {
this.onResumeNativeUpdates();
}
};
ViewBase.prototype._batchUpdate = function (callback) {
try {
this._suspendNativeUpdates(SuspendType.Incremental);
return callback();
}
finally {
this._resumeNativeUpdates(SuspendType.Incremental);
}
};
ViewBase.prototype.setFlag = function (flag, value) {
switch (flag) {
case Flags.superOnLoadedCalled:
this._onLoadedCalled = value;
break;
case Flags.superOnUnloadedCalled:
this._onUnloadedCalled = value;
break;
}
};
ViewBase.prototype.isFlagSet = function (flag) {
switch (flag) {
case Flags.superOnLoadedCalled:
return this._onLoadedCalled;
case Flags.superOnUnloadedCalled:
return this._onUnloadedCalled;
}
};
ViewBase.prototype.callFunctionWithSuper = function (flag, func) {
this.setFlag(flag, false);
func();
if (!this.isFlagSet(flag)) {
throw new Error("super." + flag + " not called in " + this);
}
};
ViewBase.prototype.callLoaded = function () {
var _this = this;
this.callFunctionWithSuper(Flags.superOnLoadedCalled, function () { return _this.onLoaded(); });
};
ViewBase.prototype.callUnloaded = function () {
var _this = this;
this.callFunctionWithSuper(Flags.superOnUnloadedCalled, function () { return _this.onUnloaded(); });
};
ViewBase.prototype.notifyPseudoClassChanged = function (pseudoClass) {
this.notify({ eventName: ":" + pseudoClass, object: this });
};
ViewBase.prototype.getAllAliasedStates = function (name) {
var allStates = [];
allStates.push(name);
if (name in this.pseudoClassAliases) {
for (var i = 0; i < this.pseudoClassAliases[name].length; i++) {
allStates.push(this.pseudoClassAliases[name][i]);
}
}
return allStates;
};
ViewBase.prototype.addPseudoClass = function (name) {
var allStates = this.getAllAliasedStates(name);
for (var i = 0; i < allStates.length; i++) {
if (!this.cssPseudoClasses.has(allStates[i])) {
this.cssPseudoClasses.add(allStates[i]);
this.notifyPseudoClassChanged(allStates[i]);
}
}
};
ViewBase.prototype.deletePseudoClass = function (name) {
var allStates = this.getAllAliasedStates(name);
for (var i = 0; i < allStates.length; i++) {
if (this.cssPseudoClasses.has(allStates[i])) {
this.cssPseudoClasses.delete(allStates[i]);
this.notifyPseudoClassChanged(allStates[i]);
}
}
};
ViewBase.prototype.bindingContextChanged = function (data) {
this.bindings.get("bindingContext").bind(data.value);
};
ViewBase.prototype.bind = function (options, source) {
if (source === void 0) { source = defaultBindingSource; }
var targetProperty = options.targetProperty;
this.unbind(targetProperty);
if (!this.bindings) {
this.bindings = new Map();
}
var binding = new bindable_1.Binding(this, options);
this.bindings.set(targetProperty, binding);
var bindingSource = source;
if (bindingSource === defaultBindingSource) {
bindingSource = this.bindingContext;
binding.sourceIsBindingContext = true;
if (targetProperty === "bindingContext") {
this.bindingContextBoundToParentBindingContextChanged = true;
var parent_2 = this.parent;
if (parent_2) {
parent_2.on("bindingContextChange", this.bindingContextChanged, this);
}
else {
this.shouldAddHandlerToParentBindingContextChanged = true;
}
}
}
binding.bind(bindingSource);
};
ViewBase.prototype.unbind = function (property) {
var bindings = this.bindings;
if (!bindings) {
return;
}
var binding = bindings.get(property);
if (binding) {
binding.unbind();
bindings.delete(property);
if (binding.sourceIsBindingContext) {
if (property === "bindingContext") {
this.shouldAddHandlerToParentBindingContextChanged = false;
this.bindingContextBoundToParentBindingContextChanged = false;
var parent_3 = this.parent;
if (parent_3) {
parent_3.off("bindingContextChange", this.bindingContextChanged, this);
}
}
}
}
};
ViewBase.prototype.requestLayout = function () {
var parent = this.parent;
if (parent) {
parent.requestLayout();
}
};
ViewBase.prototype.eachChild = function (callback) {
};
ViewBase.prototype._addView = function (view, atIndex) {
if (bindable_1.traceEnabled()) {
bindable_1.traceWrite(this + "._addView(" + view + ", " + atIndex + ")", bindable_1.traceCategories.ViewHierarchy);
}
if (!view) {
throw new Error("Expecting a valid View instance.");
}
if (!(view instanceof ViewBase)) {
throw new Error(view + " is not a valid View instance.");
}
if (view.parent) {
throw new Error("View already has a parent. View: " + view + " Parent: " + view.parent);
}
view.parent = this;
this._addViewCore(view, atIndex);
view._parentChanged(null);
if (this.domNode) {
this.domNode.onChildAdded(view);
}
};
ViewBase.prototype._addViewCore = function (view, atIndex) {
properties_1.propagateInheritableProperties(this, view);
view._inheritStyleScope(this._styleScope);
properties_1.propagateInheritableCssProperties(this.style, view.style);
if (this._context) {
view._setupUI(this._context, atIndex);
}
if (this._isLoaded) {
this.loadView(view);
}
};
ViewBase.prototype.loadView = function (view) {
if (view && !view.isLoaded) {
view.callLoaded();
}
};
ViewBase.prototype.unloadView = function (view) {
if (view && view.isLoaded) {
view.callUnloaded();
}
};
ViewBase.prototype._removeView = function (view) {
if (bindable_1.traceEnabled()) {
bindable_1.traceWrite(this + "._removeView(" + view + ")", bindable_1.traceCategories.ViewHierarchy);
}
if (view.parent !== this) {
throw new Error("View not added to this instance. View: " + view + " CurrentParent: " + view.parent + " ExpectedParent: " + this);
}
if (this.domNode) {
this.domNode.onChildRemoved(view);
}
this._removeViewCore(view);
view.parent = undefined;
view._parentChanged(this);
};
ViewBase.prototype._removeViewCore = function (view) {
this.unloadView(view);
if (view._context) {
view._tearDownUI();
}
};
ViewBase.prototype.createNativeView = function () {
return undefined;
};
ViewBase.prototype.disposeNativeView = function () {
};
ViewBase.prototype.initNativeView = function () {
};
ViewBase.prototype.resetNativeView = function () {
};
ViewBase.prototype.resetNativeViewInternal = function () {
};
ViewBase.prototype._setupAsRootView = function (context) {
this._setupUI(context);
};
ViewBase.prototype._setupUI = function (context, atIndex, parentIsLoaded) {
if (this._context === context) {
return;
}
else if (this._context) {
this._tearDownUI(true);
}
this._context = context;
var nativeView = this.nativeViewProtected;
if (!nativeView) {
nativeView = this.createNativeView();
}
if (platform_1.isAndroid) {
this._androidView = nativeView;
if (nativeView) {
if (this._isPaddingRelative === undefined) {
this._isPaddingRelative = nativeView.isPaddingRelative();
}
var result = nativeView.defaultPaddings;
if (result === undefined) {
result = org.nativescript.widgets.ViewHelper.getPadding(nativeView);
nativeView.defaultPaddings = result;
}
this._defaultPaddingTop = result.top;
this._defaultPaddingRight = result.right;
this._defaultPaddingBottom = result.bottom;
this._defaultPaddingLeft = result.left;
var style = this.style;
if (!style_properties_1.paddingTopProperty.isSet(style)) {
this.effectivePaddingTop = this._defaultPaddingTop;
}
if (!style_properties_1.paddingRightProperty.isSet(style)) {
this.effectivePaddingRight = this._defaultPaddingRight;
}
if (!style_properties_1.paddingBottomProperty.isSet(style)) {
this.effectivePaddingBottom = this._defaultPaddingBottom;
}
if (!style_properties_1.paddingLeftProperty.isSet(style)) {
this.effectivePaddingLeft = this._defaultPaddingLeft;
}
}
}
else {
this._iosView = nativeView;
}
this.setNativeView(nativeView);
if (this.parent) {
var nativeIndex = this.parent._childIndexToNativeChildIndex(atIndex);
this._isAddedToNativeVisualTree = this.parent._addViewToNativeVisualTree(this, nativeIndex);
}
this._resumeNativeUpdates(SuspendType.UISetup);
this.eachChild(function (child) {
child._setupUI(context);
return true;
});
};
ViewBase.prototype.setNativeView = function (value) {
if (this.__nativeView === value) {
return;
}
if (this.__nativeView) {
this._suspendNativeUpdates(SuspendType.NativeView);
}
this.__nativeView = this.nativeViewProtected = value;
if (this.__nativeView) {
this._suspendedUpdates = undefined;
this.initNativeView();
this._resumeNativeUpdates(SuspendType.NativeView);
}
};
ViewBase.prototype._tearDownUI = function (force) {
if (!this._context) {
return;
}
this.resetNativeViewInternal();
this.eachChild(function (child) {
child._tearDownUI(force);
return true;
});
if (this.parent) {
this.parent._removeViewFromNativeVisualTree(this);
}
this.disposeNativeView();
this._suspendNativeUpdates(SuspendType.UISetup);
if (platform_1.isAndroid) {
this.setNativeView(null);
this._androidView = null;
}
this._context = null;
if (this.domNode) {
this.domNode.dispose();
this.domNode = undefined;
}
};
ViewBase.prototype._childIndexToNativeChildIndex = function (index) {
return index;
};
ViewBase.prototype._addViewToNativeVisualTree = function (view, atIndex) {
if (view._isAddedToNativeVisualTree) {
throw new Error("Child already added to the native visual tree.");
}
return true;
};
ViewBase.prototype._removeViewFromNativeVisualTree = function (view) {
view._isAddedToNativeVisualTree = false;
};
ViewBase.prototype._goToVisualState = function (state) {
if (bindable_1.traceEnabled()) {
bindable_1.traceWrite(this + " going to state: " + state, bindable_1.traceCategories.Style);
}
if (state === this._visualState) {
return;
}
this.deletePseudoClass(this._visualState);
this._visualState = state;
this.addPseudoClass(state);
};
ViewBase.prototype._applyXmlAttribute = function (attribute, value) {
if (attribute === "style" || attribute === "rows" || attribute === "columns" || attribute === "fontAttributes") {
this[attribute] = value;
return true;
}
return false;
};
ViewBase.prototype.setInlineStyle = function (style) {
if (typeof style !== "string") {
throw new Error("Parameter should be valid CSS string!");
}
ensureStyleScopeModule();
styleScopeModule.applyInlineStyle(this, style);
};
ViewBase.prototype._parentChanged = function (oldParent) {
var newParent = this.parent;
if (oldParent) {
properties_1.clearInheritedProperties(this);
if (this.bindingContextBoundToParentBindingContextChanged) {
oldParent.off("bindingContextChange", this.bindingContextChanged, this);
}
}
else if (this.shouldAddHandlerToParentBindingContextChanged) {
newParent.on("bindingContextChange", this.bindingContextChanged, this);
this.bindings.get("bindingContext").bind(newParent.bindingContext);
}
};
ViewBase.prototype.onResumeNativeUpdates = function () {
properties_1.initNativeView(this);
};
ViewBase.prototype.toString = function () {
var str = this.typeName;
if (this.id) {
str += "<" + this.id + ">";
}
else {
str += "(" + this._domId + ")";
}
var source = debug_1.Source.get(this);
if (source) {
str += "@" + source + ";";
}
return str;
};
ViewBase.prototype._onCssStateChange = function () {
this._cssState.onChange();
eachDescendant(this, function (child) {
child._cssState.onChange();
return true;
});
};
ViewBase.prototype._inheritStyleScope = function (styleScope) {
if (this._isStyleScopeHost) {
return;
}
if (this._styleScope !== styleScope) {
this._styleScope = styleScope;
this._onCssStateChange();
this.eachChild(function (child) {
child._inheritStyleScope(styleScope);
return true;
});
}
};
ViewBase.prototype.showModal = function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
var parent = this.parent;
return parent && parent.showModal.apply(parent, args);
};
ViewBase.prototype.closeModal = function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
var parent = this.parent;
if (parent) {
parent.closeModal.apply(parent, args);
}
};
ViewBase.prototype._dialogClosed = function () {
eachDescendant(this, function (child) {
child._dialogClosed();
return true;
});
};
ViewBase.prototype._onRootViewReset = function () {
eachDescendant(this, function (child) {
child._onRootViewReset();
return true;
});
};
ViewBase.loadedEvent = "loaded";
ViewBase.unloadedEvent = "unloaded";
__decorate([
profiling_1.profile
], ViewBase.prototype, "onLoaded", null);
__decorate([
profiling_1.profile
], ViewBase.prototype, "onUnloaded", null);
__decorate([
profiling_1.profile
], ViewBase.prototype, "addPseudoClass", null);
__decorate([
profiling_1.profile
], ViewBase.prototype, "deletePseudoClass", null);
__decorate([
profiling_1.profile
], ViewBase.prototype, "requestLayout", null);
__decorate([
profiling_1.profile
], ViewBase.prototype, "_addView", null);
__decorate([
profiling_1.profile
], ViewBase.prototype, "_setupUI", null);
__decorate([
profiling_1.profile
], ViewBase.prototype, "_tearDownUI", null);
return ViewBase;
}(bindable_1.Observable));
exports.ViewBase = ViewBase;
ViewBase.prototype.isCollapsed = false;
ViewBase.prototype._oldLeft = 0;
ViewBase.prototype._oldTop = 0;
ViewBase.prototype._oldRight = 0;
ViewBase.prototype._oldBottom = 0;
ViewBase.prototype.effectiveMinWidth = 0;
ViewBase.prototype.effectiveMinHeight = 0;
ViewBase.prototype.effectiveWidth = 0;
ViewBase.prototype.effectiveHeight = 0;
ViewBase.prototype.effectiveMarginTop = 0;
ViewBase.prototype.effectiveMarginRight = 0;
ViewBase.prototype.effectiveMarginBottom = 0;
ViewBase.prototype.effectiveMarginLeft = 0;
ViewBase.prototype.effectivePaddingTop = 0;
ViewBase.prototype.effectivePaddingRight = 0;
ViewBase.prototype.effectivePaddingBottom = 0;
ViewBase.prototype.effectivePaddingLeft = 0;
ViewBase.prototype.effectiveBorderTopWidth = 0;
ViewBase.prototype.effectiveBorderRightWidth = 0;
ViewBase.prototype.effectiveBorderBottomWidth = 0;
ViewBase.prototype.effectiveBorderLeftWidth = 0;
ViewBase.prototype._defaultPaddingTop = 0;
ViewBase.prototype._defaultPaddingRight = 0;
ViewBase.prototype._defaultPaddingBottom = 0;
ViewBase.prototype._defaultPaddingLeft = 0;
ViewBase.prototype._isViewBase = true;
ViewBase.prototype.recycleNativeView = "never";
ViewBase.prototype._suspendNativeUpdatesCount =
SuspendType.Loaded |
SuspendType.NativeView |
SuspendType.UISetup;
exports.bindingContextProperty = new properties_1.InheritedProperty({ name: "bindingContext" });
exports.bindingContextProperty.register(ViewBase);
exports.classNameProperty = new properties_1.Property({
name: "className",
valueChanged: function (view, oldValue, newValue) {
var classes = view.cssClasses;
classes.clear();
if (typeof newValue === "string") {
newValue.split(" ").forEach(function (c) { return classes.add(c); });
}
view._onCssStateChange();
}
});
exports.classNameProperty.register(ViewBase);
exports.idProperty = new properties_1.Property({ name: "id", valueChanged: function (view, oldValue, newValue) { return view._onCssStateChange(); } });
exports.idProperty.register(ViewBase);
function booleanConverter(v) {
var lowercase = (v + "").toLowerCase();
if (lowercase === "true") {
return true;
}
else if (lowercase === "false") {
return false;
}
throw new Error("Invalid boolean: " + v);
}
exports.booleanConverter = booleanConverter;
//# sourceMappingURL=view-base.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/ui/core/view/view-common.js":
/***/ (function(module, exports, __webpack_require__) {
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
Object.defineProperty(exports, "__esModule", { value: true });
var view_base_1 = __webpack_require__("../node_modules/tns-core-modules/ui/core/view-base/view-base.js");
var style_properties_1 = __webpack_require__("../node_modules/tns-core-modules/ui/styling/style-properties.js");
var gestures_1 = __webpack_require__("../node_modules/tns-core-modules/ui/gestures/gestures.js");
var builder_1 = __webpack_require__("../node_modules/tns-core-modules/ui/builder/builder.js");
var style_scope_1 = __webpack_require__("../node_modules/tns-core-modules/ui/styling/style-scope.js");
var linear_gradient_1 = __webpack_require__("../node_modules/tns-core-modules/ui/styling/linear-gradient.js");
exports.LinearGradient = linear_gradient_1.LinearGradient;
__export(__webpack_require__("../node_modules/tns-core-modules/ui/styling/style-properties.js"));
__export(__webpack_require__("../node_modules/tns-core-modules/ui/core/view-base/view-base.js"));
var animationModule;
function ensureAnimationModule() {
if (!animationModule) {
animationModule = __webpack_require__("../node_modules/tns-core-modules/ui/animation/animation.js");
}
}
function CSSType(type) {
return function (cls) {
cls.prototype.cssType = type;
};
}
exports.CSSType = CSSType;
function PseudoClassHandler() {
var pseudoClasses = [];
for (var _i = 0; _i < arguments.length; _i++) {
pseudoClasses[_i] = arguments[_i];
}
var stateEventNames = pseudoClasses.map(function (s) { return ":" + s; });
var listeners = Symbol("listeners");
return function (target, propertyKey, descriptor) {
function update(change) {
var prev = this[listeners] || 0;
var next = prev + change;
if (prev <= 0 && next > 0) {
this[propertyKey](true);
}
else if (prev > 0 && next <= 0) {
this[propertyKey](false);
}
}
stateEventNames.forEach(function (s) { return target[s] = update; });
};
}
exports.PseudoClassHandler = PseudoClassHandler;
exports._rootModalViews = new Array();
var ViewCommon = (function (_super) {
__extends(ViewCommon, _super);
function ViewCommon() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this._gestureObservers = {};
return _this;
}
Object.defineProperty(ViewCommon.prototype, "css", {
get: function () {
var scope = this._styleScope;
return scope && scope.css;
},
set: function (value) {
this._updateStyleScope(undefined, undefined, value);
},
enumerable: true,
configurable: true
});
ViewCommon.prototype.addCss = function (cssString) {
this._updateStyleScope(undefined, cssString);
};
ViewCommon.prototype.addCssFile = function (cssFileName) {
this._updateStyleScope(cssFileName);
};
ViewCommon.prototype.changeCssFile = function (cssFileName) {
var scope = this._styleScope;
if (scope && cssFileName) {
scope.changeCssFile(cssFileName);
this._onCssStateChange();
}
};
ViewCommon.prototype._updateStyleScope = function (cssFileName, cssString, css) {
var scope = this._styleScope;
if (!scope) {
scope = new style_scope_1.StyleScope();
this.setScopeProperty(scope, cssFileName, cssString, css);
this._inheritStyleScope(scope);
this._isStyleScopeHost = true;
}
else {
this.setScopeProperty(scope, cssFileName, cssString, css);
this._onCssStateChange();
}
};
ViewCommon.prototype.setScopeProperty = function (scope, cssFileName, cssString, css) {
if (cssFileName !== undefined) {
scope.addCssFile(cssFileName);
}
else if (cssString !== undefined) {
scope.addCss(cssString);
}
else if (css !== undefined) {
scope.css = css;
}
};
ViewCommon.prototype._onLivesync = function (context) {
exports._rootModalViews.forEach(function (v) { return v.closeModal(); });
exports._rootModalViews.length = 0;
if (context && context.path) {
return this.changeLocalStyles(context.path);
}
return false;
};
ViewCommon.prototype.changeLocalStyles = function (contextPath) {
var _this = this;
if (!this.changeStyles(this, contextPath)) {
view_base_1.eachDescendant(this, function (child) {
_this.changeStyles(child, contextPath);
return true;
});
}
return true;
};
ViewCommon.prototype.changeStyles = function (view, contextPath) {
if (view._moduleName && contextPath.includes(view._moduleName)) {
view.changeCssFile(contextPath);
return true;
}
return false;
};
ViewCommon.prototype._setupAsRootView = function (context) {
_super.prototype._setupAsRootView.call(this, context);
if (!this._styleScope) {
this._updateStyleScope();
}
};
ViewCommon.prototype.observe = function (type, callback, thisArg) {
if (!this._gestureObservers[type]) {
this._gestureObservers[type] = [];
}
this._gestureObservers[type].push(gestures_1.observe(this, type, callback, thisArg));
};
ViewCommon.prototype.getGestureObservers = function (type) {
return this._gestureObservers[type];
};
ViewCommon.prototype.addEventListener = function (arg, callback, thisArg) {
if (typeof arg === "string") {
arg = view_base_1.getEventOrGestureName(arg);
var gesture = gestures_1.fromString(arg);
if (gesture && !this._isEvent(arg)) {
this.observe(gesture, callback, thisArg);
}
else {
var events = (arg).split(",");
if (events.length > 0) {
for (var i = 0; i < events.length; i++) {
var evt = events[i].trim();
var gst = gestures_1.fromString(evt);
if (gst && !this._isEvent(arg)) {
this.observe(gst, callback, thisArg);
}
else {
_super.prototype.addEventListener.call(this, evt, callback, thisArg);
}
}
}
else {
_super.prototype.addEventListener.call(this, arg, callback, thisArg);
}
}
}
else if (typeof arg === "number") {
this.observe(arg, callback, thisArg);
}
};
ViewCommon.prototype.removeEventListener = function (arg, callback, thisArg) {
if (typeof arg === "string") {
var gesture = gestures_1.fromString(arg);
if (gesture && !this._isEvent(arg)) {
this._disconnectGestureObservers(gesture);
}
else {
var events = arg.split(",");
if (events.length > 0) {
for (var i = 0; i < events.length; i++) {
var evt = events[i].trim();
var gst = gestures_1.fromString(evt);
if (gst && !this._isEvent(arg)) {
this._disconnectGestureObservers(gst);
}
else {
_super.prototype.removeEventListener.call(this, evt, callback, thisArg);
}
}
}
else {
_super.prototype.removeEventListener.call(this, arg, callback, thisArg);
}
}
}
else if (typeof arg === "number") {
this._disconnectGestureObservers(arg);
}
};
ViewCommon.prototype.onBackPressed = function () {
return false;
};
ViewCommon.prototype._getFragmentManager = function () {
return undefined;
};
ViewCommon.prototype.getModalOptions = function (args) {
if (args.length === 0) {
throw new Error("showModal without parameters is deprecated. Please call showModal on a view instance instead.");
}
else {
var options = null;
if (args.length === 2) {
options = args[1];
}
else {
options = {
context: args[1],
closeCallback: args[2],
fullscreen: args[3],
animated: args[4],
stretched: args[5]
};
}
var firstArgument = args[0];
var view = firstArgument instanceof ViewCommon
? firstArgument : builder_1.createViewFromEntry({ moduleName: firstArgument });
return { view: view, options: options };
}
};
ViewCommon.prototype.showModal = function () {
var _a = this.getModalOptions(arguments), view = _a.view, options = _a.options;
view._showNativeModalView(this, options);
return view;
};
ViewCommon.prototype.closeModal = function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
var closeCallback = this._closeModalCallback;
if (closeCallback) {
closeCallback.apply(undefined, arguments);
}
else {
var parent_1 = this.parent;
if (parent_1) {
parent_1.closeModal.apply(parent_1, args);
}
}
};
Object.defineProperty(ViewCommon.prototype, "modal", {
get: function () {
return this._modal;
},
enumerable: true,
configurable: true
});
ViewCommon.prototype._showNativeModalView = function (parent, options) {
exports._rootModalViews.push(this);
parent._modal = this;
this._modalParent = parent;
this._modalContext = options.context;
var that = this;
this._closeModalCallback = function () {
var originalArgs = [];
for (var _i = 0; _i < arguments.length; _i++) {
originalArgs[_i] = arguments[_i];
}
if (that._closeModalCallback) {
var modalIndex = exports._rootModalViews.indexOf(that);
exports._rootModalViews.splice(modalIndex);
that._modalParent = null;
that._modalContext = null;
that._closeModalCallback = null;
that._dialogClosed();
parent._modal = null;
var whenClosedCallback = function () {
if (typeof options.closeCallback === "function") {
options.closeCallback.apply(undefined, originalArgs);
}
};
that._hideNativeModalView(parent, whenClosedCallback);
}
};
};
ViewCommon.prototype._raiseLayoutChangedEvent = function () {
var args = {
eventName: ViewCommon.layoutChangedEvent,
object: this
};
this.notify(args);
};
ViewCommon.prototype._raiseShownModallyEvent = function () {
var args = {
eventName: ViewCommon.shownModallyEvent,
object: this,
context: this._modalContext,
closeCallback: this._closeModalCallback
};
this.notify(args);
};
ViewCommon.prototype._raiseShowingModallyEvent = function () {
var args = {
eventName: ViewCommon.showingModallyEvent,
object: this,
context: this._modalContext,
closeCallback: this._closeModalCallback
};
this.notify(args);
};
ViewCommon.prototype._isEvent = function (name) {
return this.constructor && name + "Event" in this.constructor;
};
ViewCommon.prototype._disconnectGestureObservers = function (type) {
var observers = this.getGestureObservers(type);
if (observers) {
for (var i = 0; i < observers.length; i++) {
observers[i].disconnect();
}
}
};
Object.defineProperty(ViewCommon.prototype, "borderColor", {
get: function () {
return this.style.borderColor;
},
set: function (value) {
this.style.borderColor = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ViewCommon.prototype, "borderTopColor", {
get: function () {
return this.style.borderTopColor;
},
set: function (value) {
this.style.borderTopColor = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ViewCommon.prototype, "borderRightColor", {
get: function () {
return this.style.borderRightColor;
},
set: function (value) {
this.style.borderRightColor = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ViewCommon.prototype, "borderBottomColor", {
get: function () {
return this.style.borderBottomColor;
},
set: function (value) {
this.style.borderBottomColor = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ViewCommon.prototype, "borderLeftColor", {
get: function () {
return this.style.borderLeftColor;
},
set: function (value) {
this.style.borderLeftColor = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ViewCommon.prototype, "borderWidth", {
get: function () {
return this.style.borderWidth;
},
set: function (value) {
this.style.borderWidth = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ViewCommon.prototype, "borderTopWidth", {
get: function () {
return this.style.borderTopWidth;
},
set: function (value) {
this.style.borderTopWidth = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ViewCommon.prototype, "borderRightWidth", {
get: function () {
return this.style.borderRightWidth;
},
set: function (value) {
this.style.borderRightWidth = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ViewCommon.prototype, "borderBottomWidth", {
get: function () {
return this.style.borderBottomWidth;
},
set: function (value) {
this.style.borderBottomWidth = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ViewCommon.prototype, "borderLeftWidth", {
get: function () {
return this.style.borderLeftWidth;
},
set: function (value) {
this.style.borderLeftWidth = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ViewCommon.prototype, "borderRadius", {
get: function () {
return this.style.borderRadius;
},
set: function (value) {
this.style.borderRadius = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ViewCommon.prototype, "borderTopLeftRadius", {
get: function () {
return this.style.borderTopLeftRadius;
},
set: function (value) {
this.style.borderTopLeftRadius = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ViewCommon.prototype, "borderTopRightRadius", {
get: function () {
return this.style.borderTopRightRadius;
},
set: function (value) {
this.style.borderTopRightRadius = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ViewCommon.prototype, "borderBottomRightRadius", {
get: function () {
return this.style.borderBottomRightRadius;
},
set: function (value) {
this.style.borderBottomRightRadius = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ViewCommon.prototype, "borderBottomLeftRadius", {
get: function () {
return this.style.borderBottomLeftRadius;
},
set: function (value) {
this.style.borderBottomLeftRadius = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ViewCommon.prototype, "color", {
get: function () {
return this.style.color;
},
set: function (value) {
this.style.color = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ViewCommon.prototype, "background", {
get: function () {
return this.style.background;
},
set: function (value) {
this.style.background = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ViewCommon.prototype, "backgroundColor", {
get: function () {
return this.style.backgroundColor;
},
set: function (value) {
this.style.backgroundColor = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ViewCommon.prototype, "backgroundImage", {
get: function () {
return this.style.backgroundImage;
},
set: function (value) {
this.style.backgroundImage = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ViewCommon.prototype, "backgroundSize", {
get: function () {
return this.style.backgroundSize;
},
set: function (value) {
this.style.backgroundSize = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ViewCommon.prototype, "backgroundPosition", {
get: function () {
return this.style.backgroundPosition;
},
set: function (value) {
this.style.backgroundPosition = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ViewCommon.prototype, "backgroundRepeat", {
get: function () {
return this.style.backgroundRepeat;
},
set: function (value) {
this.style.backgroundRepeat = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ViewCommon.prototype, "minWidth", {
get: function () {
return this.style.minWidth;
},
set: function (value) {
this.style.minWidth = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ViewCommon.prototype, "minHeight", {
get: function () {
return this.style.minHeight;
},
set: function (value) {
this.style.minHeight = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ViewCommon.prototype, "width", {
get: function () {
return this.style.width;
},
set: function (value) {
this.style.width = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ViewCommon.prototype, "height", {
get: function () {
return this.style.height;
},
set: function (value) {
this.style.height = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ViewCommon.prototype, "margin", {
get: function () {
return this.style.margin;
},
set: function (value) {
this.style.margin = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ViewCommon.prototype, "marginLeft", {
get: function () {
return this.style.marginLeft;
},
set: function (value) {
this.style.marginLeft = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ViewCommon.prototype, "marginTop", {
get: function () {
return this.style.marginTop;
},
set: function (value) {
this.style.marginTop = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ViewCommon.prototype, "marginRight", {
get: function () {
return this.style.marginRight;
},
set: function (value) {
this.style.marginRight = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ViewCommon.prototype, "marginBottom", {
get: function () {
return this.style.marginBottom;
},
set: function (value) {
this.style.marginBottom = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ViewCommon.prototype, "horizontalAlignment", {
get: function () {
return this.style.horizontalAlignment;
},
set: function (value) {
this.style.horizontalAlignment = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ViewCommon.prototype, "verticalAlignment", {
get: function () {
return this.style.verticalAlignment;
},
set: function (value) {
this.style.verticalAlignment = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ViewCommon.prototype, "visibility", {
get: function () {
return this.style.visibility;
},
set: function (value) {
this.style.visibility = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ViewCommon.prototype, "opacity", {
get: function () {
return this.style.opacity;
},
set: function (value) {
this.style.opacity = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ViewCommon.prototype, "rotate", {
get: function () {
return this.style.rotate;
},
set: function (value) {
this.style.rotate = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ViewCommon.prototype, "translateX", {
get: function () {
return this.style.translateX;
},
set: function (value) {
this.style.translateX = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ViewCommon.prototype, "translateY", {
get: function () {
return this.style.translateY;
},
set: function (value) {
this.style.translateY = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ViewCommon.prototype, "scaleX", {
get: function () {
return this.style.scaleX;
},
set: function (value) {
this.style.scaleX = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ViewCommon.prototype, "scaleY", {
get: function () {
return this.style.scaleY;
},
set: function (value) {
this.style.scaleY = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ViewCommon.prototype, "isLayoutValid", {
get: function () {
return this._isLayoutValid;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ViewCommon.prototype, "cssType", {
get: function () {
if (!this._cssType) {
this._cssType = this.typeName.toLowerCase();
}
return this._cssType;
},
set: function (type) {
this._cssType = type.toLowerCase();
},
enumerable: true,
configurable: true
});
Object.defineProperty(ViewCommon.prototype, "isLayoutRequired", {
get: function () {
return true;
},
enumerable: true,
configurable: true
});
ViewCommon.prototype.measure = function (widthMeasureSpec, heightMeasureSpec) {
this._setCurrentMeasureSpecs(widthMeasureSpec, heightMeasureSpec);
};
ViewCommon.prototype.layout = function (left, top, right, bottom) {
this._setCurrentLayoutBounds(left, top, right, bottom);
};
ViewCommon.prototype.getMeasuredWidth = function () {
return this._measuredWidth & view_base_1.layout.MEASURED_SIZE_MASK || 0;
};
ViewCommon.prototype.getMeasuredHeight = function () {
return this._measuredHeight & view_base_1.layout.MEASURED_SIZE_MASK || 0;
};
ViewCommon.prototype.getMeasuredState = function () {
return (this._measuredWidth & view_base_1.layout.MEASURED_STATE_MASK)
| ((this._measuredHeight >> view_base_1.layout.MEASURED_HEIGHT_STATE_SHIFT)
& (view_base_1.layout.MEASURED_STATE_MASK >> view_base_1.layout.MEASURED_HEIGHT_STATE_SHIFT));
};
ViewCommon.prototype.setMeasuredDimension = function (measuredWidth, measuredHeight) {
this._measuredWidth = measuredWidth;
this._measuredHeight = measuredHeight;
if (view_base_1.traceEnabled()) {
view_base_1.traceWrite(this + " :setMeasuredDimension: " + measuredWidth + ", " + measuredHeight, view_base_1.traceCategories.Layout);
}
};
ViewCommon.prototype.requestLayout = function () {
this._isLayoutValid = false;
_super.prototype.requestLayout.call(this);
};
ViewCommon.resolveSizeAndState = function (size, specSize, specMode, childMeasuredState) {
var result = size;
switch (specMode) {
case view_base_1.layout.UNSPECIFIED:
result = Math.ceil(size);
break;
case view_base_1.layout.AT_MOST:
if (specSize < size) {
result = Math.ceil(specSize) | view_base_1.layout.MEASURED_STATE_TOO_SMALL;
}
break;
case view_base_1.layout.EXACTLY:
result = Math.ceil(specSize);
break;
}
return result | (childMeasuredState & view_base_1.layout.MEASURED_STATE_MASK);
};
ViewCommon.combineMeasuredStates = function (curState, newState) {
return curState | newState;
};
ViewCommon.layoutChild = function (parent, child, left, top, right, bottom, setFrame) {
if (setFrame === void 0) { setFrame = true; }
if (!child || child.isCollapsed) {
return;
}
var childStyle = child.style;
var childTop;
var childLeft;
var childWidth = child.getMeasuredWidth();
var childHeight = child.getMeasuredHeight();
var effectiveMarginTop = child.effectiveMarginTop;
var effectiveMarginBottom = child.effectiveMarginBottom;
var vAlignment;
if (child.effectiveHeight >= 0 && childStyle.verticalAlignment === "stretch") {
vAlignment = "middle";
}
else {
vAlignment = childStyle.verticalAlignment;
}
switch (vAlignment) {
case "top":
childTop = top + effectiveMarginTop;
break;
case "middle":
childTop = top + (bottom - top - childHeight + (effectiveMarginTop - effectiveMarginBottom)) / 2;
break;
case "bottom":
childTop = bottom - childHeight - effectiveMarginBottom;
break;
case "stretch":
default:
childTop = top + effectiveMarginTop;
childHeight = bottom - top - (effectiveMarginTop + effectiveMarginBottom);
break;
}
var effectiveMarginLeft = child.effectiveMarginLeft;
var effectiveMarginRight = child.effectiveMarginRight;
var hAlignment;
if (child.effectiveWidth >= 0 && childStyle.horizontalAlignment === "stretch") {
hAlignment = "center";
}
else {
hAlignment = childStyle.horizontalAlignment;
}
switch (hAlignment) {
case "left":
childLeft = left + effectiveMarginLeft;
break;
case "center":
childLeft = left + (right - left - childWidth + (effectiveMarginLeft - effectiveMarginRight)) / 2;
break;
case "right":
childLeft = right - childWidth - effectiveMarginRight;
break;
case "stretch":
default:
childLeft = left + effectiveMarginLeft;
childWidth = right - left - (effectiveMarginLeft + effectiveMarginRight);
break;
}
var childRight = Math.round(childLeft + childWidth);
var childBottom = Math.round(childTop + childHeight);
childLeft = Math.round(childLeft);
childTop = Math.round(childTop);
if (view_base_1.traceEnabled()) {
view_base_1.traceWrite(child.parent + " :layoutChild: " + child + " " + childLeft + ", " + childTop + ", " + childRight + ", " + childBottom, view_base_1.traceCategories.Layout);
}
child.layout(childLeft, childTop, childRight, childBottom, setFrame);
};
ViewCommon.measureChild = function (parent, child, widthMeasureSpec, heightMeasureSpec) {
var measureWidth = 0;
var measureHeight = 0;
if (child && !child.isCollapsed) {
var widthSpec = parent ? parent._currentWidthMeasureSpec : widthMeasureSpec;
var heightSpec = parent ? parent._currentHeightMeasureSpec : heightMeasureSpec;
var width = view_base_1.layout.getMeasureSpecSize(widthSpec);
var widthMode = view_base_1.layout.getMeasureSpecMode(widthSpec);
var height = view_base_1.layout.getMeasureSpecSize(heightSpec);
var heightMode = view_base_1.layout.getMeasureSpecMode(heightSpec);
child._updateEffectiveLayoutValues(width, widthMode, height, heightMode);
var style = child.style;
var horizontalMargins = child.effectiveMarginLeft + child.effectiveMarginRight;
var verticalMargins = child.effectiveMarginTop + child.effectiveMarginBottom;
var childWidthMeasureSpec = ViewCommon.getMeasureSpec(widthMeasureSpec, horizontalMargins, child.effectiveWidth, style.horizontalAlignment === "stretch");
var childHeightMeasureSpec = ViewCommon.getMeasureSpec(heightMeasureSpec, verticalMargins, child.effectiveHeight, style.verticalAlignment === "stretch");
if (view_base_1.traceEnabled()) {
view_base_1.traceWrite(child.parent + " :measureChild: " + child + " " + view_base_1.layout.measureSpecToString(childWidthMeasureSpec) + ", " + view_base_1.layout.measureSpecToString(childHeightMeasureSpec) + "}", view_base_1.traceCategories.Layout);
}
child.measure(childWidthMeasureSpec, childHeightMeasureSpec);
measureWidth = Math.round(child.getMeasuredWidth() + horizontalMargins);
measureHeight = Math.round(child.getMeasuredHeight() + verticalMargins);
}
return { measuredWidth: measureWidth, measuredHeight: measureHeight };
};
ViewCommon.getMeasureSpec = function (parentSpec, margins, childLength, stretched) {
var parentLength = view_base_1.layout.getMeasureSpecSize(parentSpec);
var parentSpecMode = view_base_1.layout.getMeasureSpecMode(parentSpec);
var resultSize;
var resultMode;
if (childLength >= 0) {
resultSize = parentSpecMode === view_base_1.layout.UNSPECIFIED ? childLength : Math.min(parentLength, childLength);
resultMode = view_base_1.layout.EXACTLY;
}
else {
switch (parentSpecMode) {
case view_base_1.layout.EXACTLY:
resultSize = Math.max(0, parentLength - margins);
resultMode = stretched ? view_base_1.layout.EXACTLY : view_base_1.layout.AT_MOST;
break;
case view_base_1.layout.AT_MOST:
resultSize = Math.max(0, parentLength - margins);
resultMode = view_base_1.layout.AT_MOST;
break;
case view_base_1.layout.UNSPECIFIED:
resultSize = 0;
resultMode = view_base_1.layout.UNSPECIFIED;
break;
}
}
return view_base_1.layout.makeMeasureSpec(resultSize, resultMode);
};
ViewCommon.prototype._setCurrentMeasureSpecs = function (widthMeasureSpec, heightMeasureSpec) {
var changed = this._currentWidthMeasureSpec !== widthMeasureSpec || this._currentHeightMeasureSpec !== heightMeasureSpec;
this._currentWidthMeasureSpec = widthMeasureSpec;
this._currentHeightMeasureSpec = heightMeasureSpec;
return changed;
};
ViewCommon.prototype._getCurrentLayoutBounds = function () {
return { left: 0, top: 0, right: 0, bottom: 0 };
};
ViewCommon.prototype._setCurrentLayoutBounds = function (left, top, right, bottom) {
this._isLayoutValid = true;
var boundsChanged = this._oldLeft !== left || this._oldTop !== top || this._oldRight !== right || this._oldBottom !== bottom;
var sizeChanged = (this._oldRight - this._oldLeft !== right - left) || (this._oldBottom - this._oldTop !== bottom - top);
this._oldLeft = left;
this._oldTop = top;
this._oldRight = right;
this._oldBottom = bottom;
return { boundsChanged: boundsChanged, sizeChanged: sizeChanged };
};
ViewCommon.prototype.eachChild = function (callback) {
this.eachChildView(callback);
};
ViewCommon.prototype.eachChildView = function (callback) {
};
ViewCommon.prototype._getNativeViewsCount = function () {
return this._isAddedToNativeVisualTree ? 1 : 0;
};
ViewCommon.prototype._eachLayoutView = function (callback) {
return callback(this);
};
ViewCommon.prototype.focus = function () {
return undefined;
};
ViewCommon.prototype.getSafeAreaInsets = function () {
return { left: 0, top: 0, right: 0, bottom: 0 };
};
ViewCommon.prototype.getLocationInWindow = function () {
return undefined;
};
ViewCommon.prototype.getLocationOnScreen = function () {
return undefined;
};
ViewCommon.prototype.getLocationRelativeTo = function (otherView) {
return undefined;
};
ViewCommon.prototype.getActualSize = function () {
var currentBounds = this._getCurrentLayoutBounds();
if (!currentBounds) {
return undefined;
}
return {
width: view_base_1.layout.toDeviceIndependentPixels(currentBounds.right - currentBounds.left),
height: view_base_1.layout.toDeviceIndependentPixels(currentBounds.bottom - currentBounds.top),
};
};
ViewCommon.prototype.animate = function (animation) {
return this.createAnimation(animation).play();
};
ViewCommon.prototype.createAnimation = function (animation) {
ensureAnimationModule();
if (!this._localAnimations) {
this._localAnimations = new Set();
}
animation.target = this;
var anim = new animationModule.Animation([animation]);
this._localAnimations.add(anim);
return anim;
};
ViewCommon.prototype._removeAnimation = function (animation) {
var localAnimations = this._localAnimations;
if (localAnimations && localAnimations.has(animation)) {
localAnimations.delete(animation);
if (animation.isPlaying) {
animation.cancel();
}
return true;
}
return false;
};
ViewCommon.prototype.resetNativeView = function () {
var _this = this;
if (this._localAnimations) {
this._localAnimations.forEach(function (a) { return _this._removeAnimation(a); });
}
_super.prototype.resetNativeView.call(this);
};
ViewCommon.prototype._setNativeViewFrame = function (nativeView, frame) {
};
ViewCommon.prototype._getValue = function () {
throw new Error("The View._getValue is obsolete. There is a new property system.");
};
ViewCommon.prototype._setValue = function () {
throw new Error("The View._setValue is obsolete. There is a new property system.");
};
ViewCommon.prototype._updateEffectiveLayoutValues = function (parentWidthMeasureSize, parentWidthMeasureMode, parentHeightMeasureSize, parentHeightMeasureMode) {
var style = this.style;
var availableWidth = parentWidthMeasureMode === view_base_1.layout.UNSPECIFIED ? -1 : parentWidthMeasureSize;
this.effectiveWidth = style_properties_1.PercentLength.toDevicePixels(style.width, -2, availableWidth);
this.effectiveMarginLeft = style_properties_1.PercentLength.toDevicePixels(style.marginLeft, 0, availableWidth);
this.effectiveMarginRight = style_properties_1.PercentLength.toDevicePixels(style.marginRight, 0, availableWidth);
var availableHeight = parentHeightMeasureMode === view_base_1.layout.UNSPECIFIED ? -1 : parentHeightMeasureSize;
this.effectiveHeight = style_properties_1.PercentLength.toDevicePixels(style.height, -2, availableHeight);
this.effectiveMarginTop = style_properties_1.PercentLength.toDevicePixels(style.marginTop, 0, availableHeight);
this.effectiveMarginBottom = style_properties_1.PercentLength.toDevicePixels(style.marginBottom, 0, availableHeight);
};
ViewCommon.prototype._setNativeClipToBounds = function () {
};
ViewCommon.prototype._redrawNativeBackground = function (value) {
};
ViewCommon.prototype._onAttachedToWindow = function () {
};
ViewCommon.prototype._onDetachedFromWindow = function () {
};
ViewCommon.prototype._hasAncestorView = function (ancestorView) {
var matcher = function (view) { return view === ancestorView; };
for (var parent_2 = this.parent; parent_2 != null; parent_2 = parent_2.parent) {
if (matcher(parent_2)) {
return true;
}
}
return false;
};
ViewCommon.layoutChangedEvent = "layoutChanged";
ViewCommon.shownModallyEvent = "shownModally";
ViewCommon.showingModallyEvent = "showingModally";
return ViewCommon;
}(view_base_1.ViewBase));
exports.ViewCommon = ViewCommon;
exports.automationTextProperty = new view_base_1.Property({ name: "automationText" });
exports.automationTextProperty.register(ViewCommon);
exports.originXProperty = new view_base_1.Property({ name: "originX", defaultValue: 0.5, valueConverter: function (v) { return parseFloat(v); } });
exports.originXProperty.register(ViewCommon);
exports.originYProperty = new view_base_1.Property({ name: "originY", defaultValue: 0.5, valueConverter: function (v) { return parseFloat(v); } });
exports.originYProperty.register(ViewCommon);
exports.isEnabledProperty = new view_base_1.Property({
name: "isEnabled",
defaultValue: true,
valueConverter: view_base_1.booleanConverter,
valueChanged: function (target, oldValue, newValue) {
target._goToVisualState(newValue ? "normal" : "disabled");
}
});
exports.isEnabledProperty.register(ViewCommon);
exports.isUserInteractionEnabledProperty = new view_base_1.Property({ name: "isUserInteractionEnabled", defaultValue: true, valueConverter: view_base_1.booleanConverter });
exports.isUserInteractionEnabledProperty.register(ViewCommon);
exports.iosOverflowSafeAreaProperty = new view_base_1.Property({ name: "iosOverflowSafeArea", defaultValue: false, valueConverter: view_base_1.booleanConverter });
exports.iosOverflowSafeAreaProperty.register(ViewCommon);
exports.iosOverflowSafeAreaEnabledProperty = new view_base_1.InheritedProperty({ name: "iosOverflowSafeAreaEnabled", defaultValue: true, valueConverter: view_base_1.booleanConverter });
exports.iosOverflowSafeAreaEnabledProperty.register(ViewCommon);
//# sourceMappingURL=view-common.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/ui/core/view/view.js":
/***/ (function(module, exports, __webpack_require__) {
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
Object.defineProperty(exports, "__esModule", { value: true });
var view_common_1 = __webpack_require__("../node_modules/tns-core-modules/ui/core/view/view-common.js");
var background_1 = __webpack_require__("../node_modules/tns-core-modules/ui/styling/background.js");
var utils_1 = __webpack_require__("../node_modules/tns-core-modules/utils/utils.js");
var style_properties_1 = __webpack_require__("../node_modules/tns-core-modules/ui/styling/style-properties.js");
var profiling_1 = __webpack_require__("../node_modules/tns-core-modules/profiling/profiling.js");
__export(__webpack_require__("../node_modules/tns-core-modules/ui/core/view/view-common.js"));
var PFLAG_FORCE_LAYOUT = 1;
var PFLAG_MEASURED_DIMENSION_SET = 1 << 1;
var PFLAG_LAYOUT_REQUIRED = 1 << 2;
var majorVersion = utils_1.ios.MajorVersion;
var View = (function (_super) {
__extends(View, _super);
function View() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this._isLaidOut = false;
_this._hasTransfrom = false;
_this._privateFlags = PFLAG_LAYOUT_REQUIRED | PFLAG_FORCE_LAYOUT;
_this._suspendCATransaction = false;
return _this;
}
Object.defineProperty(View.prototype, "isLayoutRequired", {
get: function () {
return (this._privateFlags & PFLAG_LAYOUT_REQUIRED) === PFLAG_LAYOUT_REQUIRED;
},
enumerable: true,
configurable: true
});
Object.defineProperty(View.prototype, "isLayoutRequested", {
get: function () {
return (this._privateFlags & PFLAG_FORCE_LAYOUT) === PFLAG_FORCE_LAYOUT;
},
enumerable: true,
configurable: true
});
View.prototype.requestLayout = function () {
_super.prototype.requestLayout.call(this);
this._privateFlags |= PFLAG_FORCE_LAYOUT;
var nativeView = this.nativeViewProtected;
if (nativeView) {
nativeView.setNeedsLayout();
}
if (this.viewController && this.viewController.view !== nativeView) {
this.viewController.view.setNeedsLayout();
}
};
View.prototype.measure = function (widthMeasureSpec, heightMeasureSpec) {
var measureSpecsChanged = this._setCurrentMeasureSpecs(widthMeasureSpec, heightMeasureSpec);
var forceLayout = (this._privateFlags & PFLAG_FORCE_LAYOUT) === PFLAG_FORCE_LAYOUT;
if (forceLayout || measureSpecsChanged) {
this._privateFlags &= ~PFLAG_MEASURED_DIMENSION_SET;
this.onMeasure(widthMeasureSpec, heightMeasureSpec);
this._privateFlags |= PFLAG_LAYOUT_REQUIRED;
if ((this._privateFlags & PFLAG_MEASURED_DIMENSION_SET) !== PFLAG_MEASURED_DIMENSION_SET) {
throw new Error("onMeasure() did not set the measured dimension by calling setMeasuredDimension() " + this);
}
}
};
View.prototype.layout = function (left, top, right, bottom, setFrame) {
if (setFrame === void 0) { setFrame = true; }
var _a = this._setCurrentLayoutBounds(left, top, right, bottom), boundsChanged = _a.boundsChanged, sizeChanged = _a.sizeChanged;
if (setFrame) {
this.layoutNativeView(left, top, right, bottom);
}
if (boundsChanged || (this._privateFlags & PFLAG_LAYOUT_REQUIRED) === PFLAG_LAYOUT_REQUIRED) {
var position = { left: left, top: top, right: right, bottom: bottom };
if (this.nativeViewProtected && majorVersion > 10) {
var frame = this.nativeViewProtected.frame;
position = ios.getPositionFromFrame(frame);
}
this.onLayout(position.left, position.top, position.right, position.bottom);
this._privateFlags &= ~PFLAG_LAYOUT_REQUIRED;
}
this.updateBackground(sizeChanged);
this._privateFlags &= ~PFLAG_FORCE_LAYOUT;
};
View.prototype.updateBackground = function (sizeChanged) {
if (sizeChanged) {
this._onSizeChanged();
}
else if (this._nativeBackgroundState === "invalid") {
var background = this.style.backgroundInternal;
this._redrawNativeBackground(background);
}
};
View.prototype.setMeasuredDimension = function (measuredWidth, measuredHeight) {
_super.prototype.setMeasuredDimension.call(this, measuredWidth, measuredHeight);
this._privateFlags |= PFLAG_MEASURED_DIMENSION_SET;
};
View.prototype.onMeasure = function (widthMeasureSpec, heightMeasureSpec) {
var view = this.nativeViewProtected;
var width = view_common_1.layout.getMeasureSpecSize(widthMeasureSpec);
var widthMode = view_common_1.layout.getMeasureSpecMode(widthMeasureSpec);
var height = view_common_1.layout.getMeasureSpecSize(heightMeasureSpec);
var heightMode = view_common_1.layout.getMeasureSpecMode(heightMeasureSpec);
var nativeWidth = 0;
var nativeHeight = 0;
if (view) {
var nativeSize = view_common_1.layout.measureNativeView(view, width, widthMode, height, heightMode);
nativeWidth = nativeSize.width;
nativeHeight = nativeSize.height;
}
var measureWidth = Math.max(nativeWidth, this.effectiveMinWidth);
var measureHeight = Math.max(nativeHeight, this.effectiveMinHeight);
var widthAndState = View.resolveSizeAndState(measureWidth, width, widthMode, 0);
var heightAndState = View.resolveSizeAndState(measureHeight, height, heightMode, 0);
this.setMeasuredDimension(widthAndState, heightAndState);
};
View.prototype.onLayout = function (left, top, right, bottom) {
};
View.prototype._setNativeViewFrame = function (nativeView, frame) {
var oldFrame = this._cachedFrame || nativeView.frame;
if (!CGRectEqualToRect(oldFrame, frame)) {
if (view_common_1.traceEnabled()) {
view_common_1.traceWrite(this + " :_setNativeViewFrame: " + JSON.stringify(ios.getPositionFromFrame(frame)), view_common_1.traceCategories.Layout);
}
this._cachedFrame = frame;
var adjustedFrame = null;
var transform = null;
if (this._hasTransfrom) {
transform = nativeView.transform;
nativeView.transform = CGAffineTransformIdentity;
nativeView.frame = frame;
}
else {
nativeView.frame = frame;
}
adjustedFrame = this.applySafeAreaInsets(frame);
if (adjustedFrame) {
nativeView.frame = adjustedFrame;
}
if (this._hasTransfrom) {
nativeView.transform = transform;
}
var boundsOrigin = nativeView.bounds.origin;
var boundsFrame = adjustedFrame || frame;
nativeView.bounds = CGRectMake(boundsOrigin.x, boundsOrigin.y, boundsFrame.size.width, boundsFrame.size.height);
this._raiseLayoutChangedEvent();
this._isLaidOut = true;
}
else if (!this._isLaidOut) {
this._raiseLayoutChangedEvent();
this._isLaidOut = true;
}
};
Object.defineProperty(View.prototype, "isLayoutValid", {
get: function () {
if (this.nativeViewProtected) {
return this._isLayoutValid;
}
return false;
},
enumerable: true,
configurable: true
});
View.prototype.layoutNativeView = function (left, top, right, bottom) {
if (!this.nativeViewProtected) {
return;
}
var nativeView = this.nativeViewProtected;
var frame = ios.getFrameFromPosition({ left: left, top: top, right: right, bottom: bottom });
this._setNativeViewFrame(nativeView, frame);
};
View.prototype._setLayoutFlags = function (left, top, right, bottom) {
var width = right - left;
var height = bottom - top;
var widthSpec = view_common_1.layout.makeMeasureSpec(width, view_common_1.layout.EXACTLY);
var heightSpec = view_common_1.layout.makeMeasureSpec(height, view_common_1.layout.EXACTLY);
this._setCurrentMeasureSpecs(widthSpec, heightSpec);
this._privateFlags &= ~PFLAG_FORCE_LAYOUT;
this.setMeasuredDimension(width, height);
var sizeChanged = this._setCurrentLayoutBounds(left, top, right, bottom).sizeChanged;
this.updateBackground(sizeChanged);
this._privateFlags &= ~PFLAG_LAYOUT_REQUIRED;
};
View.prototype.focus = function () {
if (this.ios) {
return this.ios.becomeFirstResponder();
}
return false;
};
View.prototype.applySafeAreaInsets = function (frame) {
if (majorVersion <= 10) {
return null;
}
if (!this.iosOverflowSafeArea || !this.iosOverflowSafeAreaEnabled) {
return ios.shrinkToSafeArea(this, frame);
}
else if (this.nativeViewProtected && this.nativeViewProtected.window) {
return ios.expandBeyondSafeArea(this, frame);
}
return null;
};
View.prototype.getSafeAreaInsets = function () {
var safeAreaInsets = this.nativeViewProtected && this.nativeViewProtected.safeAreaInsets;
var insets = { left: 0, top: 0, right: 0, bottom: 0 };
if (safeAreaInsets) {
insets.left = view_common_1.layout.round(view_common_1.layout.toDevicePixels(safeAreaInsets.left));
insets.top = view_common_1.layout.round(view_common_1.layout.toDevicePixels(safeAreaInsets.top));
insets.right = view_common_1.layout.round(view_common_1.layout.toDevicePixels(safeAreaInsets.right));
insets.bottom = view_common_1.layout.round(view_common_1.layout.toDevicePixels(safeAreaInsets.bottom));
}
return insets;
};
View.prototype.getLocationInWindow = function () {
if (!this.nativeViewProtected || !this.nativeViewProtected.window) {
return undefined;
}
var pointInWindow = this.nativeViewProtected.convertPointToView(this.nativeViewProtected.bounds.origin, null);
return {
x: pointInWindow.x,
y: pointInWindow.y
};
};
View.prototype.getLocationOnScreen = function () {
if (!this.nativeViewProtected || !this.nativeViewProtected.window) {
return undefined;
}
var pointInWindow = this.nativeViewProtected.convertPointToView(this.nativeViewProtected.bounds.origin, null);
var pointOnScreen = this.nativeViewProtected.window.convertPointToWindow(pointInWindow, null);
return {
x: pointOnScreen.x,
y: pointOnScreen.y
};
};
View.prototype.getLocationRelativeTo = function (otherView) {
if (!this.nativeViewProtected || !this.nativeViewProtected.window ||
!otherView.nativeViewProtected || !otherView.nativeViewProtected.window ||
this.nativeViewProtected.window !== otherView.nativeViewProtected.window) {
return undefined;
}
var myPointInWindow = this.nativeViewProtected.convertPointToView(this.nativeViewProtected.bounds.origin, null);
var otherPointInWindow = otherView.nativeViewProtected.convertPointToView(otherView.nativeViewProtected.bounds.origin, null);
return {
x: myPointInWindow.x - otherPointInWindow.x,
y: myPointInWindow.y - otherPointInWindow.y
};
};
View.prototype._onSizeChanged = function () {
var nativeView = this.nativeViewProtected;
if (!nativeView) {
return;
}
var background = this.style.backgroundInternal;
var backgroundDependsOnSize = background.image
|| !background.hasUniformBorder()
|| background.hasBorderRadius();
if (this._nativeBackgroundState === "invalid" || (this._nativeBackgroundState === "drawn" && backgroundDependsOnSize)) {
this._redrawNativeBackground(background);
}
var clipPath = this.style.clipPath;
if (clipPath !== "" && this[style_properties_1.clipPathProperty.setNative]) {
this[style_properties_1.clipPathProperty.setNative](clipPath);
}
};
View.prototype.updateNativeTransform = function () {
var scaleX = this.scaleX || 1e-6;
var scaleY = this.scaleY || 1e-6;
var rotate = this.rotate || 0;
var newTransform = CGAffineTransformIdentity;
newTransform = CGAffineTransformTranslate(newTransform, this.translateX, this.translateY);
newTransform = CGAffineTransformRotate(newTransform, rotate * Math.PI / 180);
newTransform = CGAffineTransformScale(newTransform, scaleX, scaleY);
if (!CGAffineTransformEqualToTransform(this.nativeViewProtected.transform, newTransform)) {
var updateSuspended = this._isPresentationLayerUpdateSuspeneded();
if (!updateSuspended) {
CATransaction.begin();
}
this.nativeViewProtected.transform = newTransform;
this._hasTransfrom = this.nativeViewProtected && !CGAffineTransformEqualToTransform(this.nativeViewProtected.transform, CGAffineTransformIdentity);
if (!updateSuspended) {
CATransaction.commit();
}
}
};
View.prototype.updateOriginPoint = function (originX, originY) {
var newPoint = CGPointMake(originX, originY);
this.nativeViewProtected.layer.anchorPoint = newPoint;
if (this._cachedFrame) {
this._setNativeViewFrame(this.nativeViewProtected, this._cachedFrame);
}
};
View.prototype._suspendPresentationLayerUpdates = function () {
this._suspendCATransaction = true;
};
View.prototype._resumePresentationLayerUpdates = function () {
this._suspendCATransaction = false;
};
View.prototype._isPresentationLayerUpdateSuspeneded = function () {
return this._suspendCATransaction || this._suspendNativeUpdatesCount;
};
View.prototype._showNativeModalView = function (parent, options) {
var _this = this;
var parentWithController = ios.getParentWithViewController(parent);
if (!parentWithController) {
view_common_1.traceWrite("Could not find parent with viewController for " + parent + " while showing modal view.", view_common_1.traceCategories.ViewHierarchy, view_common_1.traceMessageType.error);
return;
}
var parentController = parentWithController.viewController;
if (parentController.presentedViewController) {
view_common_1.traceWrite("Parent is already presenting view controller. Close the current modal page before showing another one!", view_common_1.traceCategories.ViewHierarchy, view_common_1.traceMessageType.error);
return;
}
if (!parentController.view || !parentController.view.window) {
view_common_1.traceWrite("Parent page is not part of the window hierarchy.", view_common_1.traceCategories.ViewHierarchy, view_common_1.traceMessageType.error);
return;
}
this._setupAsRootView({});
_super.prototype._showNativeModalView.call(this, parentWithController, options);
var controller = this.viewController;
if (!controller) {
var nativeView = this.ios || this.nativeViewProtected;
controller = ios.UILayoutViewController.initWithOwner(new WeakRef(this));
if (nativeView instanceof UIView) {
controller.view.addSubview(nativeView);
}
this.viewController = controller;
}
if (options.fullscreen) {
controller.modalPresentationStyle = 0;
}
else {
controller.modalPresentationStyle = 2;
}
if (options.ios && options.ios.presentationStyle) {
var presentationStyle = options.ios.presentationStyle;
controller.modalPresentationStyle = presentationStyle;
if (presentationStyle === 7) {
var popoverPresentationController = controller.popoverPresentationController;
var view = parent.nativeViewProtected;
popoverPresentationController.sourceView = view;
popoverPresentationController.sourceRect = CGRectMake(0, 0, view.frame.size.width, view.frame.size.height);
}
}
this.horizontalAlignment = "stretch";
this.verticalAlignment = "stretch";
this._raiseShowingModallyEvent();
var animated = options.animated === undefined ? true : !!options.animated;
controller.animated = animated;
parentController.presentViewControllerAnimatedCompletion(controller, animated, null);
var transitionCoordinator = utils_1.ios.getter(parentController, parentController.transitionCoordinator);
if (transitionCoordinator) {
UIViewControllerTransitionCoordinator.prototype.animateAlongsideTransitionCompletion
.call(transitionCoordinator, null, function () { return _this._raiseShownModallyEvent(); });
}
else {
this._raiseShownModallyEvent();
}
};
View.prototype._hideNativeModalView = function (parent, whenClosedCallback) {
if (!parent || !parent.viewController) {
view_common_1.traceError("Trying to hide modal view but no parent with viewController specified.");
return;
}
var parentController = parent.viewController;
var animated = this.viewController.animated;
parentController.dismissViewControllerAnimatedCompletion(animated, whenClosedCallback);
};
View.prototype[view_common_1.isEnabledProperty.getDefault] = function () {
var nativeView = this.nativeViewProtected;
return nativeView instanceof UIControl ? nativeView.enabled : true;
};
View.prototype[view_common_1.isEnabledProperty.setNative] = function (value) {
var nativeView = this.nativeViewProtected;
if (nativeView instanceof UIControl) {
nativeView.enabled = value;
}
};
View.prototype[view_common_1.originXProperty.getDefault] = function () {
return this.nativeViewProtected.layer.anchorPoint.x;
};
View.prototype[view_common_1.originXProperty.setNative] = function (value) {
this.updateOriginPoint(value, this.originY);
};
View.prototype[view_common_1.originYProperty.getDefault] = function () {
return this.nativeViewProtected.layer.anchorPoint.y;
};
View.prototype[view_common_1.originYProperty.setNative] = function (value) {
this.updateOriginPoint(this.originX, value);
};
View.prototype[view_common_1.automationTextProperty.getDefault] = function () {
return this.nativeViewProtected.accessibilityLabel;
};
View.prototype[view_common_1.automationTextProperty.setNative] = function (value) {
this.nativeViewProtected.accessibilityIdentifier = value;
this.nativeViewProtected.accessibilityLabel = value;
};
View.prototype[view_common_1.isUserInteractionEnabledProperty.getDefault] = function () {
return this.nativeViewProtected.userInteractionEnabled;
};
View.prototype[view_common_1.isUserInteractionEnabledProperty.setNative] = function (value) {
this.nativeViewProtected.userInteractionEnabled = value;
};
View.prototype[style_properties_1.visibilityProperty.getDefault] = function () {
return this.nativeViewProtected.hidden ? style_properties_1.Visibility.COLLAPSE : style_properties_1.Visibility.VISIBLE;
};
View.prototype[style_properties_1.visibilityProperty.setNative] = function (value) {
switch (value) {
case style_properties_1.Visibility.VISIBLE:
this.nativeViewProtected.hidden = false;
break;
case style_properties_1.Visibility.HIDDEN:
case style_properties_1.Visibility.COLLAPSE:
this.nativeViewProtected.hidden = true;
break;
default:
throw new Error("Invalid visibility value: " + value + ". Valid values are: \"" + style_properties_1.Visibility.VISIBLE + "\", \"" + style_properties_1.Visibility.HIDDEN + "\", \"" + style_properties_1.Visibility.COLLAPSE + "\".");
}
};
View.prototype[style_properties_1.opacityProperty.getDefault] = function () {
return this.nativeViewProtected.alpha;
};
View.prototype[style_properties_1.opacityProperty.setNative] = function (value) {
var nativeView = this.nativeViewProtected;
var updateSuspended = this._isPresentationLayerUpdateSuspeneded();
if (!updateSuspended) {
CATransaction.begin();
}
nativeView.alpha = value;
if (!updateSuspended) {
CATransaction.commit();
}
};
View.prototype[style_properties_1.rotateProperty.getDefault] = function () {
return 0;
};
View.prototype[style_properties_1.rotateProperty.setNative] = function (value) {
this.updateNativeTransform();
};
View.prototype[style_properties_1.scaleXProperty.getDefault] = function () {
return 1;
};
View.prototype[style_properties_1.scaleXProperty.setNative] = function (value) {
this.updateNativeTransform();
};
View.prototype[style_properties_1.scaleYProperty.getDefault] = function () {
return 1;
};
View.prototype[style_properties_1.scaleYProperty.setNative] = function (value) {
this.updateNativeTransform();
};
View.prototype[style_properties_1.translateXProperty.getDefault] = function () {
return 0;
};
View.prototype[style_properties_1.translateXProperty.setNative] = function (value) {
this.updateNativeTransform();
};
View.prototype[style_properties_1.translateYProperty.getDefault] = function () {
return 0;
};
View.prototype[style_properties_1.translateYProperty.setNative] = function (value) {
this.updateNativeTransform();
};
View.prototype[style_properties_1.zIndexProperty.getDefault] = function () {
return 0;
};
View.prototype[style_properties_1.zIndexProperty.setNative] = function (value) {
this.nativeViewProtected.layer.zPosition = value;
};
View.prototype[style_properties_1.backgroundInternalProperty.getDefault] = function () {
return this.nativeViewProtected.backgroundColor;
};
View.prototype[style_properties_1.backgroundInternalProperty.setNative] = function (value) {
this._nativeBackgroundState = "invalid";
if (this.isLayoutValid) {
this._redrawNativeBackground(value);
}
};
View.prototype._getCurrentLayoutBounds = function () {
var nativeView = this.nativeViewProtected;
if (nativeView && !this.isCollapsed) {
var frame = nativeView.frame;
var origin_1 = frame.origin;
var size = frame.size;
return {
left: Math.round(view_common_1.layout.toDevicePixels(origin_1.x)),
top: Math.round(view_common_1.layout.toDevicePixels(origin_1.y)),
right: Math.round(view_common_1.layout.toDevicePixels(origin_1.x + size.width)),
bottom: Math.round(view_common_1.layout.toDevicePixels(origin_1.y + size.height))
};
}
else {
return { left: 0, top: 0, right: 0, bottom: 0 };
}
};
View.prototype._redrawNativeBackground = function (value) {
var _this = this;
var updateSuspended = this._isPresentationLayerUpdateSuspeneded();
if (!updateSuspended) {
CATransaction.begin();
}
if (value instanceof UIColor) {
this.nativeViewProtected.backgroundColor = value;
}
else {
background_1.ios.createBackgroundUIColor(this, function (color) {
_this.nativeViewProtected.backgroundColor = color;
});
this._setNativeClipToBounds();
}
if (!updateSuspended) {
CATransaction.commit();
}
this._nativeBackgroundState = "drawn";
};
View.prototype._setNativeClipToBounds = function () {
var backgroundInternal = this.style.backgroundInternal;
this.nativeViewProtected.clipsToBounds =
this.nativeViewProtected instanceof UIScrollView ||
backgroundInternal.hasBorderWidth() ||
backgroundInternal.hasBorderRadius();
};
__decorate([
profiling_1.profile
], View.prototype, "layout", null);
__decorate([
profiling_1.profile
], View.prototype, "onMeasure", null);
return View;
}(view_common_1.ViewCommon));
exports.View = View;
View.prototype._nativeBackgroundState = "unset";
var ContainerView = (function (_super) {
__extends(ContainerView, _super);
function ContainerView() {
var _this = _super.call(this) || this;
_this.iosOverflowSafeArea = true;
return _this;
}
return ContainerView;
}(View));
exports.ContainerView = ContainerView;
var CustomLayoutView = (function (_super) {
__extends(CustomLayoutView, _super);
function CustomLayoutView() {
return _super !== null && _super.apply(this, arguments) || this;
}
CustomLayoutView.prototype.createNativeView = function () {
return UIView.alloc().initWithFrame(utils_1.ios.getter(UIScreen, UIScreen.mainScreen).bounds);
};
Object.defineProperty(CustomLayoutView.prototype, "ios", {
get: function () {
return this.nativeViewProtected;
},
enumerable: true,
configurable: true
});
CustomLayoutView.prototype.onMeasure = function (widthMeasureSpec, heightMeasureSpec) {
};
CustomLayoutView.prototype._addViewToNativeVisualTree = function (child, atIndex) {
_super.prototype._addViewToNativeVisualTree.call(this, child, atIndex);
var parentNativeView = this.nativeViewProtected;
var childNativeView = child.nativeViewProtected;
if (parentNativeView && childNativeView) {
if (typeof atIndex !== "number" || atIndex >= parentNativeView.subviews.count) {
parentNativeView.addSubview(childNativeView);
}
else {
parentNativeView.insertSubviewAtIndex(childNativeView, atIndex);
}
return true;
}
return false;
};
CustomLayoutView.prototype._removeViewFromNativeVisualTree = function (child) {
_super.prototype._removeViewFromNativeVisualTree.call(this, child);
if (child.nativeViewProtected) {
child.nativeViewProtected.removeFromSuperview();
}
};
return CustomLayoutView;
}(ContainerView));
exports.CustomLayoutView = CustomLayoutView;
var ios;
(function (ios) {
function getParentWithViewController(view) {
while (view && !view.viewController) {
view = view.parent;
}
return view;
}
ios.getParentWithViewController = getParentWithViewController;
function updateAutoAdjustScrollInsets(controller, owner) {
if (majorVersion <= 10) {
owner._automaticallyAdjustsScrollViewInsets = false;
controller.automaticallyAdjustsScrollViewInsets = false;
}
}
ios.updateAutoAdjustScrollInsets = updateAutoAdjustScrollInsets;
function updateConstraints(controller, owner) {
if (majorVersion <= 10) {
var layoutGuide = initLayoutGuide(controller);
controller.view.safeAreaLayoutGuide = layoutGuide;
}
}
ios.updateConstraints = updateConstraints;
function initLayoutGuide(controller) {
var rootView = controller.view;
var layoutGuide = UILayoutGuide.alloc().init();
rootView.addLayoutGuide(layoutGuide);
NSLayoutConstraint.activateConstraints([
layoutGuide.topAnchor.constraintEqualToAnchor(controller.topLayoutGuide.bottomAnchor),
layoutGuide.bottomAnchor.constraintEqualToAnchor(controller.bottomLayoutGuide.topAnchor),
layoutGuide.leadingAnchor.constraintEqualToAnchor(rootView.leadingAnchor),
layoutGuide.trailingAnchor.constraintEqualToAnchor(rootView.trailingAnchor)
]);
return layoutGuide;
}
function layoutView(controller, owner) {
var layoutGuide = controller.view.safeAreaLayoutGuide;
if (!layoutGuide) {
view_common_1.traceWrite("safeAreaLayoutGuide during layout of " + owner + ". Creating fallback constraints, but layout might be wrong.", view_common_1.traceCategories.Layout, view_common_1.traceMessageType.error);
layoutGuide = initLayoutGuide(controller);
}
var safeArea = layoutGuide.layoutFrame;
var position = ios.getPositionFromFrame(safeArea);
var safeAreaSize = safeArea.size;
var hasChildViewControllers = controller.childViewControllers.count > 0;
if (hasChildViewControllers) {
var fullscreen = controller.view.frame;
position = ios.getPositionFromFrame(fullscreen);
}
var safeAreaWidth = view_common_1.layout.round(view_common_1.layout.toDevicePixels(safeAreaSize.width));
var safeAreaHeight = view_common_1.layout.round(view_common_1.layout.toDevicePixels(safeAreaSize.height));
var widthSpec = view_common_1.layout.makeMeasureSpec(safeAreaWidth, view_common_1.layout.EXACTLY);
var heightSpec = view_common_1.layout.makeMeasureSpec(safeAreaHeight, view_common_1.layout.EXACTLY);
View.measureChild(null, owner, widthSpec, heightSpec);
View.layoutChild(null, owner, position.left, position.top, position.right, position.bottom);
layoutParent(owner.parent);
}
ios.layoutView = layoutView;
function getPositionFromFrame(frame) {
var left = view_common_1.layout.round(view_common_1.layout.toDevicePixels(frame.origin.x));
var top = view_common_1.layout.round(view_common_1.layout.toDevicePixels(frame.origin.y));
var right = view_common_1.layout.round(view_common_1.layout.toDevicePixels(frame.origin.x + frame.size.width));
var bottom = view_common_1.layout.round(view_common_1.layout.toDevicePixels(frame.origin.y + frame.size.height));
return { left: left, right: right, top: top, bottom: bottom };
}
ios.getPositionFromFrame = getPositionFromFrame;
function getFrameFromPosition(position, insets) {
insets = insets || { left: 0, top: 0, right: 0, bottom: 0 };
var left = view_common_1.layout.toDeviceIndependentPixels(position.left + insets.left);
var top = view_common_1.layout.toDeviceIndependentPixels(position.top + insets.top);
var width = view_common_1.layout.toDeviceIndependentPixels(position.right - position.left - insets.left - insets.right);
var height = view_common_1.layout.toDeviceIndependentPixels(position.bottom - position.top - insets.top - insets.bottom);
return CGRectMake(left, top, width, height);
}
ios.getFrameFromPosition = getFrameFromPosition;
function shrinkToSafeArea(view, frame) {
var insets = view.getSafeAreaInsets();
if (insets.left || insets.top) {
var position = ios.getPositionFromFrame(frame);
var adjustedFrame = ios.getFrameFromPosition(position, insets);
if (view_common_1.traceEnabled()) {
view_common_1.traceWrite(this + " :shrinkToSafeArea: " + JSON.stringify(ios.getPositionFromFrame(adjustedFrame)), view_common_1.traceCategories.Layout);
}
return adjustedFrame;
}
return null;
}
ios.shrinkToSafeArea = shrinkToSafeArea;
function expandBeyondSafeArea(view, frame) {
var availableSpace = getAvailableSpaceFromParent(view, frame);
var safeArea = availableSpace.safeArea;
var fullscreen = availableSpace.fullscreen;
var inWindow = availableSpace.inWindow;
var position = ios.getPositionFromFrame(frame);
var safeAreaPosition = ios.getPositionFromFrame(safeArea);
var fullscreenPosition = ios.getPositionFromFrame(fullscreen);
var inWindowPosition = ios.getPositionFromFrame(inWindow);
var adjustedPosition = position;
if (position.left && inWindowPosition.left <= safeAreaPosition.left) {
adjustedPosition.left = fullscreenPosition.left;
}
if (position.top && inWindowPosition.top <= safeAreaPosition.top) {
adjustedPosition.top = fullscreenPosition.top;
}
if (inWindowPosition.right < fullscreenPosition.right && inWindowPosition.right >= safeAreaPosition.right + fullscreenPosition.left) {
adjustedPosition.right += fullscreenPosition.right - inWindowPosition.right;
}
if (inWindowPosition.bottom < fullscreenPosition.bottom && inWindowPosition.bottom >= safeAreaPosition.bottom + fullscreenPosition.top) {
adjustedPosition.bottom += fullscreenPosition.bottom - inWindowPosition.bottom;
}
var adjustedFrame = CGRectMake(view_common_1.layout.toDeviceIndependentPixels(adjustedPosition.left), view_common_1.layout.toDeviceIndependentPixels(adjustedPosition.top), view_common_1.layout.toDeviceIndependentPixels(adjustedPosition.right - adjustedPosition.left), view_common_1.layout.toDeviceIndependentPixels(adjustedPosition.bottom - adjustedPosition.top));
if (view_common_1.traceEnabled()) {
view_common_1.traceWrite(view + " :expandBeyondSafeArea: " + JSON.stringify(ios.getPositionFromFrame(adjustedFrame)), view_common_1.traceCategories.Layout);
}
return adjustedFrame;
}
ios.expandBeyondSafeArea = expandBeyondSafeArea;
function layoutParent(view) {
if (!view) {
return;
}
if (view instanceof View && view.nativeViewProtected) {
var frame = view.nativeViewProtected.frame;
var origin_2 = frame.origin;
var size = frame.size;
var left = view_common_1.layout.toDevicePixels(origin_2.x);
var top_1 = view_common_1.layout.toDevicePixels(origin_2.y);
var width = view_common_1.layout.toDevicePixels(size.width);
var height = view_common_1.layout.toDevicePixels(size.height);
view._setLayoutFlags(left, top_1, width + left, height + top_1);
}
layoutParent(view.parent);
}
function getAvailableSpaceFromParent(view, frame) {
if (!view) {
return;
}
var scrollView = null;
var viewControllerView = null;
if (view.viewController) {
viewControllerView = view.viewController.view;
}
else {
var parent_1 = view.parent;
while (parent_1 && !parent_1.viewController && !(parent_1.nativeViewProtected instanceof UIScrollView)) {
parent_1 = parent_1.parent;
}
if (parent_1.nativeViewProtected instanceof UIScrollView) {
scrollView = parent_1.nativeViewProtected;
}
else if (parent_1.viewController) {
viewControllerView = parent_1.viewController.view;
}
}
var fullscreen = null;
var safeArea = null;
if (viewControllerView) {
safeArea = viewControllerView.safeAreaLayoutGuide.layoutFrame;
fullscreen = viewControllerView.frame;
}
else if (scrollView) {
var insets = scrollView.safeAreaInsets;
safeArea = CGRectMake(insets.left, insets.top, scrollView.contentSize.width - insets.left - insets.right, scrollView.contentSize.height - insets.top - insets.bottom);
fullscreen = CGRectMake(0, 0, scrollView.contentSize.width, scrollView.contentSize.height);
}
var locationInWindow = view.getLocationInWindow();
var inWindowLeft = locationInWindow.x;
var inWindowTop = locationInWindow.y;
if (scrollView) {
inWindowLeft += scrollView.contentOffset.x;
inWindowTop += scrollView.contentOffset.y;
}
var inWindow = CGRectMake(inWindowLeft, inWindowTop, frame.size.width, frame.size.height);
return { safeArea: safeArea, fullscreen: fullscreen, inWindow: inWindow };
}
var UILayoutViewController = (function (_super) {
__extends(UILayoutViewController, _super);
function UILayoutViewController() {
return _super !== null && _super.apply(this, arguments) || this;
}
UILayoutViewController.initWithOwner = function (owner) {
var controller = UILayoutViewController.new();
controller.owner = owner;
return controller;
};
UILayoutViewController.prototype.viewWillLayoutSubviews = function () {
_super.prototype.viewWillLayoutSubviews.call(this);
var owner = this.owner.get();
if (owner) {
updateConstraints(this, owner);
}
};
UILayoutViewController.prototype.viewDidLayoutSubviews = function () {
_super.prototype.viewDidLayoutSubviews.call(this);
var owner = this.owner.get();
if (owner) {
if (majorVersion >= 11) {
var tabViewItem = owner.parent;
var tabView = tabViewItem && tabViewItem.parent;
var parent_2 = tabView && tabView.parent;
while (parent_2 && !parent_2.nativeViewProtected) {
parent_2 = parent_2.parent;
}
if (parent_2) {
var parentPageInsetsTop = parent_2.nativeViewProtected.safeAreaInsets.top;
var currentInsetsTop = this.view.safeAreaInsets.top;
var additionalInsetsTop = Math.max(parentPageInsetsTop - currentInsetsTop, 0);
var parentPageInsetsBottom = parent_2.nativeViewProtected.safeAreaInsets.bottom;
var currentInsetsBottom = this.view.safeAreaInsets.bottom;
var additionalInsetsBottom = Math.max(parentPageInsetsBottom - currentInsetsBottom, 0);
if (additionalInsetsTop > 0 || additionalInsetsBottom > 0) {
var additionalInsets = new UIEdgeInsets({ top: additionalInsetsTop, left: 0, bottom: additionalInsetsBottom, right: 0 });
this.additionalSafeAreaInsets = additionalInsets;
}
}
}
layoutView(this, owner);
}
};
UILayoutViewController.prototype.viewWillAppear = function (animated) {
_super.prototype.viewWillAppear.call(this, animated);
var owner = this.owner.get();
if (!owner) {
return;
}
this.extendedLayoutIncludesOpaqueBars = true;
updateAutoAdjustScrollInsets(this, owner);
if (!owner.parent) {
owner.callLoaded();
}
};
UILayoutViewController.prototype.viewDidDisappear = function (animated) {
_super.prototype.viewDidDisappear.call(this, animated);
var owner = this.owner.get();
if (owner && !owner.parent) {
owner.callUnloaded();
}
};
return UILayoutViewController;
}(UIViewController));
ios.UILayoutViewController = UILayoutViewController;
})(ios = exports.ios || (exports.ios = {}));
//# sourceMappingURL=view.ios.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/ui/core/weak-event-listener/weak-event-listener.js":
/***/ (function(module, exports) {
Object.defineProperty(exports, "__esModule", { value: true });
var handlersForEventName = new Map();
var sourcesMap = new WeakMap();
var TargetHandlerPair = (function () {
function TargetHandlerPair(target, handler) {
this.tagetRef = new WeakRef(target);
this.handler = handler;
}
return TargetHandlerPair;
}());
function getHandlerForEventName(eventName) {
var handler = handlersForEventName.get(eventName);
if (!handler) {
handler = function (eventData) {
var source = eventData.object;
var sourceEventMap = sourcesMap.get(source);
if (!sourceEventMap) {
source.removeEventListener(eventName, handlersForEventName.get(eventName));
return;
}
var targetHandlerPairList = sourceEventMap.get(eventName);
if (!targetHandlerPairList) {
return;
}
var deadPairsIndexes = [];
for (var i = 0; i < targetHandlerPairList.length; i++) {
var pair = targetHandlerPairList[i];
var target = pair.tagetRef.get();
if (target) {
pair.handler.call(target, eventData);
}
else {
deadPairsIndexes.push(i);
}
}
if (deadPairsIndexes.length === targetHandlerPairList.length) {
source.removeEventListener(eventName, handlersForEventName.get(eventName));
sourceEventMap.delete(eventName);
}
else {
for (var j = deadPairsIndexes.length - 1; j >= 0; j--) {
targetHandlerPairList.splice(deadPairsIndexes[j], 1);
}
}
};
handlersForEventName.set(eventName, handler);
}
return handler;
}
function validateArgs(source, eventName, handler, target) {
if (!source) {
throw new Error("source is null or undefined");
}
if (!target) {
throw new Error("target is null or undefined");
}
if (typeof eventName !== "string") {
throw new Error("eventName is not a string");
}
if (typeof handler !== "function") {
throw new Error("handler is not a function");
}
}
function addWeakEventListener(source, eventName, handler, target) {
validateArgs(source, eventName, handler, target);
var shouldAttach = false;
var sourceEventMap = sourcesMap.get(source);
if (!sourceEventMap) {
sourceEventMap = new Map();
sourcesMap.set(source, sourceEventMap);
shouldAttach = true;
}
var pairList = sourceEventMap.get(eventName);
if (!pairList) {
pairList = new Array();
sourceEventMap.set(eventName, pairList);
shouldAttach = true;
}
pairList.push(new TargetHandlerPair(target, handler));
if (shouldAttach) {
source.addEventListener(eventName, getHandlerForEventName(eventName));
}
}
exports.addWeakEventListener = addWeakEventListener;
function removeWeakEventListener(source, eventName, handler, target) {
validateArgs(source, eventName, handler, target);
var handlerForEventWithName = handlersForEventName.get(eventName);
if (!handlerForEventWithName) {
return;
}
var sourceEventMap = sourcesMap.get(source);
if (!sourceEventMap) {
return;
}
var targetHandlerPairList = sourceEventMap.get(eventName);
if (!targetHandlerPairList) {
return;
}
var targetHandlerPairsToRemove = [];
for (var i = 0; i < targetHandlerPairList.length; i++) {
var pair = targetHandlerPairList[i];
var registeredTarget = pair.tagetRef.get();
if (!registeredTarget || (registeredTarget === target && handler === pair.handler)) {
targetHandlerPairsToRemove.push(i);
}
}
if (targetHandlerPairsToRemove.length === targetHandlerPairList.length) {
source.removeEventListener(eventName, handlerForEventWithName);
sourceEventMap.delete(eventName);
}
else {
for (var j = targetHandlerPairsToRemove.length - 1; j >= 0; j--) {
targetHandlerPairList.splice(targetHandlerPairsToRemove[j], 1);
}
}
}
exports.removeWeakEventListener = removeWeakEventListener;
//# sourceMappingURL=weak-event-listener.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/ui/date-picker/date-picker-common.js":
/***/ (function(module, exports, __webpack_require__) {
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
Object.defineProperty(exports, "__esModule", { value: true });
var view_1 = __webpack_require__("../node_modules/tns-core-modules/ui/core/view/view.js");
__export(__webpack_require__("../node_modules/tns-core-modules/ui/core/view/view.js"));
var defaultDate = new Date();
var dateComparer = function (x, y) { return (x <= y && x >= y); };
var DatePickerBase = (function (_super) {
__extends(DatePickerBase, _super);
function DatePickerBase() {
return _super !== null && _super.apply(this, arguments) || this;
}
DatePickerBase = __decorate([
view_1.CSSType("DatePicker")
], DatePickerBase);
return DatePickerBase;
}(view_1.View));
exports.DatePickerBase = DatePickerBase;
DatePickerBase.prototype.recycleNativeView = "auto";
exports.yearProperty = new view_1.Property({
name: "year",
defaultValue: defaultDate.getFullYear(),
valueConverter: function (v) { return parseInt(v); },
});
exports.yearProperty.register(DatePickerBase);
exports.monthProperty = new view_1.Property({
name: "month",
defaultValue: defaultDate.getMonth() + 1,
valueConverter: function (v) { return parseInt(v); },
});
exports.monthProperty.register(DatePickerBase);
exports.dayProperty = new view_1.Property({
name: "day",
defaultValue: defaultDate.getDate(),
valueConverter: function (v) { return parseInt(v); },
});
exports.dayProperty.register(DatePickerBase);
exports.maxDateProperty = new view_1.Property({
name: "maxDate",
equalityComparer: dateComparer,
valueConverter: function (v) { return new Date(v); },
});
exports.maxDateProperty.register(DatePickerBase);
exports.minDateProperty = new view_1.Property({
name: "minDate",
equalityComparer: dateComparer,
valueConverter: function (v) { return new Date(v); },
});
exports.minDateProperty.register(DatePickerBase);
exports.dateProperty = new view_1.Property({
name: "date",
defaultValue: defaultDate,
equalityComparer: dateComparer,
valueConverter: function (v) { return new Date(v); },
});
exports.dateProperty.register(DatePickerBase);
//# sourceMappingURL=date-picker-common.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/ui/date-picker/date-picker.js":
/***/ (function(module, exports, __webpack_require__) {
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
Object.defineProperty(exports, "__esModule", { value: true });
var date_picker_common_1 = __webpack_require__("../node_modules/tns-core-modules/ui/date-picker/date-picker-common.js");
var utils_1 = __webpack_require__("../node_modules/tns-core-modules/utils/utils.js");
__export(__webpack_require__("../node_modules/tns-core-modules/ui/date-picker/date-picker-common.js"));
var DatePicker = (function (_super) {
__extends(DatePicker, _super);
function DatePicker() {
return _super !== null && _super.apply(this, arguments) || this;
}
DatePicker.prototype.createNativeView = function () {
var picker = UIDatePicker.new();
picker.datePickerMode = 1;
return picker;
};
DatePicker.prototype.initNativeView = function () {
_super.prototype.initNativeView.call(this);
var nativeView = this.nativeViewProtected;
this._changeHandler = UIDatePickerChangeHandlerImpl.initWithOwner(new WeakRef(this));
nativeView.addTargetActionForControlEvents(this._changeHandler, "valueChanged", 4096);
};
DatePicker.prototype.disposeNativeView = function () {
this._changeHandler = null;
_super.prototype.disposeNativeView.call(this);
};
Object.defineProperty(DatePicker.prototype, "ios", {
get: function () {
return this.nativeViewProtected;
},
enumerable: true,
configurable: true
});
DatePicker.prototype[date_picker_common_1.yearProperty.setNative] = function (value) {
this.date = new Date(value, this.month - 1, this.day);
};
DatePicker.prototype[date_picker_common_1.monthProperty.setNative] = function (value) {
this.date = new Date(this.year, value - 1, this.day);
};
DatePicker.prototype[date_picker_common_1.dayProperty.setNative] = function (value) {
this.date = new Date(this.year, this.month - 1, value);
};
DatePicker.prototype[date_picker_common_1.dateProperty.setNative] = function (value) {
var picker = this.nativeViewProtected;
var comps = utils_1.ios.getter(NSCalendar, NSCalendar.currentCalendar).componentsFromDate(4 | 8 | 16, picker.date);
comps.year = value.getFullYear();
comps.month = value.getMonth() + 1;
comps.day = value.getDate();
picker.setDateAnimated(utils_1.ios.getter(NSCalendar, NSCalendar.currentCalendar).dateFromComponents(comps), false);
};
DatePicker.prototype[date_picker_common_1.maxDateProperty.getDefault] = function () {
return this.nativeViewProtected.maximumDate;
};
DatePicker.prototype[date_picker_common_1.maxDateProperty.setNative] = function (value) {
var picker = this.nativeViewProtected;
var nsDate = NSDate.dateWithTimeIntervalSince1970(value.getTime() / 1000);
picker.maximumDate = nsDate;
};
DatePicker.prototype[date_picker_common_1.minDateProperty.getDefault] = function () {
return this.nativeViewProtected.minimumDate;
};
DatePicker.prototype[date_picker_common_1.minDateProperty.setNative] = function (value) {
var picker = this.nativeViewProtected;
var nsDate = NSDate.dateWithTimeIntervalSince1970(value.getTime() / 1000);
picker.minimumDate = nsDate;
};
DatePicker.prototype[date_picker_common_1.colorProperty.getDefault] = function () {
return this.nativeViewProtected.valueForKey("textColor");
};
DatePicker.prototype[date_picker_common_1.colorProperty.setNative] = function (value) {
var picker = this.nativeViewProtected;
picker.setValueForKey(value instanceof date_picker_common_1.Color ? value.ios : value, "textColor");
};
return DatePicker;
}(date_picker_common_1.DatePickerBase));
exports.DatePicker = DatePicker;
var UIDatePickerChangeHandlerImpl = (function (_super) {
__extends(UIDatePickerChangeHandlerImpl, _super);
function UIDatePickerChangeHandlerImpl() {
return _super !== null && _super.apply(this, arguments) || this;
}
UIDatePickerChangeHandlerImpl.initWithOwner = function (owner) {
var impl = UIDatePickerChangeHandlerImpl.new();
impl._owner = owner;
return impl;
};
UIDatePickerChangeHandlerImpl.prototype.valueChanged = function (sender) {
var comps = utils_1.ios.getter(NSCalendar, NSCalendar.currentCalendar).componentsFromDate(4 | 8 | 16, sender.date);
var owner = this._owner.get();
if (!owner) {
return;
}
var dateChanged = false;
if (comps.year !== owner.year) {
date_picker_common_1.yearProperty.nativeValueChange(owner, comps.year);
dateChanged = true;
}
if (comps.month !== owner.month) {
date_picker_common_1.monthProperty.nativeValueChange(owner, comps.month);
dateChanged = true;
}
if (comps.day !== owner.day) {
date_picker_common_1.dayProperty.nativeValueChange(owner, comps.day);
dateChanged = true;
}
if (dateChanged) {
date_picker_common_1.dateProperty.nativeValueChange(owner, new Date(comps.year, comps.month - 1, comps.day));
}
};
UIDatePickerChangeHandlerImpl.ObjCExposedMethods = {
"valueChanged": { returns: interop.types.void, params: [UIDatePicker] }
};
return UIDatePickerChangeHandlerImpl;
}(NSObject));
//# sourceMappingURL=date-picker.ios.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/ui/dialogs/dialogs-common.js":
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", { value: true });
var platform_1 = __webpack_require__("../node_modules/tns-core-modules/platform/platform.js");
var types_1 = __webpack_require__("../node_modules/tns-core-modules/utils/types.js");
exports.STRING = "string";
exports.PROMPT = "Prompt";
exports.CONFIRM = "Confirm";
exports.ALERT = "Alert";
exports.LOGIN = "Login";
exports.OK = "OK";
exports.CANCEL = "Cancel";
var inputType;
(function (inputType) {
inputType.text = "text";
inputType.password = "password";
inputType.email = "email";
inputType.number = "number";
inputType.decimal = "decimal";
inputType.phone = "phone";
})(inputType = exports.inputType || (exports.inputType = {}));
var capitalizationType;
(function (capitalizationType) {
capitalizationType.none = "none";
capitalizationType.all = "all";
capitalizationType.sentences = "sentences";
capitalizationType.words = "words";
})(capitalizationType = exports.capitalizationType || (exports.capitalizationType = {}));
var frame;
function getCurrentPage() {
if (!frame) {
frame = __webpack_require__("../node_modules/tns-core-modules/ui/frame/frame.js");
}
var topmostFrame = frame.topmost();
if (topmostFrame) {
return topmostFrame.currentPage;
}
return undefined;
}
exports.getCurrentPage = getCurrentPage;
function applySelectors(view, callback) {
var currentPage = getCurrentPage();
if (currentPage) {
var styleScope = currentPage._styleScope;
if (styleScope) {
view._inheritStyleScope(styleScope);
view.onLoaded();
callback(view);
view.onUnloaded();
}
}
}
var button;
var label;
var textField;
function getButtonColors() {
if (!button) {
var Button = __webpack_require__("../node_modules/tns-core-modules/ui/button/button.js").Button;
button = new Button;
if (platform_1.isIOS) {
button._setupUI({});
}
}
var buttonColor;
var buttonBackgroundColor;
applySelectors(button, function (btn) {
buttonColor = btn.color;
buttonBackgroundColor = btn.backgroundColor;
});
return { color: buttonColor, backgroundColor: buttonBackgroundColor };
}
exports.getButtonColors = getButtonColors;
function getLabelColor() {
if (!label) {
var Label = __webpack_require__("../node_modules/tns-core-modules/ui/label/label.js").Label;
label = new Label;
if (platform_1.isIOS) {
label._setupUI({});
}
}
var labelColor;
applySelectors(label, function (lbl) {
labelColor = lbl.color;
});
return labelColor;
}
exports.getLabelColor = getLabelColor;
function getTextFieldColor() {
if (!textField) {
var TextField = __webpack_require__("../node_modules/tns-core-modules/ui/text-field/text-field.js").TextField;
textField = new TextField();
if (platform_1.isIOS) {
textField._setupUI({});
}
}
var textFieldColor;
applySelectors(textField, function (tf) {
textFieldColor = tf.color;
});
return textFieldColor;
}
exports.getTextFieldColor = getTextFieldColor;
function isDialogOptions(arg) {
return arg && (arg.message || arg.title);
}
exports.isDialogOptions = isDialogOptions;
function parseLoginOptions(args) {
if (args.length === 1 && types_1.isObject(args[0])) {
return args[0];
}
var options = { title: exports.LOGIN, okButtonText: exports.OK, cancelButtonText: exports.CANCEL };
if (types_1.isString(args[0])) {
options.message = args[0];
}
if (types_1.isString(args[1])) {
options.userNameHint = args[1];
}
if (types_1.isString(args[2])) {
options.passwordHint = args[2];
}
if (types_1.isString(args[3])) {
options.userName = args[3];
}
if (types_1.isString(args[4])) {
options.password = args[4];
}
return options;
}
exports.parseLoginOptions = parseLoginOptions;
//# sourceMappingURL=dialogs-common.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/ui/dialogs/dialogs.js":
/***/ (function(module, exports, __webpack_require__) {
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
Object.defineProperty(exports, "__esModule", { value: true });
var view_1 = __webpack_require__("../node_modules/tns-core-modules/ui/core/view/view.js");
var dialogs_common_1 = __webpack_require__("../node_modules/tns-core-modules/ui/dialogs/dialogs-common.js");
var types_1 = __webpack_require__("../node_modules/tns-core-modules/utils/types.js");
var application_1 = __webpack_require__("../node_modules/tns-core-modules/application/application.js");
__export(__webpack_require__("../node_modules/tns-core-modules/ui/dialogs/dialogs-common.js"));
function addButtonsToAlertController(alertController, options, callback) {
if (!options) {
return;
}
if (types_1.isString(options.cancelButtonText)) {
alertController.addAction(UIAlertAction.actionWithTitleStyleHandler(options.cancelButtonText, 0, function () {
raiseCallback(callback, false);
}));
}
if (types_1.isString(options.neutralButtonText)) {
alertController.addAction(UIAlertAction.actionWithTitleStyleHandler(options.neutralButtonText, 0, function () {
raiseCallback(callback, undefined);
}));
}
if (types_1.isString(options.okButtonText)) {
alertController.addAction(UIAlertAction.actionWithTitleStyleHandler(options.okButtonText, 0, function () {
raiseCallback(callback, true);
}));
}
}
function raiseCallback(callback, result) {
if (types_1.isFunction(callback)) {
callback(result);
}
}
function alert(arg) {
return new Promise(function (resolve, reject) {
try {
var options = !dialogs_common_1.isDialogOptions(arg) ? { title: dialogs_common_1.ALERT, okButtonText: dialogs_common_1.OK, message: arg + "" } : arg;
var alertController = UIAlertController.alertControllerWithTitleMessagePreferredStyle(options.title, options.message, 1);
addButtonsToAlertController(alertController, options, function () { resolve(); });
showUIAlertController(alertController);
}
catch (ex) {
reject(ex);
}
});
}
exports.alert = alert;
function confirm(arg) {
return new Promise(function (resolve, reject) {
try {
var options = !dialogs_common_1.isDialogOptions(arg) ? { title: dialogs_common_1.CONFIRM, okButtonText: dialogs_common_1.OK, cancelButtonText: dialogs_common_1.CANCEL, message: arg + "" } : arg;
var alertController = UIAlertController.alertControllerWithTitleMessagePreferredStyle(options.title, options.message, 1);
addButtonsToAlertController(alertController, options, function (r) { resolve(r); });
showUIAlertController(alertController);
}
catch (ex) {
reject(ex);
}
});
}
exports.confirm = confirm;
function prompt(arg) {
var options;
var defaultOptions = {
title: dialogs_common_1.PROMPT,
okButtonText: dialogs_common_1.OK,
cancelButtonText: dialogs_common_1.CANCEL,
inputType: dialogs_common_1.inputType.text,
};
if (arguments.length === 1) {
if (types_1.isString(arg)) {
options = defaultOptions;
options.message = arg;
}
else {
options = arg;
}
}
else if (arguments.length === 2) {
if (types_1.isString(arguments[0]) && types_1.isString(arguments[1])) {
options = defaultOptions;
options.message = arguments[0];
options.defaultText = arguments[1];
}
}
return new Promise(function (resolve, reject) {
try {
var textField_1;
var alertController = UIAlertController.alertControllerWithTitleMessagePreferredStyle(options.title, options.message, 1);
alertController.addTextFieldWithConfigurationHandler(function (arg) {
arg.text = types_1.isString(options.defaultText) ? options.defaultText : "";
arg.secureTextEntry = options && options.inputType === dialogs_common_1.inputType.password;
if (options && options.inputType === dialogs_common_1.inputType.email) {
arg.keyboardType = 7;
}
else if (options && options.inputType === dialogs_common_1.inputType.number) {
arg.keyboardType = 4;
}
else if (options && options.inputType === dialogs_common_1.inputType.decimal) {
arg.keyboardType = 8;
}
else if (options && options.inputType === dialogs_common_1.inputType.phone) {
arg.keyboardType = 5;
}
var color = dialogs_common_1.getTextFieldColor();
if (color) {
arg.textColor = arg.tintColor = color.ios;
}
});
textField_1 = alertController.textFields.firstObject;
if (options) {
switch (options.capitalizationType) {
case dialogs_common_1.capitalizationType.all: {
textField_1.autocapitalizationType = 3;
break;
}
case dialogs_common_1.capitalizationType.sentences: {
textField_1.autocapitalizationType = 2;
break;
}
case dialogs_common_1.capitalizationType.words: {
textField_1.autocapitalizationType = 1;
break;
}
default: {
textField_1.autocapitalizationType = 0;
}
}
}
addButtonsToAlertController(alertController, options, function (r) { resolve({ result: r, text: textField_1.text }); });
showUIAlertController(alertController);
}
catch (ex) {
reject(ex);
}
});
}
exports.prompt = prompt;
function login() {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
var options = dialogs_common_1.parseLoginOptions(args);
return new Promise(function (resolve, reject) {
try {
var userNameTextField_1;
var passwordTextField_1;
var alertController = UIAlertController.alertControllerWithTitleMessagePreferredStyle(options.title, options.message, 1);
var textFieldColor_1 = dialogs_common_1.getTextFieldColor();
alertController.addTextFieldWithConfigurationHandler(function (arg) {
arg.placeholder = "Login";
arg.placeholder = options.userNameHint ? options.userNameHint : "";
arg.text = types_1.isString(options.userName) ? options.userName : "";
if (textFieldColor_1) {
arg.textColor = arg.tintColor = textFieldColor_1.ios;
}
});
alertController.addTextFieldWithConfigurationHandler(function (arg) {
arg.placeholder = "Password";
arg.secureTextEntry = true;
arg.placeholder = options.passwordHint ? options.passwordHint : "";
arg.text = types_1.isString(options.password) ? options.password : "";
if (textFieldColor_1) {
arg.textColor = arg.tintColor = textFieldColor_1.ios;
}
});
userNameTextField_1 = alertController.textFields.firstObject;
passwordTextField_1 = alertController.textFields.lastObject;
addButtonsToAlertController(alertController, options, function (r) {
resolve({
result: r,
userName: userNameTextField_1.text,
password: passwordTextField_1.text
});
});
showUIAlertController(alertController);
}
catch (ex) {
reject(ex);
}
});
}
exports.login = login;
function showUIAlertController(alertController) {
var _a, _b;
var currentView = dialogs_common_1.getCurrentPage() || application_1.getRootView();
if (currentView) {
currentView = currentView.modal || currentView;
var viewController = currentView.ios;
if (!(currentView.ios instanceof UIViewController)) {
var parentWithController = view_1.ios.getParentWithViewController(currentView);
viewController = parentWithController ? parentWithController.viewController : undefined;
}
if (viewController) {
if (alertController.popoverPresentationController) {
alertController.popoverPresentationController.sourceView = viewController.view;
alertController.popoverPresentationController.sourceRect = CGRectMake(viewController.view.bounds.size.width / 2.0, viewController.view.bounds.size.height / 2.0, 1.0, 1.0);
alertController.popoverPresentationController.permittedArrowDirections = 0;
}
var color = dialogs_common_1.getButtonColors().color;
if (color) {
alertController.view.tintColor = color.ios;
}
var lblColor = dialogs_common_1.getLabelColor();
if (lblColor) {
if (alertController.title) {
var title = NSAttributedString.alloc().initWithStringAttributes(alertController.title, (_a = {}, _a[NSForegroundColorAttributeName] = lblColor.ios, _a));
alertController.setValueForKey(title, "attributedTitle");
}
if (alertController.message) {
var message = NSAttributedString.alloc().initWithStringAttributes(alertController.message, (_b = {}, _b[NSForegroundColorAttributeName] = lblColor.ios, _b));
alertController.setValueForKey(message, "attributedMessage");
}
}
viewController.presentModalViewControllerAnimated(alertController, true);
}
}
}
function action() {
var options;
var defaultOptions = { title: null, cancelButtonText: dialogs_common_1.CANCEL };
if (arguments.length === 1) {
if (types_1.isString(arguments[0])) {
options = defaultOptions;
options.message = arguments[0];
}
else {
options = arguments[0];
}
}
else if (arguments.length === 2) {
if (types_1.isString(arguments[0]) && types_1.isString(arguments[1])) {
options = defaultOptions;
options.message = arguments[0];
options.cancelButtonText = arguments[1];
}
}
else if (arguments.length === 3) {
if (types_1.isString(arguments[0]) && types_1.isString(arguments[1]) && types_1.isDefined(arguments[2])) {
options = defaultOptions;
options.message = arguments[0];
options.cancelButtonText = arguments[1];
options.actions = arguments[2];
}
}
return new Promise(function (resolve, reject) {
try {
var i = void 0;
var action_1;
var alertController = UIAlertController.alertControllerWithTitleMessagePreferredStyle(options.title, options.message, 0);
if (options.actions) {
for (i = 0; i < options.actions.length; i++) {
action_1 = options.actions[i];
if (types_1.isString(action_1)) {
alertController.addAction(UIAlertAction.actionWithTitleStyleHandler(action_1, 0, function (arg) {
resolve(arg.title);
}));
}
}
}
if (types_1.isString(options.cancelButtonText)) {
alertController.addAction(UIAlertAction.actionWithTitleStyleHandler(options.cancelButtonText, 1, function (arg) {
resolve(arg.title);
}));
}
showUIAlertController(alertController);
}
catch (ex) {
reject(ex);
}
});
}
exports.action = action;
//# sourceMappingURL=dialogs.ios.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/ui/editable-text-base/editable-text-base-common.js":
/***/ (function(module, exports, __webpack_require__) {
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
Object.defineProperty(exports, "__esModule", { value: true });
var text_base_1 = __webpack_require__("../node_modules/tns-core-modules/ui/text-base/text-base.js");
__export(__webpack_require__("../node_modules/tns-core-modules/ui/text-base/text-base.js"));
var EditableTextBase = (function (_super) {
__extends(EditableTextBase, _super);
function EditableTextBase() {
return _super !== null && _super.apply(this, arguments) || this;
}
EditableTextBase.blurEvent = "blur";
EditableTextBase.focusEvent = "focus";
return EditableTextBase;
}(text_base_1.TextBase));
exports.EditableTextBase = EditableTextBase;
exports.placeholderColorProperty = new text_base_1.CssProperty({ name: "placeholderColor", cssName: "placeholder-color", equalityComparer: text_base_1.Color.equals, valueConverter: function (v) { return new text_base_1.Color(v); } });
exports.placeholderColorProperty.register(text_base_1.Style);
var keyboardTypeConverter = text_base_1.makeParser(text_base_1.makeValidator("datetime", "phone", "number", "url", "email"));
exports.keyboardTypeProperty = new text_base_1.Property({ name: "keyboardType", valueConverter: keyboardTypeConverter });
exports.keyboardTypeProperty.register(EditableTextBase);
var returnKeyTypeConverter = text_base_1.makeParser(text_base_1.makeValidator("done", "next", "go", "search", "send"));
exports.returnKeyTypeProperty = new text_base_1.Property({ name: "returnKeyType", valueConverter: returnKeyTypeConverter });
exports.returnKeyTypeProperty.register(EditableTextBase);
exports.editableProperty = new text_base_1.Property({ name: "editable", defaultValue: true, valueConverter: text_base_1.booleanConverter });
exports.editableProperty.register(EditableTextBase);
exports.updateTextTriggerProperty = new text_base_1.Property({ name: "updateTextTrigger", defaultValue: "textChanged" });
exports.updateTextTriggerProperty.register(EditableTextBase);
var autocapitalizationTypeConverter = text_base_1.makeParser(text_base_1.makeValidator("none", "words", "sentences", "allcharacters"));
exports.autocapitalizationTypeProperty = new text_base_1.Property({ name: "autocapitalizationType", defaultValue: "sentences", valueConverter: autocapitalizationTypeConverter });
exports.autocapitalizationTypeProperty.register(EditableTextBase);
exports.autocorrectProperty = new text_base_1.Property({ name: "autocorrect", valueConverter: text_base_1.booleanConverter });
exports.autocorrectProperty.register(EditableTextBase);
exports.hintProperty = new text_base_1.Property({ name: "hint", defaultValue: "" });
exports.hintProperty.register(EditableTextBase);
exports.maxLengthProperty = new text_base_1.Property({ name: "maxLength", defaultValue: Number.POSITIVE_INFINITY, valueConverter: parseInt });
exports.maxLengthProperty.register(EditableTextBase);
//# sourceMappingURL=editable-text-base-common.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/ui/editable-text-base/editable-text-base.js":
/***/ (function(module, exports, __webpack_require__) {
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
Object.defineProperty(exports, "__esModule", { value: true });
var editable_text_base_common_1 = __webpack_require__("../node_modules/tns-core-modules/ui/editable-text-base/editable-text-base-common.js");
__export(__webpack_require__("../node_modules/tns-core-modules/ui/editable-text-base/editable-text-base-common.js"));
var EditableTextBase = (function (_super) {
__extends(EditableTextBase, _super);
function EditableTextBase() {
return _super !== null && _super.apply(this, arguments) || this;
}
EditableTextBase.prototype.dismissSoftInput = function () {
this.nativeTextViewProtected.resignFirstResponder();
this.notify({ eventName: EditableTextBase.blurEvent, object: this });
};
EditableTextBase.prototype[editable_text_base_common_1.keyboardTypeProperty.getDefault] = function () {
var keyboardType = this.nativeTextViewProtected.keyboardType;
switch (keyboardType) {
case 2:
return "number";
case 5:
return "phone";
case 3:
return "url";
case 7:
return "email";
default:
return keyboardType.toString();
}
};
EditableTextBase.prototype[editable_text_base_common_1.keyboardTypeProperty.setNative] = function (value) {
var newKeyboardType;
switch (value) {
case "datetime":
newKeyboardType = 2;
break;
case "phone":
newKeyboardType = 5;
break;
case "number":
newKeyboardType = 2;
break;
case "url":
newKeyboardType = 3;
break;
case "email":
newKeyboardType = 7;
break;
default:
var kt = +value;
if (!isNaN(kt)) {
newKeyboardType = kt;
}
else {
newKeyboardType = 0;
}
break;
}
this.nativeTextViewProtected.keyboardType = newKeyboardType;
};
EditableTextBase.prototype[editable_text_base_common_1.returnKeyTypeProperty.getDefault] = function () {
var returnKeyType = this.nativeTextViewProtected.returnKeyType;
switch (returnKeyType) {
case 9:
return "done";
case 1:
return "go";
case 4:
return "next";
case 6:
return "search";
case 7:
return "send";
default:
return returnKeyType.toString();
}
};
EditableTextBase.prototype[editable_text_base_common_1.returnKeyTypeProperty.setNative] = function (value) {
var newValue;
switch (value) {
case "done":
newValue = 9;
break;
case "go":
newValue = 1;
break;
case "next":
newValue = 4;
break;
case "search":
newValue = 6;
break;
case "send":
newValue = 7;
break;
default:
var rkt = +value;
if (!isNaN(rkt)) {
newValue = rkt;
}
else {
newValue = 0;
}
break;
}
this.nativeTextViewProtected.returnKeyType = newValue;
};
EditableTextBase.prototype[editable_text_base_common_1.autocapitalizationTypeProperty.getDefault] = function () {
var autocapitalizationType = this.nativeTextViewProtected.autocapitalizationType;
switch (autocapitalizationType) {
case 0:
return "none";
case 1:
return "words";
case 2:
return "sentences";
case 3:
return "allcharacters";
default:
throw new Error("Invalid autocapitalizationType value:" + autocapitalizationType);
}
};
EditableTextBase.prototype[editable_text_base_common_1.autocapitalizationTypeProperty.setNative] = function (value) {
var newValue;
switch (value) {
case "none":
newValue = 0;
break;
case "words":
newValue = 1;
break;
case "sentences":
newValue = 2;
break;
case "allcharacters":
newValue = 3;
break;
default:
newValue = 2;
break;
}
this.nativeTextViewProtected.autocapitalizationType = newValue;
};
EditableTextBase.prototype[editable_text_base_common_1.autocorrectProperty.getDefault] = function () {
var autocorrectionType = this.nativeTextViewProtected.autocorrectionType;
switch (autocorrectionType) {
case 2:
return true;
case 1:
return false;
case 0:
return autocorrectionType;
}
};
EditableTextBase.prototype[editable_text_base_common_1.autocorrectProperty.setNative] = function (value) {
var newValue;
if (typeof value === "number") {
newValue = 0;
}
else if (value) {
newValue = 2;
}
else {
newValue = 1;
}
this.nativeTextViewProtected.autocorrectionType = newValue;
};
return EditableTextBase;
}(editable_text_base_common_1.EditableTextBase));
exports.EditableTextBase = EditableTextBase;
function _updateCharactersInRangeReplacementString(formattedText, rangeLocation, rangeLength, replacementString) {
var deletingText = !replacementString;
var currentLocation = 0;
for (var i = 0, length_1 = formattedText.spans.length; i < length_1; i++) {
var span = formattedText.spans.getItem(i);
if (currentLocation <= rangeLocation && rangeLocation < (currentLocation + span.text.length)) {
var newText = splice(span.text, rangeLocation - currentLocation, deletingText ? rangeLength : 0, replacementString);
span._setTextInternal(newText);
return;
}
currentLocation += span.text.length;
}
}
exports._updateCharactersInRangeReplacementString = _updateCharactersInRangeReplacementString;
function splice(value, start, delCount, newSubStr) {
return value.slice(0, start) + newSubStr + value.slice(start + Math.abs(delCount));
}
//# sourceMappingURL=editable-text-base.ios.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/ui/enums/enums.js":
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", { value: true });
var KeyboardType;
(function (KeyboardType) {
KeyboardType.datetime = "datetime";
KeyboardType.phone = "phone";
KeyboardType.number = "number";
KeyboardType.url = "url";
KeyboardType.email = "email";
})(KeyboardType = exports.KeyboardType || (exports.KeyboardType = {}));
var ReturnKeyType;
(function (ReturnKeyType) {
ReturnKeyType.done = "done";
ReturnKeyType.next = "next";
ReturnKeyType.go = "go";
ReturnKeyType.search = "search";
ReturnKeyType.send = "send";
})(ReturnKeyType = exports.ReturnKeyType || (exports.ReturnKeyType = {}));
var TextAlignment;
(function (TextAlignment) {
TextAlignment.left = "left";
TextAlignment.center = "center";
TextAlignment.right = "right";
})(TextAlignment = exports.TextAlignment || (exports.TextAlignment = {}));
var TextDecoration;
(function (TextDecoration) {
TextDecoration.none = "none";
TextDecoration.underline = "underline";
TextDecoration.lineThrough = "line-through";
})(TextDecoration = exports.TextDecoration || (exports.TextDecoration = {}));
var TextTransform;
(function (TextTransform) {
TextTransform.none = "none";
TextTransform.capitalize = "capitalize";
TextTransform.uppercase = "uppercase";
TextTransform.lowercase = "lowercase";
})(TextTransform = exports.TextTransform || (exports.TextTransform = {}));
var WhiteSpace;
(function (WhiteSpace) {
WhiteSpace.normal = "normal";
WhiteSpace.nowrap = "nowrap";
})(WhiteSpace = exports.WhiteSpace || (exports.WhiteSpace = {}));
var Orientation;
(function (Orientation) {
Orientation.horizontal = "horizontal";
Orientation.vertical = "vertical";
})(Orientation = exports.Orientation || (exports.Orientation = {}));
var DeviceOrientation;
(function (DeviceOrientation) {
DeviceOrientation.portrait = "portrait";
DeviceOrientation.landscape = "landscape";
DeviceOrientation.unknown = "unknown";
})(DeviceOrientation = exports.DeviceOrientation || (exports.DeviceOrientation = {}));
var HorizontalAlignment;
(function (HorizontalAlignment) {
HorizontalAlignment.left = "left";
HorizontalAlignment.center = "center";
HorizontalAlignment.right = "right";
HorizontalAlignment.stretch = "stretch";
})(HorizontalAlignment = exports.HorizontalAlignment || (exports.HorizontalAlignment = {}));
var VerticalAlignment;
(function (VerticalAlignment) {
VerticalAlignment.top = "top";
VerticalAlignment.middle = "middle";
VerticalAlignment.bottom = "bottom";
VerticalAlignment.stretch = "stretch";
})(VerticalAlignment = exports.VerticalAlignment || (exports.VerticalAlignment = {}));
var Stretch;
(function (Stretch) {
Stretch.none = "none";
Stretch.aspectFill = "aspectFill";
Stretch.aspectFit = "aspectFit";
Stretch.fill = "fill";
})(Stretch = exports.Stretch || (exports.Stretch = {}));
var Visibility;
(function (Visibility) {
Visibility.visible = "visible";
Visibility.collapse = "collapse";
Visibility.collapsed = "collapsed";
})(Visibility = exports.Visibility || (exports.Visibility = {}));
var FontAttributes;
(function (FontAttributes) {
FontAttributes.Normal = 0;
FontAttributes.Bold = 1;
FontAttributes.Italic = 1 << 1;
})(FontAttributes = exports.FontAttributes || (exports.FontAttributes = {}));
var DeviceType;
(function (DeviceType) {
DeviceType.Phone = "Phone";
DeviceType.Tablet = "Tablet";
})(DeviceType = exports.DeviceType || (exports.DeviceType = {}));
var UpdateTextTrigger;
(function (UpdateTextTrigger) {
UpdateTextTrigger.focusLost = "focusLost";
UpdateTextTrigger.textChanged = "textChanged";
})(UpdateTextTrigger = exports.UpdateTextTrigger || (exports.UpdateTextTrigger = {}));
var Accuracy;
(function (Accuracy) {
Accuracy.any = 300;
Accuracy.high = 3;
})(Accuracy = exports.Accuracy || (exports.Accuracy = {}));
var Dock;
(function (Dock) {
Dock.left = "left";
Dock.top = "top";
Dock.right = "right";
Dock.bottom = "bottom";
})(Dock = exports.Dock || (exports.Dock = {}));
var AutocapitalizationType;
(function (AutocapitalizationType) {
AutocapitalizationType.none = "none";
AutocapitalizationType.words = "words";
AutocapitalizationType.sentences = "sentences";
AutocapitalizationType.allCharacters = "allcharacters";
})(AutocapitalizationType = exports.AutocapitalizationType || (exports.AutocapitalizationType = {}));
var NavigationBarVisibility;
(function (NavigationBarVisibility) {
NavigationBarVisibility.auto = "auto";
NavigationBarVisibility.never = "never";
NavigationBarVisibility.always = "always";
})(NavigationBarVisibility = exports.NavigationBarVisibility || (exports.NavigationBarVisibility = {}));
var AndroidActionBarIconVisibility;
(function (AndroidActionBarIconVisibility) {
AndroidActionBarIconVisibility.auto = "auto";
AndroidActionBarIconVisibility.never = "never";
AndroidActionBarIconVisibility.always = "always";
})(AndroidActionBarIconVisibility = exports.AndroidActionBarIconVisibility || (exports.AndroidActionBarIconVisibility = {}));
var AndroidActionItemPosition;
(function (AndroidActionItemPosition) {
AndroidActionItemPosition.actionBar = "actionBar";
AndroidActionItemPosition.actionBarIfRoom = "actionBarIfRoom";
AndroidActionItemPosition.popup = "popup";
})(AndroidActionItemPosition = exports.AndroidActionItemPosition || (exports.AndroidActionItemPosition = {}));
var IOSActionItemPosition;
(function (IOSActionItemPosition) {
IOSActionItemPosition.left = "left";
IOSActionItemPosition.right = "right";
})(IOSActionItemPosition = exports.IOSActionItemPosition || (exports.IOSActionItemPosition = {}));
var ImageFormat;
(function (ImageFormat) {
ImageFormat.png = "png";
ImageFormat.jpeg = "jpeg";
ImageFormat.jpg = "jpg";
})(ImageFormat = exports.ImageFormat || (exports.ImageFormat = {}));
var FontStyle;
(function (FontStyle) {
FontStyle.normal = "normal";
FontStyle.italic = "italic";
})(FontStyle = exports.FontStyle || (exports.FontStyle = {}));
var FontWeight;
(function (FontWeight) {
FontWeight.thin = "100";
FontWeight.extraLight = "200";
FontWeight.light = "300";
FontWeight.normal = "normal";
FontWeight.medium = "500";
FontWeight.semiBold = "600";
FontWeight.bold = "bold";
FontWeight.extraBold = "800";
FontWeight.black = "900";
})(FontWeight = exports.FontWeight || (exports.FontWeight = {}));
var BackgroundRepeat;
(function (BackgroundRepeat) {
BackgroundRepeat.repeat = "repeat";
BackgroundRepeat.repeatX = "repeat-x";
BackgroundRepeat.repeatY = "repeat-y";
BackgroundRepeat.noRepeat = "no-repeat";
})(BackgroundRepeat = exports.BackgroundRepeat || (exports.BackgroundRepeat = {}));
var animationModule;
var AnimationCurve;
(function (AnimationCurve) {
AnimationCurve.ease = "ease";
AnimationCurve.easeIn = "easeIn";
AnimationCurve.easeOut = "easeOut";
AnimationCurve.easeInOut = "easeInOut";
AnimationCurve.linear = "linear";
AnimationCurve.spring = "spring";
function cubicBezier(x1, y1, x2, y2) {
animationModule = animationModule || __webpack_require__("../node_modules/tns-core-modules/ui/animation/animation.js");
return new animationModule.CubicBezierAnimationCurve(x1, y1, x2, y2);
}
AnimationCurve.cubicBezier = cubicBezier;
})(AnimationCurve = exports.AnimationCurve || (exports.AnimationCurve = {}));
var StatusBarStyle;
(function (StatusBarStyle) {
StatusBarStyle.light = "light";
StatusBarStyle.dark = "dark";
})(StatusBarStyle = exports.StatusBarStyle || (exports.StatusBarStyle = {}));
//# sourceMappingURL=enums.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/ui/frame/fragment.transitions.js":
/***/ (function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", { value: true });
var slide_transition_1 = __webpack_require__("../node_modules/tns-core-modules/ui/transition/slide-transition.js");
var fade_transition_1 = __webpack_require__("../node_modules/tns-core-modules/ui/transition/fade-transition.js");
var trace_1 = __webpack_require__("../node_modules/tns-core-modules/trace/trace.js");
var UIViewControllerAnimatedTransitioningMethods;
(function (UIViewControllerAnimatedTransitioningMethods) {
var methodSignature = NSMethodSignature.signatureWithObjCTypes("v@:c");
var invocation = NSInvocation.invocationWithMethodSignature(methodSignature);
invocation.selector = "completeTransition:";
function completeTransition(didComplete) {
var didCompleteReference = new interop.Reference(interop.types.bool, didComplete);
invocation.setArgumentAtIndex(didCompleteReference, 2);
invocation.invokeWithTarget(this);
}
UIViewControllerAnimatedTransitioningMethods.completeTransition = completeTransition;
})(UIViewControllerAnimatedTransitioningMethods || (UIViewControllerAnimatedTransitioningMethods = {}));
var AnimatedTransitioning = (function (_super) {
__extends(AnimatedTransitioning, _super);
function AnimatedTransitioning() {
return _super !== null && _super.apply(this, arguments) || this;
}
AnimatedTransitioning.init = function (transition, operation, fromVC, toVC) {
var impl = AnimatedTransitioning.new();
impl._transition = transition;
impl._operation = operation;
impl._fromVC = fromVC;
impl._toVC = toVC;
return impl;
};
AnimatedTransitioning.prototype.animateTransition = function (transitionContext) {
var containerView = transitionContext.valueForKey("containerView");
var completion = UIViewControllerAnimatedTransitioningMethods.completeTransition.bind(transitionContext);
switch (this._operation) {
case 1:
this._transitionType = "push";
break;
case 2:
this._transitionType = "pop";
break;
case 0:
this._transitionType = "none";
break;
}
if (trace_1.isEnabled()) {
trace_1.write("START " + this._transition + " " + this._transitionType, trace_1.categories.Transition);
}
this._transition.animateIOSTransition(containerView, this._fromVC.view, this._toVC.view, this._operation, completion);
};
AnimatedTransitioning.prototype.transitionDuration = function (transitionContext) {
return this._transition.getDuration();
};
AnimatedTransitioning.prototype.animationEnded = function (transitionCompleted) {
if (transitionCompleted) {
if (trace_1.isEnabled()) {
trace_1.write("END " + this._transition + " " + this._transitionType, trace_1.categories.Transition);
}
}
else {
if (trace_1.isEnabled()) {
trace_1.write("CANCEL " + this._transition + " " + this._transitionType, trace_1.categories.Transition);
}
}
};
AnimatedTransitioning.ObjCProtocols = [UIViewControllerAnimatedTransitioning];
return AnimatedTransitioning;
}(NSObject));
function _createIOSAnimatedTransitioning(navigationTransition, nativeCurve, operation, fromVC, toVC) {
var instance = navigationTransition.instance;
var transition;
if (instance) {
transition = instance;
}
else if (navigationTransition.name) {
var name_1 = navigationTransition.name.toLowerCase();
if (name_1.indexOf("slide") === 0) {
var direction = name_1.substr("slide".length) || "left";
transition = new slide_transition_1.SlideTransition(direction, navigationTransition.duration, nativeCurve);
}
else if (name_1 === "fade") {
transition = new fade_transition_1.FadeTransition(navigationTransition.duration, nativeCurve);
}
}
return transition ? AnimatedTransitioning.init(transition, operation, fromVC, toVC) : undefined;
}
exports._createIOSAnimatedTransitioning = _createIOSAnimatedTransitioning;
//# sourceMappingURL=fragment.transitions.ios.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/ui/frame/frame-common.js":
/***/ (function(module, exports, __webpack_require__) {
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
Object.defineProperty(exports, "__esModule", { value: true });
var view_common_1 = __webpack_require__("../node_modules/tns-core-modules/ui/core/view/view-common.js");
var view_1 = __webpack_require__("../node_modules/tns-core-modules/ui/core/view/view.js");
var builder_1 = __webpack_require__("../node_modules/tns-core-modules/ui/builder/builder.js");
var profiling_1 = __webpack_require__("../node_modules/tns-core-modules/profiling/profiling.js");
var frame_stack_1 = __webpack_require__("../node_modules/tns-core-modules/ui/frame/frame-stack.js");
__export(__webpack_require__("../node_modules/tns-core-modules/ui/core/view/view.js"));
function buildEntryFromArgs(arg) {
var entry;
if (typeof arg === "string") {
entry = {
moduleName: arg
};
}
else if (typeof arg === "function") {
entry = {
create: arg
};
}
else {
entry = arg;
}
return entry;
}
var FrameBase = (function (_super) {
__extends(FrameBase, _super);
function FrameBase() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this._backStack = new Array();
_this._navigationQueue = new Array();
_this._isInFrameStack = false;
return _this;
}
FrameBase_1 = FrameBase;
FrameBase.prototype._addChildFromBuilder = function (name, value) {
throw new Error("Frame should not have a view. Use 'defaultPage' property instead.");
};
FrameBase.prototype.onLoaded = function () {
_super.prototype.onLoaded.call(this);
this._processNextNavigationEntry();
};
FrameBase.prototype.canGoBack = function () {
var _this = this;
var backstack = this._backStack.length;
var previousForwardNotInBackstack = false;
this._navigationQueue.forEach(function (item) {
var entry = item.entry;
if (item.isBackNavigation) {
previousForwardNotInBackstack = false;
if (!entry) {
backstack--;
}
else {
var backstackIndex = _this._backStack.indexOf(entry);
if (backstackIndex !== -1) {
backstack = backstackIndex;
}
else {
backstack--;
}
}
}
else if (entry.entry.clearHistory) {
previousForwardNotInBackstack = false;
backstack = 0;
}
else {
backstack++;
if (previousForwardNotInBackstack) {
backstack--;
}
previousForwardNotInBackstack = entry.entry.backstackVisible === false;
}
});
if (this._navigationQueue.length > 0 && !this._currentEntry) {
backstack--;
}
return backstack > 0;
};
FrameBase.prototype.goBack = function (backstackEntry) {
if (view_1.traceEnabled()) {
view_1.traceWrite("GO BACK", view_1.traceCategories.Navigation);
}
if (!this.canGoBack()) {
return;
}
if (backstackEntry) {
var index_1 = this._backStack.indexOf(backstackEntry);
if (index_1 < 0) {
return;
}
}
var navigationContext = {
entry: backstackEntry,
isBackNavigation: true
};
this._navigationQueue.push(navigationContext);
this._processNextNavigationEntry();
};
FrameBase.prototype._removeEntry = function (removed) {
var page = removed.resolvedPage;
var frame = page.frame;
page._frame = null;
if (frame) {
frame._removeView(page);
}
else {
page._tearDownUI(true);
}
};
FrameBase.prototype.navigate = function (param) {
if (view_1.traceEnabled()) {
view_1.traceWrite("NAVIGATE", view_1.traceCategories.Navigation);
}
var entry = buildEntryFromArgs(param);
var page = builder_1.createViewFromEntry(entry);
this._pushInFrameStack();
var backstackEntry = {
entry: entry,
resolvedPage: page,
navDepth: undefined,
fragmentTag: undefined
};
var navigationContext = {
entry: backstackEntry,
isBackNavigation: false
};
this._navigationQueue.push(navigationContext);
this._processNextNavigationEntry();
};
FrameBase.prototype.isCurrent = function (entry) {
return this._currentEntry === entry;
};
FrameBase.prototype.setCurrent = function (entry, isBack) {
var newPage = entry.resolvedPage;
if (!newPage.frame) {
this._addView(newPage);
newPage._frame = this;
}
this._currentEntry = entry;
if (isBack) {
this._pushInFrameStack();
}
newPage.onNavigatedTo(isBack);
this._executingEntry = null;
};
FrameBase.prototype._updateBackstack = function (entry, isBack) {
var _this = this;
this.raiseCurrentPageNavigatedEvents(isBack);
var current = this._currentEntry;
if (isBack) {
var index_2 = this._backStack.indexOf(entry);
this._backStack.splice(index_2 + 1).forEach(function (e) { return _this._removeEntry(e); });
this._backStack.pop();
}
else {
if (entry.entry.clearHistory) {
this._backStack.forEach(function (e) { return _this._removeEntry(e); });
this._backStack.length = 0;
}
else if (FrameBase_1._isEntryBackstackVisible(current)) {
this._backStack.push(current);
}
}
if (current && this._backStack.indexOf(current) < 0) {
this._removeEntry(current);
}
};
FrameBase.prototype.isNestedWithin = function (parentFrameCandidate) {
var frameAncestor = this;
while (frameAncestor) {
frameAncestor = view_common_1.getAncestor(frameAncestor, FrameBase_1);
if (frameAncestor === parentFrameCandidate) {
return true;
}
}
return false;
};
FrameBase.prototype.raiseCurrentPageNavigatedEvents = function (isBack) {
var page = this.currentPage;
if (page) {
if (page.isLoaded) {
page.callUnloaded();
}
page.onNavigatedFrom(isBack);
}
};
FrameBase.prototype._processNavigationQueue = function (page) {
if (this._navigationQueue.length === 0) {
return;
}
var entry = this._navigationQueue[0].entry;
var currentNavigationPage = entry.resolvedPage;
if (page !== currentNavigationPage) {
return;
}
this._navigationQueue.shift();
this._processNextNavigationEntry();
this._updateActionBar();
};
FrameBase.prototype._findEntryForTag = function (fragmentTag) {
var entry;
if (this._currentEntry && this._currentEntry.fragmentTag === fragmentTag) {
entry = this._currentEntry;
}
else {
entry = this._backStack.find(function (value) { return value.fragmentTag === fragmentTag; });
if (!entry) {
var navigationItem = this._navigationQueue.find(function (value) { return value.entry.fragmentTag === fragmentTag; });
entry = navigationItem ? navigationItem.entry : undefined;
}
}
return entry;
};
FrameBase.prototype.navigationQueueIsEmpty = function () {
return this._navigationQueue.length === 0;
};
FrameBase._isEntryBackstackVisible = function (entry) {
if (!entry) {
return false;
}
var backstackVisibleValue = entry.entry.backstackVisible;
var backstackHidden = backstackVisibleValue !== undefined && !backstackVisibleValue;
return !backstackHidden;
};
FrameBase.prototype._updateActionBar = function (page, disableNavBarAnimation) {
};
FrameBase.prototype._processNextNavigationEntry = function () {
if (!this.isLoaded || this._executingEntry) {
return;
}
if (this._navigationQueue.length > 0) {
var navigationContext = this._navigationQueue[0];
if (navigationContext.isBackNavigation) {
this.performGoBack(navigationContext);
}
else {
this.performNavigation(navigationContext);
}
}
};
FrameBase.prototype.performNavigation = function (navigationContext) {
var navContext = navigationContext.entry;
this._executingEntry = navContext;
this._onNavigatingTo(navContext, navigationContext.isBackNavigation);
this._navigateCore(navContext);
};
FrameBase.prototype.performGoBack = function (navigationContext) {
var backstackEntry = navigationContext.entry;
var backstack = this._backStack;
if (!backstackEntry) {
backstackEntry = backstack[backstack.length - 1];
navigationContext.entry = backstackEntry;
}
this._executingEntry = backstackEntry;
this._onNavigatingTo(backstackEntry, true);
this._goBackCore(backstackEntry);
};
FrameBase.prototype._goBackCore = function (backstackEntry) {
if (view_1.traceEnabled()) {
view_1.traceWrite("GO BACK CORE(" + this._backstackEntryTrace(backstackEntry) + "); currentPage: " + this.currentPage, view_1.traceCategories.Navigation);
}
};
FrameBase.prototype._navigateCore = function (backstackEntry) {
if (view_1.traceEnabled()) {
view_1.traceWrite("NAVIGATE CORE(" + this._backstackEntryTrace(backstackEntry) + "); currentPage: " + this.currentPage, view_1.traceCategories.Navigation);
}
};
FrameBase.prototype._onNavigatingTo = function (backstackEntry, isBack) {
if (this.currentPage) {
this.currentPage.onNavigatingFrom(isBack);
}
backstackEntry.resolvedPage.onNavigatingTo(backstackEntry.entry.context, isBack, backstackEntry.entry.bindingContext);
};
Object.defineProperty(FrameBase.prototype, "animated", {
get: function () {
return this._animated;
},
set: function (value) {
this._animated = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(FrameBase.prototype, "transition", {
get: function () {
return this._transition;
},
set: function (value) {
this._transition = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(FrameBase.prototype, "backStack", {
get: function () {
return this._backStack.slice();
},
enumerable: true,
configurable: true
});
Object.defineProperty(FrameBase.prototype, "currentPage", {
get: function () {
if (this._currentEntry) {
return this._currentEntry.resolvedPage;
}
return null;
},
enumerable: true,
configurable: true
});
Object.defineProperty(FrameBase.prototype, "currentEntry", {
get: function () {
if (this._currentEntry) {
return this._currentEntry.entry;
}
return null;
},
enumerable: true,
configurable: true
});
FrameBase.prototype._pushInFrameStackRecursive = function () {
this._pushInFrameStack();
var framesToPush = [];
for (var _i = 0, frameStack_1 = frame_stack_1.frameStack; _i < frameStack_1.length; _i++) {
var frame = frameStack_1[_i];
if (frame.isNestedWithin(this)) {
framesToPush.push(frame);
}
}
for (var _a = 0, framesToPush_1 = framesToPush; _a < framesToPush_1.length; _a++) {
var frame = framesToPush_1[_a];
frame._pushInFrameStack();
}
};
FrameBase.prototype._pushInFrameStack = function () {
frame_stack_1._pushInFrameStack(this);
};
FrameBase.prototype._popFromFrameStack = function () {
frame_stack_1._popFromFrameStack(this);
};
FrameBase.prototype._removeFromFrameStack = function () {
frame_stack_1._removeFromFrameStack(this);
};
FrameBase.prototype._dialogClosed = function () {
this._removeFromFrameStack();
};
FrameBase.prototype._onRootViewReset = function () {
_super.prototype._onRootViewReset.call(this);
this._removeFromFrameStack();
};
Object.defineProperty(FrameBase.prototype, "_childrenCount", {
get: function () {
if (this.currentPage) {
return 1;
}
return 0;
},
enumerable: true,
configurable: true
});
FrameBase.prototype.eachChildView = function (callback) {
var page = this.currentPage;
if (page) {
callback(page);
}
};
FrameBase.prototype._getIsAnimatedNavigation = function (entry) {
if (entry && entry.animated !== undefined) {
return entry.animated;
}
if (this.animated !== undefined) {
return this.animated;
}
return FrameBase_1.defaultAnimatedNavigation;
};
FrameBase.prototype._getNavigationTransition = function (entry) {
if (entry) {
if (view_1.isIOS && entry.transitioniOS !== undefined) {
return entry.transitioniOS;
}
if (view_1.isAndroid && entry.transitionAndroid !== undefined) {
return entry.transitionAndroid;
}
if (entry.transition !== undefined) {
return entry.transition;
}
}
if (this.transition !== undefined) {
return this.transition;
}
return FrameBase_1.defaultTransition;
};
Object.defineProperty(FrameBase.prototype, "navigationBarHeight", {
get: function () {
return 0;
},
enumerable: true,
configurable: true
});
FrameBase.prototype._getNavBarVisible = function (page) {
throw new Error();
};
FrameBase.prototype._addViewToNativeVisualTree = function (child) {
return true;
};
FrameBase.prototype._removeViewFromNativeVisualTree = function (child) {
child._isAddedToNativeVisualTree = false;
};
FrameBase.prototype._printFrameBackStack = function () {
var length = this.backStack.length;
var i = length - 1;
console.log("Frame Back Stack: ");
while (i >= 0) {
var backstackEntry = this.backStack[i--];
console.log("\t" + backstackEntry.resolvedPage);
}
};
FrameBase.prototype._backstackEntryTrace = function (b) {
var result = "" + b.resolvedPage;
var backstackVisible = FrameBase_1._isEntryBackstackVisible(b);
if (!backstackVisible) {
result += " | INVISIBLE";
}
if (b.entry.clearHistory) {
result += " | CLEAR HISTORY";
}
var animated = this._getIsAnimatedNavigation(b.entry);
if (!animated) {
result += " | NOT ANIMATED";
}
var t = this._getNavigationTransition(b.entry);
if (t) {
result += " | Transition[" + JSON.stringify(t) + "]";
}
return result;
};
FrameBase.prototype._onLivesync = function (context) {
if (!_super.prototype._onLivesync.call(this, context)) {
if (!this._currentEntry || !this._currentEntry.entry) {
return false;
}
var currentEntry = this._currentEntry.entry;
var newEntry = {
animated: false,
clearHistory: true,
context: currentEntry.context,
create: currentEntry.create,
moduleName: currentEntry.moduleName,
backstackVisible: currentEntry.backstackVisible
};
if (newEntry.create) {
var page = newEntry.create();
if (page === this.currentPage) {
return false;
}
}
this.navigate(newEntry);
}
return true;
};
var FrameBase_1;
FrameBase.androidOptionSelectedEvent = "optionSelected";
FrameBase.defaultAnimatedNavigation = true;
__decorate([
profiling_1.profile
], FrameBase.prototype, "onLoaded", null);
__decorate([
profiling_1.profile
], FrameBase.prototype, "performNavigation", null);
__decorate([
profiling_1.profile
], FrameBase.prototype, "performGoBack", null);
FrameBase = FrameBase_1 = __decorate([
view_1.CSSType("Frame")
], FrameBase);
return FrameBase;
}(view_1.CustomLayoutView));
exports.FrameBase = FrameBase;
function getFrameById(id) {
return frame_stack_1.frameStack.find(function (frame) { return frame.id && frame.id === id; });
}
exports.getFrameById = getFrameById;
function topmost() {
return frame_stack_1.topmost();
}
exports.topmost = topmost;
function goBack() {
var top = topmost();
if (top && top.canGoBack()) {
top.goBack();
return true;
}
else if (top) {
var parentFrameCanGoBack = false;
var parentFrame = view_common_1.getAncestor(top, "Frame");
while (parentFrame && !parentFrameCanGoBack) {
if (parentFrame && parentFrame.canGoBack()) {
parentFrameCanGoBack = true;
}
else {
parentFrame = view_common_1.getAncestor(parentFrame, "Frame");
}
}
if (parentFrame && parentFrameCanGoBack) {
parentFrame.goBack();
return true;
}
}
if (frame_stack_1.frameStack.length > 1) {
top._popFromFrameStack();
}
return false;
}
exports.goBack = goBack;
function stack() {
return frame_stack_1.frameStack;
}
exports.stack = stack;
exports.defaultPage = new view_1.Property({
name: "defaultPage", valueChanged: function (frame, oldValue, newValue) {
frame.navigate({ moduleName: newValue });
}
});
exports.defaultPage.register(FrameBase);
exports.actionBarVisibilityProperty = new view_1.Property({ name: "actionBarVisibility", defaultValue: "auto", affectsLayout: view_1.isIOS });
exports.actionBarVisibilityProperty.register(FrameBase);
//# sourceMappingURL=frame-common.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/ui/frame/frame-stack.js":
/***/ (function(module, exports) {
Object.defineProperty(exports, "__esModule", { value: true });
exports.frameStack = [];
function topmost() {
if (exports.frameStack.length > 0) {
return exports.frameStack[exports.frameStack.length - 1];
}
return undefined;
}
exports.topmost = topmost;
function _pushInFrameStack(frame) {
if (frame._isInFrameStack && exports.frameStack[exports.frameStack.length - 1] === frame) {
return;
}
if (frame._isInFrameStack) {
var indexOfFrame = exports.frameStack.indexOf(frame);
exports.frameStack.splice(indexOfFrame, 1);
}
exports.frameStack.push(frame);
frame._isInFrameStack = true;
}
exports._pushInFrameStack = _pushInFrameStack;
function _popFromFrameStack(frame) {
if (!frame._isInFrameStack) {
return;
}
var top = topmost();
if (top !== frame) {
throw new Error("Cannot pop a Frame which is not at the top of the navigation stack.");
}
exports.frameStack.pop();
frame._isInFrameStack = false;
}
exports._popFromFrameStack = _popFromFrameStack;
function _removeFromFrameStack(frame) {
if (!frame._isInFrameStack) {
return;
}
var index = exports.frameStack.indexOf(frame);
exports.frameStack.splice(index, 1);
frame._isInFrameStack = false;
}
exports._removeFromFrameStack = _removeFromFrameStack;
//# sourceMappingURL=frame-stack.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/ui/frame/frame.js":
/***/ (function(module, exports, __webpack_require__) {
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
Object.defineProperty(exports, "__esModule", { value: true });
var profiling_1 = __webpack_require__("../node_modules/tns-core-modules/profiling/profiling.js");
var frame_common_1 = __webpack_require__("../node_modules/tns-core-modules/ui/frame/frame-common.js");
var fragment_transitions_1 = __webpack_require__("../node_modules/tns-core-modules/ui/frame/fragment.transitions.js");
var utils = __webpack_require__("../node_modules/tns-core-modules/utils/utils.js");
__export(__webpack_require__("../node_modules/tns-core-modules/ui/frame/frame-common.js"));
var majorVersion = utils.ios.MajorVersion;
var ENTRY = "_entry";
var NAV_DEPTH = "_navDepth";
var TRANSITION = "_transition";
var DELEGATE = "_delegate";
var navDepth = -1;
var Frame = (function (_super) {
__extends(Frame, _super);
function Frame() {
var _this = _super.call(this) || this;
_this._animatedDelegate = UINavigationControllerAnimatedDelegate.new();
_this._ios = new iOSFrame(_this);
_this.viewController = _this._ios.controller;
return _this;
}
Frame.prototype.createNativeView = function () {
return this.viewController.view;
};
Frame.prototype.disposeNativeView = function () {
this._removeFromFrameStack();
this.viewController = null;
this._ios.controller = null;
_super.prototype.disposeNativeView.call(this);
};
Object.defineProperty(Frame.prototype, "ios", {
get: function () {
return this._ios;
},
enumerable: true,
configurable: true
});
Frame.prototype.setCurrent = function (entry, isBack) {
var current = this._currentEntry;
var currentEntryChanged = current !== entry;
if (currentEntryChanged) {
this._updateBackstack(entry, isBack);
_super.prototype.setCurrent.call(this, entry, isBack);
}
};
Frame.prototype._navigateCore = function (backstackEntry) {
_super.prototype._navigateCore.call(this, backstackEntry);
var viewController = backstackEntry.resolvedPage.ios;
if (!viewController) {
throw new Error("Required page does not have a viewController created.");
}
var clearHistory = backstackEntry.entry.clearHistory;
if (clearHistory) {
navDepth = -1;
}
navDepth++;
var navigationTransition;
var animated = this.currentPage ? this._getIsAnimatedNavigation(backstackEntry.entry) : false;
if (animated) {
navigationTransition = this._getNavigationTransition(backstackEntry.entry);
if (navigationTransition) {
viewController[TRANSITION] = navigationTransition;
}
}
else {
viewController[TRANSITION] = { name: "non-animated" };
}
var nativeTransition = _getNativeTransition(navigationTransition, true);
if (!nativeTransition && navigationTransition) {
this._ios.controller.delegate = this._animatedDelegate;
viewController[DELEGATE] = this._animatedDelegate;
}
else {
viewController[DELEGATE] = null;
this._ios.controller.delegate = null;
}
backstackEntry[NAV_DEPTH] = navDepth;
viewController[ENTRY] = backstackEntry;
if (!animated && majorVersion > 10) {
var barButtonItem = UIBarButtonItem.alloc().initWithTitleStyleTargetAction("", 0, null, null);
viewController.navigationItem.backBarButtonItem = barButtonItem;
}
if (!this._currentEntry) {
this._updateActionBar(backstackEntry.resolvedPage, true);
this._ios.controller.pushViewControllerAnimated(viewController, animated);
if (frame_common_1.traceEnabled()) {
frame_common_1.traceWrite(this + ".pushViewControllerAnimated(" + viewController + ", " + animated + "); depth = " + navDepth, frame_common_1.traceCategories.Navigation);
}
return;
}
if (clearHistory) {
viewController.navigationItem.hidesBackButton = true;
var newControllers = NSMutableArray.alloc().initWithCapacity(1);
newControllers.addObject(viewController);
var oldControllers = this._ios.controller.viewControllers;
for (var i = 0; i < oldControllers.count; i++) {
oldControllers.objectAtIndex(i).isBackstackCleared = true;
}
this._ios.controller.setViewControllersAnimated(newControllers, animated);
if (frame_common_1.traceEnabled()) {
frame_common_1.traceWrite(this + ".setViewControllersAnimated([" + viewController + "], " + animated + "); depth = " + navDepth, frame_common_1.traceCategories.Navigation);
}
return;
}
if (!Frame._isEntryBackstackVisible(this._currentEntry)) {
var newControllers = NSMutableArray.alloc().initWithArray(this._ios.controller.viewControllers);
if (newControllers.count === 0) {
throw new Error("Wrong controllers count.");
}
viewController.navigationItem.hidesBackButton = this.backStack.length === 0;
var skippedNavController = newControllers.lastObject;
skippedNavController.isBackstackSkipped = true;
newControllers.removeLastObject();
newControllers.addObject(viewController);
this._ios.controller.setViewControllersAnimated(newControllers, animated);
if (frame_common_1.traceEnabled()) {
frame_common_1.traceWrite(this + ".setViewControllersAnimated([originalControllers - lastController + " + viewController + "], " + animated + "); depth = " + navDepth, frame_common_1.traceCategories.Navigation);
}
return;
}
this._ios.controller.pushViewControllerAnimated(viewController, animated);
if (frame_common_1.traceEnabled()) {
frame_common_1.traceWrite(this + ".pushViewControllerAnimated(" + viewController + ", " + animated + "); depth = " + navDepth, frame_common_1.traceCategories.Navigation);
}
};
Frame.prototype._goBackCore = function (backstackEntry) {
_super.prototype._goBackCore.call(this, backstackEntry);
navDepth = backstackEntry[NAV_DEPTH];
var controller = backstackEntry.resolvedPage.ios;
var animated = this._currentEntry ? this._getIsAnimatedNavigation(this._currentEntry.entry) : false;
this._updateActionBar(backstackEntry.resolvedPage);
if (frame_common_1.traceEnabled()) {
frame_common_1.traceWrite(this + ".popToViewControllerAnimated(" + controller + ", " + animated + "); depth = " + navDepth, frame_common_1.traceCategories.Navigation);
}
this._ios.controller.popToViewControllerAnimated(controller, animated);
};
Frame.prototype._updateActionBar = function (page, disableNavBarAnimation) {
if (disableNavBarAnimation === void 0) { disableNavBarAnimation = false; }
_super.prototype._updateActionBar.call(this, page);
if (page && this.currentPage && this.currentPage.modal === page) {
return;
}
page = page || this.currentPage;
var newValue = this._getNavBarVisible(page);
var disableNavBarAnimationCache = this._ios._disableNavBarAnimation;
if (disableNavBarAnimation) {
this._ios._disableNavBarAnimation = true;
}
this._ios.showNavigationBar = newValue;
if (disableNavBarAnimation) {
this._ios._disableNavBarAnimation = disableNavBarAnimationCache;
}
if (this._ios.controller.navigationBar) {
this._ios.controller.navigationBar.userInteractionEnabled = this.navigationQueueIsEmpty();
}
};
Frame.prototype._getNavBarVisible = function (page) {
switch (this.actionBarVisibility) {
case "always":
return true;
case "never":
return false;
case "auto":
switch (this._ios.navBarVisibility) {
case "always":
return true;
case "never":
return false;
case "auto":
var newValue = void 0;
if (page && page.actionBarHidden !== undefined) {
newValue = !page.actionBarHidden;
}
else {
newValue = this.ios.controller.viewControllers.count > 1 || (page && page.actionBar && !page.actionBar._isEmpty());
}
newValue = !!newValue;
return newValue;
}
}
};
Object.defineProperty(Frame, "defaultAnimatedNavigation", {
get: function () {
return frame_common_1.FrameBase.defaultAnimatedNavigation;
},
set: function (value) {
frame_common_1.FrameBase.defaultAnimatedNavigation = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(Frame, "defaultTransition", {
get: function () {
return frame_common_1.FrameBase.defaultTransition;
},
set: function (value) {
frame_common_1.FrameBase.defaultTransition = value;
},
enumerable: true,
configurable: true
});
Frame.prototype.onMeasure = function (widthMeasureSpec, heightMeasureSpec) {
var width = frame_common_1.layout.getMeasureSpecSize(widthMeasureSpec);
var widthMode = frame_common_1.layout.getMeasureSpecMode(widthMeasureSpec);
var height = frame_common_1.layout.getMeasureSpecSize(heightMeasureSpec);
var heightMode = frame_common_1.layout.getMeasureSpecMode(heightMeasureSpec);
var widthAndState = frame_common_1.View.resolveSizeAndState(width, width, widthMode, 0);
var heightAndState = frame_common_1.View.resolveSizeAndState(height, height, heightMode, 0);
this.setMeasuredDimension(widthAndState, heightAndState);
};
Frame.prototype.layoutNativeView = function (left, top, right, bottom) {
};
Frame.prototype._setNativeViewFrame = function (nativeView, frame) {
};
Frame.prototype._onNavigatingTo = function (backstackEntry, isBack) {
};
__decorate([
profiling_1.profile
], Frame.prototype, "_navigateCore", null);
return Frame;
}(frame_common_1.FrameBase));
exports.Frame = Frame;
var transitionDelegates = new Array();
var TransitionDelegate = (function (_super) {
__extends(TransitionDelegate, _super);
function TransitionDelegate() {
return _super !== null && _super.apply(this, arguments) || this;
}
TransitionDelegate.initWithOwnerId = function (id) {
var delegate = TransitionDelegate.new();
delegate._id = id;
transitionDelegates.push(delegate);
return delegate;
};
TransitionDelegate.prototype.animationWillStart = function (animationID, context) {
if (frame_common_1.traceEnabled()) {
frame_common_1.traceWrite("START " + this._id, frame_common_1.traceCategories.Transition);
}
};
TransitionDelegate.prototype.animationDidStop = function (animationID, finished, context) {
if (finished) {
if (frame_common_1.traceEnabled()) {
frame_common_1.traceWrite("END " + this._id, frame_common_1.traceCategories.Transition);
}
}
else {
if (frame_common_1.traceEnabled()) {
frame_common_1.traceWrite("CANCEL " + this._id, frame_common_1.traceCategories.Transition);
}
}
var index = transitionDelegates.indexOf(this);
if (index > -1) {
transitionDelegates.splice(index, 1);
}
};
TransitionDelegate.ObjCExposedMethods = {
"animationWillStart": { returns: interop.types.void, params: [NSString, NSObject] },
"animationDidStop": { returns: interop.types.void, params: [NSString, NSNumber, NSObject] }
};
return TransitionDelegate;
}(NSObject));
var _defaultTransitionDuration = 0.35;
var UINavigationControllerAnimatedDelegate = (function (_super) {
__extends(UINavigationControllerAnimatedDelegate, _super);
function UINavigationControllerAnimatedDelegate() {
return _super !== null && _super.apply(this, arguments) || this;
}
UINavigationControllerAnimatedDelegate.prototype.navigationControllerAnimationControllerForOperationFromViewControllerToViewController = function (navigationController, operation, fromVC, toVC) {
var viewController;
switch (operation) {
case 1:
viewController = toVC;
break;
case 2:
viewController = fromVC;
break;
}
if (!viewController) {
return null;
}
var navigationTransition = viewController[TRANSITION];
if (!navigationTransition) {
return null;
}
if (frame_common_1.traceEnabled()) {
frame_common_1.traceWrite("UINavigationControllerImpl.navigationControllerAnimationControllerForOperationFromViewControllerToViewController(" + operation + ", " + fromVC + ", " + toVC + "), transition: " + JSON.stringify(navigationTransition), frame_common_1.traceCategories.NativeLifecycle);
}
var curve = _getNativeCurve(navigationTransition);
var animationController = fragment_transitions_1._createIOSAnimatedTransitioning(navigationTransition, curve, operation, fromVC, toVC);
return animationController;
};
UINavigationControllerAnimatedDelegate.ObjCProtocols = [UINavigationControllerDelegate];
return UINavigationControllerAnimatedDelegate;
}(NSObject));
var UINavigationControllerImpl = (function (_super) {
__extends(UINavigationControllerImpl, _super);
function UINavigationControllerImpl() {
return _super !== null && _super.apply(this, arguments) || this;
}
UINavigationControllerImpl.initWithOwner = function (owner) {
var controller = UINavigationControllerImpl.new();
controller._owner = owner;
return controller;
};
Object.defineProperty(UINavigationControllerImpl.prototype, "owner", {
get: function () {
return this._owner.get();
},
enumerable: true,
configurable: true
});
UINavigationControllerImpl.prototype.viewWillAppear = function (animated) {
_super.prototype.viewWillAppear.call(this, animated);
var owner = this._owner.get();
if (owner && !owner.isLoaded && !owner.parent) {
owner.callLoaded();
}
};
UINavigationControllerImpl.prototype.viewDidDisappear = function (animated) {
_super.prototype.viewDidDisappear.call(this, animated);
var owner = this._owner.get();
if (owner && owner.isLoaded && !owner.parent && !this.presentedViewController) {
owner.callUnloaded();
owner._tearDownUI(true);
}
};
UINavigationControllerImpl.prototype.animateWithDuration = function (navigationTransition, nativeTransition, transitionType, baseCallback) {
var _this = this;
var duration = navigationTransition.duration ? navigationTransition.duration / 1000 : _defaultTransitionDuration;
var curve = _getNativeCurve(navigationTransition);
var transitionTraced = frame_common_1.isCategorySet(frame_common_1.traceCategories.Transition);
var transitionDelegate;
if (transitionTraced) {
var id = _getTransitionId(nativeTransition, transitionType);
transitionDelegate = TransitionDelegate.initWithOwnerId(id);
}
UIView.animateWithDurationAnimations(duration, function () {
if (transitionTraced) {
UIView.setAnimationDelegate(transitionDelegate);
}
UIView.setAnimationWillStartSelector("animationWillStart");
UIView.setAnimationDidStopSelector("animationDidStop");
UIView.setAnimationCurve(curve);
baseCallback();
UIView.setAnimationTransitionForViewCache(nativeTransition, _this.view, true);
});
};
UINavigationControllerImpl.prototype.pushViewControllerAnimated = function (viewController, animated) {
var _this = this;
var navigationTransition = viewController[TRANSITION];
if (frame_common_1.traceEnabled()) {
frame_common_1.traceWrite("UINavigationControllerImpl.pushViewControllerAnimated(" + viewController + ", " + animated + "); transition: " + JSON.stringify(navigationTransition), frame_common_1.traceCategories.NativeLifecycle);
}
var nativeTransition = _getNativeTransition(navigationTransition, true);
if (!animated || !navigationTransition || !nativeTransition) {
_super.prototype.pushViewControllerAnimated.call(this, viewController, animated);
return;
}
this.animateWithDuration(navigationTransition, nativeTransition, "push", function () {
_super.prototype.pushViewControllerAnimated.call(_this, viewController, false);
});
};
UINavigationControllerImpl.prototype.setViewControllersAnimated = function (viewControllers, animated) {
var _this = this;
var viewController = viewControllers.lastObject;
var navigationTransition = viewController[TRANSITION];
if (frame_common_1.traceEnabled()) {
frame_common_1.traceWrite("UINavigationControllerImpl.setViewControllersAnimated(" + viewControllers + ", " + animated + "); transition: " + JSON.stringify(navigationTransition), frame_common_1.traceCategories.NativeLifecycle);
}
var nativeTransition = _getNativeTransition(navigationTransition, true);
if (!animated || !navigationTransition || !nativeTransition) {
_super.prototype.setViewControllersAnimated.call(this, viewControllers, animated);
return;
}
this.animateWithDuration(navigationTransition, nativeTransition, "set", function () {
_super.prototype.setViewControllersAnimated.call(_this, viewControllers, false);
});
};
UINavigationControllerImpl.prototype.popViewControllerAnimated = function (animated) {
var _this = this;
var lastViewController = this.viewControllers.lastObject;
var navigationTransition = lastViewController[TRANSITION];
if (frame_common_1.traceEnabled()) {
frame_common_1.traceWrite("UINavigationControllerImpl.popViewControllerAnimated(" + animated + "); transition: " + JSON.stringify(navigationTransition), frame_common_1.traceCategories.NativeLifecycle);
}
if (navigationTransition && navigationTransition.name === "non-animated") {
return _super.prototype.popViewControllerAnimated.call(this, false);
}
var nativeTransition = _getNativeTransition(navigationTransition, false);
if (!animated || !navigationTransition || !nativeTransition) {
return _super.prototype.popViewControllerAnimated.call(this, animated);
}
this.animateWithDuration(navigationTransition, nativeTransition, "pop", function () {
_super.prototype.popViewControllerAnimated.call(_this, false);
});
return null;
};
UINavigationControllerImpl.prototype.popToViewControllerAnimated = function (viewController, animated) {
var _this = this;
var lastViewController = this.viewControllers.lastObject;
var navigationTransition = lastViewController[TRANSITION];
if (frame_common_1.traceEnabled()) {
frame_common_1.traceWrite("UINavigationControllerImpl.popToViewControllerAnimated(" + viewController + ", " + animated + "); transition: " + JSON.stringify(navigationTransition), frame_common_1.traceCategories.NativeLifecycle);
}
if (navigationTransition && navigationTransition.name === "non-animated") {
return _super.prototype.popToViewControllerAnimated.call(this, viewController, false);
}
var nativeTransition = _getNativeTransition(navigationTransition, false);
if (!animated || !navigationTransition || !nativeTransition) {
return _super.prototype.popToViewControllerAnimated.call(this, viewController, animated);
}
this.animateWithDuration(navigationTransition, nativeTransition, "popTo", function () {
_super.prototype.popToViewControllerAnimated.call(_this, viewController, false);
});
return null;
};
__decorate([
profiling_1.profile
], UINavigationControllerImpl.prototype, "viewWillAppear", null);
__decorate([
profiling_1.profile
], UINavigationControllerImpl.prototype, "viewDidDisappear", null);
__decorate([
profiling_1.profile
], UINavigationControllerImpl.prototype, "pushViewControllerAnimated", null);
__decorate([
profiling_1.profile
], UINavigationControllerImpl.prototype, "setViewControllersAnimated", null);
return UINavigationControllerImpl;
}(UINavigationController));
function _getTransitionId(nativeTransition, transitionType) {
var name;
switch (nativeTransition) {
case 4:
name = "CurlDown";
break;
case 3:
name = "CurlUp";
break;
case 1:
name = "FlipFromLeft";
break;
case 2:
name = "FlipFromRight";
break;
case 0:
name = "None";
break;
}
return name + " " + transitionType;
}
function _getNativeTransition(navigationTransition, push) {
if (navigationTransition && navigationTransition.name) {
switch (navigationTransition.name.toLowerCase()) {
case "flip":
case "flipright":
return push ? 2 : 1;
case "flipleft":
return push ? 1 : 2;
case "curl":
case "curlup":
return push ? 3 : 4;
case "curldown":
return push ? 4 : 3;
}
}
return null;
}
function _getNativeCurve(transition) {
if (transition.curve) {
switch (transition.curve) {
case "easeIn":
if (frame_common_1.traceEnabled()) {
frame_common_1.traceWrite("Transition curve resolved to UIViewAnimationCurve.EaseIn.", frame_common_1.traceCategories.Transition);
}
return 1;
case "easeOut":
if (frame_common_1.traceEnabled()) {
frame_common_1.traceWrite("Transition curve resolved to UIViewAnimationCurve.EaseOut.", frame_common_1.traceCategories.Transition);
}
return 2;
case "easeInOut":
if (frame_common_1.traceEnabled()) {
frame_common_1.traceWrite("Transition curve resolved to UIViewAnimationCurve.EaseInOut.", frame_common_1.traceCategories.Transition);
}
return 0;
case "linear":
if (frame_common_1.traceEnabled()) {
frame_common_1.traceWrite("Transition curve resolved to UIViewAnimationCurve.Linear.", frame_common_1.traceCategories.Transition);
}
return 3;
default:
if (frame_common_1.traceEnabled()) {
frame_common_1.traceWrite("Transition curve resolved to original: " + transition.curve, frame_common_1.traceCategories.Transition);
}
return transition.curve;
}
}
return 0;
}
exports._getNativeCurve = _getNativeCurve;
var iOSFrame = (function () {
function iOSFrame(frame) {
this._navBarVisibility = "auto";
this._controller = UINavigationControllerImpl.initWithOwner(new WeakRef(frame));
}
Object.defineProperty(iOSFrame.prototype, "controller", {
get: function () {
return this._controller;
},
set: function (value) {
this._controller = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(iOSFrame.prototype, "showNavigationBar", {
get: function () {
return this._showNavigationBar;
},
set: function (value) {
this._showNavigationBar = value;
this._controller.setNavigationBarHiddenAnimated(!value, !this._disableNavBarAnimation);
},
enumerable: true,
configurable: true
});
Object.defineProperty(iOSFrame.prototype, "navBarVisibility", {
get: function () {
return this._navBarVisibility;
},
set: function (value) {
this._navBarVisibility = value;
},
enumerable: true,
configurable: true
});
return iOSFrame;
}());
//# sourceMappingURL=frame.ios.js.map
/***/ }),
/***/ "../node_modules/tns-core-modules/ui/gestures/gestures-common.js":
/***/ (function(module, exports) {
Object.defineProperty(exports, "__esModule", { value: true });
var GestureTypes;
(function (GestureTypes) {
GestureTypes[GestureTypes["tap"] = 1] = "tap";
GestureTypes[GestureTypes["doubleTap"] = 2] = "doubleTap";
GestureTypes[GestureTypes["pinch"] = 4] = "pinch";
GestureTypes[GestureTypes["pan"] = 8] = "pan";
GestureTypes[GestureTypes["swipe"] = 16] = "swipe";
GestureTypes[GestureTypes["rotation"] = 32] = "rotation";
GestureTypes[GestureTypes["longPress"] = 64] = "longPress";
GestureTypes[GestureTypes["touch"] = 128] = "touch";
})(GestureTypes = exports.GestureTypes || (exports.GestureTypes = {}));
var GestureStateTypes;
(function (GestureStateTypes) {
GestureStateTypes[GestureStateTypes["cancelled"] = 0] = "cancelled";
GestureStateTypes[GestureStateTypes["began"] = 1] = "began";
GestureStateTypes[GestureStateTypes["changed"] = 2] = "changed";
GestureStateTypes[GestureStateTypes["ended"] = 3] = "ended";
})(GestureStateTypes = exports.GestureStateTypes || (exports.GestureStateTypes = {}));
var SwipeDirection;
(function (SwipeDirection) {
SwipeDirection[SwipeDirection["right"] = 1] = "right";
SwipeDirection[SwipeDirection["left"] = 2] = "left";
SwipeDirection[SwipeDirection["up"] = 4] = "up";
SwipeDirection[SwipeDirection["down"] = 8] = "down";
})(SwipeDirection = exports.SwipeDirection || (exports.SwipeDirection = {}));
var TouchAction;
(function (TouchAction) {
TouchAction.down = "down";
TouchAction.up = "up";
TouchAction.move = "move";
TouchAction.cancel = "cancel";
})(TouchAction = exports.TouchAction || (exports.TouchAction = {}));
function toString(type, separator) {
var types = new Array();
if (type & GestureTypes.tap) {
types.push("tap");
}
if (type & GestureTypes.doubleTap) {
types.push("doubleTap");
}
if (type & GestureTypes.pinch) {
types.push("pinch");
}
if (type & GestureTypes.pan) {
types.push("pan");
}
if (type & GestureTypes.swipe) {
types.push("swipe");
}
if (type & GestureTypes.rotation) {
types.push("rotation");
}
if (type & GestureTypes.longPress) {
types.push("longPress");
}
if (type & GestureTypes.touch) {
types.push("touch");
}
return types.join(separator);
}
exports.toString = toString;
function fromString(type) {
var t = type.trim().toLowerCase();
if (t === "tap") {
return GestureTypes.tap;
}
else if (t === "doubletap") {
return GestureTypes.doubleTap;
}
else if (t === "pinch") {
return GestureTypes.pinch;
}
else if (t === "pan") {
return GestureTypes.pan;
}
else if (t === "swipe") {
return GestureTypes.swipe;
}
else if (t === "rotation") {
return GestureTypes.rotation;
}
else if (t === "longpress") {
return GestureTypes.longPress;
}
else if (t === "touch") {
return GestureTypes.touch;
}
return undefined;
}
exports.fromString = fromString;
var GesturesObserverBase = (function () {
function GesturesObserverBase(target, callback, context) {
this._target = target;
this._callback = callback;
this._context = context;
}
Object.defineProperty(GesturesObserverBase.prototype, "callback", {
get: function () {
return this._callback;
},
enumerable: true,
configurable: true
});
Object.defineProperty(GesturesObserverBase.prototype, "target", {
get: function () {
return this._target;
},
enumerable: true,
configurable: true
});
Object.defineProperty(GesturesObserverBase.prototype, "context", {
get: function () {
return this._context;
},
enumerable: true,
configurable: true
});
GesturesObserverBase.prototype.disconnect = function () {
if (this.target) {
var list = this.target.getGestureObservers(this.type);
if (list && list.length > 0) {
for (var i = 0; i < list.length; i++) {
if (list[i].callback === this.callback) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment