targetj 1.0.240 → 1.0.242

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/App.js CHANGED
@@ -1,24 +1,4 @@
1
- "use strict";
2
-
3
1
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.tRoot = exports.tApp = exports.isRunning = exports.getVisibles = exports.getTargetManager = exports.getTModelById = exports.getScreenWidth = exports.getScreenHeight = exports.getRunScheduler = exports.getResizeLastUpdate = exports.getPager = exports.getManager = exports.getLocationManager = exports.getLoader = exports.getEvents = exports.getDomTModelById = exports.getAnimationManager = exports.fetchImage = exports.fetch = exports.App = void 0;
8
- var _$Dom = require("./$Dom.js");
9
- var _TModel = require("./TModel.js");
10
- var _EventListener = require("./EventListener.js");
11
- var _LoadingManager = require("./LoadingManager.js");
12
- var _LocationManager = require("./LocationManager.js");
13
- var _PageManager = require("./PageManager.js");
14
- var _TModelManager = require("./TModelManager.js");
15
- var _RunScheduler = require("./RunScheduler.js");
16
- var _TargetManager = require("./TargetManager.js");
17
- var _TargetExecutor = require("./TargetExecutor.js");
18
- var _AnimationManager = require("./AnimationManager.js");
19
- var _TUtil = require("./TUtil.js");
20
- var _DomInit = require("./DomInit.js");
21
- var _SearchUtil = require("./SearchUtil.js");
22
2
  function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
23
3
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
24
4
  function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
@@ -29,6 +9,20 @@ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length)
29
9
  function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
30
10
  function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
31
11
  function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
12
+ import { $Dom } from "./$Dom.js";
13
+ import { TModel } from "./TModel.js";
14
+ import { EventListener } from "./EventListener.js";
15
+ import { LoadingManager } from "./LoadingManager.js";
16
+ import { LocationManager } from "./LocationManager.js";
17
+ import { PageManager } from "./PageManager.js";
18
+ import { TModelManager } from "./TModelManager.js";
19
+ import { RunScheduler } from "./RunScheduler.js";
20
+ import { TargetManager } from "./TargetManager.js";
21
+ import { TargetExecutor } from "./TargetExecutor.js";
22
+ import { AnimationManager } from "./AnimationManager.js";
23
+ import { TUtil } from "./TUtil.js";
24
+ import { DomInit } from "./DomInit.js";
25
+ import { SearchUtil } from "./SearchUtil.js";
32
26
  var tApp;
33
27
  var queuedAppCalls = [];
34
28
  var AppFn = function AppFn() {
@@ -38,37 +32,37 @@ var AppFn = function AppFn() {
38
32
  my.runningFlag = false;
39
33
  my.resizeLastUpdate = 0;
40
34
  my.init = function () {
41
- my.$window = new _$Dom.$Dom(window);
42
- my.loader = new _LoadingManager.LoadingManager();
43
- my.pager = new _PageManager.PageManager();
44
- my.events = new _EventListener.EventListener();
45
- my.locationManager = new _LocationManager.LocationManager();
46
- my.targetManager = new _TargetManager.TargetManager();
47
- my.animationManager = new _AnimationManager.AnimationManager();
48
- my.manager = new _TModelManager.TModelManager();
49
- my.runScheduler = new _RunScheduler.RunScheduler();
35
+ my.$window = new $Dom(window);
36
+ my.loader = new LoadingManager();
37
+ my.pager = new PageManager();
38
+ my.events = new EventListener();
39
+ my.locationManager = new LocationManager();
40
+ my.targetManager = new TargetManager();
41
+ my.animationManager = new AnimationManager();
42
+ my.manager = new TModelManager();
43
+ my.runScheduler = new RunScheduler();
50
44
  my.tRootFactory = function () {
51
- var tmodel = new _TModel.TModel('tRoot', {
45
+ var tmodel = new TModel('tRoot', {
52
46
  styling: false,
53
47
  domHolder: true,
54
48
  isVisible: true,
55
49
  screenWidth: function screenWidth() {
56
- var width = _$Dom.$Dom.getScreenWidth();
50
+ var width = $Dom.getScreenWidth();
57
51
  if (width !== tmodel.val('screenWidth')) {
58
- my.resizeLastUpdate = _TUtil.TUtil.now();
52
+ my.resizeLastUpdate = TUtil.now();
59
53
  }
60
54
  return width;
61
55
  },
62
56
  screenHeight: function screenHeight() {
63
- var height = _$Dom.$Dom.getScreenHeight();
57
+ var height = $Dom.getScreenHeight();
64
58
  if (height !== tmodel.val('screenHeight')) {
65
- my.resizeLastUpdate = _TUtil.TUtil.now();
59
+ my.resizeLastUpdate = TUtil.now();
66
60
  }
67
61
  return height;
68
62
  },
69
63
  initPageDom: function initPageDom() {
70
64
  var _this = this;
71
- _DomInit.DomInit.initPageDoms(this.$dom);
65
+ DomInit.initPageDoms(this.$dom);
72
66
  if (queuedAppCalls.length) {
73
67
  queuedAppCalls.forEach(function (child) {
74
68
  return _this.addChild(child);
@@ -77,18 +71,18 @@ var AppFn = function AppFn() {
77
71
  }
78
72
  }
79
73
  });
80
- tmodel.$dom = _$Dom.$Dom.query('#tgjs-root') ? new _$Dom.$Dom('#tgjs-root') : new _$Dom.$Dom('body');
74
+ tmodel.$dom = $Dom.query('#tgjs-root') ? new $Dom('#tgjs-root') : new $Dom('body');
81
75
  if (tmodel.$dom.getTagName() !== 'body') {
82
76
  tmodel.$dom.attr('data-tjno-slot', 'true');
83
77
  }
84
- tmodel.val('screenWidth', _$Dom.$Dom.getScreenWidth());
85
- tmodel.val('screenHeight', _$Dom.$Dom.getScreenHeight());
78
+ tmodel.val('screenWidth', $Dom.getScreenWidth());
79
+ tmodel.val('screenHeight', $Dom.getScreenHeight());
86
80
  if (my.tRoot) {
87
81
  my.tRoot.getChildren().forEach(function (t) {
88
82
  if (t.val('sourceDom')) {
89
83
  return;
90
84
  }
91
- var child = new _TModel.TModel(t.type, t.targets);
85
+ var child = new TModel(t.type, t.targets);
92
86
  tmodel.addChild(child);
93
87
  });
94
88
  }
@@ -102,8 +96,8 @@ var AppFn = function AppFn() {
102
96
  while (1) switch (_context.prev = _context.next) {
103
97
  case 0:
104
98
  my.runningFlag = false;
105
- _TargetExecutor.TargetExecutor.executeDeclarativeTarget(my.tRoot, 'screenWidth');
106
- _TargetExecutor.TargetExecutor.executeDeclarativeTarget(my.tRoot, 'screenHeight');
99
+ TargetExecutor.executeDeclarativeTarget(my.tRoot, 'screenWidth');
100
+ TargetExecutor.executeDeclarativeTarget(my.tRoot, 'screenHeight');
107
101
  my.events.detachAll();
108
102
  my.events.detachWindowEvents();
109
103
  my.events.attachWindowEvents();
@@ -160,7 +154,7 @@ var AppFn = function AppFn() {
160
154
  for (_iterator.s(); !(_step = _iterator.n()).done;) {
161
155
  var _step$value = _slicedToArray(_step.value, 1),
162
156
  key = _step$value[0];
163
- if (_TUtil.TUtil.isDefined(tmodel.val(key))) {
157
+ if (TUtil.isDefined(tmodel.val(key))) {
164
158
  tmodel.addToStyleTargetList(key);
165
159
  }
166
160
  }
@@ -177,7 +171,7 @@ var AppFn = function AppFn() {
177
171
  my.manager.clearAll();
178
172
  my.locationManager.clear();
179
173
  my.loader.clear();
180
- _SearchUtil.SearchUtil.clear();
174
+ SearchUtil.clear();
181
175
  case 7:
182
176
  case "end":
183
177
  return _context3.stop();
@@ -188,7 +182,7 @@ var AppFn = function AppFn() {
188
182
  return my.runningFlag;
189
183
  };
190
184
  my.find = function (oid) {
191
- return _SearchUtil.SearchUtil.find(oid);
185
+ return SearchUtil.find(oid);
192
186
  };
193
187
  return my;
194
188
  };
@@ -199,12 +193,12 @@ var ensureRunning = function ensureRunning() {
199
193
  }
200
194
  runApp();
201
195
  };
202
- var App = exports.App = function App(firstChild) {
196
+ var App = function App(firstChild) {
203
197
  var _tApp2;
204
198
  if (!firstChild) {
205
199
  return;
206
200
  }
207
- var tmodel = firstChild instanceof _TModel.TModel ? firstChild : new _TModel.TModel("App", firstChild);
201
+ var tmodel = firstChild instanceof TModel ? firstChild : new TModel("App", firstChild);
208
202
  if (!((_tApp2 = tApp) !== null && _tApp2 !== void 0 && _tApp2.tRoot)) {
209
203
  if (document.readyState === "loading") {
210
204
  queuedAppCalls.push(tmodel);
@@ -237,7 +231,7 @@ App.unmount = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime()
237
231
  var _child$$dom2;
238
232
  if (child.val('sourceDom')) {
239
233
  var _child$$dom;
240
- _DomInit.DomInit.restoreDomState((_child$$dom = child.$dom) === null || _child$$dom === void 0 ? void 0 : _child$$dom.element, child.domState);
234
+ DomInit.restoreDomState((_child$$dom = child.$dom) === null || _child$$dom === void 0 ? void 0 : _child$$dom.element, child.domState);
241
235
  return;
242
236
  }
243
237
  if ((_child$$dom2 = child.$dom) !== null && _child$$dom2 !== void 0 && _child$$dom2.attr('tgjs')) {
@@ -254,7 +248,7 @@ App.unmount = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime()
254
248
  case 14:
255
249
  App.oids = {};
256
250
  App.tmodelIdMap = {};
257
- exports.tApp = tApp = undefined;
251
+ tApp = undefined;
258
252
  case 17:
259
253
  case "end":
260
254
  return _context4.stop();
@@ -265,7 +259,7 @@ App.oids = {};
265
259
  App.tmodelIdMap = {};
266
260
  App.getOid = function (type) {
267
261
  var oids = App.oids;
268
- if (!_TUtil.TUtil.isDefined(oids[type])) {
262
+ if (!TUtil.isDefined(oids[type])) {
269
263
  oids[type] = 0;
270
264
  }
271
265
  var num = oids[type]++;
@@ -274,86 +268,91 @@ App.getOid = function (type) {
274
268
  num: num
275
269
  };
276
270
  };
277
- var isRunning = exports.isRunning = function isRunning() {
271
+ var isRunning = function isRunning() {
278
272
  return tApp ? tApp.runningFlag : false;
279
273
  };
280
- var tRoot = exports.tRoot = function tRoot() {
274
+ var tRoot = function tRoot() {
281
275
  var _tApp3;
282
276
  return (_tApp3 = tApp) === null || _tApp3 === void 0 ? void 0 : _tApp3.tRoot;
283
277
  };
284
- var getEvents = exports.getEvents = function getEvents() {
278
+ var getEvents = function getEvents() {
285
279
  var _tApp4;
286
280
  return (_tApp4 = tApp) === null || _tApp4 === void 0 ? void 0 : _tApp4.events;
287
281
  };
288
- var getPager = exports.getPager = function getPager() {
282
+ var getPager = function getPager() {
289
283
  var _tApp5;
290
284
  return (_tApp5 = tApp) === null || _tApp5 === void 0 ? void 0 : _tApp5.pager;
291
285
  };
292
- var getLoader = exports.getLoader = function getLoader() {
286
+ var getLoader = function getLoader() {
293
287
  var _tApp6;
294
288
  return (_tApp6 = tApp) === null || _tApp6 === void 0 ? void 0 : _tApp6.loader;
295
289
  };
296
- var fetch = exports.fetch = function fetch(tmodel, url, query, cacheId) {
290
+ var fetch = function fetch(tmodel, url, query, cacheId) {
297
291
  var _tApp7;
298
292
  return (_tApp7 = tApp) === null || _tApp7 === void 0 || (_tApp7 = _tApp7.loader) === null || _tApp7 === void 0 ? void 0 : _tApp7.fetch(tmodel, url, query, cacheId);
299
293
  };
300
- var fetchImage = exports.fetchImage = function fetchImage(tmodel, src, cacheId) {
294
+ var fetchImage = function fetchImage(tmodel, src, cacheId) {
301
295
  var _tApp8;
302
296
  return (_tApp8 = tApp) === null || _tApp8 === void 0 || (_tApp8 = _tApp8.loader) === null || _tApp8 === void 0 ? void 0 : _tApp8.fetchImage(tmodel, src, cacheId);
303
297
  };
304
- var getManager = exports.getManager = function getManager() {
298
+ var getManager = function getManager() {
305
299
  var _tApp9;
306
300
  return (_tApp9 = tApp) === null || _tApp9 === void 0 ? void 0 : _tApp9.manager;
307
301
  };
308
- var getTargetManager = exports.getTargetManager = function getTargetManager() {
302
+ var getTargetManager = function getTargetManager() {
309
303
  var _tApp10;
310
304
  return (_tApp10 = tApp) === null || _tApp10 === void 0 ? void 0 : _tApp10.targetManager;
311
305
  };
312
- var getAnimationManager = exports.getAnimationManager = function getAnimationManager() {
306
+ var getAnimationManager = function getAnimationManager() {
313
307
  var _tApp11;
314
308
  return (_tApp11 = tApp) === null || _tApp11 === void 0 ? void 0 : _tApp11.animationManager;
315
309
  };
316
- var getRunScheduler = exports.getRunScheduler = function getRunScheduler() {
310
+ var getRunScheduler = function getRunScheduler() {
317
311
  var _tApp12;
318
312
  return (_tApp12 = tApp) === null || _tApp12 === void 0 ? void 0 : _tApp12.runScheduler;
319
313
  };
320
- var getLocationManager = exports.getLocationManager = function getLocationManager() {
314
+ var getLocationManager = function getLocationManager() {
321
315
  var _tApp13;
322
316
  return (_tApp13 = tApp) === null || _tApp13 === void 0 ? void 0 : _tApp13.locationManager;
323
317
  };
324
- var getScreenWidth = exports.getScreenWidth = function getScreenWidth() {
318
+ var getScreenWidth = function getScreenWidth() {
325
319
  var _tApp$tRoot$val, _tApp14;
326
320
  return (_tApp$tRoot$val = (_tApp14 = tApp) === null || _tApp14 === void 0 || (_tApp14 = _tApp14.tRoot) === null || _tApp14 === void 0 ? void 0 : _tApp14.val('screenWidth')) !== null && _tApp$tRoot$val !== void 0 ? _tApp$tRoot$val : 0;
327
321
  };
328
- var getScreenHeight = exports.getScreenHeight = function getScreenHeight() {
322
+ var getScreenHeight = function getScreenHeight() {
329
323
  var _tApp$tRoot$val2, _tApp15;
330
324
  return (_tApp$tRoot$val2 = (_tApp15 = tApp) === null || _tApp15 === void 0 || (_tApp15 = _tApp15.tRoot) === null || _tApp15 === void 0 ? void 0 : _tApp15.val('screenHeight')) !== null && _tApp$tRoot$val2 !== void 0 ? _tApp$tRoot$val2 : 0;
331
325
  };
332
- var getVisibles = exports.getVisibles = function getVisibles() {
326
+ var getVisibles = function getVisibles() {
333
327
  var _tApp16;
334
328
  return (_tApp16 = tApp) === null || _tApp16 === void 0 || (_tApp16 = _tApp16.manager) === null || _tApp16 === void 0 ? void 0 : _tApp16.getVisibles();
335
329
  };
336
- var getResizeLastUpdate = exports.getResizeLastUpdate = function getResizeLastUpdate() {
330
+ var getResizeLastUpdate = function getResizeLastUpdate() {
337
331
  var _tApp17;
338
332
  return (_tApp17 = tApp) === null || _tApp17 === void 0 ? void 0 : _tApp17.resizeLastUpdate;
339
333
  };
340
- var getTModelById = exports.getTModelById = function getTModelById(id) {
334
+ var getTModelById = function getTModelById(id) {
341
335
  return App.tmodelIdMap[id];
342
336
  };
343
- var getDomTModelById = exports.getDomTModelById = function getDomTModelById(id) {
337
+ var getDomTModelById = function getDomTModelById(id) {
344
338
  var tmodel = App.tmodelIdMap[id];
345
339
  return tmodel && tmodel.targets['sourceDom'] ? tmodel : undefined;
346
340
  };
347
- window.t = window.t || getTModelById;
341
+ if (typeof window !== "undefined") {
342
+ window.t = window.t || getTModelById;
343
+ }
348
344
  var runApp = function runApp() {
349
345
  if (tApp) {
350
346
  return;
351
347
  }
352
- exports.tApp = tApp = AppFn();
348
+ tApp = AppFn();
353
349
  tApp.init().start();
354
350
  };
355
- if (document.readyState === "loading") {
356
- document.addEventListener("DOMContentLoaded", runApp);
357
- } else {
358
- runApp();
359
- }
351
+ if (typeof document !== "undefined") {
352
+ if (document.readyState === "loading") {
353
+ document.addEventListener("DOMContentLoaded", runApp);
354
+ } else {
355
+ runApp();
356
+ }
357
+ }
358
+ export { tApp, App, tRoot, isRunning, getEvents, getPager, getLoader, fetch, fetchImage, getManager, getTargetManager, getAnimationManager, getRunScheduler, getLocationManager, getScreenWidth, getScreenHeight, getVisibles, getResizeLastUpdate, getTModelById, getDomTModelById };