@plattar/plattar-ar-adapter 1.123.7 → 1.129.1
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/es2015/plattar-ar-adapter.js +506 -355
- package/build/es2015/plattar-ar-adapter.min.js +1 -1
- package/build/es2019/plattar-ar-adapter.js +137 -27
- package/build/es2019/plattar-ar-adapter.min.js +2 -2
- package/dist/embed/controllers/configurator-controller.d.ts +1 -4
- package/dist/embed/controllers/configurator-controller.js +1 -4
- package/dist/embed/controllers/plattar-controller.d.ts +20 -5
- package/dist/embed/controllers/plattar-controller.js +84 -0
- package/dist/embed/controllers/product-controller.d.ts +1 -4
- package/dist/embed/controllers/product-controller.js +9 -4
- package/dist/embed/controllers/viewer-controller.d.ts +1 -4
- package/dist/embed/controllers/viewer-controller.js +20 -7
- package/dist/embed/controllers/vto-controller.d.ts +1 -4
- package/dist/embed/controllers/vto-controller.js +1 -4
- package/dist/index.js +5 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +8 -8
|
@@ -1106,15 +1106,9 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
1106
1106
|
var _super6 = _createSuper(ConfiguratorController);
|
|
1107
1107
|
|
|
1108
1108
|
function ConfiguratorController(parent) {
|
|
1109
|
-
var _this12;
|
|
1110
|
-
|
|
1111
1109
|
_classCallCheck(this, ConfiguratorController);
|
|
1112
1110
|
|
|
1113
|
-
|
|
1114
|
-
_this12._state = plattar_controller_1.ControllerState.None;
|
|
1115
|
-
_this12._element = null;
|
|
1116
|
-
_this12._prevQROpt = null;
|
|
1117
|
-
return _this12;
|
|
1111
|
+
return _super6.call(this, parent);
|
|
1118
1112
|
}
|
|
1119
1113
|
|
|
1120
1114
|
_createClass(ConfiguratorController, [{
|
|
@@ -1128,22 +1122,22 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
1128
1122
|
}
|
|
1129
1123
|
}
|
|
1130
1124
|
}, {
|
|
1131
|
-
key: "
|
|
1132
|
-
value: function
|
|
1133
|
-
var
|
|
1125
|
+
key: "startViewerQRCode",
|
|
1126
|
+
value: function startViewerQRCode(options) {
|
|
1127
|
+
var _this12 = this;
|
|
1134
1128
|
|
|
1135
1129
|
return new Promise(function (accept, reject) {
|
|
1136
1130
|
// remove the old renderer instance if any
|
|
1137
|
-
|
|
1131
|
+
_this12.removeRenderer();
|
|
1138
1132
|
|
|
1139
|
-
var sceneID =
|
|
1133
|
+
var sceneID = _this12.getAttribute("scene-id");
|
|
1140
1134
|
|
|
1141
1135
|
if (sceneID) {
|
|
1142
1136
|
var opt = options || plattar_controller_1.PlattarController.DEFAULT_QR_OPTIONS;
|
|
1143
1137
|
var viewer = document.createElement("plattar-qrcode"); // required attributes with defaults for plattar-viewer node
|
|
1144
1138
|
|
|
1145
|
-
var width =
|
|
1146
|
-
var height =
|
|
1139
|
+
var width = _this12.getAttribute("width") || "500px";
|
|
1140
|
+
var height = _this12.getAttribute("height") || "500px";
|
|
1147
1141
|
viewer.setAttribute("width", width);
|
|
1148
1142
|
viewer.setAttribute("height", height);
|
|
1149
1143
|
|
|
@@ -1161,9 +1155,9 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
1161
1155
|
|
|
1162
1156
|
var dst = plattar_api_1.Server.location().base + "renderer/configurator.html?scene_id=" + sceneID; // optional attributes
|
|
1163
1157
|
|
|
1164
|
-
var configState =
|
|
1158
|
+
var configState = _this12.getAttribute("config-state");
|
|
1165
1159
|
|
|
1166
|
-
var showAR =
|
|
1160
|
+
var showAR = _this12.getAttribute("show-ar");
|
|
1167
1161
|
|
|
1168
1162
|
if (configState) {
|
|
1169
1163
|
dst += "&config_state=" + configState;
|
|
@@ -1179,11 +1173,11 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
1179
1173
|
return accept(viewer);
|
|
1180
1174
|
};
|
|
1181
1175
|
|
|
1182
|
-
|
|
1176
|
+
_this12.append(viewer);
|
|
1183
1177
|
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1178
|
+
_this12._element = viewer;
|
|
1179
|
+
_this12._state = plattar_controller_1.ControllerState.QRCode;
|
|
1180
|
+
_this12._prevQROpt = opt;
|
|
1187
1181
|
return;
|
|
1188
1182
|
}
|
|
1189
1183
|
|
|
@@ -1193,28 +1187,28 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
1193
1187
|
}, {
|
|
1194
1188
|
key: "startRenderer",
|
|
1195
1189
|
value: function startRenderer() {
|
|
1196
|
-
var
|
|
1190
|
+
var _this13 = this;
|
|
1197
1191
|
|
|
1198
1192
|
return new Promise(function (accept, reject) {
|
|
1199
1193
|
// remove the old renderer instance if any
|
|
1200
|
-
|
|
1194
|
+
_this13.removeRenderer();
|
|
1201
1195
|
|
|
1202
|
-
var sceneID =
|
|
1196
|
+
var sceneID = _this13.getAttribute("scene-id");
|
|
1203
1197
|
|
|
1204
1198
|
if (sceneID) {
|
|
1205
1199
|
// required attributes with defaults for plattar-configurator node
|
|
1206
|
-
var width =
|
|
1207
|
-
var height =
|
|
1208
|
-
var server =
|
|
1200
|
+
var width = _this13.getAttribute("width") || "500px";
|
|
1201
|
+
var height = _this13.getAttribute("height") || "500px";
|
|
1202
|
+
var server = _this13.getAttribute("server") || "production";
|
|
1209
1203
|
var viewer = document.createElement("plattar-configurator");
|
|
1210
1204
|
viewer.setAttribute("width", width);
|
|
1211
1205
|
viewer.setAttribute("height", height);
|
|
1212
1206
|
viewer.setAttribute("server", server);
|
|
1213
1207
|
viewer.setAttribute("scene-id", sceneID); // optional attributes
|
|
1214
1208
|
|
|
1215
|
-
var configState =
|
|
1209
|
+
var configState = _this13.getAttribute("config-state");
|
|
1216
1210
|
|
|
1217
|
-
var showAR =
|
|
1211
|
+
var showAR = _this13.getAttribute("show-ar");
|
|
1218
1212
|
|
|
1219
1213
|
if (configState) {
|
|
1220
1214
|
viewer.setAttribute("config-state", configState);
|
|
@@ -1228,10 +1222,10 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
1228
1222
|
return accept(viewer);
|
|
1229
1223
|
};
|
|
1230
1224
|
|
|
1231
|
-
|
|
1225
|
+
_this13.append(viewer);
|
|
1232
1226
|
|
|
1233
|
-
|
|
1234
|
-
|
|
1227
|
+
_this13._element = viewer;
|
|
1228
|
+
_this13._state = plattar_controller_1.ControllerState.Renderer;
|
|
1235
1229
|
return;
|
|
1236
1230
|
}
|
|
1237
1231
|
|
|
@@ -1241,24 +1235,24 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
1241
1235
|
}, {
|
|
1242
1236
|
key: "initAR",
|
|
1243
1237
|
value: function initAR() {
|
|
1244
|
-
var
|
|
1238
|
+
var _this14 = this;
|
|
1245
1239
|
|
|
1246
1240
|
return new Promise(function (accept, reject) {
|
|
1247
1241
|
if (!util_1.Util.canAugment()) {
|
|
1248
1242
|
return reject(new Error("ConfiguratorController.initAR() - cannot proceed as AR not available in context"));
|
|
1249
1243
|
}
|
|
1250
1244
|
|
|
1251
|
-
var arMode =
|
|
1245
|
+
var arMode = _this14.getAttribute("ar-mode") || "generated";
|
|
1252
1246
|
|
|
1253
1247
|
switch (arMode.toLowerCase()) {
|
|
1254
1248
|
case "inherited":
|
|
1255
|
-
|
|
1249
|
+
_this14._InitARInherited(accept, reject);
|
|
1256
1250
|
|
|
1257
1251
|
return;
|
|
1258
1252
|
|
|
1259
1253
|
case "generated":
|
|
1260
1254
|
default:
|
|
1261
|
-
|
|
1255
|
+
_this14._InitARGenerated(accept, reject);
|
|
1262
1256
|
|
|
1263
1257
|
}
|
|
1264
1258
|
});
|
|
@@ -1414,6 +1408,9 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
1414
1408
|
value: true
|
|
1415
1409
|
});
|
|
1416
1410
|
exports.PlattarController = exports.ControllerState = void 0;
|
|
1411
|
+
|
|
1412
|
+
var plattar_api_1 = require("@plattar/plattar-api");
|
|
1413
|
+
|
|
1417
1414
|
var ControllerState;
|
|
1418
1415
|
|
|
1419
1416
|
(function (ControllerState) {
|
|
@@ -1430,6 +1427,9 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
1430
1427
|
function PlattarController(parent) {
|
|
1431
1428
|
_classCallCheck(this, PlattarController);
|
|
1432
1429
|
|
|
1430
|
+
this._state = ControllerState.None;
|
|
1431
|
+
this._element = null;
|
|
1432
|
+
this._prevQROpt = null;
|
|
1433
1433
|
this._parent = parent;
|
|
1434
1434
|
}
|
|
1435
1435
|
/**
|
|
@@ -1444,15 +1444,128 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
1444
1444
|
* Initialise and start AR mode if available
|
|
1445
1445
|
*/
|
|
1446
1446
|
function startAR() {
|
|
1447
|
-
var
|
|
1447
|
+
var _this15 = this;
|
|
1448
1448
|
|
|
1449
1449
|
return new Promise(function (accept, reject) {
|
|
1450
|
-
|
|
1450
|
+
_this15.initAR().then(function (launcher) {
|
|
1451
1451
|
launcher.start();
|
|
1452
1452
|
accept();
|
|
1453
1453
|
})["catch"](reject);
|
|
1454
1454
|
});
|
|
1455
1455
|
}
|
|
1456
|
+
/**
|
|
1457
|
+
* Decide which QR Code to render according to the qr-type attribute
|
|
1458
|
+
* @param options
|
|
1459
|
+
* @returns
|
|
1460
|
+
*/
|
|
1461
|
+
|
|
1462
|
+
}, {
|
|
1463
|
+
key: "startQRCode",
|
|
1464
|
+
value: function startQRCode(options) {
|
|
1465
|
+
var qrType = this.getAttribute("qr-type") || "viewer";
|
|
1466
|
+
|
|
1467
|
+
switch (qrType.toLowerCase()) {
|
|
1468
|
+
case "ar":
|
|
1469
|
+
return this.startARQRCode(options);
|
|
1470
|
+
|
|
1471
|
+
case "viewer":
|
|
1472
|
+
default:
|
|
1473
|
+
return this.startViewerQRCode(options);
|
|
1474
|
+
}
|
|
1475
|
+
}
|
|
1476
|
+
/**
|
|
1477
|
+
* Displays a QR Code that sends the user direct to AR
|
|
1478
|
+
* @param options
|
|
1479
|
+
* @returns
|
|
1480
|
+
*/
|
|
1481
|
+
|
|
1482
|
+
}, {
|
|
1483
|
+
key: "startARQRCode",
|
|
1484
|
+
value: function startARQRCode(options) {
|
|
1485
|
+
var _this16 = this;
|
|
1486
|
+
|
|
1487
|
+
return new Promise(function (accept, reject) {
|
|
1488
|
+
// remove the old renderer instance if any
|
|
1489
|
+
_this16.removeRenderer();
|
|
1490
|
+
|
|
1491
|
+
var opt = options || PlattarController.DEFAULT_QR_OPTIONS;
|
|
1492
|
+
var viewer = document.createElement("plattar-qrcode"); // required attributes with defaults for plattar-viewer node
|
|
1493
|
+
|
|
1494
|
+
var width = _this16.getAttribute("width") || "500px";
|
|
1495
|
+
var height = _this16.getAttribute("height") || "500px";
|
|
1496
|
+
viewer.setAttribute("width", width);
|
|
1497
|
+
viewer.setAttribute("height", height);
|
|
1498
|
+
|
|
1499
|
+
if (opt.color) {
|
|
1500
|
+
viewer.setAttribute("color", opt.color);
|
|
1501
|
+
}
|
|
1502
|
+
|
|
1503
|
+
if (opt.margin) {
|
|
1504
|
+
viewer.setAttribute("margin", "" + opt.margin);
|
|
1505
|
+
}
|
|
1506
|
+
|
|
1507
|
+
if (opt.qrType) {
|
|
1508
|
+
viewer.setAttribute("qr-type", opt.qrType);
|
|
1509
|
+
}
|
|
1510
|
+
|
|
1511
|
+
var qrOptions = btoa(JSON.stringify(opt));
|
|
1512
|
+
var dst = plattar_api_1.Server.location().base + "renderer/launcher.html?qr_options=" + qrOptions;
|
|
1513
|
+
|
|
1514
|
+
var sceneID = _this16.getAttribute("scene-id");
|
|
1515
|
+
|
|
1516
|
+
var configState = _this16.getAttribute("config-state");
|
|
1517
|
+
|
|
1518
|
+
var embedType = _this16.getAttribute("embed-type");
|
|
1519
|
+
|
|
1520
|
+
var productID = _this16.getAttribute("product-id");
|
|
1521
|
+
|
|
1522
|
+
var sceneProductID = _this16.getAttribute("scene-product-id");
|
|
1523
|
+
|
|
1524
|
+
var variationID = _this16.getAttribute("variation-id");
|
|
1525
|
+
|
|
1526
|
+
var arMode = _this16.getAttribute("ar-mode");
|
|
1527
|
+
|
|
1528
|
+
if (configState) {
|
|
1529
|
+
dst += "&config_state=" + configState;
|
|
1530
|
+
}
|
|
1531
|
+
|
|
1532
|
+
if (embedType) {
|
|
1533
|
+
dst += "&embed_type=" + embedType;
|
|
1534
|
+
}
|
|
1535
|
+
|
|
1536
|
+
if (productID) {
|
|
1537
|
+
dst += "&product_id=" + productID;
|
|
1538
|
+
}
|
|
1539
|
+
|
|
1540
|
+
if (sceneProductID) {
|
|
1541
|
+
dst += "&scene_product_id=" + sceneProductID;
|
|
1542
|
+
}
|
|
1543
|
+
|
|
1544
|
+
if (variationID) {
|
|
1545
|
+
dst += "&variation_id=" + variationID;
|
|
1546
|
+
}
|
|
1547
|
+
|
|
1548
|
+
if (arMode) {
|
|
1549
|
+
dst += "&ar_mode=" + arMode;
|
|
1550
|
+
}
|
|
1551
|
+
|
|
1552
|
+
if (sceneID) {
|
|
1553
|
+
dst += "&scene_id=" + sceneID;
|
|
1554
|
+
}
|
|
1555
|
+
|
|
1556
|
+
viewer.setAttribute("url", opt.url || dst);
|
|
1557
|
+
|
|
1558
|
+
viewer.onload = function () {
|
|
1559
|
+
return accept(viewer);
|
|
1560
|
+
};
|
|
1561
|
+
|
|
1562
|
+
_this16._element = viewer;
|
|
1563
|
+
_this16._state = ControllerState.QRCode;
|
|
1564
|
+
_this16._prevQROpt = opt;
|
|
1565
|
+
|
|
1566
|
+
_this16.append(viewer);
|
|
1567
|
+
});
|
|
1568
|
+
}
|
|
1456
1569
|
/**
|
|
1457
1570
|
* Returns the Parent Instance
|
|
1458
1571
|
*/
|
|
@@ -1501,7 +1614,9 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
1501
1614
|
}();
|
|
1502
1615
|
|
|
1503
1616
|
exports.PlattarController = PlattarController;
|
|
1504
|
-
}, {
|
|
1617
|
+
}, {
|
|
1618
|
+
"@plattar/plattar-api": 42
|
|
1619
|
+
}],
|
|
1505
1620
|
9: [function (require, module, exports) {
|
|
1506
1621
|
"use strict";
|
|
1507
1622
|
|
|
@@ -1528,15 +1643,9 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
1528
1643
|
var _super7 = _createSuper(ProductController);
|
|
1529
1644
|
|
|
1530
1645
|
function ProductController(parent) {
|
|
1531
|
-
var _this17;
|
|
1532
|
-
|
|
1533
1646
|
_classCallCheck(this, ProductController);
|
|
1534
1647
|
|
|
1535
|
-
|
|
1536
|
-
_this17._state = plattar_controller_1.ControllerState.None;
|
|
1537
|
-
_this17._element = null;
|
|
1538
|
-
_this17._prevQROpt = null;
|
|
1539
|
-
return _this17;
|
|
1648
|
+
return _super7.call(this, parent);
|
|
1540
1649
|
}
|
|
1541
1650
|
|
|
1542
1651
|
_createClass(ProductController, [{
|
|
@@ -1565,22 +1674,22 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
1565
1674
|
}
|
|
1566
1675
|
}
|
|
1567
1676
|
}, {
|
|
1568
|
-
key: "
|
|
1569
|
-
value: function
|
|
1570
|
-
var
|
|
1677
|
+
key: "startViewerQRCode",
|
|
1678
|
+
value: function startViewerQRCode(options) {
|
|
1679
|
+
var _this17 = this;
|
|
1571
1680
|
|
|
1572
1681
|
return new Promise(function (accept, reject) {
|
|
1573
1682
|
// remove the old renderer instance if any
|
|
1574
|
-
|
|
1683
|
+
_this17.removeRenderer();
|
|
1575
1684
|
|
|
1576
|
-
var productID =
|
|
1685
|
+
var productID = _this17.getAttribute("product-id");
|
|
1577
1686
|
|
|
1578
1687
|
if (productID) {
|
|
1579
1688
|
var opt = options || plattar_controller_1.PlattarController.DEFAULT_QR_OPTIONS;
|
|
1580
1689
|
var viewer = document.createElement("plattar-qrcode"); // required attributes with defaults for plattar-viewer node
|
|
1581
1690
|
|
|
1582
|
-
var width =
|
|
1583
|
-
var height =
|
|
1691
|
+
var width = _this17.getAttribute("width") || "500px";
|
|
1692
|
+
var height = _this17.getAttribute("height") || "500px";
|
|
1584
1693
|
viewer.setAttribute("width", width);
|
|
1585
1694
|
viewer.setAttribute("height", height);
|
|
1586
1695
|
|
|
@@ -1597,7 +1706,9 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
1597
1706
|
} // optional attributes
|
|
1598
1707
|
|
|
1599
1708
|
|
|
1600
|
-
var variationID =
|
|
1709
|
+
var variationID = _this17.getAttribute("variation-id");
|
|
1710
|
+
|
|
1711
|
+
var showAR = _this17.getAttribute("show-ar");
|
|
1601
1712
|
|
|
1602
1713
|
var dst = plattar_api_1.Server.location().base + "renderer/product.html?product_id=" + productID;
|
|
1603
1714
|
|
|
@@ -1605,17 +1716,21 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
1605
1716
|
dst += "&variation_id=" + variationID;
|
|
1606
1717
|
}
|
|
1607
1718
|
|
|
1719
|
+
if (showAR) {
|
|
1720
|
+
dst += "&show_ar=" + showAR;
|
|
1721
|
+
}
|
|
1722
|
+
|
|
1608
1723
|
viewer.setAttribute("url", opt.url || dst);
|
|
1609
1724
|
|
|
1610
1725
|
viewer.onload = function () {
|
|
1611
1726
|
return accept(viewer);
|
|
1612
1727
|
};
|
|
1613
1728
|
|
|
1614
|
-
|
|
1729
|
+
_this17.append(viewer);
|
|
1615
1730
|
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1731
|
+
_this17._element = viewer;
|
|
1732
|
+
_this17._state = plattar_controller_1.ControllerState.QRCode;
|
|
1733
|
+
_this17._prevQROpt = opt;
|
|
1619
1734
|
return;
|
|
1620
1735
|
}
|
|
1621
1736
|
|
|
@@ -1625,39 +1740,45 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
1625
1740
|
}, {
|
|
1626
1741
|
key: "startRenderer",
|
|
1627
1742
|
value: function startRenderer() {
|
|
1628
|
-
var
|
|
1743
|
+
var _this18 = this;
|
|
1629
1744
|
|
|
1630
1745
|
return new Promise(function (accept, reject) {
|
|
1631
1746
|
// remove the old renderer instance if any
|
|
1632
|
-
|
|
1747
|
+
_this18.removeRenderer();
|
|
1633
1748
|
|
|
1634
|
-
var productID =
|
|
1749
|
+
var productID = _this18.getAttribute("product-id");
|
|
1635
1750
|
|
|
1636
1751
|
if (productID) {
|
|
1637
1752
|
// required attributes with defaults for plattar-product node
|
|
1638
|
-
var width =
|
|
1639
|
-
var height =
|
|
1640
|
-
var server =
|
|
1753
|
+
var width = _this18.getAttribute("width") || "500px";
|
|
1754
|
+
var height = _this18.getAttribute("height") || "500px";
|
|
1755
|
+
var server = _this18.getAttribute("server") || "production";
|
|
1641
1756
|
var viewer = document.createElement("plattar-product");
|
|
1642
1757
|
viewer.setAttribute("width", width);
|
|
1643
1758
|
viewer.setAttribute("height", height);
|
|
1644
1759
|
viewer.setAttribute("server", server);
|
|
1645
1760
|
viewer.setAttribute("product-id", productID); // optional attributes
|
|
1646
1761
|
|
|
1647
|
-
var variationID =
|
|
1762
|
+
var variationID = _this18.getAttribute("variation-id");
|
|
1763
|
+
|
|
1764
|
+
var showAR = _this18.getAttribute("show-ar");
|
|
1648
1765
|
|
|
1649
1766
|
if (variationID) {
|
|
1650
1767
|
viewer.setAttribute("variation-id", variationID);
|
|
1651
1768
|
}
|
|
1652
1769
|
|
|
1770
|
+
if (showAR) {
|
|
1771
|
+
viewer.setAttribute("show-ar", showAR);
|
|
1772
|
+
}
|
|
1773
|
+
|
|
1653
1774
|
viewer.onload = function () {
|
|
1654
1775
|
return accept(viewer);
|
|
1655
1776
|
};
|
|
1656
1777
|
|
|
1657
|
-
|
|
1778
|
+
_this18.append(viewer);
|
|
1658
1779
|
|
|
1659
|
-
|
|
1660
|
-
|
|
1780
|
+
_this18._element = viewer;
|
|
1781
|
+
_this18._state = plattar_controller_1.ControllerState.Renderer;
|
|
1661
1782
|
return;
|
|
1662
1783
|
}
|
|
1663
1784
|
|
|
@@ -1667,17 +1788,17 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
1667
1788
|
}, {
|
|
1668
1789
|
key: "initAR",
|
|
1669
1790
|
value: function initAR() {
|
|
1670
|
-
var
|
|
1791
|
+
var _this19 = this;
|
|
1671
1792
|
|
|
1672
1793
|
return new Promise(function (accept, reject) {
|
|
1673
1794
|
if (!util_1.Util.canAugment()) {
|
|
1674
1795
|
return reject(new Error("ProductController.initAR() - cannot proceed as AR not available in context"));
|
|
1675
1796
|
}
|
|
1676
1797
|
|
|
1677
|
-
var productID =
|
|
1798
|
+
var productID = _this19.getAttribute("product-id");
|
|
1678
1799
|
|
|
1679
1800
|
if (productID) {
|
|
1680
|
-
var variationID =
|
|
1801
|
+
var variationID = _this19.getAttribute("variation-id");
|
|
1681
1802
|
|
|
1682
1803
|
var product = new product_ar_1.ProductAR(productID, variationID);
|
|
1683
1804
|
return product.init().then(accept)["catch"](reject);
|
|
@@ -1729,6 +1850,8 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
1729
1850
|
|
|
1730
1851
|
var scene_product_ar_1 = require("../../ar/scene-product-ar");
|
|
1731
1852
|
|
|
1853
|
+
var configurator_state_1 = require("../../util/configurator-state");
|
|
1854
|
+
|
|
1732
1855
|
var util_1 = require("../../util/util");
|
|
1733
1856
|
|
|
1734
1857
|
var plattar_controller_1 = require("./plattar-controller");
|
|
@@ -1743,15 +1866,9 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
1743
1866
|
var _super8 = _createSuper(ViewerController);
|
|
1744
1867
|
|
|
1745
1868
|
function ViewerController(parent) {
|
|
1746
|
-
var _this21;
|
|
1747
|
-
|
|
1748
1869
|
_classCallCheck(this, ViewerController);
|
|
1749
1870
|
|
|
1750
|
-
|
|
1751
|
-
_this21._state = plattar_controller_1.ControllerState.None;
|
|
1752
|
-
_this21._element = null;
|
|
1753
|
-
_this21._prevQROpt = null;
|
|
1754
|
-
return _this21;
|
|
1871
|
+
return _super8.call(this, parent);
|
|
1755
1872
|
}
|
|
1756
1873
|
|
|
1757
1874
|
_createClass(ViewerController, [{
|
|
@@ -1781,22 +1898,22 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
1781
1898
|
}
|
|
1782
1899
|
}
|
|
1783
1900
|
}, {
|
|
1784
|
-
key: "
|
|
1785
|
-
value: function
|
|
1786
|
-
var
|
|
1901
|
+
key: "startViewerQRCode",
|
|
1902
|
+
value: function startViewerQRCode(options) {
|
|
1903
|
+
var _this20 = this;
|
|
1787
1904
|
|
|
1788
1905
|
return new Promise(function (accept, reject) {
|
|
1789
1906
|
// remove the old renderer instance if any
|
|
1790
|
-
|
|
1907
|
+
_this20.removeRenderer();
|
|
1791
1908
|
|
|
1792
|
-
var sceneID =
|
|
1909
|
+
var sceneID = _this20.getAttribute("scene-id");
|
|
1793
1910
|
|
|
1794
1911
|
if (sceneID) {
|
|
1795
1912
|
var opt = options || plattar_controller_1.PlattarController.DEFAULT_QR_OPTIONS;
|
|
1796
1913
|
var viewer = document.createElement("plattar-qrcode"); // required attributes with defaults for plattar-viewer node
|
|
1797
1914
|
|
|
1798
|
-
var width =
|
|
1799
|
-
var height =
|
|
1915
|
+
var width = _this20.getAttribute("width") || "500px";
|
|
1916
|
+
var height = _this20.getAttribute("height") || "500px";
|
|
1800
1917
|
viewer.setAttribute("width", width);
|
|
1801
1918
|
viewer.setAttribute("height", height);
|
|
1802
1919
|
|
|
@@ -1814,9 +1931,11 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
1814
1931
|
|
|
1815
1932
|
var dst = plattar_api_1.Server.location().base + "renderer/viewer.html?scene_id=" + sceneID; // optional attributes
|
|
1816
1933
|
|
|
1817
|
-
var productID =
|
|
1934
|
+
var productID = _this20.getAttribute("product-id") || _this20.getAttribute("scene-product-id");
|
|
1818
1935
|
|
|
1819
|
-
var variationID =
|
|
1936
|
+
var variationID = _this20.getAttribute("variation-id");
|
|
1937
|
+
|
|
1938
|
+
var showAR = _this20.getAttribute("show-ar");
|
|
1820
1939
|
|
|
1821
1940
|
if (productID) {
|
|
1822
1941
|
dst += "&productId=" + productID;
|
|
@@ -1826,17 +1945,21 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
1826
1945
|
dst += "&variationId=" + variationID;
|
|
1827
1946
|
}
|
|
1828
1947
|
|
|
1948
|
+
if (showAR) {
|
|
1949
|
+
dst += "&show_ar=" + showAR;
|
|
1950
|
+
}
|
|
1951
|
+
|
|
1829
1952
|
viewer.setAttribute("url", opt.url || dst);
|
|
1830
1953
|
|
|
1831
1954
|
viewer.onload = function () {
|
|
1832
1955
|
return accept(viewer);
|
|
1833
1956
|
};
|
|
1834
1957
|
|
|
1835
|
-
|
|
1958
|
+
_this20.append(viewer);
|
|
1836
1959
|
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1960
|
+
_this20._element = viewer;
|
|
1961
|
+
_this20._state = plattar_controller_1.ControllerState.QRCode;
|
|
1962
|
+
_this20._prevQROpt = opt;
|
|
1840
1963
|
return;
|
|
1841
1964
|
}
|
|
1842
1965
|
|
|
@@ -1846,28 +1969,30 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
1846
1969
|
}, {
|
|
1847
1970
|
key: "startRenderer",
|
|
1848
1971
|
value: function startRenderer() {
|
|
1849
|
-
var
|
|
1972
|
+
var _this21 = this;
|
|
1850
1973
|
|
|
1851
1974
|
return new Promise(function (accept, reject) {
|
|
1852
1975
|
// remove the old renderer instance if any
|
|
1853
|
-
|
|
1976
|
+
_this21.removeRenderer();
|
|
1854
1977
|
|
|
1855
|
-
var sceneID =
|
|
1978
|
+
var sceneID = _this21.getAttribute("scene-id");
|
|
1856
1979
|
|
|
1857
1980
|
if (sceneID) {
|
|
1858
1981
|
// required attributes with defaults for plattar-viewer node
|
|
1859
|
-
var width =
|
|
1860
|
-
var height =
|
|
1861
|
-
var server =
|
|
1982
|
+
var width = _this21.getAttribute("width") || "500px";
|
|
1983
|
+
var height = _this21.getAttribute("height") || "500px";
|
|
1984
|
+
var server = _this21.getAttribute("server") || "production";
|
|
1862
1985
|
var viewer = document.createElement("plattar-viewer");
|
|
1863
1986
|
viewer.setAttribute("width", width);
|
|
1864
1987
|
viewer.setAttribute("height", height);
|
|
1865
1988
|
viewer.setAttribute("server", server);
|
|
1866
1989
|
viewer.setAttribute("scene-id", sceneID); // optional attributes
|
|
1867
1990
|
|
|
1868
|
-
var productID =
|
|
1991
|
+
var productID = _this21.getAttribute("product-id") || _this21.getAttribute("scene-product-id");
|
|
1869
1992
|
|
|
1870
|
-
var variationID =
|
|
1993
|
+
var variationID = _this21.getAttribute("variation-id");
|
|
1994
|
+
|
|
1995
|
+
var showAR = _this21.getAttribute("show-ar");
|
|
1871
1996
|
|
|
1872
1997
|
if (productID) {
|
|
1873
1998
|
viewer.setAttribute("product-id", productID);
|
|
@@ -1877,14 +2002,18 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
1877
2002
|
viewer.setAttribute("variation-id", variationID);
|
|
1878
2003
|
}
|
|
1879
2004
|
|
|
2005
|
+
if (showAR) {
|
|
2006
|
+
viewer.setAttribute("show-ar", showAR);
|
|
2007
|
+
}
|
|
2008
|
+
|
|
1880
2009
|
viewer.onload = function () {
|
|
1881
2010
|
return accept(viewer);
|
|
1882
2011
|
};
|
|
1883
2012
|
|
|
1884
|
-
|
|
2013
|
+
_this21.append(viewer);
|
|
1885
2014
|
|
|
1886
|
-
|
|
1887
|
-
|
|
2015
|
+
_this21._element = viewer;
|
|
2016
|
+
_this21._state = plattar_controller_1.ControllerState.Renderer;
|
|
1888
2017
|
return;
|
|
1889
2018
|
}
|
|
1890
2019
|
|
|
@@ -1894,42 +2023,51 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
1894
2023
|
}, {
|
|
1895
2024
|
key: "initAR",
|
|
1896
2025
|
value: function initAR() {
|
|
1897
|
-
var
|
|
2026
|
+
var _this22 = this;
|
|
1898
2027
|
|
|
1899
2028
|
return new Promise(function (accept, reject) {
|
|
1900
2029
|
if (!util_1.Util.canAugment()) {
|
|
1901
2030
|
return reject(new Error("ViewerController.initAR() - cannot proceed as AR not available in context"));
|
|
1902
2031
|
}
|
|
1903
2032
|
|
|
1904
|
-
var productID =
|
|
2033
|
+
var productID = _this22.getAttribute("product-id"); // use product-id if available
|
|
1905
2034
|
|
|
1906
2035
|
|
|
1907
2036
|
if (productID) {
|
|
1908
|
-
var variationID =
|
|
2037
|
+
var variationID = _this22.getAttribute("variation-id");
|
|
1909
2038
|
|
|
1910
2039
|
var product = new product_ar_1.ProductAR(productID, variationID);
|
|
1911
2040
|
return product.init().then(accept)["catch"](reject);
|
|
1912
2041
|
}
|
|
1913
2042
|
|
|
1914
|
-
var sceneProductID =
|
|
2043
|
+
var sceneProductID = _this22.getAttribute("scene-product-id"); // use scene-product-id if available
|
|
1915
2044
|
|
|
1916
2045
|
|
|
1917
2046
|
if (sceneProductID) {
|
|
1918
|
-
var _variationID =
|
|
2047
|
+
var _variationID = _this22.getAttribute("variation-id");
|
|
1919
2048
|
|
|
1920
2049
|
var _product = new scene_product_ar_1.SceneProductAR(sceneProductID, _variationID);
|
|
1921
2050
|
|
|
1922
2051
|
return _product.init().then(accept)["catch"](reject);
|
|
1923
2052
|
}
|
|
1924
2053
|
|
|
1925
|
-
var sceneID =
|
|
2054
|
+
var sceneID = _this22.getAttribute("scene-id"); // use the first default product-variation id if available
|
|
1926
2055
|
|
|
1927
2056
|
|
|
1928
2057
|
if (sceneID) {
|
|
1929
|
-
return
|
|
2058
|
+
return configurator_state_1.ConfiguratorState.decodeScene(sceneID).then(function (state) {
|
|
2059
|
+
var first = state.first();
|
|
2060
|
+
|
|
2061
|
+
if (first) {
|
|
2062
|
+
var sceneProductAR = new scene_product_ar_1.SceneProductAR(first.scene_product_id, first.product_variation_id);
|
|
2063
|
+
return sceneProductAR.init().then(accept)["catch"](reject);
|
|
2064
|
+
}
|
|
2065
|
+
|
|
2066
|
+
return reject(new Error("ViewerController.initAR() - your scene does not contain any valid products"));
|
|
2067
|
+
})["catch"](reject);
|
|
1930
2068
|
}
|
|
1931
2069
|
|
|
1932
|
-
return reject(new Error("ViewerController.initAR() - minimum required attributes not set, use
|
|
2070
|
+
return reject(new Error("ViewerController.initAR() - minimum required attributes not set, use scene-id as a minimum"));
|
|
1933
2071
|
});
|
|
1934
2072
|
}
|
|
1935
2073
|
}, {
|
|
@@ -1958,6 +2096,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
1958
2096
|
}, {
|
|
1959
2097
|
"../../ar/product-ar": 3,
|
|
1960
2098
|
"../../ar/scene-product-ar": 6,
|
|
2099
|
+
"../../util/configurator-state": 14,
|
|
1961
2100
|
"../../util/util": 15,
|
|
1962
2101
|
"./plattar-controller": 8,
|
|
1963
2102
|
"@plattar/plattar-api": 42
|
|
@@ -1992,15 +2131,9 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
1992
2131
|
var _super9 = _createSuper(VTOController);
|
|
1993
2132
|
|
|
1994
2133
|
function VTOController(parent) {
|
|
1995
|
-
var _this25;
|
|
1996
|
-
|
|
1997
2134
|
_classCallCheck(this, VTOController);
|
|
1998
2135
|
|
|
1999
|
-
|
|
2000
|
-
_this25._state = plattar_controller_1.ControllerState.None;
|
|
2001
|
-
_this25._element = null;
|
|
2002
|
-
_this25._prevQROpt = null;
|
|
2003
|
-
return _this25;
|
|
2136
|
+
return _super9.call(this, parent);
|
|
2004
2137
|
}
|
|
2005
2138
|
|
|
2006
2139
|
_createClass(VTOController, [{
|
|
@@ -2014,22 +2147,22 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
2014
2147
|
}
|
|
2015
2148
|
}
|
|
2016
2149
|
}, {
|
|
2017
|
-
key: "
|
|
2018
|
-
value: function
|
|
2019
|
-
var
|
|
2150
|
+
key: "startViewerQRCode",
|
|
2151
|
+
value: function startViewerQRCode(options) {
|
|
2152
|
+
var _this23 = this;
|
|
2020
2153
|
|
|
2021
2154
|
return new Promise(function (accept, reject) {
|
|
2022
2155
|
// remove the old renderer instance if any
|
|
2023
|
-
|
|
2156
|
+
_this23.removeRenderer();
|
|
2024
2157
|
|
|
2025
|
-
var sceneID =
|
|
2158
|
+
var sceneID = _this23.getAttribute("scene-id");
|
|
2026
2159
|
|
|
2027
2160
|
if (sceneID) {
|
|
2028
2161
|
var opt = options || plattar_controller_1.PlattarController.DEFAULT_QR_OPTIONS;
|
|
2029
2162
|
var viewer = document.createElement("plattar-qrcode"); // required attributes with defaults for plattar-viewer node
|
|
2030
2163
|
|
|
2031
|
-
var width =
|
|
2032
|
-
var height =
|
|
2164
|
+
var width = _this23.getAttribute("width") || "500px";
|
|
2165
|
+
var height = _this23.getAttribute("height") || "500px";
|
|
2033
2166
|
viewer.setAttribute("width", width);
|
|
2034
2167
|
viewer.setAttribute("height", height);
|
|
2035
2168
|
|
|
@@ -2047,9 +2180,9 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
2047
2180
|
|
|
2048
2181
|
var dst = plattar_api_1.Server.location().base + "renderer/facear.html?scene_id=" + sceneID; // optional attributes
|
|
2049
2182
|
|
|
2050
|
-
var configState =
|
|
2183
|
+
var configState = _this23.getAttribute("config-state");
|
|
2051
2184
|
|
|
2052
|
-
var showAR =
|
|
2185
|
+
var showAR = _this23.getAttribute("show-ar");
|
|
2053
2186
|
|
|
2054
2187
|
if (configState) {
|
|
2055
2188
|
dst += "&config_state=" + configState;
|
|
@@ -2065,11 +2198,11 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
2065
2198
|
return accept(viewer);
|
|
2066
2199
|
};
|
|
2067
2200
|
|
|
2068
|
-
|
|
2201
|
+
_this23.append(viewer);
|
|
2069
2202
|
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2203
|
+
_this23._element = viewer;
|
|
2204
|
+
_this23._state = plattar_controller_1.ControllerState.QRCode;
|
|
2205
|
+
_this23._prevQROpt = opt;
|
|
2073
2206
|
return;
|
|
2074
2207
|
}
|
|
2075
2208
|
|
|
@@ -2079,28 +2212,28 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
2079
2212
|
}, {
|
|
2080
2213
|
key: "startRenderer",
|
|
2081
2214
|
value: function startRenderer() {
|
|
2082
|
-
var
|
|
2215
|
+
var _this24 = this;
|
|
2083
2216
|
|
|
2084
2217
|
return new Promise(function (accept, reject) {
|
|
2085
2218
|
// remove the old renderer instance if any
|
|
2086
|
-
|
|
2219
|
+
_this24.removeRenderer();
|
|
2087
2220
|
|
|
2088
|
-
var sceneID =
|
|
2221
|
+
var sceneID = _this24.getAttribute("scene-id");
|
|
2089
2222
|
|
|
2090
2223
|
if (sceneID) {
|
|
2091
2224
|
// required attributes with defaults for plattar-facear node
|
|
2092
|
-
var width =
|
|
2093
|
-
var height =
|
|
2094
|
-
var server =
|
|
2225
|
+
var width = _this24.getAttribute("width") || "500px";
|
|
2226
|
+
var height = _this24.getAttribute("height") || "500px";
|
|
2227
|
+
var server = _this24.getAttribute("server") || "production";
|
|
2095
2228
|
var viewer = document.createElement("plattar-facear");
|
|
2096
2229
|
viewer.setAttribute("width", width);
|
|
2097
2230
|
viewer.setAttribute("height", height);
|
|
2098
2231
|
viewer.setAttribute("server", server);
|
|
2099
2232
|
viewer.setAttribute("scene-id", sceneID); // optional attributes
|
|
2100
2233
|
|
|
2101
|
-
var configState =
|
|
2234
|
+
var configState = _this24.getAttribute("config-state");
|
|
2102
2235
|
|
|
2103
|
-
var showAR =
|
|
2236
|
+
var showAR = _this24.getAttribute("show-ar");
|
|
2104
2237
|
|
|
2105
2238
|
if (configState) {
|
|
2106
2239
|
viewer.setAttribute("config-state", configState);
|
|
@@ -2114,10 +2247,10 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
2114
2247
|
return accept(viewer);
|
|
2115
2248
|
};
|
|
2116
2249
|
|
|
2117
|
-
|
|
2250
|
+
_this24.append(viewer);
|
|
2118
2251
|
|
|
2119
|
-
|
|
2120
|
-
|
|
2252
|
+
_this24._element = viewer;
|
|
2253
|
+
_this24._state = plattar_controller_1.ControllerState.Renderer;
|
|
2121
2254
|
return;
|
|
2122
2255
|
}
|
|
2123
2256
|
|
|
@@ -2127,7 +2260,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
2127
2260
|
}, {
|
|
2128
2261
|
key: "initAR",
|
|
2129
2262
|
value: function initAR() {
|
|
2130
|
-
var
|
|
2263
|
+
var _this25 = this;
|
|
2131
2264
|
|
|
2132
2265
|
return new Promise(function (accept, reject) {
|
|
2133
2266
|
if (!util_1.Util.canAugment()) {
|
|
@@ -2138,17 +2271,17 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
2138
2271
|
return reject(new Error("VTOController.initAR() - cannot proceed as VTO AR only available on IOS Mobile devices"));
|
|
2139
2272
|
}
|
|
2140
2273
|
|
|
2141
|
-
var arMode =
|
|
2274
|
+
var arMode = _this25.getAttribute("ar-mode") || "generated";
|
|
2142
2275
|
|
|
2143
2276
|
switch (arMode.toLowerCase()) {
|
|
2144
2277
|
case "inherited":
|
|
2145
|
-
|
|
2278
|
+
_this25._InitARInherited(accept, reject);
|
|
2146
2279
|
|
|
2147
2280
|
return;
|
|
2148
2281
|
|
|
2149
2282
|
case "generated":
|
|
2150
2283
|
default:
|
|
2151
|
-
|
|
2284
|
+
_this25._InitARGenerated(accept, reject);
|
|
2152
2285
|
|
|
2153
2286
|
}
|
|
2154
2287
|
});
|
|
@@ -2323,15 +2456,15 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
2323
2456
|
var _super10 = _createSuper(PlattarEmbed);
|
|
2324
2457
|
|
|
2325
2458
|
function PlattarEmbed() {
|
|
2326
|
-
var
|
|
2459
|
+
var _this26;
|
|
2327
2460
|
|
|
2328
2461
|
_classCallCheck(this, PlattarEmbed);
|
|
2329
2462
|
|
|
2330
|
-
|
|
2463
|
+
_this26 = _super10.call(this); // this is the current embed type, viewer by default
|
|
2331
2464
|
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
return
|
|
2465
|
+
_this26._currentType = EmbedType.Viewer;
|
|
2466
|
+
_this26._controller = null;
|
|
2467
|
+
return _this26;
|
|
2335
2468
|
}
|
|
2336
2469
|
|
|
2337
2470
|
_createClass(PlattarEmbed, [{
|
|
@@ -2342,7 +2475,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
2342
2475
|
}, {
|
|
2343
2476
|
key: "connectedCallback",
|
|
2344
2477
|
value: function connectedCallback() {
|
|
2345
|
-
var
|
|
2478
|
+
var _this27 = this;
|
|
2346
2479
|
|
|
2347
2480
|
var embedType = this.hasAttribute("embed-type") ? this.getAttribute("embed-type") : "viewer";
|
|
2348
2481
|
|
|
@@ -2368,7 +2501,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
2368
2501
|
var observer = new MutationObserver(function (mutations) {
|
|
2369
2502
|
mutations.forEach(function (mutation) {
|
|
2370
2503
|
if (mutation.type === "attributes") {
|
|
2371
|
-
|
|
2504
|
+
_this27._OnAttributesUpdated();
|
|
2372
2505
|
}
|
|
2373
2506
|
});
|
|
2374
2507
|
});
|
|
@@ -2404,66 +2537,66 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
2404
2537
|
} else if (init === "ar-fallback-qrcode") {
|
|
2405
2538
|
this.startAR().then(function () {// nothing to do, launched successfully
|
|
2406
2539
|
})["catch"](function (_err) {
|
|
2407
|
-
|
|
2540
|
+
_this27.startQRCode();
|
|
2408
2541
|
});
|
|
2409
2542
|
} else if (init === "ar-fallback-viewer") {
|
|
2410
2543
|
this.startAR().then(function () {// nothing to do, launched successfully
|
|
2411
2544
|
})["catch"](function (_err) {
|
|
2412
|
-
|
|
2545
|
+
_this27.startViewer();
|
|
2413
2546
|
});
|
|
2414
2547
|
}
|
|
2415
2548
|
}
|
|
2416
2549
|
}, {
|
|
2417
2550
|
key: "initAR",
|
|
2418
2551
|
value: function initAR() {
|
|
2419
|
-
var
|
|
2552
|
+
var _this28 = this;
|
|
2420
2553
|
|
|
2421
2554
|
return new Promise(function (accept, reject) {
|
|
2422
|
-
if (!
|
|
2555
|
+
if (!_this28._controller) {
|
|
2423
2556
|
return reject(new Error("PlattarEmbed.initAR() - cannot execute as controller has not loaded yet"));
|
|
2424
2557
|
}
|
|
2425
2558
|
|
|
2426
|
-
return
|
|
2559
|
+
return _this28._controller.initAR().then(accept)["catch"](reject);
|
|
2427
2560
|
});
|
|
2428
2561
|
}
|
|
2429
2562
|
}, {
|
|
2430
2563
|
key: "startAR",
|
|
2431
2564
|
value: function startAR() {
|
|
2432
|
-
var
|
|
2565
|
+
var _this29 = this;
|
|
2433
2566
|
|
|
2434
2567
|
return new Promise(function (accept, reject) {
|
|
2435
|
-
if (!
|
|
2568
|
+
if (!_this29._controller) {
|
|
2436
2569
|
return reject(new Error("PlattarEmbed.startAR() - cannot execute as controller has not loaded yet"));
|
|
2437
2570
|
}
|
|
2438
2571
|
|
|
2439
|
-
return
|
|
2572
|
+
return _this29._controller.startAR().then(accept)["catch"](reject);
|
|
2440
2573
|
});
|
|
2441
2574
|
}
|
|
2442
2575
|
}, {
|
|
2443
2576
|
key: "startViewer",
|
|
2444
2577
|
value: function startViewer() {
|
|
2445
|
-
var
|
|
2578
|
+
var _this30 = this;
|
|
2446
2579
|
|
|
2447
2580
|
return new Promise(function (accept, reject) {
|
|
2448
|
-
if (!
|
|
2581
|
+
if (!_this30._controller) {
|
|
2449
2582
|
return reject(new Error("PlattarEmbed.startViewer() - cannot execute as controller has not loaded yet"));
|
|
2450
2583
|
}
|
|
2451
2584
|
|
|
2452
|
-
return
|
|
2585
|
+
return _this30._controller.startRenderer().then(accept)["catch"](reject);
|
|
2453
2586
|
});
|
|
2454
2587
|
}
|
|
2455
2588
|
}, {
|
|
2456
2589
|
key: "startQRCode",
|
|
2457
2590
|
value: function startQRCode() {
|
|
2458
|
-
var
|
|
2591
|
+
var _this31 = this;
|
|
2459
2592
|
|
|
2460
2593
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
|
|
2461
2594
|
return new Promise(function (accept, reject) {
|
|
2462
|
-
if (!
|
|
2595
|
+
if (!_this31._controller) {
|
|
2463
2596
|
return reject(new Error("PlattarEmbed.startQRCode() - cannot execute as controller has not loaded yet"));
|
|
2464
2597
|
}
|
|
2465
2598
|
|
|
2466
|
-
return
|
|
2599
|
+
return _this31._controller.startQRCode(options).then(accept)["catch"](reject);
|
|
2467
2600
|
});
|
|
2468
2601
|
}
|
|
2469
2602
|
/**
|
|
@@ -2511,12 +2644,18 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
2511
2644
|
|
|
2512
2645
|
var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {
|
|
2513
2646
|
if (k2 === undefined) k2 = k;
|
|
2514
|
-
Object.
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
|
|
2647
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
2648
|
+
|
|
2649
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
2650
|
+
desc = {
|
|
2651
|
+
enumerable: true,
|
|
2652
|
+
get: function get() {
|
|
2653
|
+
return m[k];
|
|
2654
|
+
}
|
|
2655
|
+
};
|
|
2656
|
+
}
|
|
2657
|
+
|
|
2658
|
+
Object.defineProperty(o, k2, desc);
|
|
2520
2659
|
} : function (o, m, k, k2) {
|
|
2521
2660
|
if (k2 === undefined) k2 = k;
|
|
2522
2661
|
o[k2] = m[k];
|
|
@@ -3066,7 +3205,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
3066
3205
|
Object.defineProperty(exports, "__esModule", {
|
|
3067
3206
|
value: true
|
|
3068
3207
|
});
|
|
3069
|
-
exports["default"] = "1.
|
|
3208
|
+
exports["default"] = "1.129.1";
|
|
3070
3209
|
}, {}],
|
|
3071
3210
|
17: [function (require, module, exports) {
|
|
3072
3211
|
"use strict";
|
|
@@ -3105,17 +3244,17 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
3105
3244
|
var _super11 = _createSuper(QuicklookViewer);
|
|
3106
3245
|
|
|
3107
3246
|
function QuicklookViewer() {
|
|
3108
|
-
var
|
|
3247
|
+
var _this32;
|
|
3109
3248
|
|
|
3110
3249
|
_classCallCheck(this, QuicklookViewer);
|
|
3111
3250
|
|
|
3112
|
-
|
|
3113
|
-
|
|
3114
|
-
|
|
3251
|
+
_this32 = _super11.call(this);
|
|
3252
|
+
_this32.araction = null;
|
|
3253
|
+
_this32.titleHTML = "&checkoutTitle=" + document.title + "&checkoutSubtitle=" + document.title;
|
|
3115
3254
|
|
|
3116
|
-
|
|
3255
|
+
_this32.arcallback = function () {};
|
|
3117
3256
|
|
|
3118
|
-
return
|
|
3257
|
+
return _this32;
|
|
3119
3258
|
}
|
|
3120
3259
|
|
|
3121
3260
|
_createClass(QuicklookViewer, [{
|
|
@@ -3131,7 +3270,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
3131
3270
|
}, {
|
|
3132
3271
|
key: "start",
|
|
3133
3272
|
value: function start() {
|
|
3134
|
-
var
|
|
3273
|
+
var _this33 = this;
|
|
3135
3274
|
|
|
3136
3275
|
if (!this.modelUrl) {
|
|
3137
3276
|
throw new Error("QuicklookViewer.start() - model url not set, use QuicklookViewer.modelUrl");
|
|
@@ -3146,7 +3285,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
3146
3285
|
if (araction) {
|
|
3147
3286
|
var handleQuicklook = function handleQuicklook(event) {
|
|
3148
3287
|
if (event.data === "_apple_ar_quicklook_button_tapped") {
|
|
3149
|
-
|
|
3288
|
+
_this33.arcallback();
|
|
3150
3289
|
}
|
|
3151
3290
|
|
|
3152
3291
|
document.body.removeChild(anchor);
|
|
@@ -3253,16 +3392,16 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
3253
3392
|
var _super13 = _createSuper(SceneViewer);
|
|
3254
3393
|
|
|
3255
3394
|
function SceneViewer() {
|
|
3256
|
-
var
|
|
3395
|
+
var _this34;
|
|
3257
3396
|
|
|
3258
3397
|
_classCallCheck(this, SceneViewer);
|
|
3259
3398
|
|
|
3260
|
-
|
|
3261
|
-
|
|
3262
|
-
|
|
3263
|
-
|
|
3264
|
-
|
|
3265
|
-
return
|
|
3399
|
+
_this34 = _super13.call(this);
|
|
3400
|
+
_this34.araction = null;
|
|
3401
|
+
_this34.isVertical = false;
|
|
3402
|
+
_this34.titleHTML = "<b>" + document.title;
|
|
3403
|
+
_this34.isVertical = false;
|
|
3404
|
+
return _this34;
|
|
3266
3405
|
}
|
|
3267
3406
|
|
|
3268
3407
|
_createClass(SceneViewer, [{
|
|
@@ -3374,7 +3513,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
3374
3513
|
|
|
3375
3514
|
var Memory = /*#__PURE__*/function () {
|
|
3376
3515
|
function Memory(messengerInstance) {
|
|
3377
|
-
var
|
|
3516
|
+
var _this35 = this;
|
|
3378
3517
|
|
|
3379
3518
|
_classCallCheck(this, Memory);
|
|
3380
3519
|
|
|
@@ -3383,11 +3522,11 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
3383
3522
|
this._permMemory = new PermanentMemory(messengerInstance);
|
|
3384
3523
|
|
|
3385
3524
|
this._messenger.self.__memory__set_temp_var = function (name, data) {
|
|
3386
|
-
|
|
3525
|
+
_this35._tempMemory[name] = data;
|
|
3387
3526
|
};
|
|
3388
3527
|
|
|
3389
3528
|
this._messenger.self.__memory__set_perm_var = function (name, data) {
|
|
3390
|
-
|
|
3529
|
+
_this35._permMemory[name] = data;
|
|
3391
3530
|
};
|
|
3392
3531
|
}
|
|
3393
3532
|
|
|
@@ -3885,20 +4024,20 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
3885
4024
|
}, {
|
|
3886
4025
|
key: "exec",
|
|
3887
4026
|
value: function exec() {
|
|
3888
|
-
var
|
|
4027
|
+
var _this36 = this;
|
|
3889
4028
|
|
|
3890
4029
|
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
|
3891
4030
|
args[_key3] = arguments[_key3];
|
|
3892
4031
|
}
|
|
3893
4032
|
|
|
3894
4033
|
return new Promise(function (accept, reject) {
|
|
3895
|
-
if (!
|
|
3896
|
-
return reject(new Error("WrappedLocalFunction.exec() function with name " +
|
|
4034
|
+
if (!_this36._value) {
|
|
4035
|
+
return reject(new Error("WrappedLocalFunction.exec() function with name " + _this36._funcName + "() is not defined"));
|
|
3897
4036
|
}
|
|
3898
4037
|
|
|
3899
4038
|
try {
|
|
3900
4039
|
// otherwise execute the function
|
|
3901
|
-
var rObject =
|
|
4040
|
+
var rObject = _this36._execute.apply(_this36, args); // we need to check if the returned object is a Promise, if so, handle it
|
|
3902
4041
|
// differently. This can happen if the function wants to execute asyn
|
|
3903
4042
|
|
|
3904
4043
|
|
|
@@ -3962,7 +4101,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
3962
4101
|
|
|
3963
4102
|
var GlobalEventHandler = /*#__PURE__*/function () {
|
|
3964
4103
|
function GlobalEventHandler() {
|
|
3965
|
-
var
|
|
4104
|
+
var _this37 = this;
|
|
3966
4105
|
|
|
3967
4106
|
_classCallCheck(this, GlobalEventHandler);
|
|
3968
4107
|
|
|
@@ -3984,10 +4123,10 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
3984
4123
|
|
|
3985
4124
|
if (jsonData && jsonData.event && jsonData.data) {
|
|
3986
4125
|
// see if there are any listeners for this
|
|
3987
|
-
if (
|
|
4126
|
+
if (_this37._eventListeners[jsonData.event]) {
|
|
3988
4127
|
var remoteInterface = new RemoteInterface(evt.source, evt.origin); // loop through and call all the event handlers
|
|
3989
4128
|
|
|
3990
|
-
|
|
4129
|
+
_this37._eventListeners[jsonData.event].forEach(function (callback) {
|
|
3991
4130
|
try {
|
|
3992
4131
|
callback(remoteInterface, jsonData.data);
|
|
3993
4132
|
} catch (e) {
|
|
@@ -4183,40 +4322,40 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
4183
4322
|
}, {
|
|
4184
4323
|
key: "_registerListeners",
|
|
4185
4324
|
value: function _registerListeners() {
|
|
4186
|
-
var
|
|
4325
|
+
var _this38 = this;
|
|
4187
4326
|
|
|
4188
4327
|
GlobalEventHandler.instance().listen("__messenger__child_init", function (src, data) {
|
|
4189
4328
|
var iframeID = src.id; // check reserved key list
|
|
4190
4329
|
|
|
4191
4330
|
switch (iframeID) {
|
|
4192
4331
|
case undefined:
|
|
4193
|
-
throw new Error("Messenger[" +
|
|
4332
|
+
throw new Error("Messenger[" + _this38._id + "].setup() Component ID cannot be undefined");
|
|
4194
4333
|
|
|
4195
4334
|
case "self":
|
|
4196
|
-
throw new Error("Messenger[" +
|
|
4335
|
+
throw new Error("Messenger[" + _this38._id + "].setup() Component ID of \"self\" cannot be used as the keyword is reserved");
|
|
4197
4336
|
|
|
4198
4337
|
case "parent":
|
|
4199
|
-
throw new Error("Messenger[" +
|
|
4338
|
+
throw new Error("Messenger[" + _this38._id + "].setup() Component ID of \"parent\" cannot be used as the keyword is reserved");
|
|
4200
4339
|
|
|
4201
4340
|
case "id":
|
|
4202
|
-
throw new Error("Messenger[" +
|
|
4341
|
+
throw new Error("Messenger[" + _this38._id + "].setup() Component ID of \"id\" cannot be used as the keyword is reserved");
|
|
4203
4342
|
|
|
4204
4343
|
case "onload":
|
|
4205
|
-
throw new Error("Messenger[" +
|
|
4344
|
+
throw new Error("Messenger[" + _this38._id + "].setup() Component ID of \"onload\" cannot be used as the keyword is reserved");
|
|
4206
4345
|
|
|
4207
4346
|
default:
|
|
4208
4347
|
break;
|
|
4209
4348
|
} // initialise the child iframe as a messenger pipe
|
|
4210
4349
|
|
|
4211
4350
|
|
|
4212
|
-
|
|
4351
|
+
_this38[iframeID] = new RemoteFunctionList(iframeID);
|
|
4213
4352
|
|
|
4214
|
-
|
|
4353
|
+
_this38[iframeID].setup(new RemoteInterface(src.source, src.origin)); // add the interface to the broadcaster
|
|
4215
4354
|
|
|
4216
4355
|
|
|
4217
|
-
|
|
4356
|
+
_this38._broadcaster._push(iframeID);
|
|
4218
4357
|
|
|
4219
|
-
var callbacks =
|
|
4358
|
+
var callbacks = _this38._callbacks; // we have registered callbacks, begin execution
|
|
4220
4359
|
|
|
4221
4360
|
if (callbacks.has(iframeID)) {
|
|
4222
4361
|
var array = callbacks.get(iframeID);
|
|
@@ -4240,33 +4379,33 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
4240
4379
|
|
|
4241
4380
|
switch (iframeID) {
|
|
4242
4381
|
case undefined:
|
|
4243
|
-
throw new Error("Messenger[" +
|
|
4382
|
+
throw new Error("Messenger[" + _this38._id + "].setup() Component ID cannot be undefined");
|
|
4244
4383
|
|
|
4245
4384
|
case "self":
|
|
4246
|
-
throw new Error("Messenger[" +
|
|
4385
|
+
throw new Error("Messenger[" + _this38._id + "].setup() Component ID of \"self\" cannot be used as the keyword is reserved");
|
|
4247
4386
|
|
|
4248
4387
|
case "parent":
|
|
4249
|
-
throw new Error("Messenger[" +
|
|
4388
|
+
throw new Error("Messenger[" + _this38._id + "].setup() Component ID of \"parent\" cannot be used as the keyword is reserved");
|
|
4250
4389
|
|
|
4251
4390
|
case "id":
|
|
4252
|
-
throw new Error("Messenger[" +
|
|
4391
|
+
throw new Error("Messenger[" + _this38._id + "].setup() Component ID of \"id\" cannot be used as the keyword is reserved");
|
|
4253
4392
|
|
|
4254
4393
|
case "onload":
|
|
4255
|
-
throw new Error("Messenger[" +
|
|
4394
|
+
throw new Error("Messenger[" + _this38._id + "].setup() Component ID of \"onload\" cannot be used as the keyword is reserved");
|
|
4256
4395
|
|
|
4257
4396
|
default:
|
|
4258
4397
|
break;
|
|
4259
4398
|
} // initialise the child iframe as a messenger pipe
|
|
4260
4399
|
|
|
4261
4400
|
|
|
4262
|
-
|
|
4401
|
+
_this38[iframeID] = new RemoteFunctionList(iframeID);
|
|
4263
4402
|
|
|
4264
|
-
|
|
4403
|
+
_this38[iframeID].setup(new RemoteInterface(src.source, src.origin)); // add the interface to the broadcaster
|
|
4265
4404
|
|
|
4266
4405
|
|
|
4267
|
-
|
|
4406
|
+
_this38._broadcaster._push(iframeID);
|
|
4268
4407
|
|
|
4269
|
-
var callbacks =
|
|
4408
|
+
var callbacks = _this38._callbacks; // we have registered callbacks, begin execution
|
|
4270
4409
|
|
|
4271
4410
|
if (callbacks.has(iframeID)) {
|
|
4272
4411
|
var array = callbacks.get(iframeID);
|
|
@@ -4286,11 +4425,11 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
4286
4425
|
});
|
|
4287
4426
|
GlobalEventHandler.instance().listen("__messenger__parent_init", function (src, data) {
|
|
4288
4427
|
var iframeID = "parent";
|
|
4289
|
-
|
|
4428
|
+
_this38[iframeID] = new RemoteFunctionList(iframeID);
|
|
4290
4429
|
|
|
4291
|
-
|
|
4430
|
+
_this38[iframeID].setup(new RemoteInterface(src.source, src.origin));
|
|
4292
4431
|
|
|
4293
|
-
var callbacks =
|
|
4432
|
+
var callbacks = _this38._callbacks; // we have registered callbacks, begin execution
|
|
4294
4433
|
|
|
4295
4434
|
if (callbacks.has(iframeID)) {
|
|
4296
4435
|
var array = callbacks.get(iframeID);
|
|
@@ -4315,11 +4454,11 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
4315
4454
|
|
|
4316
4455
|
GlobalEventHandler.instance().listen("__messenger__parent_init_inv", function (src, data) {
|
|
4317
4456
|
var iframeID = "parent";
|
|
4318
|
-
|
|
4457
|
+
_this38[iframeID] = new RemoteFunctionList(iframeID);
|
|
4319
4458
|
|
|
4320
|
-
|
|
4459
|
+
_this38[iframeID].setup(new RemoteInterface(src.source, src.origin));
|
|
4321
4460
|
|
|
4322
|
-
var callbacks =
|
|
4461
|
+
var callbacks = _this38._callbacks; // we have registered callbacks, begin execution
|
|
4323
4462
|
|
|
4324
4463
|
if (callbacks.has(iframeID)) {
|
|
4325
4464
|
var array = callbacks.get(iframeID);
|
|
@@ -4557,7 +4696,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
4557
4696
|
|
|
4558
4697
|
var WrappedRemoteFunction = /*#__PURE__*/function () {
|
|
4559
4698
|
function WrappedRemoteFunction(funcName, remoteInterface) {
|
|
4560
|
-
var
|
|
4699
|
+
var _this39 = this;
|
|
4561
4700
|
|
|
4562
4701
|
_classCallCheck(this, WrappedRemoteFunction);
|
|
4563
4702
|
|
|
@@ -4568,19 +4707,19 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
4568
4707
|
GlobalEventHandler.instance().listen("__messenger__exec_fnc_result", function (src, data) {
|
|
4569
4708
|
var instanceID = data.instance_id; // the function name must match
|
|
4570
4709
|
|
|
4571
|
-
if (data.function_name !==
|
|
4710
|
+
if (data.function_name !== _this39._funcName) {
|
|
4572
4711
|
return;
|
|
4573
4712
|
} // the instance ID must be found, otherwise this is a rogue execution
|
|
4574
4713
|
// that can be ignored (should not happen)
|
|
4575
4714
|
|
|
4576
4715
|
|
|
4577
|
-
if (!
|
|
4716
|
+
if (!_this39._callInstances[instanceID]) {
|
|
4578
4717
|
return;
|
|
4579
4718
|
}
|
|
4580
4719
|
|
|
4581
|
-
var promise =
|
|
4720
|
+
var promise = _this39._callInstances[instanceID]; // remove the old instance
|
|
4582
4721
|
|
|
4583
|
-
delete
|
|
4722
|
+
delete _this39._callInstances[instanceID]; // perform the promise callbacks
|
|
4584
4723
|
|
|
4585
4724
|
if (data.function_status === "success") {
|
|
4586
4725
|
promise.accept(data.function_args);
|
|
@@ -4597,7 +4736,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
4597
4736
|
_createClass(WrappedRemoteFunction, [{
|
|
4598
4737
|
key: "exec",
|
|
4599
4738
|
value: function exec() {
|
|
4600
|
-
var
|
|
4739
|
+
var _this40 = this;
|
|
4601
4740
|
|
|
4602
4741
|
for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
|
|
4603
4742
|
args[_key4] = arguments[_key4];
|
|
@@ -4617,14 +4756,14 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
4617
4756
|
|
|
4618
4757
|
return new Promise(function (accept, reject) {
|
|
4619
4758
|
// save this promise to be executed later
|
|
4620
|
-
|
|
4759
|
+
_this40._callInstances[instanceID] = {
|
|
4621
4760
|
accept: accept,
|
|
4622
4761
|
reject: reject
|
|
4623
4762
|
}; // execute this event in another context
|
|
4624
4763
|
|
|
4625
|
-
|
|
4764
|
+
_this40._remoteInterface.send("__messenger__exec_fnc", {
|
|
4626
4765
|
instance_id: instanceID,
|
|
4627
|
-
function_name:
|
|
4766
|
+
function_name: _this40._funcName,
|
|
4628
4767
|
function_args: args
|
|
4629
4768
|
});
|
|
4630
4769
|
});
|
|
@@ -4773,7 +4912,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
4773
4912
|
|
|
4774
4913
|
var Analytics = /*#__PURE__*/function () {
|
|
4775
4914
|
function Analytics(applicationID) {
|
|
4776
|
-
var
|
|
4915
|
+
var _this41 = this;
|
|
4777
4916
|
|
|
4778
4917
|
_classCallCheck(this, Analytics);
|
|
4779
4918
|
|
|
@@ -4790,21 +4929,21 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
4790
4929
|
|
|
4791
4930
|
this._handlePageHide = function () {
|
|
4792
4931
|
if (document.visibilityState === "hidden") {
|
|
4793
|
-
|
|
4794
|
-
} else if (
|
|
4932
|
+
_this41._pageTime = new Date();
|
|
4933
|
+
} else if (_this41._pageTime) {
|
|
4795
4934
|
var time2 = new Date();
|
|
4796
4935
|
|
|
4797
|
-
var diff = time2.getTime() -
|
|
4936
|
+
var diff = time2.getTime() - _this41._pageTime.getTime();
|
|
4798
4937
|
|
|
4799
|
-
var data =
|
|
4938
|
+
var data = _this41.data;
|
|
4800
4939
|
data.push("eventAction", "View Time");
|
|
4801
4940
|
data.push("viewTime", diff);
|
|
4802
4941
|
data.push("eventLabel", diff);
|
|
4803
4942
|
|
|
4804
|
-
|
|
4943
|
+
_this41.write();
|
|
4805
4944
|
|
|
4806
|
-
|
|
4807
|
-
document.removeEventListener("visibilitychange",
|
|
4945
|
+
_this41._pageTime = null;
|
|
4946
|
+
document.removeEventListener("visibilitychange", _this41._handlePageHide, false);
|
|
4808
4947
|
}
|
|
4809
4948
|
};
|
|
4810
4949
|
}
|
|
@@ -4812,7 +4951,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
4812
4951
|
_createClass(Analytics, [{
|
|
4813
4952
|
key: "query",
|
|
4814
4953
|
value: function query() {
|
|
4815
|
-
var
|
|
4954
|
+
var _this42 = this;
|
|
4816
4955
|
|
|
4817
4956
|
var _query = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
|
|
4818
4957
|
|
|
@@ -4821,11 +4960,11 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
4821
4960
|
return reject(new Error("Analytics.query() - provided query was null"));
|
|
4822
4961
|
}
|
|
4823
4962
|
|
|
4824
|
-
var url =
|
|
4963
|
+
var url = _this42.origin === "dev" ? "http://localhost:9000/2015-03-31/functions/function/invocations" : "https://oyywgrj9ki.execute-api.ap-southeast-2.amazonaws.com/main/analytics";
|
|
4825
4964
|
var data = {
|
|
4826
4965
|
type: "read",
|
|
4827
|
-
application_id:
|
|
4828
|
-
event:
|
|
4966
|
+
application_id: _this42._applicationID,
|
|
4967
|
+
event: _this42.event,
|
|
4829
4968
|
data: _query
|
|
4830
4969
|
};
|
|
4831
4970
|
basic_http_1["default"].exec("POST", url, data).then(function (result) {
|
|
@@ -4836,21 +4975,21 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
4836
4975
|
}, {
|
|
4837
4976
|
key: "write",
|
|
4838
4977
|
value: function write() {
|
|
4839
|
-
var
|
|
4978
|
+
var _this43 = this;
|
|
4840
4979
|
|
|
4841
4980
|
return new Promise(function (accept, reject) {
|
|
4842
|
-
var data =
|
|
4843
|
-
var url =
|
|
4844
|
-
data.push("applicationId",
|
|
4981
|
+
var data = _this43._data;
|
|
4982
|
+
var url = _this43.origin === "dev" ? "http://localhost:9000/2015-03-31/functions/function/invocations" : "https://oyywgrj9ki.execute-api.ap-southeast-2.amazonaws.com/main/analytics";
|
|
4983
|
+
data.push("applicationId", _this43._applicationID);
|
|
4845
4984
|
var sendData = {
|
|
4846
4985
|
type: "write",
|
|
4847
|
-
application_id:
|
|
4848
|
-
origin:
|
|
4849
|
-
event:
|
|
4986
|
+
application_id: _this43._applicationID,
|
|
4987
|
+
origin: _this43.origin,
|
|
4988
|
+
event: _this43.event,
|
|
4850
4989
|
data: data.data
|
|
4851
4990
|
};
|
|
4852
4991
|
|
|
4853
|
-
if (
|
|
4992
|
+
if (_this43.isBeacon === false) {
|
|
4854
4993
|
basic_http_1["default"].exec("POST", url, sendData).then(function (result) {
|
|
4855
4994
|
accept(result && result.results ? result.results : {});
|
|
4856
4995
|
})["catch"](reject);
|
|
@@ -4886,12 +5025,18 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
4886
5025
|
|
|
4887
5026
|
var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {
|
|
4888
5027
|
if (k2 === undefined) k2 = k;
|
|
4889
|
-
Object.
|
|
4890
|
-
|
|
4891
|
-
|
|
4892
|
-
|
|
4893
|
-
|
|
4894
|
-
|
|
5028
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5029
|
+
|
|
5030
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
5031
|
+
desc = {
|
|
5032
|
+
enumerable: true,
|
|
5033
|
+
get: function get() {
|
|
5034
|
+
return m[k];
|
|
5035
|
+
}
|
|
5036
|
+
};
|
|
5037
|
+
}
|
|
5038
|
+
|
|
5039
|
+
Object.defineProperty(o, k2, desc);
|
|
4895
5040
|
} : function (o, m, k, k2) {
|
|
4896
5041
|
if (k2 === undefined) k2 = k;
|
|
4897
5042
|
o[k2] = m[k];
|
|
@@ -5077,7 +5222,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
5077
5222
|
Object.defineProperty(exports, "__esModule", {
|
|
5078
5223
|
value: true
|
|
5079
5224
|
});
|
|
5080
|
-
exports["default"] = "1.
|
|
5225
|
+
exports["default"] = "1.124.1";
|
|
5081
5226
|
}, {}],
|
|
5082
5227
|
42: [function (require, module, exports) {
|
|
5083
5228
|
"use strict";
|
|
@@ -5401,11 +5546,11 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
5401
5546
|
}, {
|
|
5402
5547
|
key: "_get",
|
|
5403
5548
|
value: function _get(opt) {
|
|
5404
|
-
var
|
|
5549
|
+
var _this44 = this;
|
|
5405
5550
|
|
|
5406
5551
|
return new Promise(function (resolve, reject) {
|
|
5407
|
-
var target =
|
|
5408
|
-
var server =
|
|
5552
|
+
var target = _this44.target;
|
|
5553
|
+
var server = _this44.server; // we cannot perform a GET request without an ID
|
|
5409
5554
|
|
|
5410
5555
|
if (!target.id) {
|
|
5411
5556
|
reject(new Error("PlattarQuery." + target.type() + ".get() - object id is missing"));
|
|
@@ -5430,16 +5575,16 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
5430
5575
|
var origin = server.originLocation.api_read;
|
|
5431
5576
|
var auth = server.authToken;
|
|
5432
5577
|
var headers = {
|
|
5433
|
-
'cookie': 'laravel_session=' +
|
|
5578
|
+
'cookie': 'laravel_session=' + _this44.getCookie('laravel_session')
|
|
5434
5579
|
};
|
|
5435
5580
|
Object.assign(headers, auth);
|
|
5436
5581
|
var reqopts = {
|
|
5437
5582
|
method: "GET",
|
|
5438
5583
|
headers: headers
|
|
5439
5584
|
};
|
|
5440
|
-
var includeQuery =
|
|
5585
|
+
var includeQuery = _this44._IncludeQuery;
|
|
5441
5586
|
|
|
5442
|
-
var params =
|
|
5587
|
+
var params = _this44._ParamFor("get");
|
|
5443
5588
|
|
|
5444
5589
|
var endpoint = origin + target.type() + "/" + target.id;
|
|
5445
5590
|
|
|
@@ -5480,11 +5625,11 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
5480
5625
|
}, {
|
|
5481
5626
|
key: "_update",
|
|
5482
5627
|
value: function _update() {
|
|
5483
|
-
var
|
|
5628
|
+
var _this45 = this;
|
|
5484
5629
|
|
|
5485
5630
|
return new Promise(function (resolve, reject) {
|
|
5486
|
-
var target =
|
|
5487
|
-
var server =
|
|
5631
|
+
var target = _this45.target;
|
|
5632
|
+
var server = _this45.server; // we cannot perform a GET request without an ID
|
|
5488
5633
|
|
|
5489
5634
|
if (!target.id) {
|
|
5490
5635
|
reject(new Error("PlattarQuery." + target.type() + ".update() - object id is missing"));
|
|
@@ -5497,7 +5642,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
5497
5642
|
var headers = {
|
|
5498
5643
|
'Accept': 'application/json',
|
|
5499
5644
|
'Content-Type': 'application/json',
|
|
5500
|
-
'cookie': 'laravel_session=' +
|
|
5645
|
+
'cookie': 'laravel_session=' + _this45.getCookie('laravel_session')
|
|
5501
5646
|
};
|
|
5502
5647
|
Object.assign(headers, auth);
|
|
5503
5648
|
var reqopts = {
|
|
@@ -5512,7 +5657,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
5512
5657
|
})
|
|
5513
5658
|
};
|
|
5514
5659
|
|
|
5515
|
-
var params =
|
|
5660
|
+
var params = _this45._ParamFor("update");
|
|
5516
5661
|
|
|
5517
5662
|
var endpoint = origin + target.type() + "/" + target.id;
|
|
5518
5663
|
|
|
@@ -5554,18 +5699,18 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
5554
5699
|
}, {
|
|
5555
5700
|
key: "_create",
|
|
5556
5701
|
value: function _create() {
|
|
5557
|
-
var
|
|
5702
|
+
var _this46 = this;
|
|
5558
5703
|
|
|
5559
5704
|
return new Promise(function (resolve, reject) {
|
|
5560
|
-
var target =
|
|
5561
|
-
var server =
|
|
5705
|
+
var target = _this46.target;
|
|
5706
|
+
var server = _this46.server; // otherwise, proceed with the fetching op
|
|
5562
5707
|
|
|
5563
5708
|
var origin = server.originLocation.api_write;
|
|
5564
5709
|
var auth = server.authToken;
|
|
5565
5710
|
var headers = {
|
|
5566
5711
|
'Accept': 'application/json',
|
|
5567
5712
|
'Content-Type': 'application/json',
|
|
5568
|
-
'cookie': 'laravel_session=' +
|
|
5713
|
+
'cookie': 'laravel_session=' + _this46.getCookie('laravel_session')
|
|
5569
5714
|
};
|
|
5570
5715
|
Object.assign(headers, auth);
|
|
5571
5716
|
var reqopts = {
|
|
@@ -5579,7 +5724,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
5579
5724
|
})
|
|
5580
5725
|
};
|
|
5581
5726
|
|
|
5582
|
-
var params =
|
|
5727
|
+
var params = _this46._ParamFor("create");
|
|
5583
5728
|
|
|
5584
5729
|
var endpoint = origin + target.type();
|
|
5585
5730
|
|
|
@@ -5623,11 +5768,11 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
5623
5768
|
}, {
|
|
5624
5769
|
key: "_delete",
|
|
5625
5770
|
value: function _delete() {
|
|
5626
|
-
var
|
|
5771
|
+
var _this47 = this;
|
|
5627
5772
|
|
|
5628
5773
|
return new Promise(function (resolve, reject) {
|
|
5629
|
-
var target =
|
|
5630
|
-
var server =
|
|
5774
|
+
var target = _this47.target;
|
|
5775
|
+
var server = _this47.server; // we cannot perform a GET request without an ID
|
|
5631
5776
|
|
|
5632
5777
|
if (!target.id) {
|
|
5633
5778
|
reject(new Error("PlattarQuery." + target.type() + ".delete() - object id is missing"));
|
|
@@ -5640,7 +5785,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
5640
5785
|
var headers = {
|
|
5641
5786
|
'Accept': 'application/json',
|
|
5642
5787
|
'Content-Type': 'application/json',
|
|
5643
|
-
'cookie': 'laravel_session=' +
|
|
5788
|
+
'cookie': 'laravel_session=' + _this47.getCookie('laravel_session')
|
|
5644
5789
|
};
|
|
5645
5790
|
Object.assign(headers, auth);
|
|
5646
5791
|
var reqopts = {
|
|
@@ -5655,7 +5800,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
5655
5800
|
})
|
|
5656
5801
|
};
|
|
5657
5802
|
|
|
5658
|
-
var params =
|
|
5803
|
+
var params = _this47._ParamFor("delete");
|
|
5659
5804
|
|
|
5660
5805
|
var endpoint = origin + target.type() + "/" + target.id;
|
|
5661
5806
|
|
|
@@ -5718,7 +5863,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
5718
5863
|
}, {
|
|
5719
5864
|
key: "_include",
|
|
5720
5865
|
value: function _include(args) {
|
|
5721
|
-
var
|
|
5866
|
+
var _this48 = this;
|
|
5722
5867
|
|
|
5723
5868
|
if (!args || args.length <= 0) {
|
|
5724
5869
|
return this;
|
|
@@ -5731,21 +5876,21 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
5731
5876
|
if (Array.isArray(obj)) {
|
|
5732
5877
|
obj.forEach(function (strObject) {
|
|
5733
5878
|
if (typeof strObject === "string" || strObject instanceof String) {
|
|
5734
|
-
|
|
5879
|
+
_this48._getIncludeQuery.push(strObject);
|
|
5735
5880
|
} else {
|
|
5736
|
-
throw new Error("PlattarQuery." +
|
|
5881
|
+
throw new Error("PlattarQuery." + _this48.target.type() + ".include(...args) - argument of Array must only include Strings");
|
|
5737
5882
|
}
|
|
5738
5883
|
});
|
|
5739
5884
|
} else if (PlattarUtil.isPlattarObject(obj)) {
|
|
5740
5885
|
var type = obj.type();
|
|
5741
5886
|
|
|
5742
5887
|
if (Array.isArray(type)) {
|
|
5743
|
-
|
|
5888
|
+
_this48._include(type);
|
|
5744
5889
|
} else {
|
|
5745
|
-
|
|
5890
|
+
_this48._getIncludeQuery.push(type);
|
|
5746
5891
|
}
|
|
5747
5892
|
} else {
|
|
5748
|
-
throw new Error("PlattarQuery." +
|
|
5893
|
+
throw new Error("PlattarQuery." + _this48.target.type() + ".include(...args) - argument must be of type PlattarObject or Array but was type=" + _typeof(obj) + " value=" + obj);
|
|
5749
5894
|
}
|
|
5750
5895
|
});
|
|
5751
5896
|
return this;
|
|
@@ -5885,13 +6030,13 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
5885
6030
|
}, {
|
|
5886
6031
|
key: "auth",
|
|
5887
6032
|
value: function auth(token, opt) {
|
|
5888
|
-
var
|
|
6033
|
+
var _this49 = this;
|
|
5889
6034
|
|
|
5890
6035
|
var copt = opt || {
|
|
5891
6036
|
validate: false
|
|
5892
6037
|
};
|
|
5893
6038
|
return new Promise(function (resolve, reject) {
|
|
5894
|
-
var server =
|
|
6039
|
+
var server = _this49.originLocation.api_write;
|
|
5895
6040
|
|
|
5896
6041
|
if (!server) {
|
|
5897
6042
|
reject(new Error("Plattar.auth(token) - cannot authenticate as server not set via Plattar.origin(server)"));
|
|
@@ -5904,10 +6049,10 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
5904
6049
|
}
|
|
5905
6050
|
|
|
5906
6051
|
if (!copt.validate) {
|
|
5907
|
-
|
|
6052
|
+
_this49._authToken = {
|
|
5908
6053
|
"plattar-auth-token": token
|
|
5909
6054
|
};
|
|
5910
|
-
resolve(
|
|
6055
|
+
resolve(_this49);
|
|
5911
6056
|
return;
|
|
5912
6057
|
}
|
|
5913
6058
|
|
|
@@ -5920,10 +6065,10 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
5920
6065
|
};
|
|
5921
6066
|
fetch(endpoint, options).then(function (res) {
|
|
5922
6067
|
if (res.ok) {
|
|
5923
|
-
|
|
6068
|
+
_this49._authToken = {
|
|
5924
6069
|
"plattar-auth-token": token
|
|
5925
6070
|
};
|
|
5926
|
-
resolve(
|
|
6071
|
+
resolve(_this49);
|
|
5927
6072
|
} else {
|
|
5928
6073
|
reject(new Error("Plattar.auth(token) - failed to validate authentication token at " + endpoint));
|
|
5929
6074
|
}
|
|
@@ -5933,7 +6078,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
5933
6078
|
}, {
|
|
5934
6079
|
key: "origin",
|
|
5935
6080
|
value: function origin(server, opt) {
|
|
5936
|
-
var
|
|
6081
|
+
var _this50 = this;
|
|
5937
6082
|
|
|
5938
6083
|
var copt = opt || {
|
|
5939
6084
|
validate: false
|
|
@@ -5945,8 +6090,8 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
5945
6090
|
}
|
|
5946
6091
|
|
|
5947
6092
|
if (!copt.validate) {
|
|
5948
|
-
|
|
5949
|
-
resolve(
|
|
6093
|
+
_this50._serverLocation = server;
|
|
6094
|
+
resolve(_this50);
|
|
5950
6095
|
return;
|
|
5951
6096
|
}
|
|
5952
6097
|
|
|
@@ -5956,8 +6101,8 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
5956
6101
|
};
|
|
5957
6102
|
fetch(endpoint, options).then(function (res) {
|
|
5958
6103
|
if (res.ok) {
|
|
5959
|
-
|
|
5960
|
-
resolve(
|
|
6104
|
+
_this50._serverLocation = server;
|
|
6105
|
+
resolve(_this50);
|
|
5961
6106
|
} else {
|
|
5962
6107
|
reject(new Error("Plattar.origin(server) - failed to ping server at " + endpoint));
|
|
5963
6108
|
}
|
|
@@ -6373,17 +6518,17 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
6373
6518
|
var _super25 = _createSuper(FileBase);
|
|
6374
6519
|
|
|
6375
6520
|
function FileBase(id, server) {
|
|
6376
|
-
var
|
|
6521
|
+
var _this51;
|
|
6377
6522
|
|
|
6378
6523
|
_classCallCheck(this, FileBase);
|
|
6379
6524
|
|
|
6380
|
-
|
|
6525
|
+
_this51 = _super25.call(this, id, server || Server["default"]());
|
|
6381
6526
|
|
|
6382
|
-
if (
|
|
6527
|
+
if (_this51.constructor === FileBase) {
|
|
6383
6528
|
throw new Error("FileBase is abstract and cannot be created");
|
|
6384
6529
|
}
|
|
6385
6530
|
|
|
6386
|
-
return
|
|
6531
|
+
return _this51;
|
|
6387
6532
|
}
|
|
6388
6533
|
|
|
6389
6534
|
_createClass(FileBase, [{
|
|
@@ -6578,17 +6723,17 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
6578
6723
|
var _super30 = _createSuper(PlattarBase);
|
|
6579
6724
|
|
|
6580
6725
|
function PlattarBase(id, server) {
|
|
6581
|
-
var
|
|
6726
|
+
var _this52;
|
|
6582
6727
|
|
|
6583
6728
|
_classCallCheck(this, PlattarBase);
|
|
6584
6729
|
|
|
6585
|
-
|
|
6730
|
+
_this52 = _super30.call(this, id, server || Server["default"]());
|
|
6586
6731
|
|
|
6587
|
-
if (
|
|
6732
|
+
if (_this52.constructor === PlattarBase) {
|
|
6588
6733
|
throw new Error("PlattarBase is abstract and cannot be created");
|
|
6589
6734
|
}
|
|
6590
6735
|
|
|
6591
|
-
return
|
|
6736
|
+
return _this52;
|
|
6592
6737
|
}
|
|
6593
6738
|
|
|
6594
6739
|
return _createClass(PlattarBase);
|
|
@@ -6660,7 +6805,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
6660
6805
|
}, {
|
|
6661
6806
|
key: "filter",
|
|
6662
6807
|
value: function filter(obj, id) {
|
|
6663
|
-
var
|
|
6808
|
+
var _this53 = this;
|
|
6664
6809
|
|
|
6665
6810
|
if (!obj) {
|
|
6666
6811
|
return [];
|
|
@@ -6678,7 +6823,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
6678
6823
|
if (Array.isArray(type)) {
|
|
6679
6824
|
var compiledList = [];
|
|
6680
6825
|
type.forEach(function (inObject) {
|
|
6681
|
-
var retArray =
|
|
6826
|
+
var retArray = _this53.filter(inObject, id);
|
|
6682
6827
|
|
|
6683
6828
|
if (retArray.length > 0) {
|
|
6684
6829
|
compiledList = compiledList.concat(retArray);
|
|
@@ -6881,7 +7026,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
6881
7026
|
}, {
|
|
6882
7027
|
key: "include",
|
|
6883
7028
|
value: function include() {
|
|
6884
|
-
var
|
|
7029
|
+
var _this54 = this;
|
|
6885
7030
|
|
|
6886
7031
|
for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {
|
|
6887
7032
|
args[_key6] = arguments[_key6];
|
|
@@ -6897,15 +7042,15 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
6897
7042
|
if (Array.isArray(obj)) {
|
|
6898
7043
|
obj.forEach(function (strObject) {
|
|
6899
7044
|
if (typeof strObject === "string" || strObject instanceof String) {
|
|
6900
|
-
includes.push("".concat(
|
|
7045
|
+
includes.push("".concat(_this54.type(), ".").concat(strObject));
|
|
6901
7046
|
} else {
|
|
6902
|
-
throw new Error("PlattarObject." +
|
|
7047
|
+
throw new Error("PlattarObject." + _this54.type() + ".include(...args) - argument of Array must only include Strings");
|
|
6903
7048
|
}
|
|
6904
7049
|
});
|
|
6905
7050
|
} else if (obj.prototype instanceof PlattarObject) {
|
|
6906
|
-
includes.push("".concat(
|
|
7051
|
+
includes.push("".concat(_this54.type(), ".").concat(obj.type()));
|
|
6907
7052
|
} else {
|
|
6908
|
-
throw new Error("PlattarObject." +
|
|
7053
|
+
throw new Error("PlattarObject." + _this54.type() + ".include(...args) - argument must be of type PlattarObject or Array but was type=" + _typeof(obj) + " value=" + obj);
|
|
6909
7054
|
}
|
|
6910
7055
|
});
|
|
6911
7056
|
return includes;
|
|
@@ -7076,17 +7221,17 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
7076
7221
|
var _super36 = _createSuper(CardBase);
|
|
7077
7222
|
|
|
7078
7223
|
function CardBase(id, server) {
|
|
7079
|
-
var
|
|
7224
|
+
var _this55;
|
|
7080
7225
|
|
|
7081
7226
|
_classCallCheck(this, CardBase);
|
|
7082
7227
|
|
|
7083
|
-
|
|
7228
|
+
_this55 = _super36.call(this, id, server || Server["default"]());
|
|
7084
7229
|
|
|
7085
|
-
if (
|
|
7230
|
+
if (_this55.constructor === CardBase) {
|
|
7086
7231
|
throw new Error("CardBase is abstract and cannot be created");
|
|
7087
7232
|
}
|
|
7088
7233
|
|
|
7089
|
-
return
|
|
7234
|
+
return _this55;
|
|
7090
7235
|
}
|
|
7091
7236
|
|
|
7092
7237
|
_createClass(CardBase, null, [{
|
|
@@ -7512,17 +7657,17 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
7512
7657
|
var _super50 = _createSuper(ProductBase);
|
|
7513
7658
|
|
|
7514
7659
|
function ProductBase(id, server) {
|
|
7515
|
-
var
|
|
7660
|
+
var _this56;
|
|
7516
7661
|
|
|
7517
7662
|
_classCallCheck(this, ProductBase);
|
|
7518
7663
|
|
|
7519
|
-
|
|
7664
|
+
_this56 = _super50.call(this, id, server || Server["default"]());
|
|
7520
7665
|
|
|
7521
|
-
if (
|
|
7666
|
+
if (_this56.constructor === ProductBase) {
|
|
7522
7667
|
throw new Error("ProductBase is abstract and cannot be created");
|
|
7523
7668
|
}
|
|
7524
7669
|
|
|
7525
|
-
return
|
|
7670
|
+
return _this56;
|
|
7526
7671
|
}
|
|
7527
7672
|
|
|
7528
7673
|
_createClass(ProductBase, null, [{
|
|
@@ -7669,17 +7814,17 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
7669
7814
|
var _super55 = _createSuper(SceneBase);
|
|
7670
7815
|
|
|
7671
7816
|
function SceneBase(id, server) {
|
|
7672
|
-
var
|
|
7817
|
+
var _this57;
|
|
7673
7818
|
|
|
7674
7819
|
_classCallCheck(this, SceneBase);
|
|
7675
7820
|
|
|
7676
|
-
|
|
7821
|
+
_this57 = _super55.call(this, id, server || Server["default"]());
|
|
7677
7822
|
|
|
7678
|
-
if (
|
|
7823
|
+
if (_this57.constructor === SceneBase) {
|
|
7679
7824
|
throw new Error("SceneBase is abstract and cannot be created");
|
|
7680
7825
|
}
|
|
7681
7826
|
|
|
7682
|
-
return
|
|
7827
|
+
return _this57;
|
|
7683
7828
|
}
|
|
7684
7829
|
|
|
7685
7830
|
_createClass(SceneBase, null, [{
|
|
@@ -8620,7 +8765,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
8620
8765
|
_createClass(BaseElement, [{
|
|
8621
8766
|
key: "connectedCallback",
|
|
8622
8767
|
value: function connectedCallback() {
|
|
8623
|
-
var
|
|
8768
|
+
var _this58 = this;
|
|
8624
8769
|
|
|
8625
8770
|
if (this.hasAttribute("url")) {
|
|
8626
8771
|
this.renderQRCode();
|
|
@@ -8629,8 +8774,8 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
8629
8774
|
var observer = new MutationObserver(function (mutations) {
|
|
8630
8775
|
mutations.forEach(function (mutation) {
|
|
8631
8776
|
if (mutation.type === "attributes") {
|
|
8632
|
-
if (
|
|
8633
|
-
|
|
8777
|
+
if (_this58.hasAttribute("url")) {
|
|
8778
|
+
_this58.renderQRCode();
|
|
8634
8779
|
}
|
|
8635
8780
|
}
|
|
8636
8781
|
});
|
|
@@ -8654,7 +8799,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
8654
8799
|
}, {
|
|
8655
8800
|
key: "renderQRCode",
|
|
8656
8801
|
value: function renderQRCode() {
|
|
8657
|
-
var
|
|
8802
|
+
var _this59 = this;
|
|
8658
8803
|
|
|
8659
8804
|
var url = this.hasAttribute("url") ? this.getAttribute("url") : undefined;
|
|
8660
8805
|
|
|
@@ -8764,11 +8909,11 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
8764
8909
|
|
|
8765
8910
|
if (shortenURL && shortenURL.toLowerCase() === "true") {
|
|
8766
8911
|
this._ShortenURL(url).then(function (newURL) {
|
|
8767
|
-
|
|
8912
|
+
_this59._GenerateQRCode(newURL, width, height);
|
|
8768
8913
|
})["catch"](function (_err) {
|
|
8769
8914
|
console.warn(_err); // ignore error and just generate normal QR Code
|
|
8770
8915
|
|
|
8771
|
-
|
|
8916
|
+
_this59._GenerateQRCode(url, width, height);
|
|
8772
8917
|
});
|
|
8773
8918
|
} else {
|
|
8774
8919
|
this._GenerateQRCode(url, width, height);
|
|
@@ -8828,10 +8973,10 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
8828
8973
|
}, {
|
|
8829
8974
|
key: "_ShortenURL",
|
|
8830
8975
|
value: function _ShortenURL(url) {
|
|
8831
|
-
var
|
|
8976
|
+
var _this60 = this;
|
|
8832
8977
|
|
|
8833
8978
|
return new Promise(function (accept, reject) {
|
|
8834
|
-
if (!
|
|
8979
|
+
if (!_this60._IsFetchAPISupported()) {
|
|
8835
8980
|
return reject(new Error("PlattarQR._ShortenURL() - fetch api not supported, cannot proceed"));
|
|
8836
8981
|
}
|
|
8837
8982
|
|
|
@@ -9059,11 +9204,11 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
9059
9204
|
}, {
|
|
9060
9205
|
key: "get",
|
|
9061
9206
|
value: function get() {
|
|
9062
|
-
var
|
|
9207
|
+
var _this61 = this;
|
|
9063
9208
|
|
|
9064
9209
|
return new Promise(function (accept, reject) {
|
|
9065
|
-
|
|
9066
|
-
remote_request_1.RemoteRequest.request(
|
|
9210
|
+
_this61._CalculateHash().then(function () {
|
|
9211
|
+
remote_request_1.RemoteRequest.request(_this61._GetPayload(), _this61.retry < 0 ? 0 : _this61.retry).then(accept)["catch"](reject);
|
|
9067
9212
|
})["catch"](function (_err) {
|
|
9068
9213
|
reject(new Error("Configurator.get() - one of the objects does not exist in Plattar API"));
|
|
9069
9214
|
});
|
|
@@ -9072,14 +9217,14 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
9072
9217
|
}, {
|
|
9073
9218
|
key: "_CalculateHash",
|
|
9074
9219
|
value: function _CalculateHash() {
|
|
9075
|
-
var
|
|
9220
|
+
var _this62 = this;
|
|
9076
9221
|
|
|
9077
9222
|
return new Promise(function (accept, reject) {
|
|
9078
9223
|
var promises = [];
|
|
9079
9224
|
var oldOrigin = plattar_api_1.Server["default"]().originLocation.type;
|
|
9080
|
-
plattar_api_1.Server.create(plattar_api_1.Server.match(
|
|
9225
|
+
plattar_api_1.Server.create(plattar_api_1.Server.match(_this62.server));
|
|
9081
9226
|
|
|
9082
|
-
|
|
9227
|
+
_this62._maps.forEach(function (map) {
|
|
9083
9228
|
if (map.productvariation) {
|
|
9084
9229
|
promises.push(new plattar_api_1.ProductVariation(map.productvariation).get());
|
|
9085
9230
|
}
|
|
@@ -9099,7 +9244,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
9099
9244
|
|
|
9100
9245
|
Promise.all(promises).then(function (values) {
|
|
9101
9246
|
values.forEach(function (value) {
|
|
9102
|
-
|
|
9247
|
+
_this62._attrHash.push(value.attributes);
|
|
9103
9248
|
}); // reset server back
|
|
9104
9249
|
|
|
9105
9250
|
plattar_api_1.Server.create(plattar_api_1.Server.match(oldOrigin));
|
|
@@ -9201,14 +9346,14 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
9201
9346
|
}, {
|
|
9202
9347
|
key: "get",
|
|
9203
9348
|
value: function get() {
|
|
9204
|
-
var
|
|
9349
|
+
var _this63 = this;
|
|
9205
9350
|
|
|
9206
9351
|
return new Promise(function (accept, reject) {
|
|
9207
|
-
if (!
|
|
9352
|
+
if (!_this63._model) {
|
|
9208
9353
|
return reject(new Error("ModelConverter.get() - required .model attribute was not set"));
|
|
9209
9354
|
}
|
|
9210
9355
|
|
|
9211
|
-
remote_request_1.RemoteRequest.request(
|
|
9356
|
+
remote_request_1.RemoteRequest.request(_this63._Payload, _this63.retry < 0 ? 0 : _this63.retry).then(accept)["catch"](reject);
|
|
9212
9357
|
});
|
|
9213
9358
|
}
|
|
9214
9359
|
}, {
|
|
@@ -9529,19 +9674,19 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
9529
9674
|
}, {
|
|
9530
9675
|
key: "allMappedAttributes",
|
|
9531
9676
|
get: function get() {
|
|
9532
|
-
var
|
|
9677
|
+
var _this64 = this;
|
|
9533
9678
|
|
|
9534
9679
|
var map = new Map();
|
|
9535
9680
|
var coreAttr = this.coreAttributes;
|
|
9536
9681
|
var optAttr = this.optionalAttributes;
|
|
9537
9682
|
coreAttr.forEach(function (ele) {
|
|
9538
|
-
if (
|
|
9539
|
-
map.set(ele.map,
|
|
9683
|
+
if (_this64.hasAttribute(ele.key)) {
|
|
9684
|
+
map.set(ele.map, _this64.getAttribute(ele.key));
|
|
9540
9685
|
}
|
|
9541
9686
|
});
|
|
9542
9687
|
optAttr.forEach(function (ele) {
|
|
9543
|
-
if (
|
|
9544
|
-
map.set(ele.map,
|
|
9688
|
+
if (_this64.hasAttribute(ele.key)) {
|
|
9689
|
+
map.set(ele.map, _this64.getAttribute(ele.key));
|
|
9545
9690
|
}
|
|
9546
9691
|
});
|
|
9547
9692
|
return map;
|
|
@@ -9641,7 +9786,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
9641
9786
|
|
|
9642
9787
|
var ElementController = /*#__PURE__*/function () {
|
|
9643
9788
|
function ElementController(element) {
|
|
9644
|
-
var
|
|
9789
|
+
var _this65 = this;
|
|
9645
9790
|
|
|
9646
9791
|
_classCallCheck(this, ElementController);
|
|
9647
9792
|
|
|
@@ -9657,7 +9802,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
9657
9802
|
|
|
9658
9803
|
if (mutation.type === 'attributes' && element.usesCoreAttribute(mutation.attributeName)) {
|
|
9659
9804
|
if (element.hasAllCoreAttributes) {
|
|
9660
|
-
|
|
9805
|
+
_this65._load();
|
|
9661
9806
|
}
|
|
9662
9807
|
}
|
|
9663
9808
|
}
|
|
@@ -9757,7 +9902,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
9757
9902
|
|
|
9758
9903
|
var IFrameController = /*#__PURE__*/function () {
|
|
9759
9904
|
function IFrameController(element, src, id) {
|
|
9760
|
-
var
|
|
9905
|
+
var _this66 = this;
|
|
9761
9906
|
|
|
9762
9907
|
var onelemload = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : undefined;
|
|
9763
9908
|
|
|
@@ -9769,7 +9914,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
9769
9914
|
if (!element.hasAttribute("sameorigin")) {
|
|
9770
9915
|
this._iframe.onload = function () {
|
|
9771
9916
|
if (onelemload) {
|
|
9772
|
-
onelemload(
|
|
9917
|
+
onelemload(_this66._iframe);
|
|
9773
9918
|
}
|
|
9774
9919
|
};
|
|
9775
9920
|
}
|
|
@@ -9910,15 +10055,15 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
9910
10055
|
var _super76 = _createSuper(EWallElement);
|
|
9911
10056
|
|
|
9912
10057
|
function EWallElement() {
|
|
9913
|
-
var
|
|
10058
|
+
var _this67;
|
|
9914
10059
|
|
|
9915
10060
|
_classCallCheck(this, EWallElement);
|
|
9916
10061
|
|
|
9917
|
-
|
|
10062
|
+
_this67 = _super76.call(this);
|
|
9918
10063
|
var tag = document.createElement("script");
|
|
9919
10064
|
tag.src = "https://cdn.8thwall.com/web/iframe/iframe.js";
|
|
9920
10065
|
tag.defer = true;
|
|
9921
|
-
return
|
|
10066
|
+
return _this67;
|
|
9922
10067
|
}
|
|
9923
10068
|
|
|
9924
10069
|
_createClass(EWallElement, [{
|
|
@@ -9935,7 +10080,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
9935
10080
|
}
|
|
9936
10081
|
};
|
|
9937
10082
|
|
|
9938
|
-
window.addEventListener(
|
|
10083
|
+
window.addEventListener("load", onLoad, false);
|
|
9939
10084
|
}
|
|
9940
10085
|
}, {
|
|
9941
10086
|
key: "permissions",
|
|
@@ -10085,6 +10230,9 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
10085
10230
|
return [{
|
|
10086
10231
|
key: "variation-id",
|
|
10087
10232
|
map: "variation_id"
|
|
10233
|
+
}, {
|
|
10234
|
+
key: "show-ar",
|
|
10235
|
+
map: "show_ar"
|
|
10088
10236
|
}];
|
|
10089
10237
|
}
|
|
10090
10238
|
}]);
|
|
@@ -10162,6 +10310,9 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
10162
10310
|
}, {
|
|
10163
10311
|
key: "product-id",
|
|
10164
10312
|
map: "productId"
|
|
10313
|
+
}, {
|
|
10314
|
+
key: "show-ar",
|
|
10315
|
+
map: "show_ar"
|
|
10165
10316
|
}];
|
|
10166
10317
|
}
|
|
10167
10318
|
}]);
|
|
@@ -10380,7 +10531,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
10380
10531
|
module.exports = Util;
|
|
10381
10532
|
}, {}],
|
|
10382
10533
|
129: [function (require, module, exports) {
|
|
10383
|
-
module.exports = "1.
|
|
10534
|
+
module.exports = "1.128.1";
|
|
10384
10535
|
}, {}],
|
|
10385
10536
|
130: [function (require, module, exports) {
|
|
10386
10537
|
(function (global) {
|