qcobjects 2.5.104-beta → 2.5.106-beta
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/VERSION +1 -1
- package/build/Cast.js +4 -2
- package/build/Logger.js +2 -0
- package/build/MainProcess.js +3 -6
- package/build/QCObjects.js +4 -1
- package/build/globalSettings.js +7 -0
- package/build/index.d.ts +179 -172
- package/build/top.js +19 -5
- package/package.json +1 -1
- package/public/browser/QCObjects.js +359 -338
- package/public/browser/QCObjects.js.map +4 -4
- package/public/cjs/QCObjects.cjs +361 -338
- package/public/cjs/QCObjects.cjs.map +4 -4
- package/public/esm/QCObjects.mjs +359 -338
- package/public/esm/QCObjects.mjs.map +4 -4
- package/src/Cast.ts +4 -2
- package/src/Logger.ts +2 -0
- package/src/MainProcess.ts +5 -9
- package/src/QCObjects.ts +1 -0
- package/src/globalSettings.ts +10 -1
- package/src/top.ts +23 -8
|
@@ -114,11 +114,53 @@ var global = (() => {
|
|
|
114
114
|
}
|
|
115
115
|
});
|
|
116
116
|
|
|
117
|
+
// src/make_global.ts
|
|
118
|
+
var __make_global__;
|
|
119
|
+
var init_make_global = __esm({
|
|
120
|
+
"src/make_global.ts"() {
|
|
121
|
+
"use strict";
|
|
122
|
+
init_platform();
|
|
123
|
+
init_top();
|
|
124
|
+
__make_global__ = /* @__PURE__ */ __name(function(f) {
|
|
125
|
+
if (typeof f !== "undefined") {
|
|
126
|
+
if (isBrowser) {
|
|
127
|
+
try {
|
|
128
|
+
_top[f.name] = f;
|
|
129
|
+
window[f.name] = f;
|
|
130
|
+
} catch (e) {
|
|
131
|
+
throw Error(`An error ocurred: ${e}`);
|
|
132
|
+
}
|
|
133
|
+
} else if (typeof global !== "undefined") {
|
|
134
|
+
if (!Object.hasOwn(global, f.name)) {
|
|
135
|
+
global[f.name] = f;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}, "__make_global__");
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
|
|
143
|
+
// src/Export.ts
|
|
144
|
+
var Export;
|
|
145
|
+
var init_Export = __esm({
|
|
146
|
+
"src/Export.ts"() {
|
|
147
|
+
"use strict";
|
|
148
|
+
init_make_global();
|
|
149
|
+
Export = /* @__PURE__ */ __name(function(f) {
|
|
150
|
+
return __make_global__(f);
|
|
151
|
+
}, "Export");
|
|
152
|
+
Export.prototype.toString = function() {
|
|
153
|
+
return "Export(function or symbol) { [QCObjects native code] }";
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
});
|
|
157
|
+
|
|
117
158
|
// src/Logger.ts
|
|
118
159
|
var Logger, logger;
|
|
119
160
|
var init_Logger = __esm({
|
|
120
161
|
"src/Logger.ts"() {
|
|
121
162
|
"use strict";
|
|
163
|
+
init_Export();
|
|
122
164
|
init_platform();
|
|
123
165
|
Logger = class {
|
|
124
166
|
static {
|
|
@@ -150,6 +192,7 @@ var global = (() => {
|
|
|
150
192
|
}
|
|
151
193
|
};
|
|
152
194
|
logger = new Logger();
|
|
195
|
+
Export(logger);
|
|
153
196
|
}
|
|
154
197
|
});
|
|
155
198
|
|
|
@@ -172,13 +215,15 @@ var global = (() => {
|
|
|
172
215
|
}
|
|
173
216
|
return obj_dest;
|
|
174
217
|
}, "_Cast");
|
|
175
|
-
_CastProps = /* @__PURE__ */ __name(function(obj_source, obj_dest) {
|
|
218
|
+
_CastProps = /* @__PURE__ */ __name(function(obj_source, obj_dest, _ignoreError = true) {
|
|
176
219
|
for (const v in obj_source) {
|
|
177
220
|
if (typeof obj_source[v] !== "undefined" && typeof obj_source[v] !== "function") {
|
|
178
221
|
try {
|
|
179
222
|
obj_dest[v] = obj_source[v];
|
|
180
223
|
} catch (e) {
|
|
181
|
-
|
|
224
|
+
if (!_ignoreError) {
|
|
225
|
+
logger.debug(`An error ocurred: ${e}.`);
|
|
226
|
+
}
|
|
182
227
|
}
|
|
183
228
|
} else if (typeof obj_source[v] === "function") {
|
|
184
229
|
try {
|
|
@@ -375,32 +420,6 @@ var global = (() => {
|
|
|
375
420
|
}
|
|
376
421
|
});
|
|
377
422
|
|
|
378
|
-
// src/make_global.ts
|
|
379
|
-
var __make_global__;
|
|
380
|
-
var init_make_global = __esm({
|
|
381
|
-
"src/make_global.ts"() {
|
|
382
|
-
"use strict";
|
|
383
|
-
init_platform();
|
|
384
|
-
init_top();
|
|
385
|
-
__make_global__ = /* @__PURE__ */ __name(function(f) {
|
|
386
|
-
if (typeof f !== "undefined") {
|
|
387
|
-
if (isBrowser) {
|
|
388
|
-
try {
|
|
389
|
-
_top[f.name] = f;
|
|
390
|
-
window[f.name] = f;
|
|
391
|
-
} catch (e) {
|
|
392
|
-
throw Error(`An error ocurred: ${e}`);
|
|
393
|
-
}
|
|
394
|
-
} else if (typeof global !== "undefined") {
|
|
395
|
-
if (!Object.hasOwn(global, f.name)) {
|
|
396
|
-
global[f.name] = f;
|
|
397
|
-
}
|
|
398
|
-
}
|
|
399
|
-
}
|
|
400
|
-
}, "__make_global__");
|
|
401
|
-
}
|
|
402
|
-
});
|
|
403
|
-
|
|
404
423
|
// src/RegisterClass.ts
|
|
405
424
|
var __register_class__, RegisterClass;
|
|
406
425
|
var init_RegisterClass = __esm({
|
|
@@ -1584,21 +1603,6 @@ var global = (() => {
|
|
|
1584
1603
|
}
|
|
1585
1604
|
});
|
|
1586
1605
|
|
|
1587
|
-
// src/Export.ts
|
|
1588
|
-
var Export;
|
|
1589
|
-
var init_Export = __esm({
|
|
1590
|
-
"src/Export.ts"() {
|
|
1591
|
-
"use strict";
|
|
1592
|
-
init_make_global();
|
|
1593
|
-
Export = /* @__PURE__ */ __name(function(f) {
|
|
1594
|
-
return __make_global__(f);
|
|
1595
|
-
}, "Export");
|
|
1596
|
-
Export.prototype.toString = function() {
|
|
1597
|
-
return "Export(function or symbol) { [QCObjects native code] }";
|
|
1598
|
-
};
|
|
1599
|
-
}
|
|
1600
|
-
});
|
|
1601
|
-
|
|
1602
1606
|
// src/asyncLoad.ts
|
|
1603
1607
|
function asyncLoad(callback, args) {
|
|
1604
1608
|
class AsyncCallback {
|
|
@@ -3461,57 +3465,316 @@ var global = (() => {
|
|
|
3461
3465
|
}
|
|
3462
3466
|
});
|
|
3463
3467
|
|
|
3464
|
-
// src/
|
|
3465
|
-
var
|
|
3466
|
-
var
|
|
3467
|
-
"src/
|
|
3468
|
-
"use strict";
|
|
3469
|
-
init_ComponentFactory();
|
|
3470
|
-
_top = typeof self !== "undefined" && self || typeof window !== "undefined" && window || typeof global !== "undefined" && global || void 0;
|
|
3471
|
-
_top.lastCache = void 0;
|
|
3472
|
-
componentsStack = [];
|
|
3473
|
-
resetTop = /* @__PURE__ */ __name((_top_) => {
|
|
3474
|
-
_top = _top_;
|
|
3475
|
-
}, "resetTop");
|
|
3476
|
-
buildComponentsStack = /* @__PURE__ */ __name(() => {
|
|
3477
|
-
componentsStack = buildComponents(document);
|
|
3478
|
-
}, "buildComponentsStack");
|
|
3479
|
-
setConfigService = /* @__PURE__ */ __name((_configService) => {
|
|
3480
|
-
_top.global.configService = _configService;
|
|
3481
|
-
configService = _configService;
|
|
3482
|
-
}, "setConfigService");
|
|
3483
|
-
}
|
|
3484
|
-
});
|
|
3485
|
-
|
|
3486
|
-
// src/subelements.ts
|
|
3487
|
-
var subelements;
|
|
3488
|
-
var init_subelements = __esm({
|
|
3489
|
-
"src/subelements.ts"() {
|
|
3468
|
+
// src/Service.ts
|
|
3469
|
+
var Service, JSONService, ConfigService;
|
|
3470
|
+
var init_Service = __esm({
|
|
3471
|
+
"src/Service.ts"() {
|
|
3490
3472
|
"use strict";
|
|
3491
|
-
|
|
3492
|
-
|
|
3493
|
-
|
|
3494
|
-
|
|
3473
|
+
init_basePath();
|
|
3474
|
+
init_Crypt();
|
|
3475
|
+
init_domain();
|
|
3476
|
+
init_InheritClass();
|
|
3477
|
+
init_Logger();
|
|
3478
|
+
init_Package();
|
|
3479
|
+
init_secretKey();
|
|
3480
|
+
init_CONFIG();
|
|
3481
|
+
Service = class extends InheritClass {
|
|
3482
|
+
static {
|
|
3483
|
+
__name(this, "Service");
|
|
3484
|
+
}
|
|
3485
|
+
options;
|
|
3486
|
+
withCredentials;
|
|
3487
|
+
useHTTP2;
|
|
3488
|
+
// eslint-disable-next-line no-unused-vars
|
|
3489
|
+
mockup({ request, service }) {
|
|
3490
|
+
throw new Error("Method not implemented.");
|
|
3491
|
+
}
|
|
3492
|
+
name;
|
|
3493
|
+
responseHeaders;
|
|
3494
|
+
// eslint-disable-next-line no-unused-vars
|
|
3495
|
+
local({ request, service }) {
|
|
3496
|
+
throw new Error("Method not implemented.");
|
|
3497
|
+
}
|
|
3498
|
+
kind = "rest";
|
|
3499
|
+
/* it can be rest, mockup, local */
|
|
3500
|
+
domain = _domain_;
|
|
3501
|
+
basePath = _basePath_;
|
|
3502
|
+
url = "";
|
|
3503
|
+
method = "GET";
|
|
3504
|
+
data = {};
|
|
3505
|
+
reload = false;
|
|
3506
|
+
cached = false;
|
|
3507
|
+
headers;
|
|
3508
|
+
template;
|
|
3509
|
+
// eslint-disable-next-line no-unused-vars
|
|
3510
|
+
done({ request, service }) {
|
|
3511
|
+
throw new Error("Method not implemented.");
|
|
3512
|
+
}
|
|
3513
|
+
// eslint-disable-next-line no-unused-vars
|
|
3514
|
+
fail(...args) {
|
|
3515
|
+
throw new Error("Method not implemented.");
|
|
3516
|
+
}
|
|
3517
|
+
set(name, value) {
|
|
3518
|
+
this[name] = value;
|
|
3519
|
+
}
|
|
3520
|
+
get(name, _default) {
|
|
3521
|
+
return this[name] || _default;
|
|
3522
|
+
}
|
|
3523
|
+
};
|
|
3524
|
+
JSONService = class extends Service {
|
|
3525
|
+
static {
|
|
3526
|
+
__name(this, "JSONService");
|
|
3527
|
+
}
|
|
3528
|
+
method = "GET";
|
|
3529
|
+
cached = false;
|
|
3530
|
+
headers = {
|
|
3531
|
+
"Content-Type": "application/json",
|
|
3532
|
+
"charset": "utf-8"
|
|
3533
|
+
};
|
|
3534
|
+
JSONresponse = void 0;
|
|
3535
|
+
done(result) {
|
|
3536
|
+
logger.debug("***** RECEIVED RESPONSE:");
|
|
3537
|
+
logger.debug(result.service.template);
|
|
3538
|
+
this.JSONresponse = JSON.parse(result.service.template);
|
|
3539
|
+
}
|
|
3540
|
+
};
|
|
3541
|
+
ConfigService = class extends JSONService {
|
|
3542
|
+
static {
|
|
3543
|
+
__name(this, "ConfigService");
|
|
3544
|
+
}
|
|
3545
|
+
method = "GET";
|
|
3546
|
+
cached = false;
|
|
3547
|
+
configFileName = "config.json";
|
|
3548
|
+
headers = {
|
|
3549
|
+
"Content-Type": "application/json",
|
|
3550
|
+
"charset": "utf-8"
|
|
3551
|
+
};
|
|
3552
|
+
configLoaded() {
|
|
3553
|
+
throw Error("Method not implemented.");
|
|
3554
|
+
}
|
|
3555
|
+
JSONresponse = void 0;
|
|
3556
|
+
done(result) {
|
|
3557
|
+
logger.debug("***** CONFIG LOADED:");
|
|
3558
|
+
logger.debug(result.service.template);
|
|
3559
|
+
this.JSONresponse = JSON.parse(result.service.template);
|
|
3560
|
+
if (Object.hasOwn(this.JSONresponse, "__encoded__")) {
|
|
3561
|
+
const decodedValue = _Crypt.decrypt(this.JSONresponse?.__encoded__, _secretKey);
|
|
3562
|
+
this.JSONresponse = JSON.parse(decodedValue);
|
|
3563
|
+
}
|
|
3564
|
+
const jsonResponse = this.JSONresponse;
|
|
3565
|
+
Object.keys(jsonResponse).map((k) => {
|
|
3566
|
+
CONFIG.set(k, jsonResponse[k]);
|
|
3567
|
+
return k;
|
|
3568
|
+
});
|
|
3569
|
+
this.configLoaded().catch((e) => {
|
|
3570
|
+
throw new Error(`An error ocurred: ${e}`);
|
|
3571
|
+
});
|
|
3572
|
+
}
|
|
3573
|
+
fail() {
|
|
3574
|
+
this.configLoaded().catch((e) => {
|
|
3575
|
+
throw new Error(`An error ocurred: ${e}`);
|
|
3576
|
+
});
|
|
3577
|
+
}
|
|
3578
|
+
constructor() {
|
|
3579
|
+
super();
|
|
3580
|
+
this.set("url", `${this.get("basePath")}${this.get("configFileName")}`);
|
|
3581
|
+
}
|
|
3582
|
+
};
|
|
3583
|
+
Package("com.qcobjects.api", [
|
|
3584
|
+
Service
|
|
3585
|
+
]);
|
|
3586
|
+
Package("com.qcobjects.api.services", [
|
|
3587
|
+
JSONService
|
|
3588
|
+
]);
|
|
3589
|
+
Package("com.qcobjects.api.config", [
|
|
3590
|
+
ConfigService
|
|
3591
|
+
]);
|
|
3495
3592
|
}
|
|
3496
3593
|
});
|
|
3497
3594
|
|
|
3498
|
-
// src/
|
|
3499
|
-
var
|
|
3500
|
-
var
|
|
3501
|
-
"src/
|
|
3595
|
+
// src/globalSettings.ts
|
|
3596
|
+
var GlobalSettings;
|
|
3597
|
+
var init_globalSettings = __esm({
|
|
3598
|
+
"src/globalSettings.ts"() {
|
|
3502
3599
|
"use strict";
|
|
3600
|
+
init_CONFIG();
|
|
3601
|
+
init_InheritClass();
|
|
3503
3602
|
init_Logger();
|
|
3504
|
-
|
|
3505
|
-
|
|
3506
|
-
|
|
3507
|
-
|
|
3508
|
-
|
|
3509
|
-
|
|
3510
|
-
|
|
3511
|
-
|
|
3512
|
-
|
|
3513
|
-
|
|
3514
|
-
|
|
3603
|
+
init_Package();
|
|
3604
|
+
init_platform();
|
|
3605
|
+
init_serviceLoader();
|
|
3606
|
+
init_top();
|
|
3607
|
+
init_Service();
|
|
3608
|
+
GlobalSettings = class _GlobalSettings extends InheritClass {
|
|
3609
|
+
static {
|
|
3610
|
+
__name(this, "GlobalSettings");
|
|
3611
|
+
}
|
|
3612
|
+
static __start__() {
|
|
3613
|
+
return _GlobalSettings.instance.__start__();
|
|
3614
|
+
}
|
|
3615
|
+
_GLOBAL = {};
|
|
3616
|
+
static _instance;
|
|
3617
|
+
static get instance() {
|
|
3618
|
+
if (typeof _GlobalSettings._instance === "undefined") {
|
|
3619
|
+
_GlobalSettings._instance = new _GlobalSettings();
|
|
3620
|
+
}
|
|
3621
|
+
return _GlobalSettings._instance;
|
|
3622
|
+
}
|
|
3623
|
+
_logger = new Logger();
|
|
3624
|
+
get logger() {
|
|
3625
|
+
return this._logger;
|
|
3626
|
+
}
|
|
3627
|
+
set logger(value) {
|
|
3628
|
+
this._logger = value;
|
|
3629
|
+
}
|
|
3630
|
+
set(name, value) {
|
|
3631
|
+
this._GLOBAL[name] = value;
|
|
3632
|
+
}
|
|
3633
|
+
get(name, _default) {
|
|
3634
|
+
let _value;
|
|
3635
|
+
if (typeof this._GLOBAL[name] !== "undefined") {
|
|
3636
|
+
_value = this._GLOBAL[name];
|
|
3637
|
+
} else if (typeof _default !== "undefined") {
|
|
3638
|
+
_value = _default;
|
|
3639
|
+
}
|
|
3640
|
+
return _value;
|
|
3641
|
+
}
|
|
3642
|
+
__start__() {
|
|
3643
|
+
const __load__serviceWorker = /* @__PURE__ */ __name(function() {
|
|
3644
|
+
let _promise;
|
|
3645
|
+
if (isBrowser) {
|
|
3646
|
+
_promise = new Promise(function(resolve, reject) {
|
|
3647
|
+
if ("serviceWorker" in navigator && typeof CONFIG.get("serviceWorkerURI") !== "undefined") {
|
|
3648
|
+
CONFIG.set("serviceWorkerScope", CONFIG.get("serviceWorkerScope") ? CONFIG.get("serviceWorkerScope") : "/");
|
|
3649
|
+
navigator.serviceWorker.register(CONFIG.get("serviceWorkerURI"), {
|
|
3650
|
+
scope: CONFIG.get("serviceWorkerScope")
|
|
3651
|
+
}).then(function(registration) {
|
|
3652
|
+
logger.debug("Service Worker Registered");
|
|
3653
|
+
resolve.call(_promise, registration);
|
|
3654
|
+
}, function(registration) {
|
|
3655
|
+
logger.debug("Error registering Service Worker");
|
|
3656
|
+
reject.call(_promise, registration);
|
|
3657
|
+
});
|
|
3658
|
+
navigator.serviceWorker.ready.then(function(registration) {
|
|
3659
|
+
logger.debug("Service Worker Ready");
|
|
3660
|
+
resolve.call(_promise, registration);
|
|
3661
|
+
}, function(registration) {
|
|
3662
|
+
logger.debug("Error loading Service Worker");
|
|
3663
|
+
reject.call(_promise, registration);
|
|
3664
|
+
});
|
|
3665
|
+
}
|
|
3666
|
+
});
|
|
3667
|
+
} else {
|
|
3668
|
+
_promise = Promise.resolve();
|
|
3669
|
+
}
|
|
3670
|
+
return _promise;
|
|
3671
|
+
}, "__load__serviceWorker");
|
|
3672
|
+
const _buildComponents = /* @__PURE__ */ __name(function() {
|
|
3673
|
+
return new Promise((resolve) => {
|
|
3674
|
+
if (isBrowser) {
|
|
3675
|
+
logger.debug("Starting to building components");
|
|
3676
|
+
try {
|
|
3677
|
+
buildComponentsStack();
|
|
3678
|
+
} catch (e) {
|
|
3679
|
+
throw Error(`Something went wrong trying to start components tree: ${e.message}`);
|
|
3680
|
+
}
|
|
3681
|
+
logger.debug("Initializing the service worker");
|
|
3682
|
+
__load__serviceWorker.call(_top).catch(function(e) {
|
|
3683
|
+
logger.debug(`error loading the service worker ${e}`);
|
|
3684
|
+
});
|
|
3685
|
+
}
|
|
3686
|
+
resolve();
|
|
3687
|
+
});
|
|
3688
|
+
}, "_buildComponents");
|
|
3689
|
+
return new Promise((resolve) => {
|
|
3690
|
+
logger.debug("Starting to load the config settings...");
|
|
3691
|
+
if (CONFIG.get("useConfigService", false)) {
|
|
3692
|
+
logger.debug("Loading settings using local configuration file...");
|
|
3693
|
+
setConfigService(new ConfigService());
|
|
3694
|
+
configService.configLoaded = _buildComponents;
|
|
3695
|
+
serviceLoader(configService)?.then((standardResponse) => {
|
|
3696
|
+
resolve(standardResponse);
|
|
3697
|
+
})?.catch((e) => {
|
|
3698
|
+
throw new Error(`An error ocurred while trying to load ${configService.url}: ${e}`);
|
|
3699
|
+
});
|
|
3700
|
+
} else {
|
|
3701
|
+
logger.debug("Starting to load the components...");
|
|
3702
|
+
_buildComponents.call(this).then(() => {
|
|
3703
|
+
resolve({});
|
|
3704
|
+
}).catch((e) => {
|
|
3705
|
+
throw new Error(`An error ocurred while trying to build the components stack. ${e}`);
|
|
3706
|
+
});
|
|
3707
|
+
}
|
|
3708
|
+
});
|
|
3709
|
+
}
|
|
3710
|
+
};
|
|
3711
|
+
Package("com.qcobjects", [
|
|
3712
|
+
GlobalSettings
|
|
3713
|
+
]);
|
|
3714
|
+
}
|
|
3715
|
+
});
|
|
3716
|
+
|
|
3717
|
+
// src/top.ts
|
|
3718
|
+
var _top, componentsStack, resetTop, buildComponentsStack, configService, setConfigService, set, get;
|
|
3719
|
+
var init_top = __esm({
|
|
3720
|
+
"src/top.ts"() {
|
|
3721
|
+
"use strict";
|
|
3722
|
+
init_ComponentFactory();
|
|
3723
|
+
init_Cast();
|
|
3724
|
+
init_globalSettings();
|
|
3725
|
+
_top = typeof module !== "undefined" && typeof module.exports !== "undefined" && module.exports || typeof global !== "undefined" && global || typeof globalThis !== "undefined" && globalThis || typeof window !== "undefined" && window || typeof self !== "undefined" && self || void 0;
|
|
3726
|
+
_top.lastCache = void 0;
|
|
3727
|
+
componentsStack = [];
|
|
3728
|
+
resetTop = /* @__PURE__ */ __name(() => {
|
|
3729
|
+
const globalSettings = GlobalSettings.instance;
|
|
3730
|
+
_top = _CastProps(globalSettings, _top, true);
|
|
3731
|
+
}, "resetTop");
|
|
3732
|
+
buildComponentsStack = /* @__PURE__ */ __name(() => {
|
|
3733
|
+
componentsStack = buildComponents(document);
|
|
3734
|
+
}, "buildComponentsStack");
|
|
3735
|
+
setConfigService = /* @__PURE__ */ __name((_configService) => {
|
|
3736
|
+
_top.global.configService = _configService;
|
|
3737
|
+
configService = _configService;
|
|
3738
|
+
}, "setConfigService");
|
|
3739
|
+
set = /* @__PURE__ */ __name((name, value) => {
|
|
3740
|
+
_top[name] = value;
|
|
3741
|
+
}, "set");
|
|
3742
|
+
get = /* @__PURE__ */ __name((name, _defaultValue) => {
|
|
3743
|
+
return _top[name] || _defaultValue;
|
|
3744
|
+
}, "get");
|
|
3745
|
+
resetTop();
|
|
3746
|
+
}
|
|
3747
|
+
});
|
|
3748
|
+
|
|
3749
|
+
// src/subelements.ts
|
|
3750
|
+
var subelements;
|
|
3751
|
+
var init_subelements = __esm({
|
|
3752
|
+
"src/subelements.ts"() {
|
|
3753
|
+
"use strict";
|
|
3754
|
+
subelements = /* @__PURE__ */ __name(function subelements2(query) {
|
|
3755
|
+
const _self = this;
|
|
3756
|
+
return [..._self.querySelectorAll(query)];
|
|
3757
|
+
}, "subelements");
|
|
3758
|
+
}
|
|
3759
|
+
});
|
|
3760
|
+
|
|
3761
|
+
// src/waitUntil.ts
|
|
3762
|
+
var waitUntil;
|
|
3763
|
+
var init_waitUntil = __esm({
|
|
3764
|
+
"src/waitUntil.ts"() {
|
|
3765
|
+
"use strict";
|
|
3766
|
+
init_Logger();
|
|
3767
|
+
waitUntil = /* @__PURE__ */ __name(function(func, exp) {
|
|
3768
|
+
const _waitUntil = /* @__PURE__ */ __name(function(func2, exp2) {
|
|
3769
|
+
const maxWaitCycles = 2e3;
|
|
3770
|
+
let _w = 0;
|
|
3771
|
+
var _t = setInterval(function() {
|
|
3772
|
+
if (exp2()) {
|
|
3773
|
+
clearInterval(_t);
|
|
3774
|
+
func2();
|
|
3775
|
+
logger.debug("Ejecuting " + func2.name + " after wait");
|
|
3776
|
+
} else {
|
|
3777
|
+
if (_w < maxWaitCycles) {
|
|
3515
3778
|
_w += 1;
|
|
3516
3779
|
logger.debug("WAIT UNTIL " + func2.name + " is true, " + _w.toString() + " cycles");
|
|
3517
3780
|
} else {
|
|
@@ -4182,248 +4445,6 @@ var global = (() => {
|
|
|
4182
4445
|
}
|
|
4183
4446
|
});
|
|
4184
4447
|
|
|
4185
|
-
// src/Service.ts
|
|
4186
|
-
var Service, JSONService, ConfigService;
|
|
4187
|
-
var init_Service = __esm({
|
|
4188
|
-
"src/Service.ts"() {
|
|
4189
|
-
"use strict";
|
|
4190
|
-
init_basePath();
|
|
4191
|
-
init_Crypt();
|
|
4192
|
-
init_domain();
|
|
4193
|
-
init_InheritClass();
|
|
4194
|
-
init_Logger();
|
|
4195
|
-
init_Package();
|
|
4196
|
-
init_secretKey();
|
|
4197
|
-
init_CONFIG();
|
|
4198
|
-
Service = class extends InheritClass {
|
|
4199
|
-
static {
|
|
4200
|
-
__name(this, "Service");
|
|
4201
|
-
}
|
|
4202
|
-
options;
|
|
4203
|
-
withCredentials;
|
|
4204
|
-
useHTTP2;
|
|
4205
|
-
// eslint-disable-next-line no-unused-vars
|
|
4206
|
-
mockup({ request, service }) {
|
|
4207
|
-
throw new Error("Method not implemented.");
|
|
4208
|
-
}
|
|
4209
|
-
name;
|
|
4210
|
-
responseHeaders;
|
|
4211
|
-
// eslint-disable-next-line no-unused-vars
|
|
4212
|
-
local({ request, service }) {
|
|
4213
|
-
throw new Error("Method not implemented.");
|
|
4214
|
-
}
|
|
4215
|
-
kind = "rest";
|
|
4216
|
-
/* it can be rest, mockup, local */
|
|
4217
|
-
domain = _domain_;
|
|
4218
|
-
basePath = _basePath_;
|
|
4219
|
-
url = "";
|
|
4220
|
-
method = "GET";
|
|
4221
|
-
data = {};
|
|
4222
|
-
reload = false;
|
|
4223
|
-
cached = false;
|
|
4224
|
-
headers;
|
|
4225
|
-
template;
|
|
4226
|
-
// eslint-disable-next-line no-unused-vars
|
|
4227
|
-
done({ request, service }) {
|
|
4228
|
-
throw new Error("Method not implemented.");
|
|
4229
|
-
}
|
|
4230
|
-
// eslint-disable-next-line no-unused-vars
|
|
4231
|
-
fail(...args) {
|
|
4232
|
-
throw new Error("Method not implemented.");
|
|
4233
|
-
}
|
|
4234
|
-
set(name, value) {
|
|
4235
|
-
this[name] = value;
|
|
4236
|
-
}
|
|
4237
|
-
get(name, _default) {
|
|
4238
|
-
return this[name] || _default;
|
|
4239
|
-
}
|
|
4240
|
-
};
|
|
4241
|
-
JSONService = class extends Service {
|
|
4242
|
-
static {
|
|
4243
|
-
__name(this, "JSONService");
|
|
4244
|
-
}
|
|
4245
|
-
method = "GET";
|
|
4246
|
-
cached = false;
|
|
4247
|
-
headers = {
|
|
4248
|
-
"Content-Type": "application/json",
|
|
4249
|
-
"charset": "utf-8"
|
|
4250
|
-
};
|
|
4251
|
-
JSONresponse = void 0;
|
|
4252
|
-
done(result) {
|
|
4253
|
-
logger.debug("***** RECEIVED RESPONSE:");
|
|
4254
|
-
logger.debug(result.service.template);
|
|
4255
|
-
this.JSONresponse = JSON.parse(result.service.template);
|
|
4256
|
-
}
|
|
4257
|
-
};
|
|
4258
|
-
ConfigService = class extends JSONService {
|
|
4259
|
-
static {
|
|
4260
|
-
__name(this, "ConfigService");
|
|
4261
|
-
}
|
|
4262
|
-
method = "GET";
|
|
4263
|
-
cached = false;
|
|
4264
|
-
configFileName = "config.json";
|
|
4265
|
-
headers = {
|
|
4266
|
-
"Content-Type": "application/json",
|
|
4267
|
-
"charset": "utf-8"
|
|
4268
|
-
};
|
|
4269
|
-
configLoaded() {
|
|
4270
|
-
throw Error("Method not implemented.");
|
|
4271
|
-
}
|
|
4272
|
-
JSONresponse = void 0;
|
|
4273
|
-
done(result) {
|
|
4274
|
-
logger.debug("***** CONFIG LOADED:");
|
|
4275
|
-
logger.debug(result.service.template);
|
|
4276
|
-
this.JSONresponse = JSON.parse(result.service.template);
|
|
4277
|
-
if (Object.hasOwn(this.JSONresponse, "__encoded__")) {
|
|
4278
|
-
const decodedValue = _Crypt.decrypt(this.JSONresponse?.__encoded__, _secretKey);
|
|
4279
|
-
this.JSONresponse = JSON.parse(decodedValue);
|
|
4280
|
-
}
|
|
4281
|
-
const jsonResponse = this.JSONresponse;
|
|
4282
|
-
Object.keys(jsonResponse).map((k) => {
|
|
4283
|
-
CONFIG.set(k, jsonResponse[k]);
|
|
4284
|
-
return k;
|
|
4285
|
-
});
|
|
4286
|
-
this.configLoaded().catch((e) => {
|
|
4287
|
-
throw new Error(`An error ocurred: ${e}`);
|
|
4288
|
-
});
|
|
4289
|
-
}
|
|
4290
|
-
fail() {
|
|
4291
|
-
this.configLoaded().catch((e) => {
|
|
4292
|
-
throw new Error(`An error ocurred: ${e}`);
|
|
4293
|
-
});
|
|
4294
|
-
}
|
|
4295
|
-
constructor() {
|
|
4296
|
-
super();
|
|
4297
|
-
this.set("url", `${this.get("basePath")}${this.get("configFileName")}`);
|
|
4298
|
-
}
|
|
4299
|
-
};
|
|
4300
|
-
Package("com.qcobjects.api", [
|
|
4301
|
-
Service
|
|
4302
|
-
]);
|
|
4303
|
-
Package("com.qcobjects.api.services", [
|
|
4304
|
-
JSONService
|
|
4305
|
-
]);
|
|
4306
|
-
Package("com.qcobjects.api.config", [
|
|
4307
|
-
ConfigService
|
|
4308
|
-
]);
|
|
4309
|
-
}
|
|
4310
|
-
});
|
|
4311
|
-
|
|
4312
|
-
// src/globalSettings.ts
|
|
4313
|
-
var GlobalSettings;
|
|
4314
|
-
var init_globalSettings = __esm({
|
|
4315
|
-
"src/globalSettings.ts"() {
|
|
4316
|
-
"use strict";
|
|
4317
|
-
init_CONFIG();
|
|
4318
|
-
init_InheritClass();
|
|
4319
|
-
init_Logger();
|
|
4320
|
-
init_Package();
|
|
4321
|
-
init_platform();
|
|
4322
|
-
init_serviceLoader();
|
|
4323
|
-
init_top();
|
|
4324
|
-
init_Service();
|
|
4325
|
-
GlobalSettings = class _GlobalSettings extends InheritClass {
|
|
4326
|
-
static {
|
|
4327
|
-
__name(this, "GlobalSettings");
|
|
4328
|
-
}
|
|
4329
|
-
static __start__() {
|
|
4330
|
-
return _GlobalSettings.instance.__start__();
|
|
4331
|
-
}
|
|
4332
|
-
_GLOBAL = {};
|
|
4333
|
-
static _instance;
|
|
4334
|
-
static get instance() {
|
|
4335
|
-
if (typeof _GlobalSettings._instance === "undefined") {
|
|
4336
|
-
_GlobalSettings._instance = new _GlobalSettings();
|
|
4337
|
-
}
|
|
4338
|
-
return _GlobalSettings._instance;
|
|
4339
|
-
}
|
|
4340
|
-
set(name, value) {
|
|
4341
|
-
this._GLOBAL[name] = value;
|
|
4342
|
-
}
|
|
4343
|
-
get(name, _default) {
|
|
4344
|
-
let _value;
|
|
4345
|
-
if (typeof this._GLOBAL[name] !== "undefined") {
|
|
4346
|
-
_value = this._GLOBAL[name];
|
|
4347
|
-
} else if (typeof _default !== "undefined") {
|
|
4348
|
-
_value = _default;
|
|
4349
|
-
}
|
|
4350
|
-
return _value;
|
|
4351
|
-
}
|
|
4352
|
-
__start__() {
|
|
4353
|
-
const __load__serviceWorker = /* @__PURE__ */ __name(function() {
|
|
4354
|
-
let _promise;
|
|
4355
|
-
if (isBrowser) {
|
|
4356
|
-
_promise = new Promise(function(resolve, reject) {
|
|
4357
|
-
if ("serviceWorker" in navigator && typeof CONFIG.get("serviceWorkerURI") !== "undefined") {
|
|
4358
|
-
CONFIG.set("serviceWorkerScope", CONFIG.get("serviceWorkerScope") ? CONFIG.get("serviceWorkerScope") : "/");
|
|
4359
|
-
navigator.serviceWorker.register(CONFIG.get("serviceWorkerURI"), {
|
|
4360
|
-
scope: CONFIG.get("serviceWorkerScope")
|
|
4361
|
-
}).then(function(registration) {
|
|
4362
|
-
logger.debug("Service Worker Registered");
|
|
4363
|
-
resolve.call(_promise, registration);
|
|
4364
|
-
}, function(registration) {
|
|
4365
|
-
logger.debug("Error registering Service Worker");
|
|
4366
|
-
reject.call(_promise, registration);
|
|
4367
|
-
});
|
|
4368
|
-
navigator.serviceWorker.ready.then(function(registration) {
|
|
4369
|
-
logger.debug("Service Worker Ready");
|
|
4370
|
-
resolve.call(_promise, registration);
|
|
4371
|
-
}, function(registration) {
|
|
4372
|
-
logger.debug("Error loading Service Worker");
|
|
4373
|
-
reject.call(_promise, registration);
|
|
4374
|
-
});
|
|
4375
|
-
}
|
|
4376
|
-
});
|
|
4377
|
-
} else {
|
|
4378
|
-
_promise = Promise.resolve();
|
|
4379
|
-
}
|
|
4380
|
-
return _promise;
|
|
4381
|
-
}, "__load__serviceWorker");
|
|
4382
|
-
const _buildComponents = /* @__PURE__ */ __name(function() {
|
|
4383
|
-
return new Promise((resolve) => {
|
|
4384
|
-
if (isBrowser) {
|
|
4385
|
-
logger.debug("Starting to building components");
|
|
4386
|
-
try {
|
|
4387
|
-
buildComponentsStack();
|
|
4388
|
-
} catch (e) {
|
|
4389
|
-
throw Error(`Something went wrong trying to start components tree: ${e.message}`);
|
|
4390
|
-
}
|
|
4391
|
-
logger.debug("Initializing the service worker");
|
|
4392
|
-
__load__serviceWorker.call(_top).catch(function(e) {
|
|
4393
|
-
logger.debug(`error loading the service worker ${e}`);
|
|
4394
|
-
});
|
|
4395
|
-
}
|
|
4396
|
-
resolve();
|
|
4397
|
-
});
|
|
4398
|
-
}, "_buildComponents");
|
|
4399
|
-
return new Promise((resolve) => {
|
|
4400
|
-
logger.debug("Starting to load the config settings...");
|
|
4401
|
-
if (CONFIG.get("useConfigService", false)) {
|
|
4402
|
-
logger.debug("Loading settings using local configuration file...");
|
|
4403
|
-
setConfigService(new ConfigService());
|
|
4404
|
-
configService.configLoaded = _buildComponents;
|
|
4405
|
-
serviceLoader(configService)?.then((standardResponse) => {
|
|
4406
|
-
resolve(standardResponse);
|
|
4407
|
-
})?.catch((e) => {
|
|
4408
|
-
throw new Error(`An error ocurred while trying to load ${configService.url}: ${e}`);
|
|
4409
|
-
});
|
|
4410
|
-
} else {
|
|
4411
|
-
logger.debug("Starting to load the components...");
|
|
4412
|
-
_buildComponents.call(this).then(() => {
|
|
4413
|
-
resolve({});
|
|
4414
|
-
}).catch((e) => {
|
|
4415
|
-
throw new Error(`An error ocurred while trying to build the components stack. ${e}`);
|
|
4416
|
-
});
|
|
4417
|
-
}
|
|
4418
|
-
});
|
|
4419
|
-
}
|
|
4420
|
-
};
|
|
4421
|
-
Package("com.qcobjects", [
|
|
4422
|
-
GlobalSettings
|
|
4423
|
-
]);
|
|
4424
|
-
}
|
|
4425
|
-
});
|
|
4426
|
-
|
|
4427
4448
|
// src/loadSDK.ts
|
|
4428
4449
|
function loadSDK() {
|
|
4429
4450
|
if (CONFIG.get("useSDK")) {
|
|
@@ -4492,6 +4513,7 @@ var global = (() => {
|
|
|
4492
4513
|
var require_MainProcess = __commonJS({
|
|
4493
4514
|
"src/MainProcess.ts"() {
|
|
4494
4515
|
"use strict";
|
|
4516
|
+
init_top();
|
|
4495
4517
|
init_asyncLoad();
|
|
4496
4518
|
init_captureFalseTouch();
|
|
4497
4519
|
init_Cast();
|
|
@@ -4518,7 +4540,6 @@ var global = (() => {
|
|
|
4518
4540
|
init_Ready();
|
|
4519
4541
|
init_serviceLoader();
|
|
4520
4542
|
init_Tag();
|
|
4521
|
-
init_top();
|
|
4522
4543
|
init_Processor();
|
|
4523
4544
|
init_is_a();
|
|
4524
4545
|
init_getType();
|
|
@@ -4530,6 +4551,7 @@ var global = (() => {
|
|
|
4530
4551
|
init_subelements();
|
|
4531
4552
|
init_globalSettings();
|
|
4532
4553
|
init_loadSDK();
|
|
4554
|
+
init_range();
|
|
4533
4555
|
(/* @__PURE__ */ __name(function __qcobjects__(_top2) {
|
|
4534
4556
|
if (typeof Object.defineProperty !== "undefined" && typeof _top2 !== "undefined") {
|
|
4535
4557
|
try {
|
|
@@ -4548,8 +4570,6 @@ var global = (() => {
|
|
|
4548
4570
|
}
|
|
4549
4571
|
if (typeof _top2.__qcobjects__.loaded === "undefined") {
|
|
4550
4572
|
_top2.__qcobjects__.loaded = true;
|
|
4551
|
-
const global2 = _top2;
|
|
4552
|
-
_top2.global = global2;
|
|
4553
4573
|
if (isBrowser) {
|
|
4554
4574
|
Element.prototype.subelements = subelements;
|
|
4555
4575
|
Document.prototype.subelements = subelements;
|
|
@@ -4560,7 +4580,6 @@ var global = (() => {
|
|
|
4560
4580
|
}
|
|
4561
4581
|
logger.debugEnabled = false;
|
|
4562
4582
|
logger.infoEnabled = true;
|
|
4563
|
-
_top2.logger = logger;
|
|
4564
4583
|
if (isBrowser) {
|
|
4565
4584
|
Element.prototype.find = function(tag) {
|
|
4566
4585
|
const _self = this;
|
|
@@ -4627,7 +4646,7 @@ var global = (() => {
|
|
|
4627
4646
|
document.addEventListener("deviceready", _Ready, captureFalseTouch);
|
|
4628
4647
|
}
|
|
4629
4648
|
} else {
|
|
4630
|
-
|
|
4649
|
+
global.onload = _Ready;
|
|
4631
4650
|
}
|
|
4632
4651
|
if (isBrowser) {
|
|
4633
4652
|
window.addEventListener("popstate", function(popStateEvent) {
|
|
@@ -4773,7 +4792,7 @@ var global = (() => {
|
|
|
4773
4792
|
_protected_code_(Array.prototype.matrix3d);
|
|
4774
4793
|
String.prototype.list = function() {
|
|
4775
4794
|
const __instance = this;
|
|
4776
|
-
return
|
|
4795
|
+
return range(0, __instance.length - 1).map(function(i) {
|
|
4777
4796
|
return __instance[i];
|
|
4778
4797
|
});
|
|
4779
4798
|
};
|
|
@@ -4797,7 +4816,6 @@ var global = (() => {
|
|
|
4797
4816
|
Export(isBrowser);
|
|
4798
4817
|
Export(_methods_);
|
|
4799
4818
|
Export(GlobalSettings);
|
|
4800
|
-
resetTop(_CastProps(New(GlobalSettings), _top2));
|
|
4801
4819
|
(function(_top3) {
|
|
4802
4820
|
Object.defineProperty(_top3, "PackagesNameList", {
|
|
4803
4821
|
// eslint-disable-next-line no-unused-vars
|
|
@@ -4878,7 +4896,7 @@ var global = (() => {
|
|
|
4878
4896
|
Class("GLOBAL", _QC_CLASSES.global);
|
|
4879
4897
|
Export(ClassFactory("GLOBAL"));
|
|
4880
4898
|
}
|
|
4881
|
-
Export(
|
|
4899
|
+
Export(global);
|
|
4882
4900
|
loadSDK_default();
|
|
4883
4901
|
})(_top2);
|
|
4884
4902
|
if (isBrowser) {
|
|
@@ -5041,6 +5059,7 @@ var global = (() => {
|
|
|
5041
5059
|
captureFalseTouch: () => captureFalseTouch,
|
|
5042
5060
|
componentLoader: () => componentLoader,
|
|
5043
5061
|
findPackageNodePath: () => findPackageNodePath,
|
|
5062
|
+
get: () => get,
|
|
5044
5063
|
getDocumentLayout: () => getDocumentLayout,
|
|
5045
5064
|
global: () => _top,
|
|
5046
5065
|
isBrowser: () => isBrowser,
|
|
@@ -5054,6 +5073,7 @@ var global = (() => {
|
|
|
5054
5073
|
ready: () => ready,
|
|
5055
5074
|
resetTop: () => resetTop,
|
|
5056
5075
|
serviceLoader: () => serviceLoader,
|
|
5076
|
+
set: () => set,
|
|
5057
5077
|
setDefaultProcessors: () => setDefaultProcessors,
|
|
5058
5078
|
shortCode: () => shortCode,
|
|
5059
5079
|
subelements: () => subelements,
|
|
@@ -6487,6 +6507,7 @@ var global = (() => {
|
|
|
6487
6507
|
init_mathFunctions();
|
|
6488
6508
|
init_top();
|
|
6489
6509
|
init_make_global();
|
|
6510
|
+
init_top();
|
|
6490
6511
|
var QCObjects = __toESM(require_MainProcess());
|
|
6491
6512
|
return __toCommonJS(QCObjects_exports);
|
|
6492
6513
|
})();
|