@plattar/plattar-ar-adapter 1.155.1 → 1.155.3

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.
@@ -2201,28 +2201,101 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
2201
2201
  return reject(new Error("ProductController.startQRCode() - minimum required attributes not set, use product-id as a minimum"));
2202
2202
  });
2203
2203
  }
2204
+ /**
2205
+ * Displays a QR Code that sends the user direct to AR
2206
+ * @param options
2207
+ * @returns
2208
+ */
2204
2209
  }, {
2205
- key: "startRenderer",
2206
- value: function startRenderer() {
2210
+ key: "startARQRCode",
2211
+ value: function startARQRCode(options) {
2207
2212
  var _this19 = this;
2208
2213
  return new Promise(function (accept, reject) {
2209
2214
  // remove the old renderer instance if any
2210
2215
  _this19.removeRenderer();
2216
+ var opt = options || _this19._GetDefaultQROptions();
2217
+ var viewer = document.createElement("plattar-qrcode");
2218
+ // required attributes with defaults for plattar-viewer node
2219
+ var width = _this19.getAttribute("width") || "500px";
2220
+ var height = _this19.getAttribute("height") || "500px";
2221
+ viewer.setAttribute("width", width);
2222
+ viewer.setAttribute("height", height);
2223
+ if (opt.color) {
2224
+ viewer.setAttribute("color", opt.color);
2225
+ }
2226
+ if (opt.margin) {
2227
+ viewer.setAttribute("margin", "" + opt.margin);
2228
+ }
2229
+ if (opt.qrType) {
2230
+ viewer.setAttribute("qr-type", opt.qrType);
2231
+ }
2232
+ viewer.setAttribute("shorten", opt.shorten && (opt.shorten === true || opt.shorten === "true") ? "true" : "false");
2233
+ var qrOptions = btoa(JSON.stringify(opt));
2234
+ var dst = plattar_api_1.Server.location().base + "renderer/launcher.html?qr_options=" + qrOptions;
2235
+ var sceneID = _this19.getAttribute("scene-id");
2236
+ var configState = _this19.getAttribute("config-state");
2237
+ var embedType = _this19.getAttribute("embed-type");
2211
2238
  var productID = _this19.getAttribute("product-id");
2239
+ var sceneProductID = _this19.getAttribute("scene-product-id");
2240
+ var variationID = _this19.getAttribute("variation-id");
2241
+ var variationSKU = _this19.getAttribute("variation-sku");
2242
+ var arMode = _this19.getAttribute("ar-mode");
2243
+ if (configState) {
2244
+ dst += "&config_state=" + configState;
2245
+ }
2246
+ if (embedType) {
2247
+ dst += "&embed_type=" + embedType;
2248
+ }
2249
+ if (productID) {
2250
+ dst += "&product_id=" + productID;
2251
+ }
2252
+ if (sceneProductID) {
2253
+ dst += "&scene_product_id=" + sceneProductID;
2254
+ }
2255
+ if (variationID) {
2256
+ dst += "&variation_id=" + variationID;
2257
+ }
2258
+ if (variationSKU) {
2259
+ dst += "&variation_sku=" + variationSKU;
2260
+ }
2261
+ if (arMode) {
2262
+ dst += "&ar_mode=" + arMode;
2263
+ }
2264
+ if (sceneID) {
2265
+ dst += "&scene_id=" + sceneID;
2266
+ }
2267
+ viewer.setAttribute("url", opt.url || dst);
2268
+ viewer.onload = function () {
2269
+ return accept(viewer);
2270
+ };
2271
+ _this19._element = viewer;
2272
+ _this19._state = plattar_controller_1.ControllerState.QRCode;
2273
+ _this19._prevQROpt = opt;
2274
+ _this19.append(viewer);
2275
+ });
2276
+ }
2277
+ }, {
2278
+ key: "startRenderer",
2279
+ value: function startRenderer() {
2280
+ var _this20 = this;
2281
+ return new Promise(function (accept, reject) {
2282
+ // remove the old renderer instance if any
2283
+ _this20.removeRenderer();
2284
+ var productID = _this20.getAttribute("product-id");
2212
2285
  if (productID) {
2213
2286
  // required attributes with defaults for plattar-product node
2214
- var width = _this19.getAttribute("width") || "500px";
2215
- var height = _this19.getAttribute("height") || "500px";
2216
- var server = _this19.getAttribute("server") || "production";
2287
+ var width = _this20.getAttribute("width") || "500px";
2288
+ var height = _this20.getAttribute("height") || "500px";
2289
+ var server = _this20.getAttribute("server") || "production";
2217
2290
  var viewer = document.createElement("plattar-product");
2218
2291
  viewer.setAttribute("width", width);
2219
2292
  viewer.setAttribute("height", height);
2220
2293
  viewer.setAttribute("server", server);
2221
2294
  viewer.setAttribute("product-id", productID);
2222
2295
  // optional attributes
2223
- var variationID = _this19.getAttribute("variation-id");
2224
- var variationSKU = _this19.getAttribute("variation-sku");
2225
- var showAR = _this19.getAttribute("show-ar");
2296
+ var variationID = _this20.getAttribute("variation-id");
2297
+ var variationSKU = _this20.getAttribute("variation-sku");
2298
+ var showAR = _this20.getAttribute("show-ar");
2226
2299
  if (variationID) {
2227
2300
  viewer.setAttribute("variation-id", variationID);
2228
2301
  }
@@ -2235,9 +2308,9 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
2235
2308
  viewer.onload = function () {
2236
2309
  return accept(viewer);
2237
2310
  };
2238
- _this19.append(viewer);
2239
- _this19._element = viewer;
2240
- _this19._state = plattar_controller_1.ControllerState.Renderer;
2311
+ _this20.append(viewer);
2312
+ _this20._element = viewer;
2313
+ _this20._state = plattar_controller_1.ControllerState.Renderer;
2241
2314
  return;
2242
2315
  }
2243
2316
  return reject(new Error("ProductController.startRenderer() - minimum required attributes not set, use scene-id as a minimum"));
@@ -2246,15 +2319,15 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
2246
2319
  }, {
2247
2320
  key: "initAR",
2248
2321
  value: function initAR() {
2249
- var _this20 = this;
2322
+ var _this21 = this;
2250
2323
  return new Promise(function (accept, reject) {
2251
2324
  if (!util_1.Util.canAugment()) {
2252
2325
  return reject(new Error("ProductController.initAR() - cannot proceed as AR not available in context"));
2253
2326
  }
2254
- var productID = _this20.getAttribute("product-id");
2327
+ var productID = _this21.getAttribute("product-id");
2255
2328
  if (productID) {
2256
- var variationID = _this20.getAttribute("variation-id");
2257
- var variationSKU = _this20.getAttribute("variation-sku");
2329
+ var variationID = _this21.getAttribute("variation-id");
2330
+ var variationSKU = _this21.getAttribute("variation-sku");
2258
2331
  var product = new product_ar_1.ProductAR(productID, variationID, variationSKU);
2259
2332
  return product.init().then(accept)["catch"](reject);
2260
2333
  }
@@ -2305,11 +2378,11 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
2305
2378
  _inherits(VTOController, _plattar_controller_3);
2306
2379
  var _super9 = _createSuper(VTOController);
2307
2380
  function VTOController() {
2308
- var _this21;
2381
+ var _this22;
2309
2382
  _classCallCheck(this, VTOController);
2310
- _this21 = _super9.apply(this, arguments);
2311
- _this21._cachedConfigState = null;
2312
- return _this21;
2383
+ _this22 = _super9.apply(this, arguments);
2384
+ _this22._cachedConfigState = null;
2385
+ return _this22;
2313
2386
  }
2314
2387
  _createClass(VTOController, [{
2315
2388
  key: "getConfiguratorState",
@@ -2432,7 +2505,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
2432
2505
  key: "startViewerQRCode",
2433
2506
  value: function () {
2434
2507
  var _startViewerQRCode2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee19(options) {
2435
- var _this22 = this;
2508
+ var _this23 = this;
2436
2509
  var sceneID, opt, viewer, width, height, dst, configState, showAR, productID, sceneProductID, variationID;
2437
2510
  return _regeneratorRuntime().wrap(function _callee19$(_context19) {
2438
2511
  while (1) switch (_context19.prev = _context19.next) {
@@ -2505,7 +2578,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
2505
2578
  viewer.onload = function () {
2506
2579
  return accept(viewer);
2507
2580
  };
2508
- _this22.append(viewer);
2581
+ _this23.append(viewer);
2509
2582
  }));
2510
2583
  case 39:
2511
2584
  case "end":
@@ -2522,7 +2595,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
2522
2595
  key: "startRenderer",
2523
2596
  value: function () {
2524
2597
  var _startRenderer2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee20() {
2525
- var _this23 = this;
2598
+ var _this24 = this;
2526
2599
  var sceneID, width, height, server, viewer, configState, showAR, productID, sceneProductID, variationID;
2527
2600
  return _regeneratorRuntime().wrap(function _callee20$(_context20) {
2528
2601
  while (1) switch (_context20.prev = _context20.next) {
@@ -2582,9 +2655,9 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
2582
2655
  }
2583
2656
  this._state = plattar_controller_1.ControllerState.Renderer;
2584
2657
  return _context20.abrupt("return", new Promise(function (accept, reject) {
2585
- _this23.append(viewer);
2658
+ _this24.append(viewer);
2586
2659
  if (configState) {
2587
- _this23.setupMessengerObservers(viewer, configState);
2660
+ _this24.setupMessengerObservers(viewer, configState);
2588
2661
  }
2589
2662
  return accept(viewer);
2590
2663
  }));
@@ -2771,15 +2844,15 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
2771
2844
  _inherits(PlattarEmbed, _HTMLElement);
2772
2845
  var _super10 = _createSuper(PlattarEmbed);
2773
2846
  function PlattarEmbed() {
2774
- var _this24;
2847
+ var _this25;
2775
2848
  _classCallCheck(this, PlattarEmbed);
2776
- _this24 = _super10.call(this);
2849
+ _this25 = _super10.call(this);
2777
2850
  // this is the current embed type, viewer by default
2778
- _this24._currentType = EmbedType.None;
2779
- _this24._controller = null;
2780
- _this24._currentSceneID = null;
2781
- _this24._observer = null;
2782
- return _this24;
2851
+ _this25._currentType = EmbedType.None;
2852
+ _this25._controller = null;
2853
+ _this25._currentSceneID = null;
2854
+ _this25._observer = null;
2855
+ return _this25;
2783
2856
  }
2784
2857
  _createClass(PlattarEmbed, [{
2785
2858
  key: "viewer",
@@ -2800,7 +2873,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
2800
2873
  }, {
2801
2874
  key: "create",
2802
2875
  value: function create() {
2803
- var _this25 = this;
2876
+ var _this26 = this;
2804
2877
  // server cannot be changed once its set - defaults to production
2805
2878
  var server = this.hasAttribute("server") ? this.getAttribute("server") : "production";
2806
2879
  plattar_api_1.Server.create(plattar_api_1.Server.match(server || "production"));
@@ -2809,10 +2882,10 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
2809
2882
  mutations.forEach(function (mutation) {
2810
2883
  if (mutation.type === "attributes") {
2811
2884
  var attributeName = mutation.attributeName ? mutation.attributeName : "none";
2812
- if (_this25._currentType !== EmbedType.Legacy) {
2813
- _this25._CreateEmbed(attributeName);
2885
+ if (_this26._currentType !== EmbedType.Legacy) {
2886
+ _this26._CreateEmbed(attributeName);
2814
2887
  } else {
2815
- _this25._OnAttributesUpdated(attributeName);
2888
+ _this26._OnAttributesUpdated(attributeName);
2816
2889
  }
2817
2890
  }
2818
2891
  });
@@ -2821,9 +2894,8 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
2821
2894
  attributes: true
2822
2895
  });
2823
2896
  }
2824
- var sceneID = this.hasAttribute("scene-id") ? this.getAttribute("scene-id") : null;
2825
2897
  var productID = this.hasAttribute("product-id") ? this.getAttribute("product-id") : null;
2826
- if (!sceneID && productID) {
2898
+ if (productID) {
2827
2899
  this._currentType = EmbedType.Legacy;
2828
2900
  this._CreateLegacyEmbed();
2829
2901
  return;
@@ -2850,6 +2922,15 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
2850
2922
  key: "_CreateLegacyEmbed",
2851
2923
  value: function _CreateLegacyEmbed() {
2852
2924
  this._controller = new product_controller_1.ProductController(this);
2925
+ var init = this.hasAttribute("init") ? this.getAttribute("init") : null;
2926
+ switch (init) {
2927
+ case "viewer":
2928
+ this.startViewer();
2929
+ break;
2930
+ case "qrcode":
2931
+ this.startQRCode();
2932
+ break;
2933
+ }
2853
2934
  }
2854
2935
  /**
2855
2936
  * creates the embed
@@ -3226,12 +3307,15 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
3226
3307
  _createClass(ConfiguratorState, [{
3227
3308
  key: "setVariationSKU",
3228
3309
  value: function setVariationSKU(productVariationSKU) {
3229
- var variationID = this._mappedVariationSKUValues.get(productVariationSKU);
3230
- if (!variationID) {
3310
+ var _this27 = this;
3311
+ var variationIDs = this._mappedVariationSKUValues.get(productVariationSKU);
3312
+ if (!variationIDs) {
3231
3313
  console.warn("ConfiguratorState.setVariationSKU() - Variation SKU of " + productVariationSKU + " is not defined in any variations");
3232
3314
  return;
3233
3315
  }
3234
- this.setVariationID(variationID);
3316
+ variationIDs.forEach(function (variationID) {
3317
+ _this27.setVariationID(variationID);
3318
+ });
3235
3319
  }
3236
3320
  /**
3237
3321
  * Modifyes the SceneProduct that this Variation belongs to and changes for
@@ -3588,7 +3672,12 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
3588
3672
  variations.forEach(function (variation) {
3589
3673
  configState._mappedVariationIDValues.set(variation.id, sceneProduct.id);
3590
3674
  if (variation.attributes.sku) {
3591
- configState._mappedVariationSKUValues.set(variation.attributes.sku, variation.id);
3675
+ var existingSKUs = configState._mappedVariationSKUValues.get(variation.attributes.sku);
3676
+ if (existingSKUs) {
3677
+ existingSKUs.push(variation.id);
3678
+ } else {
3679
+ configState._mappedVariationSKUValues.set(variation.attributes.sku, [variation.id]);
3680
+ }
3592
3681
  }
3593
3682
  });
3594
3683
  }
@@ -3729,7 +3818,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
3729
3818
  Object.defineProperty(exports, "__esModule", {
3730
3819
  value: true
3731
3820
  });
3732
- exports["default"] = "1.155.1";
3821
+ exports["default"] = "1.155.3";
3733
3822
  }, {}],
3734
3823
  17: [function (require, module, exports) {
3735
3824
  "use strict";
@@ -3760,13 +3849,13 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
3760
3849
  _inherits(QuicklookViewer, _ar_viewer_1$default);
3761
3850
  var _super11 = _createSuper(QuicklookViewer);
3762
3851
  function QuicklookViewer() {
3763
- var _this26;
3852
+ var _this28;
3764
3853
  _classCallCheck(this, QuicklookViewer);
3765
- _this26 = _super11.call(this);
3766
- _this26.araction = null;
3767
- _this26.titleHTML = "&checkoutTitle=" + document.title + "&checkoutSubtitle=" + document.title;
3768
- _this26.arcallback = function () {};
3769
- return _this26;
3854
+ _this28 = _super11.call(this);
3855
+ _this28.araction = null;
3856
+ _this28.titleHTML = "&checkoutTitle=" + document.title + "&checkoutSubtitle=" + document.title;
3857
+ _this28.arcallback = function () {};
3858
+ return _this28;
3770
3859
  }
3771
3860
  _createClass(QuicklookViewer, [{
3772
3861
  key: "nodeType",
@@ -3781,7 +3870,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
3781
3870
  }, {
3782
3871
  key: "start",
3783
3872
  value: function start() {
3784
- var _this27 = this;
3873
+ var _this29 = this;
3785
3874
  if (!this.modelUrl) {
3786
3875
  throw new Error("QuicklookViewer.start() - model url not set, use QuicklookViewer.modelUrl");
3787
3876
  }
@@ -3793,7 +3882,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
3793
3882
  if (araction) {
3794
3883
  var handleQuicklook = function handleQuicklook(event) {
3795
3884
  if (event.data === "_apple_ar_quicklook_button_tapped") {
3796
- _this27.arcallback();
3885
+ _this29.arcallback();
3797
3886
  }
3798
3887
  document.body.removeChild(anchor);
3799
3888
  anchor.removeEventListener("message", handleQuicklook, false);
@@ -3879,14 +3968,14 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
3879
3968
  _inherits(SceneViewer, _ar_viewer_1$default3);
3880
3969
  var _super13 = _createSuper(SceneViewer);
3881
3970
  function SceneViewer() {
3882
- var _this28;
3971
+ var _this30;
3883
3972
  _classCallCheck(this, SceneViewer);
3884
- _this28 = _super13.call(this);
3885
- _this28.araction = null;
3886
- _this28.isVertical = false;
3887
- _this28.titleHTML = "<b>" + document.title;
3888
- _this28.isVertical = false;
3889
- return _this28;
3973
+ _this30 = _super13.call(this);
3974
+ _this30.araction = null;
3975
+ _this30.isVertical = false;
3976
+ _this30.titleHTML = "<b>" + document.title;
3977
+ _this30.isVertical = false;
3978
+ return _this30;
3890
3979
  }
3891
3980
  _createClass(SceneViewer, [{
3892
3981
  key: "nodeType",
@@ -3983,16 +4072,16 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
3983
4072
  */
3984
4073
  var Memory = /*#__PURE__*/function () {
3985
4074
  function Memory(messengerInstance) {
3986
- var _this29 = this;
4075
+ var _this31 = this;
3987
4076
  _classCallCheck(this, Memory);
3988
4077
  this._messenger = messengerInstance;
3989
4078
  this._tempMemory = new TemporaryMemory(messengerInstance);
3990
4079
  this._permMemory = new PermanentMemory(messengerInstance);
3991
4080
  this._messenger.self.__memory__set_temp_var = function (name, data) {
3992
- _this29._tempMemory[name] = data;
4081
+ _this31._tempMemory[name] = data;
3993
4082
  };
3994
4083
  this._messenger.self.__memory__set_perm_var = function (name, data) {
3995
- _this29._permMemory[name] = data;
4084
+ _this31._permMemory[name] = data;
3996
4085
  };
3997
4086
  }
3998
4087
  _createClass(Memory, [{
@@ -4439,17 +4528,17 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
4439
4528
  }, {
4440
4529
  key: "exec",
4441
4530
  value: function exec() {
4442
- var _this30 = this;
4531
+ var _this32 = this;
4443
4532
  for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
4444
4533
  args[_key3] = arguments[_key3];
4445
4534
  }
4446
4535
  return new Promise(function (accept, reject) {
4447
- if (!_this30._value) {
4448
- return reject(new Error("WrappedLocalFunction.exec() function with name " + _this30._funcName + "() is not defined"));
4536
+ if (!_this32._value) {
4537
+ return reject(new Error("WrappedLocalFunction.exec() function with name " + _this32._funcName + "() is not defined"));
4449
4538
  }
4450
4539
  try {
4451
4540
  // otherwise execute the function
4452
- var rObject = _this30._execute.apply(_this30, args);
4541
+ var rObject = _this32._execute.apply(_this32, args);
4453
4542
 
4454
4543
  // we need to check if the returned object is a Promise, if so, handle it
4455
4544
  // differently. This can happen if the function wants to execute asyn
@@ -4515,7 +4604,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
4515
4604
  _createClass(FunctionObserver, [{
4516
4605
  key: "subscribe",
4517
4606
  value: function subscribe(functionName, callback) {
4518
- var _this31 = this;
4607
+ var _this33 = this;
4519
4608
  if (!functionName || !Util.isFunction(callback)) {
4520
4609
  return function () {};
4521
4610
  }
@@ -4529,7 +4618,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
4529
4618
  }
4530
4619
  list.push(callback);
4531
4620
  return function () {
4532
- return _this31.unsubscribe(functionName, callback);
4621
+ return _this33.unsubscribe(functionName, callback);
4533
4622
  };
4534
4623
  }
4535
4624
 
@@ -4596,7 +4685,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
4596
4685
  */
4597
4686
  var GlobalEventHandler = /*#__PURE__*/function () {
4598
4687
  function GlobalEventHandler() {
4599
- var _this32 = this;
4688
+ var _this34 = this;
4600
4689
  _classCallCheck(this, GlobalEventHandler);
4601
4690
  this._eventListeners = {};
4602
4691
 
@@ -4616,11 +4705,11 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
4616
4705
  // make sure the event is properly formatted
4617
4706
  if (jsonData && jsonData.event && jsonData.data) {
4618
4707
  // see if there are any listeners for this
4619
- if (_this32._eventListeners[jsonData.event]) {
4708
+ if (_this34._eventListeners[jsonData.event]) {
4620
4709
  var remoteInterface = new RemoteInterface(evt.source, evt.origin);
4621
4710
 
4622
4711
  // loop through and call all the event handlers
4623
- _this32._eventListeners[jsonData.event].forEach(function (callback) {
4712
+ _this34._eventListeners[jsonData.event].forEach(function (callback) {
4624
4713
  try {
4625
4714
  callback(remoteInterface, jsonData.data);
4626
4715
  } catch (e) {
@@ -4812,33 +4901,33 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
4812
4901
  }, {
4813
4902
  key: "_registerListeners",
4814
4903
  value: function _registerListeners() {
4815
- var _this33 = this;
4904
+ var _this35 = this;
4816
4905
  GlobalEventHandler.instance().listen("__messenger__child_init", function (src, data) {
4817
4906
  var iframeID = src.id;
4818
4907
 
4819
4908
  // check reserved key list
4820
4909
  switch (iframeID) {
4821
4910
  case undefined:
4822
- throw new Error("Messenger[" + _this33._id + "].setup() Component ID cannot be undefined");
4911
+ throw new Error("Messenger[" + _this35._id + "].setup() Component ID cannot be undefined");
4823
4912
  case "self":
4824
- throw new Error("Messenger[" + _this33._id + "].setup() Component ID of \"self\" cannot be used as the keyword is reserved");
4913
+ throw new Error("Messenger[" + _this35._id + "].setup() Component ID of \"self\" cannot be used as the keyword is reserved");
4825
4914
  case "parent":
4826
- throw new Error("Messenger[" + _this33._id + "].setup() Component ID of \"parent\" cannot be used as the keyword is reserved");
4915
+ throw new Error("Messenger[" + _this35._id + "].setup() Component ID of \"parent\" cannot be used as the keyword is reserved");
4827
4916
  case "id":
4828
- throw new Error("Messenger[" + _this33._id + "].setup() Component ID of \"id\" cannot be used as the keyword is reserved");
4917
+ throw new Error("Messenger[" + _this35._id + "].setup() Component ID of \"id\" cannot be used as the keyword is reserved");
4829
4918
  case "onload":
4830
- throw new Error("Messenger[" + _this33._id + "].setup() Component ID of \"onload\" cannot be used as the keyword is reserved");
4919
+ throw new Error("Messenger[" + _this35._id + "].setup() Component ID of \"onload\" cannot be used as the keyword is reserved");
4831
4920
  default:
4832
4921
  break;
4833
4922
  }
4834
4923
 
4835
4924
  // initialise the child iframe as a messenger pipe
4836
- _this33[iframeID] = new RemoteFunctionList(iframeID, _this33._functionObserver);
4837
- _this33[iframeID].setup(new RemoteInterface(src.source, src.origin));
4925
+ _this35[iframeID] = new RemoteFunctionList(iframeID, _this35._functionObserver);
4926
+ _this35[iframeID].setup(new RemoteInterface(src.source, src.origin));
4838
4927
 
4839
4928
  // add the interface to the broadcaster
4840
- _this33._broadcaster._push(iframeID);
4841
- var callbacks = _this33._callbacks;
4929
+ _this35._broadcaster._push(iframeID);
4930
+ var callbacks = _this35._callbacks;
4842
4931
 
4843
4932
  // we have registered callbacks, begin execution
4844
4933
  if (callbacks.has(iframeID)) {
@@ -4862,26 +4951,26 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
4862
4951
  // check reserved key list
4863
4952
  switch (iframeID) {
4864
4953
  case undefined:
4865
- throw new Error("Messenger[" + _this33._id + "].setup() Component ID cannot be undefined");
4954
+ throw new Error("Messenger[" + _this35._id + "].setup() Component ID cannot be undefined");
4866
4955
  case "self":
4867
- throw new Error("Messenger[" + _this33._id + "].setup() Component ID of \"self\" cannot be used as the keyword is reserved");
4956
+ throw new Error("Messenger[" + _this35._id + "].setup() Component ID of \"self\" cannot be used as the keyword is reserved");
4868
4957
  case "parent":
4869
- throw new Error("Messenger[" + _this33._id + "].setup() Component ID of \"parent\" cannot be used as the keyword is reserved");
4958
+ throw new Error("Messenger[" + _this35._id + "].setup() Component ID of \"parent\" cannot be used as the keyword is reserved");
4870
4959
  case "id":
4871
- throw new Error("Messenger[" + _this33._id + "].setup() Component ID of \"id\" cannot be used as the keyword is reserved");
4960
+ throw new Error("Messenger[" + _this35._id + "].setup() Component ID of \"id\" cannot be used as the keyword is reserved");
4872
4961
  case "onload":
4873
- throw new Error("Messenger[" + _this33._id + "].setup() Component ID of \"onload\" cannot be used as the keyword is reserved");
4962
+ throw new Error("Messenger[" + _this35._id + "].setup() Component ID of \"onload\" cannot be used as the keyword is reserved");
4874
4963
  default:
4875
4964
  break;
4876
4965
  }
4877
4966
 
4878
4967
  // initialise the child iframe as a messenger pipe
4879
- _this33[iframeID] = new RemoteFunctionList(iframeID, _this33._functionObserver);
4880
- _this33[iframeID].setup(new RemoteInterface(src.source, src.origin));
4968
+ _this35[iframeID] = new RemoteFunctionList(iframeID, _this35._functionObserver);
4969
+ _this35[iframeID].setup(new RemoteInterface(src.source, src.origin));
4881
4970
 
4882
4971
  // add the interface to the broadcaster
4883
- _this33._broadcaster._push(iframeID);
4884
- var callbacks = _this33._callbacks;
4972
+ _this35._broadcaster._push(iframeID);
4973
+ var callbacks = _this35._callbacks;
4885
4974
 
4886
4975
  // we have registered callbacks, begin execution
4887
4976
  if (callbacks.has(iframeID)) {
@@ -4900,9 +4989,9 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
4900
4989
  });
4901
4990
  GlobalEventHandler.instance().listen("__messenger__parent_init", function (src, data) {
4902
4991
  var iframeID = "parent";
4903
- _this33[iframeID] = new RemoteFunctionList(iframeID, _this33._functionObserver);
4904
- _this33[iframeID].setup(new RemoteInterface(src.source, src.origin));
4905
- var callbacks = _this33._callbacks;
4992
+ _this35[iframeID] = new RemoteFunctionList(iframeID, _this35._functionObserver);
4993
+ _this35[iframeID].setup(new RemoteInterface(src.source, src.origin));
4994
+ var callbacks = _this35._callbacks;
4906
4995
 
4907
4996
  // we have registered callbacks, begin execution
4908
4997
  if (callbacks.has(iframeID)) {
@@ -4926,9 +5015,9 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
4926
5015
  */
4927
5016
  GlobalEventHandler.instance().listen("__messenger__parent_init_inv", function (src, data) {
4928
5017
  var iframeID = "parent";
4929
- _this33[iframeID] = new RemoteFunctionList(iframeID, _this33._functionObserver);
4930
- _this33[iframeID].setup(new RemoteInterface(src.source, src.origin));
4931
- var callbacks = _this33._callbacks;
5018
+ _this35[iframeID] = new RemoteFunctionList(iframeID, _this35._functionObserver);
5019
+ _this35[iframeID].setup(new RemoteInterface(src.source, src.origin));
5020
+ var callbacks = _this35._callbacks;
4932
5021
 
4933
5022
  // we have registered callbacks, begin execution
4934
5023
  if (callbacks.has(iframeID)) {
@@ -5150,7 +5239,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
5150
5239
  */
5151
5240
  var WrappedRemoteFunction = /*#__PURE__*/function () {
5152
5241
  function WrappedRemoteFunction(funcName, remoteInterface, functionObserver) {
5153
- var _this34 = this;
5242
+ var _this36 = this;
5154
5243
  _classCallCheck(this, WrappedRemoteFunction);
5155
5244
  this._funcName = funcName;
5156
5245
  this._remoteInterface = remoteInterface;
@@ -5162,24 +5251,24 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
5162
5251
  var instanceID = data.instance_id;
5163
5252
 
5164
5253
  // the function name must match
5165
- if (data.function_name !== _this34._funcName) {
5254
+ if (data.function_name !== _this36._funcName) {
5166
5255
  return;
5167
5256
  }
5168
5257
 
5169
5258
  // the instance ID must be found, otherwise this is a rogue execution
5170
5259
  // that can be ignored (should not happen)
5171
- if (!_this34._callInstances[instanceID]) {
5260
+ if (!_this36._callInstances[instanceID]) {
5172
5261
  return;
5173
5262
  }
5174
- var promise = _this34._callInstances[instanceID];
5263
+ var promise = _this36._callInstances[instanceID];
5175
5264
 
5176
5265
  // remove the old instance
5177
- delete _this34._callInstances[instanceID];
5266
+ delete _this36._callInstances[instanceID];
5178
5267
 
5179
5268
  // perform the promise callbacks
5180
5269
  if (data.function_status === "success") {
5181
5270
  // execute the observers
5182
- _this34._functionObserver.call(_this34._funcName, {
5271
+ _this36._functionObserver.call(_this36._funcName, {
5183
5272
  type: "return",
5184
5273
  state: "success",
5185
5274
  data: data.function_args
@@ -5187,7 +5276,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
5187
5276
  promise.accept(data.function_args);
5188
5277
  } else {
5189
5278
  // execute the observers
5190
- _this34._functionObserver.call(_this34._funcName, {
5279
+ _this36._functionObserver.call(_this36._funcName, {
5191
5280
  type: "return",
5192
5281
  state: "exception",
5193
5282
  data: new Error(data.function_args)
@@ -5203,7 +5292,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
5203
5292
  _createClass(WrappedRemoteFunction, [{
5204
5293
  key: "exec",
5205
5294
  value: function exec() {
5206
- var _this35 = this;
5295
+ var _this37 = this;
5207
5296
  for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
5208
5297
  args[_key4] = arguments[_key4];
5209
5298
  }
@@ -5222,20 +5311,20 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
5222
5311
  // to be executed later
5223
5312
  return new Promise(function (accept, reject) {
5224
5313
  // save this promise to be executed later
5225
- _this35._callInstances[instanceID] = {
5314
+ _this37._callInstances[instanceID] = {
5226
5315
  accept: accept,
5227
5316
  reject: reject
5228
5317
  };
5229
5318
 
5230
5319
  // execute this event in another context
5231
- _this35._remoteInterface.send("__messenger__exec_fnc", {
5320
+ _this37._remoteInterface.send("__messenger__exec_fnc", {
5232
5321
  instance_id: instanceID,
5233
- function_name: _this35._funcName,
5322
+ function_name: _this37._funcName,
5234
5323
  function_args: args
5235
5324
  });
5236
5325
 
5237
5326
  // execute the observers
5238
- _this35._functionObserver.call(_this35._funcName, {
5327
+ _this37._functionObserver.call(_this37._funcName, {
5239
5328
  type: "call",
5240
5329
  state: "success",
5241
5330
  data: args
@@ -5384,7 +5473,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
5384
5473
  var google_analytics_1 = require("./google/google-analytics");
5385
5474
  var Analytics = /*#__PURE__*/function () {
5386
5475
  function Analytics(applicationID) {
5387
- var _this36 = this;
5476
+ var _this38 = this;
5388
5477
  _classCallCheck(this, Analytics);
5389
5478
  this._pageTime = null;
5390
5479
  this.origin = "production";
@@ -5398,17 +5487,17 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
5398
5487
  this._ga = new google_analytics_1.GoogleAnalytics();
5399
5488
  this._handlePageHide = function () {
5400
5489
  if (document.visibilityState === "hidden") {
5401
- _this36._pageTime = new Date();
5402
- } else if (_this36._pageTime) {
5490
+ _this38._pageTime = new Date();
5491
+ } else if (_this38._pageTime) {
5403
5492
  var time2 = new Date();
5404
- var diff = time2.getTime() - _this36._pageTime.getTime();
5405
- var data = _this36.data;
5493
+ var diff = time2.getTime() - _this38._pageTime.getTime();
5494
+ var data = _this38.data;
5406
5495
  data.push("eventAction", "View Time");
5407
5496
  data.push("viewTime", diff);
5408
5497
  data.push("eventLabel", diff);
5409
- _this36.write();
5410
- _this36._pageTime = null;
5411
- document.removeEventListener("visibilitychange", _this36._handlePageHide, false);
5498
+ _this38.write();
5499
+ _this38._pageTime = null;
5500
+ document.removeEventListener("visibilitychange", _this38._handlePageHide, false);
5412
5501
  }
5413
5502
  };
5414
5503
  }
@@ -5420,18 +5509,18 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
5420
5509
  }, {
5421
5510
  key: "query",
5422
5511
  value: function query() {
5423
- var _this37 = this;
5512
+ var _this39 = this;
5424
5513
  var _query = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
5425
5514
  return new Promise(function (accept, reject) {
5426
5515
  if (!_query) {
5427
5516
  return reject(new Error("Analytics.query() - provided query was null"));
5428
5517
  }
5429
- var url = _this37.origin === "dev" ? "https://localhost:3008/v3/read" : "https://analytics.plattar.com/v3/read";
5518
+ var url = _this39.origin === "dev" ? "https://localhost:3008/v3/read" : "https://analytics.plattar.com/v3/read";
5430
5519
  var data = {
5431
5520
  data: {
5432
5521
  attributes: {
5433
- application_id: _this37._applicationID,
5434
- event: _this37.event,
5522
+ application_id: _this39._applicationID,
5523
+ event: _this39.event,
5435
5524
  query: _query
5436
5525
  }
5437
5526
  }
@@ -5444,22 +5533,22 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
5444
5533
  }, {
5445
5534
  key: "write",
5446
5535
  value: function write() {
5447
- var _this38 = this;
5536
+ var _this40 = this;
5448
5537
  return new Promise(function (accept, reject) {
5449
- var data = _this38._data;
5450
- var url = _this38.origin === "dev" ? "https://localhost:3008/v3/write" : "https://analytics.plattar.com/v3/write";
5451
- data.push("applicationId", _this38._applicationID);
5538
+ var data = _this40._data;
5539
+ var url = _this40.origin === "dev" ? "https://localhost:3008/v3/write" : "https://analytics.plattar.com/v3/write";
5540
+ data.push("applicationId", _this40._applicationID);
5452
5541
  var sendData = {
5453
5542
  data: {
5454
5543
  attributes: {
5455
- application_id: _this38._applicationID,
5456
- event: _this38.event,
5457
- origin: _this38.origin,
5544
+ application_id: _this40._applicationID,
5545
+ event: _this40.event,
5546
+ origin: _this40.origin,
5458
5547
  fields: data.data
5459
5548
  }
5460
5549
  }
5461
5550
  };
5462
- if (_this38.isBeacon === false) {
5551
+ if (_this40.isBeacon === false) {
5463
5552
  basic_http_1["default"].exec("POST", url, sendData).then(function (result) {
5464
5553
  accept(result ? result : {});
5465
5554
  })["catch"](reject);
@@ -5468,7 +5557,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
5468
5557
  accept(result ? result : {});
5469
5558
  })["catch"](reject);
5470
5559
  }
5471
- _this38.googleAnalytics.write(_this38.event, _this38.data);
5560
+ _this40.googleAnalytics.write(_this40.event, _this40.data);
5472
5561
  });
5473
5562
  }
5474
5563
  }, {
@@ -6020,10 +6109,10 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
6020
6109
  }, {
6021
6110
  key: "_get",
6022
6111
  value: function _get(opt) {
6023
- var _this39 = this;
6112
+ var _this41 = this;
6024
6113
  return new Promise(function (resolve, reject) {
6025
- var target = _this39.target;
6026
- var server = _this39.server;
6114
+ var target = _this41.target;
6115
+ var server = _this41.server;
6027
6116
 
6028
6117
  // we cannot perform a GET request without an ID
6029
6118
  if (!target.id) {
@@ -6048,15 +6137,15 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
6048
6137
  var origin = server.originLocation.api_read;
6049
6138
  var auth = server.authToken;
6050
6139
  var headers = {
6051
- 'cookie': 'laravel_session=' + _this39.getCookie('laravel_session')
6140
+ 'cookie': 'laravel_session=' + _this41.getCookie('laravel_session')
6052
6141
  };
6053
6142
  Object.assign(headers, auth);
6054
6143
  var reqopts = {
6055
6144
  method: "GET",
6056
6145
  headers: headers
6057
6146
  };
6058
- var includeQuery = _this39._IncludeQuery;
6059
- var params = _this39._ParamFor("get");
6147
+ var includeQuery = _this41._IncludeQuery;
6148
+ var params = _this41._ParamFor("get");
6060
6149
  var endpoint = origin + target.type() + "/" + target.id;
6061
6150
  if (includeQuery) {
6062
6151
  endpoint = endpoint + "?include=" + includeQuery;
@@ -6091,10 +6180,10 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
6091
6180
  }, {
6092
6181
  key: "_update",
6093
6182
  value: function _update() {
6094
- var _this40 = this;
6183
+ var _this42 = this;
6095
6184
  return new Promise(function (resolve, reject) {
6096
- var target = _this40.target;
6097
- var server = _this40.server;
6185
+ var target = _this42.target;
6186
+ var server = _this42.server;
6098
6187
 
6099
6188
  // we cannot perform a GET request without an ID
6100
6189
  if (!target.id) {
@@ -6108,7 +6197,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
6108
6197
  var headers = {
6109
6198
  'Accept': 'application/json',
6110
6199
  'Content-Type': 'application/json',
6111
- 'cookie': 'laravel_session=' + _this40.getCookie('laravel_session')
6200
+ 'cookie': 'laravel_session=' + _this42.getCookie('laravel_session')
6112
6201
  };
6113
6202
  Object.assign(headers, auth);
6114
6203
  var reqopts = {
@@ -6122,7 +6211,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
6122
6211
  meta: target.meta || {}
6123
6212
  })
6124
6213
  };
6125
- var params = _this40._ParamFor("update");
6214
+ var params = _this42._ParamFor("update");
6126
6215
  var endpoint = origin + target.type() + "/" + target.id;
6127
6216
  if (params) {
6128
6217
  var appender = "?";
@@ -6158,10 +6247,10 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
6158
6247
  }, {
6159
6248
  key: "_create",
6160
6249
  value: function _create() {
6161
- var _this41 = this;
6250
+ var _this43 = this;
6162
6251
  return new Promise(function (resolve, reject) {
6163
- var target = _this41.target;
6164
- var server = _this41.server;
6252
+ var target = _this43.target;
6253
+ var server = _this43.server;
6165
6254
 
6166
6255
  // otherwise, proceed with the fetching op
6167
6256
  var origin = server.originLocation.api_write;
@@ -6169,7 +6258,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
6169
6258
  var headers = {
6170
6259
  'Accept': 'application/json',
6171
6260
  'Content-Type': 'application/json',
6172
- 'cookie': 'laravel_session=' + _this41.getCookie('laravel_session')
6261
+ 'cookie': 'laravel_session=' + _this43.getCookie('laravel_session')
6173
6262
  };
6174
6263
  Object.assign(headers, auth);
6175
6264
  var reqopts = {
@@ -6182,7 +6271,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
6182
6271
  meta: target.meta || {}
6183
6272
  })
6184
6273
  };
6185
- var params = _this41._ParamFor("create");
6274
+ var params = _this43._ParamFor("create");
6186
6275
  var endpoint = origin + target.type();
6187
6276
  if (params) {
6188
6277
  var appender = "?";
@@ -6219,10 +6308,10 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
6219
6308
  }, {
6220
6309
  key: "_delete",
6221
6310
  value: function _delete() {
6222
- var _this42 = this;
6311
+ var _this44 = this;
6223
6312
  return new Promise(function (resolve, reject) {
6224
- var target = _this42.target;
6225
- var server = _this42.server;
6313
+ var target = _this44.target;
6314
+ var server = _this44.server;
6226
6315
 
6227
6316
  // we cannot perform a GET request without an ID
6228
6317
  if (!target.id) {
@@ -6236,7 +6325,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
6236
6325
  var headers = {
6237
6326
  'Accept': 'application/json',
6238
6327
  'Content-Type': 'application/json',
6239
- 'cookie': 'laravel_session=' + _this42.getCookie('laravel_session')
6328
+ 'cookie': 'laravel_session=' + _this44.getCookie('laravel_session')
6240
6329
  };
6241
6330
  Object.assign(headers, auth);
6242
6331
  var reqopts = {
@@ -6250,7 +6339,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
6250
6339
  meta: target.meta || {}
6251
6340
  })
6252
6341
  };
6253
- var params = _this42._ParamFor("delete");
6342
+ var params = _this44._ParamFor("delete");
6254
6343
  var endpoint = origin + target.type() + "/" + target.id;
6255
6344
  if (params) {
6256
6345
  var appender = "?";
@@ -6305,7 +6394,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
6305
6394
  }, {
6306
6395
  key: "_include",
6307
6396
  value: function _include(args) {
6308
- var _this43 = this;
6397
+ var _this45 = this;
6309
6398
  if (!args || args.length <= 0) {
6310
6399
  return this;
6311
6400
  }
@@ -6315,20 +6404,20 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
6315
6404
  if (Array.isArray(obj)) {
6316
6405
  obj.forEach(function (strObject) {
6317
6406
  if (typeof strObject === "string" || strObject instanceof String) {
6318
- _this43._getIncludeQuery.push(strObject);
6407
+ _this45._getIncludeQuery.push(strObject);
6319
6408
  } else {
6320
- throw new Error("PlattarQuery." + _this43.target.type() + ".include(...args) - argument of Array must only include Strings");
6409
+ throw new Error("PlattarQuery." + _this45.target.type() + ".include(...args) - argument of Array must only include Strings");
6321
6410
  }
6322
6411
  });
6323
6412
  } else if (PlattarUtil.isPlattarObject(obj)) {
6324
6413
  var type = obj.type();
6325
6414
  if (Array.isArray(type)) {
6326
- _this43._include(type);
6415
+ _this45._include(type);
6327
6416
  } else {
6328
- _this43._getIncludeQuery.push(type);
6417
+ _this45._getIncludeQuery.push(type);
6329
6418
  }
6330
6419
  } else {
6331
- throw new Error("PlattarQuery." + _this43.target.type() + ".include(...args) - argument must be of type PlattarObject or Array but was type=" + _typeof(obj) + " value=" + obj);
6420
+ throw new Error("PlattarQuery." + _this45.target.type() + ".include(...args) - argument must be of type PlattarObject or Array but was type=" + _typeof(obj) + " value=" + obj);
6332
6421
  }
6333
6422
  });
6334
6423
  return this;
@@ -6463,12 +6552,12 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
6463
6552
  }, {
6464
6553
  key: "auth",
6465
6554
  value: function auth(token, opt) {
6466
- var _this44 = this;
6555
+ var _this46 = this;
6467
6556
  var copt = opt || {
6468
6557
  validate: false
6469
6558
  };
6470
6559
  return new Promise(function (resolve, reject) {
6471
- var server = _this44.originLocation.api_write;
6560
+ var server = _this46.originLocation.api_write;
6472
6561
  if (!server) {
6473
6562
  reject(new Error("Plattar.auth(token) - cannot authenticate as server not set via Plattar.origin(server)"));
6474
6563
  return;
@@ -6478,10 +6567,10 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
6478
6567
  return;
6479
6568
  }
6480
6569
  if (!copt.validate) {
6481
- _this44._authToken = {
6570
+ _this46._authToken = {
6482
6571
  "plattar-auth-token": token
6483
6572
  };
6484
- resolve(_this44);
6573
+ resolve(_this46);
6485
6574
  return;
6486
6575
  }
6487
6576
  var endpoint = server + "plattaruser/xauth/validate";
@@ -6493,10 +6582,10 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
6493
6582
  };
6494
6583
  fetch(endpoint, options).then(function (res) {
6495
6584
  if (res.ok) {
6496
- _this44._authToken = {
6585
+ _this46._authToken = {
6497
6586
  "plattar-auth-token": token
6498
6587
  };
6499
- resolve(_this44);
6588
+ resolve(_this46);
6500
6589
  } else {
6501
6590
  reject(new Error("Plattar.auth(token) - failed to validate authentication token at " + endpoint));
6502
6591
  }
@@ -6506,7 +6595,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
6506
6595
  }, {
6507
6596
  key: "origin",
6508
6597
  value: function origin(server, opt) {
6509
- var _this45 = this;
6598
+ var _this47 = this;
6510
6599
  var copt = opt || {
6511
6600
  validate: false
6512
6601
  };
@@ -6516,8 +6605,8 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
6516
6605
  return;
6517
6606
  }
6518
6607
  if (!copt.validate) {
6519
- _this45._serverLocation = server;
6520
- resolve(_this45);
6608
+ _this47._serverLocation = server;
6609
+ resolve(_this47);
6521
6610
  return;
6522
6611
  }
6523
6612
  var endpoint = server.api_read + "ping";
@@ -6526,8 +6615,8 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
6526
6615
  };
6527
6616
  fetch(endpoint, options).then(function (res) {
6528
6617
  if (res.ok) {
6529
- _this45._serverLocation = server;
6530
- resolve(_this45);
6618
+ _this47._serverLocation = server;
6619
+ resolve(_this47);
6531
6620
  } else {
6532
6621
  reject(new Error("Plattar.origin(server) - failed to ping server at " + endpoint));
6533
6622
  }
@@ -6861,13 +6950,13 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
6861
6950
  _inherits(FileBase, _PlattarBase11);
6862
6951
  var _super25 = _createSuper(FileBase);
6863
6952
  function FileBase(id, server) {
6864
- var _this46;
6953
+ var _this48;
6865
6954
  _classCallCheck(this, FileBase);
6866
- _this46 = _super25.call(this, id, server || Server["default"]());
6867
- if (_this46.constructor === FileBase) {
6955
+ _this48 = _super25.call(this, id, server || Server["default"]());
6956
+ if (_this48.constructor === FileBase) {
6868
6957
  throw new Error("FileBase is abstract and cannot be created");
6869
6958
  }
6870
- return _this46;
6959
+ return _this48;
6871
6960
  }
6872
6961
  _createClass(FileBase, [{
6873
6962
  key: "sourcePath",
@@ -7020,13 +7109,13 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
7020
7109
  _inherits(PlattarBase, _PlattarObject);
7021
7110
  var _super30 = _createSuper(PlattarBase);
7022
7111
  function PlattarBase(id, server) {
7023
- var _this47;
7112
+ var _this49;
7024
7113
  _classCallCheck(this, PlattarBase);
7025
- _this47 = _super30.call(this, id, server || Server["default"]());
7026
- if (_this47.constructor === PlattarBase) {
7114
+ _this49 = _super30.call(this, id, server || Server["default"]());
7115
+ if (_this49.constructor === PlattarBase) {
7027
7116
  throw new Error("PlattarBase is abstract and cannot be created");
7028
7117
  }
7029
- return _this47;
7118
+ return _this49;
7030
7119
  }
7031
7120
  return _createClass(PlattarBase);
7032
7121
  }(PlattarObject);
@@ -7093,7 +7182,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
7093
7182
  }, {
7094
7183
  key: "filter",
7095
7184
  value: function filter(obj, id) {
7096
- var _this48 = this;
7185
+ var _this50 = this;
7097
7186
  if (!obj) {
7098
7187
  return [];
7099
7188
  }
@@ -7109,7 +7198,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
7109
7198
  if (Array.isArray(type)) {
7110
7199
  var compiledList = [];
7111
7200
  type.forEach(function (inObject) {
7112
- var retArray = _this48.filter(inObject, id);
7201
+ var retArray = _this50.filter(inObject, id);
7113
7202
  if (retArray.length > 0) {
7114
7203
  compiledList = compiledList.concat(retArray);
7115
7204
  }
@@ -7297,7 +7386,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
7297
7386
  }, {
7298
7387
  key: "include",
7299
7388
  value: function include() {
7300
- var _this49 = this;
7389
+ var _this51 = this;
7301
7390
  for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {
7302
7391
  args[_key6] = arguments[_key6];
7303
7392
  }
@@ -7310,15 +7399,15 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
7310
7399
  if (Array.isArray(obj)) {
7311
7400
  obj.forEach(function (strObject) {
7312
7401
  if (typeof strObject === "string" || strObject instanceof String) {
7313
- includes.push("".concat(_this49.type(), ".").concat(strObject));
7402
+ includes.push("".concat(_this51.type(), ".").concat(strObject));
7314
7403
  } else {
7315
- throw new Error("PlattarObject." + _this49.type() + ".include(...args) - argument of Array must only include Strings");
7404
+ throw new Error("PlattarObject." + _this51.type() + ".include(...args) - argument of Array must only include Strings");
7316
7405
  }
7317
7406
  });
7318
7407
  } else if (obj.prototype instanceof PlattarObject) {
7319
- includes.push("".concat(_this49.type(), ".").concat(obj.type()));
7408
+ includes.push("".concat(_this51.type(), ".").concat(obj.type()));
7320
7409
  } else {
7321
- throw new Error("PlattarObject." + _this49.type() + ".include(...args) - argument must be of type PlattarObject or Array but was type=" + _typeof(obj) + " value=" + obj);
7410
+ throw new Error("PlattarObject." + _this51.type() + ".include(...args) - argument must be of type PlattarObject or Array but was type=" + _typeof(obj) + " value=" + obj);
7322
7411
  }
7323
7412
  });
7324
7413
  return includes;
@@ -7448,13 +7537,13 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
7448
7537
  _inherits(CardBase, _PlattarBase17);
7449
7538
  var _super36 = _createSuper(CardBase);
7450
7539
  function CardBase(id, server) {
7451
- var _this50;
7540
+ var _this52;
7452
7541
  _classCallCheck(this, CardBase);
7453
- _this50 = _super36.call(this, id, server || Server["default"]());
7454
- if (_this50.constructor === CardBase) {
7542
+ _this52 = _super36.call(this, id, server || Server["default"]());
7543
+ if (_this52.constructor === CardBase) {
7455
7544
  throw new Error("CardBase is abstract and cannot be created");
7456
7545
  }
7457
- return _this50;
7546
+ return _this52;
7458
7547
  }
7459
7548
  _createClass(CardBase, null, [{
7460
7549
  key: "type",
@@ -7771,13 +7860,13 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
7771
7860
  _inherits(ProductBase, _PlattarBase19);
7772
7861
  var _super50 = _createSuper(ProductBase);
7773
7862
  function ProductBase(id, server) {
7774
- var _this51;
7863
+ var _this53;
7775
7864
  _classCallCheck(this, ProductBase);
7776
- _this51 = _super50.call(this, id, server || Server["default"]());
7777
- if (_this51.constructor === ProductBase) {
7865
+ _this53 = _super50.call(this, id, server || Server["default"]());
7866
+ if (_this53.constructor === ProductBase) {
7778
7867
  throw new Error("ProductBase is abstract and cannot be created");
7779
7868
  }
7780
- return _this51;
7869
+ return _this53;
7781
7870
  }
7782
7871
  _createClass(ProductBase, null, [{
7783
7872
  key: "type",
@@ -7887,13 +7976,13 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
7887
7976
  _inherits(SceneBase, _PlattarBase21);
7888
7977
  var _super55 = _createSuper(SceneBase);
7889
7978
  function SceneBase(id, server) {
7890
- var _this52;
7979
+ var _this54;
7891
7980
  _classCallCheck(this, SceneBase);
7892
- _this52 = _super55.call(this, id, server || Server["default"]());
7893
- if (_this52.constructor === SceneBase) {
7981
+ _this54 = _super55.call(this, id, server || Server["default"]());
7982
+ if (_this54.constructor === SceneBase) {
7894
7983
  throw new Error("SceneBase is abstract and cannot be created");
7895
7984
  }
7896
- return _this52;
7985
+ return _this54;
7897
7986
  }
7898
7987
  _createClass(SceneBase, null, [{
7899
7988
  key: "type",
@@ -8596,15 +8685,15 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
8596
8685
  _createClass(BaseElement, [{
8597
8686
  key: "connectedCallback",
8598
8687
  value: function connectedCallback() {
8599
- var _this53 = this;
8688
+ var _this55 = this;
8600
8689
  if (this.hasAttribute("url")) {
8601
8690
  this.renderQRCode();
8602
8691
  }
8603
8692
  var observer = new MutationObserver(function (mutations) {
8604
8693
  mutations.forEach(function (mutation) {
8605
8694
  if (mutation.type === "attributes") {
8606
- if (_this53.hasAttribute("url")) {
8607
- _this53.renderQRCode();
8695
+ if (_this55.hasAttribute("url")) {
8696
+ _this55.renderQRCode();
8608
8697
  }
8609
8698
  }
8610
8699
  });
@@ -8627,7 +8716,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
8627
8716
  }, {
8628
8717
  key: "renderQRCode",
8629
8718
  value: function renderQRCode() {
8630
- var _this54 = this;
8719
+ var _this56 = this;
8631
8720
  var url = this.hasAttribute("url") ? this.getAttribute("url") : undefined;
8632
8721
  if (!url) {
8633
8722
  console.warn("PlattarQR.renderQRCode() - required attribute \"url\" is missing or invalid, QR Code will not render");
@@ -8735,11 +8824,11 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
8735
8824
  var shortenURL = this.hasAttribute("shorten") ? this.getAttribute("shorten") : "false";
8736
8825
  if (shortenURL && shortenURL.toLowerCase() === "true") {
8737
8826
  this._ShortenURL(url).then(function (newURL) {
8738
- _this54._GenerateQRCode(newURL, width, height);
8827
+ _this56._GenerateQRCode(newURL, width, height);
8739
8828
  })["catch"](function (_err) {
8740
8829
  console.warn(_err);
8741
8830
  // ignore error and just generate normal QR Code
8742
- _this54._GenerateQRCode(url, width, height);
8831
+ _this56._GenerateQRCode(url, width, height);
8743
8832
  });
8744
8833
  } else {
8745
8834
  this._GenerateQRCode(url, width, height);
@@ -8808,9 +8897,9 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
8808
8897
  }, {
8809
8898
  key: "_ShortenURL",
8810
8899
  value: function _ShortenURL(url) {
8811
- var _this55 = this;
8900
+ var _this57 = this;
8812
8901
  return new Promise(function (accept, reject) {
8813
- if (!_this55._IsFetchAPISupported()) {
8902
+ if (!_this57._IsFetchAPISupported()) {
8814
8903
  return reject(new Error("PlattarQR._ShortenURL() - fetch api not supported, cannot proceed"));
8815
8904
  }
8816
8905
  try {
@@ -9003,10 +9092,10 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
9003
9092
  }, {
9004
9093
  key: "get",
9005
9094
  value: function get() {
9006
- var _this56 = this;
9095
+ var _this58 = this;
9007
9096
  return new Promise(function (accept, reject) {
9008
- _this56._CalculateHash().then(function () {
9009
- remote_request_1.RemoteRequest.request(_this56._GetPayload(), _this56.retry < 0 ? 0 : _this56.retry).then(accept)["catch"](reject);
9097
+ _this58._CalculateHash().then(function () {
9098
+ remote_request_1.RemoteRequest.request(_this58._GetPayload(), _this58.retry < 0 ? 0 : _this58.retry).then(accept)["catch"](reject);
9010
9099
  })["catch"](function (_err) {
9011
9100
  reject(new Error("Configurator.get() - one of the objects does not exist in Plattar API"));
9012
9101
  });
@@ -9015,12 +9104,12 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
9015
9104
  }, {
9016
9105
  key: "_CalculateHash",
9017
9106
  value: function _CalculateHash() {
9018
- var _this57 = this;
9107
+ var _this59 = this;
9019
9108
  return new Promise(function (accept, reject) {
9020
9109
  var promises = [];
9021
9110
  var oldOrigin = plattar_api_1.Server["default"]().originLocation.type;
9022
- plattar_api_1.Server.create(plattar_api_1.Server.match(_this57.server));
9023
- _this57._maps.forEach(function (map) {
9111
+ plattar_api_1.Server.create(plattar_api_1.Server.match(_this59.server));
9112
+ _this59._maps.forEach(function (map) {
9024
9113
  if (map.productvariation) {
9025
9114
  promises.push(new plattar_api_1.ProductVariation(map.productvariation).get());
9026
9115
  }
@@ -9036,7 +9125,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
9036
9125
  });
9037
9126
  Promise.all(promises).then(function (values) {
9038
9127
  values.forEach(function (value) {
9039
- _this57._attrHash.push(value.attributes);
9128
+ _this59._attrHash.push(value.attributes);
9040
9129
  });
9041
9130
  // reset server back
9042
9131
  plattar_api_1.Server.create(plattar_api_1.Server.match(oldOrigin));
@@ -9123,12 +9212,12 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
9123
9212
  }, {
9124
9213
  key: "get",
9125
9214
  value: function get() {
9126
- var _this58 = this;
9215
+ var _this60 = this;
9127
9216
  return new Promise(function (accept, reject) {
9128
- if (!_this58._model) {
9217
+ if (!_this60._model) {
9129
9218
  return reject(new Error("ModelConverter.get() - required .model attribute was not set"));
9130
9219
  }
9131
- remote_request_1.RemoteRequest.request(_this58._Payload, _this58.retry < 0 ? 0 : _this58.retry).then(accept)["catch"](reject);
9220
+ remote_request_1.RemoteRequest.request(_this60._Payload, _this60.retry < 0 ? 0 : _this60.retry).then(accept)["catch"](reject);
9132
9221
  });
9133
9222
  }
9134
9223
  }, {
@@ -10493,18 +10582,18 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
10493
10582
  }, {
10494
10583
  key: "allMappedAttributes",
10495
10584
  get: function get() {
10496
- var _this59 = this;
10585
+ var _this61 = this;
10497
10586
  var map = new Map();
10498
10587
  var coreAttr = this.coreAttributes;
10499
10588
  var optAttr = this.optionalAttributes;
10500
10589
  coreAttr.forEach(function (ele) {
10501
- if (_this59.hasAttribute(ele.key)) {
10502
- map.set(ele.map, _this59.getAttribute(ele.key));
10590
+ if (_this61.hasAttribute(ele.key)) {
10591
+ map.set(ele.map, _this61.getAttribute(ele.key));
10503
10592
  }
10504
10593
  });
10505
10594
  optAttr.forEach(function (ele) {
10506
- if (_this59.hasAttribute(ele.key)) {
10507
- map.set(ele.map, _this59.getAttribute(ele.key));
10595
+ if (_this61.hasAttribute(ele.key)) {
10596
+ map.set(ele.map, _this61.getAttribute(ele.key));
10508
10597
  }
10509
10598
  });
10510
10599
  return map;
@@ -10604,7 +10693,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
10604
10693
  var IFrameController = require("./iframe-controller.js");
10605
10694
  var ElementController = /*#__PURE__*/function () {
10606
10695
  function ElementController(element) {
10607
- var _this60 = this;
10696
+ var _this62 = this;
10608
10697
  _classCallCheck(this, ElementController);
10609
10698
  this._element = element;
10610
10699
 
@@ -10617,7 +10706,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
10617
10706
  var mutation = _step8.value;
10618
10707
  if (mutation.type === 'attributes' && element.usesAttribute(mutation.attributeName)) {
10619
10708
  if (element.hasAllCoreAttributes) {
10620
- _this60._load();
10709
+ _this62._load();
10621
10710
  }
10622
10711
  }
10623
10712
  }
@@ -10712,7 +10801,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
10712
10801
  var Util = require("../../util/util.js");
10713
10802
  var IFrameController = /*#__PURE__*/function () {
10714
10803
  function IFrameController(element, src, id) {
10715
- var _this61 = this;
10804
+ var _this63 = this;
10716
10805
  var onelemload = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : undefined;
10717
10806
  _classCallCheck(this, IFrameController);
10718
10807
  this._iframe = document.createElement("iframe");
@@ -10722,7 +10811,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
10722
10811
  if (!element.hasAttribute("sameorigin")) {
10723
10812
  this._iframe.onload = function () {
10724
10813
  if (onelemload) {
10725
- onelemload(_this61._iframe);
10814
+ onelemload(_this63._iframe);
10726
10815
  }
10727
10816
  };
10728
10817
  }
@@ -10839,13 +10928,13 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
10839
10928
  _inherits(EWallElement, _BaseElement4);
10840
10929
  var _super76 = _createSuper(EWallElement);
10841
10930
  function EWallElement() {
10842
- var _this62;
10931
+ var _this64;
10843
10932
  _classCallCheck(this, EWallElement);
10844
- _this62 = _super76.call(this);
10933
+ _this64 = _super76.call(this);
10845
10934
  var tag = document.createElement("script");
10846
10935
  tag.src = "https://cdn.8thwall.com/web/iframe/iframe.js";
10847
10936
  tag.defer = true;
10848
- return _this62;
10937
+ return _this64;
10849
10938
  }
10850
10939
  _createClass(EWallElement, [{
10851
10940
  key: "connectedCallback",