@plattar/plattar-ar-adapter 1.158.2 → 1.163.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.
Files changed (37) hide show
  1. package/build/es2015/plattar-ar-adapter.js +571 -335
  2. package/build/es2015/plattar-ar-adapter.min.js +1 -1
  3. package/build/es2019/plattar-ar-adapter.js +206 -100
  4. package/build/es2019/plattar-ar-adapter.min.js +1 -1
  5. package/dist/ar/configurator-ar.d.ts +6 -2
  6. package/dist/ar/configurator-ar.js +17 -8
  7. package/dist/ar/launcher-ar.d.ts +2 -0
  8. package/dist/ar/launcher-ar.js +2 -1
  9. package/dist/ar/model-ar.d.ts +6 -2
  10. package/dist/ar/model-ar.js +14 -4
  11. package/dist/ar/product-ar.d.ts +8 -4
  12. package/dist/ar/product-ar.js +28 -6
  13. package/dist/ar/raw-ar.d.ts +7 -3
  14. package/dist/ar/raw-ar.js +16 -8
  15. package/dist/ar/scene-ar.d.ts +7 -3
  16. package/dist/ar/scene-ar.js +16 -8
  17. package/dist/ar/scene-product-ar.d.ts +2 -2
  18. package/dist/ar/scene-product-ar.js +5 -4
  19. package/dist/embed/controllers/configurator-controller.js +16 -2
  20. package/dist/embed/controllers/plattar-controller.d.ts +12 -0
  21. package/dist/embed/controllers/plattar-controller.js +22 -0
  22. package/dist/embed/controllers/product-controller.js +11 -1
  23. package/dist/embed/controllers/vto-controller.js +7 -2
  24. package/dist/embed/plattar-embed.d.ts +2 -0
  25. package/dist/embed/plattar-embed.js +16 -0
  26. package/dist/index.d.ts +2 -0
  27. package/dist/version.d.ts +1 -1
  28. package/dist/version.js +1 -1
  29. package/dist/viewers/ar-viewer.d.ts +8 -1
  30. package/dist/viewers/ar-viewer.js +8 -2
  31. package/dist/viewers/quicklook-viewer.d.ts +1 -4
  32. package/dist/viewers/quicklook-viewer.js +9 -18
  33. package/dist/viewers/reality-viewer.d.ts +1 -1
  34. package/dist/viewers/reality-viewer.js +2 -5
  35. package/dist/viewers/scene-viewer.d.ts +1 -3
  36. package/dist/viewers/scene-viewer.js +9 -23
  37. package/package.json +7 -7
@@ -13,7 +13,7 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
13
13
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
14
14
  function _wrapNativeSuper(Class) { var _cache = typeof Map === "function" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== "function") { throw new TypeError("Super expression must either be null or a function"); } if (typeof _cache !== "undefined") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); }
15
15
  function _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct.bind(); } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }
16
- function _isNativeFunction(fn) { return Function.toString.call(fn).indexOf("[native code]") !== -1; }
16
+ function _isNativeFunction(fn) { try { return Function.toString.call(fn).indexOf("[native code]") !== -1; } catch (e) { return typeof fn === "function"; } }
17
17
  function _get() { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }
18
18
  function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }
19
19
  function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
@@ -95,33 +95,32 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
95
95
  var plattar_services_1 = require("@plattar/plattar-services");
96
96
  var util_1 = require("../util/util");
97
97
  var quicklook_viewer_1 = __importDefault(require("../viewers/quicklook-viewer"));
98
- var reality_viewer_1 = __importDefault(require("../viewers/reality-viewer"));
99
98
  var scene_viewer_1 = __importDefault(require("../viewers/scene-viewer"));
100
99
  var launcher_ar_1 = require("./launcher-ar");
101
100
  var version_1 = __importDefault(require("../version"));
102
101
  /**
103
102
  * Performs AR functionality related to Plattar Scenes
104
103
  */
105
- var ConfiguratorAR = /*#__PURE__*/function (_launcher_ar_1$Launch, _Compose2, _init) {
104
+ var ConfiguratorAR = /*#__PURE__*/function (_launcher_ar_1$Launch) {
106
105
  _inherits(ConfiguratorAR, _launcher_ar_1$Launch);
107
106
  var _super = _createSuper(ConfiguratorAR);
108
- function ConfiguratorAR(state) {
107
+ function ConfiguratorAR(options) {
109
108
  var _this;
110
109
  _classCallCheck(this, ConfiguratorAR);
111
110
  _this = _super.call(this);
112
111
  // analytics instance
113
112
  _this._analytics = null;
114
- if (!state) {
113
+ if (!options.state) {
115
114
  throw new Error("ConfiguratorAR.constructor(state) - state must be defined");
116
115
  }
117
- _this._state = state;
116
+ _this._options = options;
118
117
  _this._ar = null;
119
118
  return _this;
120
119
  }
121
120
  _createClass(ConfiguratorAR, [{
122
121
  key: "_SetupAnalytics",
123
122
  value: function _SetupAnalytics() {
124
- var scene = this._state.scene;
123
+ var scene = this._options.state.scene;
125
124
  var analytics = null;
126
125
  // setup scene stuff (if any)
127
126
  if (scene) {
@@ -137,6 +136,13 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
137
136
  if (application) {
138
137
  analytics.data.push("applicationId", application.id);
139
138
  analytics.data.push("applicationTitle", application.attributes.title);
139
+ if (this._options.useARBanner) {
140
+ this.options.banner = {
141
+ title: application.attributes.title,
142
+ subtitle: scene.attributes.title,
143
+ button: 'Visit'
144
+ };
145
+ }
140
146
  }
141
147
  }
142
148
  }
@@ -146,13 +152,13 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
146
152
  */
147
153
  }, {
148
154
  key: "_Compose",
149
- value: function _Compose(_x) {
150
- return (_Compose2 = _Compose2 || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(output) {
155
+ value: (function () {
156
+ var _Compose2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(output) {
151
157
  var objects, configurator, totalARObjectCount, results;
152
158
  return _regeneratorRuntime().wrap(function _callee$(_context) {
153
159
  while (1) switch (_context.prev = _context.next) {
154
160
  case 0:
155
- objects = this._state.state.array();
161
+ objects = this._options.state.state.array();
156
162
  if (!(objects.length <= 0)) {
157
163
  _context.next = 3;
158
164
  break;
@@ -190,8 +196,12 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
190
196
  return _context.stop();
191
197
  }
192
198
  }, _callee, this);
193
- }))).apply(this, arguments);
194
- }
199
+ }));
200
+ function _Compose(_x) {
201
+ return _Compose2.apply(this, arguments);
202
+ }
203
+ return _Compose;
204
+ }()
195
205
  /**
196
206
  * Initialise the SceneAR instance. This returns a Promise that resolves
197
207
  * successfully if initialisation is successful, otherwise it will fail.
@@ -199,10 +209,11 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
199
209
  * filure can occur for a number of reasons but it generally means that AR
200
210
  * cannot be performed.
201
211
  */
212
+ )
202
213
  }, {
203
214
  key: "init",
204
- value: function init() {
205
- return (_init = _init || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
215
+ value: (function () {
216
+ var _init = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
206
217
  var scene, sceneOpt, modelUrl, _modelUrl, _modelUrl2, arviewer;
207
218
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
208
219
  while (1) switch (_context2.prev = _context2.next) {
@@ -213,71 +224,78 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
213
224
  }
214
225
  throw new Error("ConfiguratorAR.init() - cannot proceed as AR not available in context");
215
226
  case 2:
216
- scene = this._state.scene;
227
+ scene = this._options.state.scene;
217
228
  this._SetupAnalytics();
218
229
  sceneOpt = scene.attributes.custom_json || {}; // we need to define our AR module here
219
230
  // we are in Safari/Quicklook mode here
220
231
  if (!(util_1.Util.isSafari() || util_1.Util.isChromeOnIOS())) {
221
- _context2.next = 25;
232
+ _context2.next = 27;
222
233
  break;
223
234
  }
224
235
  if (!(sceneOpt.anchor === "face")) {
225
- _context2.next = 17;
236
+ _context2.next = 18;
226
237
  break;
227
238
  }
228
239
  if (!util_1.Util.canRealityViewer()) {
229
- _context2.next = 16;
240
+ _context2.next = 17;
230
241
  break;
231
242
  }
232
243
  _context2.next = 10;
233
244
  return this._Compose("vto");
234
245
  case 10:
235
246
  modelUrl = _context2.sent;
236
- this._ar = new reality_viewer_1["default"]();
247
+ this._ar = new quicklook_viewer_1["default"]();
237
248
  this._ar.modelUrl = modelUrl;
249
+ this._ar.banner = this.options.banner;
238
250
  return _context2.abrupt("return", this);
239
- case 16:
240
- throw new Error("ConfiguratorAR.init() - cannot proceed as VTO AR requires Reality Viewer support");
241
251
  case 17:
252
+ throw new Error("ConfiguratorAR.init() - cannot proceed as VTO AR requires Reality Viewer support");
253
+ case 18:
242
254
  if (!util_1.Util.canQuicklook()) {
243
- _context2.next = 24;
255
+ _context2.next = 26;
244
256
  break;
245
257
  }
246
- _context2.next = 20;
258
+ _context2.next = 21;
247
259
  return this._Compose("usdz");
248
- case 20:
260
+ case 21:
249
261
  _modelUrl = _context2.sent;
250
262
  this._ar = new quicklook_viewer_1["default"]();
251
263
  this._ar.modelUrl = _modelUrl;
264
+ this._ar.banner = this.options.banner;
252
265
  return _context2.abrupt("return", this);
253
- case 24:
266
+ case 26:
254
267
  throw new Error("ConfiguratorAR.init() - cannot proceed as IOS device does not support AR Mode");
255
- case 25:
268
+ case 27:
256
269
  if (!util_1.Util.canSceneViewer()) {
257
- _context2.next = 35;
270
+ _context2.next = 38;
258
271
  break;
259
272
  }
260
- _context2.next = 28;
273
+ _context2.next = 30;
261
274
  return this._Compose("glb");
262
- case 28:
275
+ case 30:
263
276
  _modelUrl2 = _context2.sent;
264
277
  arviewer = new scene_viewer_1["default"]();
265
278
  arviewer.modelUrl = _modelUrl2;
266
279
  arviewer.isVertical = this.options.anchor === "vertical" ? true : false;
280
+ arviewer.banner = this.options.banner;
267
281
  if (sceneOpt.anchor === "vertical") {
268
282
  arviewer.isVertical = true;
269
283
  }
270
284
  this._ar = arviewer;
271
285
  return _context2.abrupt("return", this);
272
- case 35:
286
+ case 38:
273
287
  throw new Error("ConfiguratorAR.init() - could not initialise AR correctly, check values");
274
- case 36:
288
+ case 39:
275
289
  case "end":
276
290
  return _context2.stop();
277
291
  }
278
292
  }, _callee2, this);
279
- }))).apply(this, arguments);
280
- }
293
+ }));
294
+ function init() {
295
+ return _init.apply(this, arguments);
296
+ }
297
+ return init;
298
+ }())
281
299
  }, {
282
300
  key: "start",
283
301
  value: function start() {
@@ -318,7 +336,6 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
318
336
  "../util/util": 15,
319
337
  "../version": 16,
320
338
  "../viewers/quicklook-viewer": 18,
321
- "../viewers/reality-viewer": 19,
322
339
  "../viewers/scene-viewer": 20,
323
340
  "./launcher-ar": 2,
324
341
  "@plattar/plattar-analytics": 40,
@@ -332,11 +349,12 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
332
349
  value: true
333
350
  });
334
351
  exports.LauncherAR = void 0;
335
- var LauncherAR = /*#__PURE__*/function (_launch) {
352
+ var LauncherAR = /*#__PURE__*/function () {
336
353
  function LauncherAR() {
337
354
  _classCallCheck(this, LauncherAR);
338
355
  this._opt = {
339
- anchor: "horizontal_vertical"
356
+ anchor: "horizontal_vertical",
357
+ banner: null
340
358
  };
341
359
  }
342
360
  /**
@@ -345,8 +363,8 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
345
363
  */
346
364
  _createClass(LauncherAR, [{
347
365
  key: "launch",
348
- value: function launch() {
349
- return (_launch = _launch || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
366
+ value: (function () {
367
+ var _launch = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
350
368
  var value;
351
369
  return _regeneratorRuntime().wrap(function _callee3$(_context3) {
352
370
  while (1) switch (_context3.prev = _context3.next) {
@@ -361,11 +379,16 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
361
379
  return _context3.stop();
362
380
  }
363
381
  }, _callee3, this);
364
- }))).apply(this, arguments);
365
- }
382
+ }));
383
+ function launch() {
384
+ return _launch.apply(this, arguments);
385
+ }
386
+ return launch;
387
+ }()
366
388
  /**
367
389
  * AR Options used for launching AR
368
390
  */
391
+ )
369
392
  }, {
370
393
  key: "options",
371
394
  get: function get() {
@@ -402,24 +425,23 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
402
425
  var ModelAR = /*#__PURE__*/function (_launcher_ar_1$Launch2) {
403
426
  _inherits(ModelAR, _launcher_ar_1$Launch2);
404
427
  var _super2 = _createSuper(ModelAR);
405
- function ModelAR() {
428
+ function ModelAR(options) {
406
429
  var _this2;
407
- var modelID = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
408
430
  _classCallCheck(this, ModelAR);
409
431
  _this2 = _super2.call(this);
410
432
  // analytics instance
411
433
  _this2._analytics = null;
412
- if (!modelID) {
434
+ if (!options.modelID) {
413
435
  throw new Error("ModelAR.constructor(modelID) - modelID must be defined");
414
436
  }
415
- _this2._modelID = modelID;
437
+ _this2._options = options;
416
438
  _this2._ar = null;
417
439
  return _this2;
418
440
  }
419
441
  _createClass(ModelAR, [{
420
442
  key: "modelID",
421
443
  get: function get() {
422
- return this._modelID;
444
+ return this._options.modelID;
423
445
  }
424
446
  }, {
425
447
  key: "_SetupAnalytics",
@@ -437,6 +459,13 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
437
459
  analytics.data.push("modelId", model.id);
438
460
  analytics.data.push("modelTitle", model.attributes.title);
439
461
  this._analytics = analytics;
462
+ if (this._options.useARBanner) {
463
+ this.options.banner = {
464
+ title: project.attributes.title,
465
+ subtitle: model.attributes.title,
466
+ button: 'Visit'
467
+ };
468
+ }
440
469
  }
441
470
  }
442
471
  /**
@@ -467,12 +496,14 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
467
496
  if (model.attributes.reality_filename && util_1.Util.canRealityViewer()) {
468
497
  _this3._ar = new reality_viewer_1["default"]();
469
498
  _this3._ar.modelUrl = plattar_api_1.Server.location().cdn + model.attributes.path + model.attributes.reality_filename;
499
+ _this3._ar.banner = _this3.options.banner;
470
500
  return accept(_this3);
471
501
  }
472
502
  // otherwise, load the USDZ stuff second if available
473
503
  if (model.attributes.usdz_filename && util_1.Util.canQuicklook()) {
474
504
  _this3._ar = new quicklook_viewer_1["default"]();
475
505
  _this3._ar.modelUrl = plattar_api_1.Server.location().cdn + model.attributes.path + model.attributes.usdz_filename;
506
+ _this3._ar.banner = _this3.options.banner;
476
507
  return accept(_this3);
477
508
  }
478
509
  return reject(new Error("ModelAR.init() - cannot proceed as ModelFile does not have a defined .usdz or .reality file"));
@@ -482,6 +513,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
482
513
  var arviewer = new scene_viewer_1["default"]();
483
514
  arviewer.modelUrl = plattar_api_1.Server.location().cdn + model.attributes.path + model.attributes.original_filename;
484
515
  arviewer.isVertical = _this3.options.anchor === "vertical" ? true : false;
516
+ arviewer.banner = _this3.options.banner;
485
517
  _this3._ar = arviewer;
486
518
  return accept(_this3);
487
519
  }
@@ -566,38 +598,45 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
566
598
  var ProductAR = /*#__PURE__*/function (_launcher_ar_1$Launch3) {
567
599
  _inherits(ProductAR, _launcher_ar_1$Launch3);
568
600
  var _super3 = _createSuper(ProductAR);
569
- function ProductAR() {
601
+ /*
602
+ constructor(productID: string | undefined | null = null, variationID: string | undefined | null = null, variationSKU: string | undefined | null = null) {
603
+ super();
604
+ if (!productID) {
605
+ throw new Error("ProductAR.constructor(productID, variationID) - productID must be defined");
606
+ }
607
+ this._productID = productID;
608
+ this._variationSKU = variationSKU;
609
+ this._variationID = variationID ? variationID : (variationSKU ? null : "default");
610
+ this._ar = null;
611
+ }
612
+ */
613
+ function ProductAR(options) {
570
614
  var _this4;
571
- var productID = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
572
- var variationID = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
573
- var variationSKU = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
574
615
  _classCallCheck(this, ProductAR);
575
616
  _this4 = _super3.call(this);
576
617
  // analytics instance
577
618
  _this4._analytics = null;
578
- if (!productID) {
619
+ if (!options.productID) {
579
620
  throw new Error("ProductAR.constructor(productID, variationID) - productID must be defined");
580
621
  }
581
- _this4._productID = productID;
582
- _this4._variationSKU = variationSKU;
583
- _this4._variationID = variationID ? variationID : variationSKU ? null : "default";
622
+ _this4._options = options;
584
623
  _this4._ar = null;
585
624
  return _this4;
586
625
  }
587
626
  _createClass(ProductAR, [{
588
627
  key: "productID",
589
628
  get: function get() {
590
- return this._productID;
629
+ return this._options.productID;
591
630
  }
592
631
  }, {
593
632
  key: "variationID",
594
633
  get: function get() {
595
- return this._variationID;
634
+ return this._options.variationID;
596
635
  }
597
636
  }, {
598
637
  key: "variationSKU",
599
638
  get: function get() {
600
- return this._variationSKU;
639
+ return this._options.variationSKU;
601
640
  }
602
641
  }, {
603
642
  key: "_SetupAnalytics",
@@ -618,6 +657,13 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
618
657
  if (application) {
619
658
  analytics.data.push("applicationId", application.id);
620
659
  analytics.data.push("applicationTitle", application.attributes.title);
660
+ if (this._options.useARBanner) {
661
+ this.options.banner = {
662
+ title: product.attributes.title,
663
+ subtitle: variation.attributes.title,
664
+ button: 'Visit'
665
+ };
666
+ }
621
667
  }
622
668
  }
623
669
  if (analytics) {
@@ -696,12 +742,14 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
696
742
  if (model.attributes.reality_filename && util_1.Util.canRealityViewer()) {
697
743
  _this5._ar = new reality_viewer_1["default"]();
698
744
  _this5._ar.modelUrl = plattar_api_1.Server.location().cdn + model.attributes.path + model.attributes.reality_filename;
745
+ _this5._ar.banner = _this5.options.banner;
699
746
  return accept(_this5);
700
747
  }
701
748
  // otherwise, load the USDZ stuff second if available
702
749
  if (model.attributes.usdz_filename && util_1.Util.canQuicklook()) {
703
750
  _this5._ar = new quicklook_viewer_1["default"]();
704
751
  _this5._ar.modelUrl = plattar_api_1.Server.location().cdn + model.attributes.path + model.attributes.usdz_filename;
752
+ _this5._ar.banner = _this5.options.banner;
705
753
  return accept(_this5);
706
754
  }
707
755
  return reject(new Error("ProductAR.init() - cannot proceed as ModelFile does not have a defined .usdz or .reality file"));
@@ -711,6 +759,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
711
759
  var arviewer = new scene_viewer_1["default"]();
712
760
  arviewer.modelUrl = plattar_api_1.Server.location().cdn + model.attributes.path + model.attributes.original_filename;
713
761
  arviewer.isVertical = _this5.options.anchor === "vertical" ? true : false;
762
+ arviewer.banner = _this5.options.banner;
714
763
  var scene = product.relationships.find(plattar_api_1.Scene);
715
764
  if (scene) {
716
765
  var sceneOpt = scene.attributes.custom_json || {};
@@ -802,21 +851,18 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
802
851
  var RawAR = /*#__PURE__*/function (_launcher_ar_1$Launch4) {
803
852
  _inherits(RawAR, _launcher_ar_1$Launch4);
804
853
  var _super4 = _createSuper(RawAR);
805
- function RawAR() {
854
+ function RawAR(options) {
806
855
  var _this6;
807
- var modelLocation = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
808
- var sceneID = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
809
856
  _classCallCheck(this, RawAR);
810
857
  _this6 = _super4.call(this);
811
858
  // analytics instance
812
859
  _this6._analytics = null;
813
- if (!modelLocation) {
860
+ if (!options.modelLocation) {
814
861
  throw new Error("RawAR.constructor(modelLocation) - modelLocation must be defined");
815
862
  }
816
- var lowerLoc = modelLocation.toLowerCase();
863
+ var lowerLoc = options.modelLocation.toLowerCase();
817
864
  if (lowerLoc.endsWith("usdz") || lowerLoc.endsWith("glb") || lowerLoc.endsWith("gltf") || lowerLoc.endsWith("reality")) {
818
- _this6._modelLocation = modelLocation;
819
- _this6._sceneID = sceneID;
865
+ _this6._options = options;
820
866
  _this6._ar = null;
821
867
  } else {
822
868
  throw new Error("RawAR.constructor(modelLocation) - modelLocation must be one of gltf, glb, usdz or reality");
@@ -826,14 +872,14 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
826
872
  _createClass(RawAR, [{
827
873
  key: "modelLocation",
828
874
  get: function get() {
829
- return this._modelLocation;
875
+ return this._options.modelLocation;
830
876
  }
831
877
  }, {
832
878
  key: "_SetupAnalytics",
833
879
  value: function _SetupAnalytics() {
834
880
  var _this7 = this;
835
881
  return new Promise(function (accept, _reject) {
836
- var sceneID = _this7._sceneID;
882
+ var sceneID = _this7._options.sceneID;
837
883
  if (!sceneID) {
838
884
  return accept();
839
885
  }
@@ -852,6 +898,13 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
852
898
  if (application) {
853
899
  analytics.data.push("applicationId", application.id);
854
900
  analytics.data.push("applicationTitle", application.attributes.title);
901
+ if (_this7._options.useARBanner) {
902
+ _this7.options.banner = {
903
+ title: application.attributes.title,
904
+ subtitle: scene.attributes.title,
905
+ button: 'Visit'
906
+ };
907
+ }
855
908
  }
856
909
  accept();
857
910
  })["catch"](function (_err) {
@@ -876,7 +929,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
876
929
  }
877
930
  // send the analytics (if any)
878
931
  _this8._SetupAnalytics().then(function () {
879
- var modelLocation = _this8._modelLocation;
932
+ var modelLocation = _this8._options.modelLocation;
880
933
  var lowerLoc = modelLocation.toLowerCase();
881
934
  // we need to define our AR module here
882
935
  // we are in Safari/Quicklook mode here
@@ -885,6 +938,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
885
938
  if (lowerLoc.endsWith("reality") && util_1.Util.canRealityViewer()) {
886
939
  _this8._ar = new reality_viewer_1["default"]();
887
940
  _this8._ar.modelUrl = modelLocation;
941
+ _this8._ar.banner = _this8.options.banner;
888
942
  return accept(_this8);
889
943
  }
890
944
  // load the usdz experience if dealing with usdz file
@@ -901,6 +955,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
901
955
  var arviewer = new scene_viewer_1["default"]();
902
956
  arviewer.modelUrl = modelLocation;
903
957
  arviewer.isVertical = _this8.options.anchor === "vertical" ? true : false;
958
+ arviewer.banner = _this8.options.banner;
904
959
  _this8._ar = arviewer;
905
960
  return accept(_this8);
906
961
  }
@@ -978,7 +1033,6 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
978
1033
  var plattar_services_1 = require("@plattar/plattar-services");
979
1034
  var util_1 = require("../util/util");
980
1035
  var quicklook_viewer_1 = __importDefault(require("../viewers/quicklook-viewer"));
981
- var reality_viewer_1 = __importDefault(require("../viewers/reality-viewer"));
982
1036
  var scene_viewer_1 = __importDefault(require("../viewers/scene-viewer"));
983
1037
  var launcher_ar_1 = require("./launcher-ar");
984
1038
  var version_1 = __importDefault(require("../version"));
@@ -988,26 +1042,23 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
988
1042
  var SceneAR = /*#__PURE__*/function (_launcher_ar_1$Launch5) {
989
1043
  _inherits(SceneAR, _launcher_ar_1$Launch5);
990
1044
  var _super5 = _createSuper(SceneAR);
991
- function SceneAR() {
1045
+ function SceneAR(options) {
992
1046
  var _this9;
993
- var sceneID = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
994
- var variationSelection = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
995
1047
  _classCallCheck(this, SceneAR);
996
1048
  _this9 = _super5.call(this);
997
1049
  // analytics instance
998
1050
  _this9._analytics = null;
999
- if (!sceneID) {
1051
+ if (!options.sceneID) {
1000
1052
  throw new Error("SceneAR.constructor(sceneID) - sceneID must be defined");
1001
1053
  }
1002
- _this9._sceneID = sceneID;
1003
- _this9._variationSelection = variationSelection || {};
1054
+ _this9._options = options;
1004
1055
  _this9._ar = null;
1005
1056
  return _this9;
1006
1057
  }
1007
1058
  _createClass(SceneAR, [{
1008
1059
  key: "sceneID",
1009
1060
  get: function get() {
1010
- return this._sceneID;
1061
+ return this._options.sceneID;
1011
1062
  }
1012
1063
  }, {
1013
1064
  key: "_SetupAnalytics",
@@ -1027,6 +1078,13 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
1027
1078
  if (application) {
1028
1079
  analytics.data.push("applicationId", application.id);
1029
1080
  analytics.data.push("applicationTitle", application.attributes.title);
1081
+ if (this._options.useARBanner) {
1082
+ this.options.banner = {
1083
+ title: application.attributes.title,
1084
+ subtitle: scene.attributes.title,
1085
+ button: 'Visit'
1086
+ };
1087
+ }
1030
1088
  }
1031
1089
  }
1032
1090
  }
@@ -1053,7 +1111,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
1053
1111
  // add our scene products
1054
1112
  sceneProducts.forEach(function (sceneProduct) {
1055
1113
  var product = sceneProduct.relationships.find(plattar_api_1.Product);
1056
- var selection = _this10._variationSelection;
1114
+ var selection = _this10._options.variationSelection;
1057
1115
  // we have a specific product selection
1058
1116
  if (sceneProduct.attributes.include_in_augment) {
1059
1117
  // check if this product is the one we want (from selection optionally)
@@ -1119,8 +1177,9 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
1119
1177
  if (sceneOpt.anchor === "face") {
1120
1178
  if (util_1.Util.canRealityViewer()) {
1121
1179
  return _this11._ComposeScene(scene, "vto").then(function (modelUrl) {
1122
- _this11._ar = new reality_viewer_1["default"]();
1180
+ _this11._ar = new quicklook_viewer_1["default"]();
1123
1181
  _this11._ar.modelUrl = modelUrl;
1182
+ _this11._ar.banner = _this11.options.banner;
1124
1183
  return accept(_this11);
1125
1184
  })["catch"](reject);
1126
1185
  } else {
@@ -1132,6 +1191,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
1132
1191
  return _this11._ComposeScene(scene, "usdz").then(function (modelUrl) {
1133
1192
  _this11._ar = new quicklook_viewer_1["default"]();
1134
1193
  _this11._ar.modelUrl = modelUrl;
1194
+ _this11._ar.banner = _this11.options.banner;
1135
1195
  return accept(_this11);
1136
1196
  })["catch"](reject);
1137
1197
  }
@@ -1143,6 +1203,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
1143
1203
  var arviewer = new scene_viewer_1["default"]();
1144
1204
  arviewer.modelUrl = modelUrl;
1145
1205
  arviewer.isVertical = _this11.options.anchor === "vertical" ? true : false;
1206
+ arviewer.banner = _this11.options.banner;
1146
1207
  if (sceneOpt.anchor === "vertical") {
1147
1208
  arviewer.isVertical = true;
1148
1209
  }
@@ -1196,7 +1257,6 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
1196
1257
  "../util/util": 15,
1197
1258
  "../version": 16,
1198
1259
  "../viewers/quicklook-viewer": 18,
1199
- "../viewers/reality-viewer": 19,
1200
1260
  "../viewers/scene-viewer": 20,
1201
1261
  "./launcher-ar": 2,
1202
1262
  "@plattar/plattar-analytics": 40,
@@ -1220,19 +1280,17 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
1220
1280
  var SceneProductAR = /*#__PURE__*/function (_product_ar_1$Product) {
1221
1281
  _inherits(SceneProductAR, _product_ar_1$Product);
1222
1282
  var _super6 = _createSuper(SceneProductAR);
1223
- function SceneProductAR() {
1283
+ function SceneProductAR(options) {
1224
1284
  var _this12;
1225
- var sceneProductID = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
1226
- var variationID = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
1227
- var variationSKU = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
1228
1285
  _classCallCheck(this, SceneProductAR);
1229
- _this12 = _super6.call(this, sceneProductID, variationID, variationSKU);
1286
+ //super(sceneProductID, variationID, variationSKU);
1287
+ _this12 = _super6.call(this, options);
1230
1288
  // this is evaluated in the init() function
1231
1289
  _this12._attachedProductID = null;
1232
- if (!sceneProductID) {
1290
+ if (!options.productID) {
1233
1291
  throw new Error("SceneProductAR.constructor(sceneProductID, variationID) - sceneProductID must be defined");
1234
1292
  }
1235
- _this12._sceneProductID = sceneProductID;
1293
+ _this12._sceneProductID = options.productID;
1236
1294
  return _this12;
1237
1295
  }
1238
1296
  _createClass(SceneProductAR, [{
@@ -1292,7 +1350,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
1292
1350
  /**
1293
1351
  * Manages an instance of the <plattar-configurator> HTML Element
1294
1352
  */
1295
- var ConfiguratorController = /*#__PURE__*/function (_plattar_controller_, _getConfiguratorState, _onAttributesUpdated, _startARQRCode, _startViewerQRCode, _startRenderer, _initAR, _InitARInherited2, _InitARGenerated2) {
1353
+ var ConfiguratorController = /*#__PURE__*/function (_plattar_controller_) {
1296
1354
  _inherits(ConfiguratorController, _plattar_controller_);
1297
1355
  var _super7 = _createSuper(ConfiguratorController);
1298
1356
  function ConfiguratorController() {
@@ -1304,8 +1362,8 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
1304
1362
  }
1305
1363
  _createClass(ConfiguratorController, [{
1306
1364
  key: "getConfiguratorState",
1307
- value: function getConfiguratorState() {
1308
- return (_getConfiguratorState = _getConfiguratorState || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
1365
+ value: function () {
1366
+ var _getConfiguratorState = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
1309
1367
  return _regeneratorRuntime().wrap(function _callee4$(_context4) {
1310
1368
  while (1) switch (_context4.prev = _context4.next) {
1311
1369
  case 0:
@@ -1322,12 +1380,16 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
1322
1380
  return _context4.stop();
1323
1381
  }
1324
1382
  }, _callee4, this);
1325
- }))).apply(this, arguments);
1326
- }
1383
+ }));
1384
+ function getConfiguratorState() {
1385
+ return _getConfiguratorState.apply(this, arguments);
1386
+ }
1387
+ return getConfiguratorState;
1388
+ }()
1327
1389
  }, {
1328
1390
  key: "onAttributesUpdated",
1329
- value: function onAttributesUpdated(_x2) {
1330
- return (_onAttributesUpdated = _onAttributesUpdated || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(attributeName) {
1391
+ value: function () {
1392
+ var _onAttributesUpdated = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(attributeName) {
1331
1393
  var state, viewer, variationIDs, variationIDsList, variationSKUs, variationSKUList, configState, _variationIDs, _variationIDsList, _configState, _variationSKUs, _variationSKUList;
1332
1394
  return _regeneratorRuntime().wrap(function _callee5$(_context5) {
1333
1395
  while (1) switch (_context5.prev = _context5.next) {
@@ -1409,12 +1471,16 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
1409
1471
  return _context5.stop();
1410
1472
  }
1411
1473
  }, _callee5, this);
1412
- }))).apply(this, arguments);
1413
- }
1474
+ }));
1475
+ function onAttributesUpdated(_x2) {
1476
+ return _onAttributesUpdated.apply(this, arguments);
1477
+ }
1478
+ return onAttributesUpdated;
1479
+ }()
1414
1480
  }, {
1415
1481
  key: "startARQRCode",
1416
- value: function startARQRCode(_x3) {
1417
- return (_startARQRCode = _startARQRCode || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(options) {
1482
+ value: function () {
1483
+ var _startARQRCode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(options) {
1418
1484
  var dState, product, controller;
1419
1485
  return _regeneratorRuntime().wrap(function _callee6$(_context6) {
1420
1486
  while (1) switch (_context6.prev = _context6.next) {
@@ -1428,42 +1494,47 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
1428
1494
  // with new attributes
1429
1495
  product = dState.state.firstOfType("product");
1430
1496
  if (!product) {
1431
- _context6.next = 14;
1497
+ _context6.next = 15;
1432
1498
  break;
1433
1499
  }
1434
1500
  this.parent.lockObserver();
1435
1501
  this.parent.destroy();
1436
1502
  this.setAttribute("product-id", product.scene_product_id);
1503
+ this.removeAttribute("scene-id");
1437
1504
  this.parent.unlockObserver();
1438
1505
  controller = this.parent.create();
1439
1506
  if (!controller) {
1440
- _context6.next = 13;
1507
+ _context6.next = 14;
1441
1508
  break;
1442
1509
  }
1443
1510
  return _context6.abrupt("return", controller.startARQRCode(options));
1444
- case 13:
1445
- return _context6.abrupt("return", Promise.reject(new Error("ConfiguratorController.startARQRCode() - legacy product transition failed")));
1446
1511
  case 14:
1447
- _context6.next = 18;
1512
+ return _context6.abrupt("return", Promise.reject(new Error("ConfiguratorController.startARQRCode() - legacy product transition failed")));
1513
+ case 15:
1514
+ _context6.next = 19;
1448
1515
  break;
1449
- case 16:
1450
- _context6.prev = 16;
1516
+ case 17:
1517
+ _context6.prev = 17;
1451
1518
  _context6.t0 = _context6["catch"](0);
1452
- case 18:
1453
- return _context6.abrupt("return", _get(_getPrototypeOf(ConfiguratorController.prototype), "startARQRCode", this).call(this, options));
1454
1519
  case 19:
1520
+ return _context6.abrupt("return", _get(_getPrototypeOf(ConfiguratorController.prototype), "startARQRCode", this).call(this, options));
1521
+ case 20:
1455
1522
  case "end":
1456
1523
  return _context6.stop();
1457
1524
  }
1458
- }, _callee6, this, [[0, 16]]);
1459
- }))).apply(this, arguments);
1460
- }
1525
+ }, _callee6, this, [[0, 17]]);
1526
+ }));
1527
+ function startARQRCode(_x3) {
1528
+ return _startARQRCode.apply(this, arguments);
1529
+ }
1530
+ return startARQRCode;
1531
+ }()
1461
1532
  }, {
1462
1533
  key: "startViewerQRCode",
1463
- value: function startViewerQRCode(_x4) {
1464
- return (_startViewerQRCode = _startViewerQRCode || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(options) {
1534
+ value: function () {
1535
+ var _startViewerQRCode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(options) {
1465
1536
  var _this15 = this;
1466
- var sceneID, configState, dState, product, controller, opt, viewer, width, height, dst, showAR, showUI;
1537
+ var sceneID, configState, dState, product, controller, opt, viewer, width, height, dst, showAR, showUI, showBanner;
1467
1538
  return _regeneratorRuntime().wrap(function _callee7$(_context7) {
1468
1539
  while (1) switch (_context7.prev = _context7.next) {
1469
1540
  case 0:
@@ -1487,31 +1558,32 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
1487
1558
  // with new attributes
1488
1559
  product = dState.state.firstOfType("product");
1489
1560
  if (!product) {
1490
- _context7.next = 19;
1561
+ _context7.next = 20;
1491
1562
  break;
1492
1563
  }
1493
1564
  this.parent.lockObserver();
1494
1565
  this.parent.destroy();
1495
1566
  this.setAttribute("product-id", product.scene_product_id);
1567
+ this.removeAttribute("scene-id");
1496
1568
  this.parent.unlockObserver();
1497
1569
  controller = this.parent.create();
1498
1570
  if (!controller) {
1499
- _context7.next = 18;
1571
+ _context7.next = 19;
1500
1572
  break;
1501
1573
  }
1502
1574
  return _context7.abrupt("return", controller.startViewerQRCode(options));
1503
- case 18:
1504
- return _context7.abrupt("return", Promise.reject(new Error("ConfiguratorController.startViewerQRCode() - legacy product transition failed")));
1505
1575
  case 19:
1576
+ return _context7.abrupt("return", Promise.reject(new Error("ConfiguratorController.startViewerQRCode() - legacy product transition failed")));
1577
+ case 20:
1506
1578
  configState = dState.state.encode();
1507
- _context7.next = 25;
1579
+ _context7.next = 26;
1508
1580
  break;
1509
- case 22:
1510
- _context7.prev = 22;
1581
+ case 23:
1582
+ _context7.prev = 23;
1511
1583
  _context7.t0 = _context7["catch"](5);
1512
1584
  // config state is not available
1513
1585
  configState = null;
1514
- case 25:
1586
+ case 26:
1515
1587
  opt = options || this._GetDefaultQROptions();
1516
1588
  viewer = document.createElement("plattar-qrcode");
1517
1589
  this._element = viewer;
@@ -1533,6 +1605,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
1533
1605
  dst = plattar_api_1.Server.location().base + "renderer/configurator.html?scene_id=" + sceneID;
1534
1606
  showAR = this.getAttribute("show-ar");
1535
1607
  showUI = this.getAttribute("show-ui");
1608
+ showBanner = this.getAttribute("show-ar-banner");
1536
1609
  if (showUI && showUI === "true") {
1537
1610
  dst = plattar_api_1.Server.location().base + "configurator/dist/index.html?scene_id=" + sceneID;
1538
1611
  }
@@ -1542,6 +1615,9 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
1542
1615
  if (showAR) {
1543
1616
  dst += "&show_ar=" + showAR;
1544
1617
  }
1618
+ if (showBanner) {
1619
+ dst += "&show_ar_banner=" + showBanner;
1620
+ }
1545
1621
  viewer.setAttribute("url", opt.url || dst);
1546
1622
  this._state = plattar_controller_1.ControllerState.QRCode;
1547
1623
  this._prevQROpt = opt;
@@ -1551,17 +1627,21 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
1551
1627
  };
1552
1628
  _this15.append(viewer);
1553
1629
  }));
1554
- case 46:
1630
+ case 49:
1555
1631
  case "end":
1556
1632
  return _context7.stop();
1557
1633
  }
1558
- }, _callee7, this, [[5, 22]]);
1559
- }))).apply(this, arguments);
1560
- }
1634
+ }, _callee7, this, [[5, 23]]);
1635
+ }));
1636
+ function startViewerQRCode(_x4) {
1637
+ return _startViewerQRCode.apply(this, arguments);
1638
+ }
1639
+ return startViewerQRCode;
1640
+ }()
1561
1641
  }, {
1562
1642
  key: "startRenderer",
1563
- value: function startRenderer() {
1564
- return (_startRenderer = _startRenderer || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
1643
+ value: function () {
1644
+ var _startRenderer = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
1565
1645
  var _this16 = this;
1566
1646
  var sceneID, configState, dState, product, controller, width, height, server, viewer, showAR, showUI;
1567
1647
  return _regeneratorRuntime().wrap(function _callee8$(_context8) {
@@ -1587,31 +1667,32 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
1587
1667
  // with new attributes
1588
1668
  product = dState.state.firstOfType("product");
1589
1669
  if (!product) {
1590
- _context8.next = 19;
1670
+ _context8.next = 20;
1591
1671
  break;
1592
1672
  }
1593
1673
  this.parent.lockObserver();
1594
1674
  this.parent.destroy();
1595
1675
  this.setAttribute("product-id", product.scene_product_id);
1676
+ this.removeAttribute("scene-id");
1596
1677
  this.parent.unlockObserver();
1597
1678
  controller = this.parent.create();
1598
1679
  if (!controller) {
1599
- _context8.next = 18;
1680
+ _context8.next = 19;
1600
1681
  break;
1601
1682
  }
1602
1683
  return _context8.abrupt("return", controller.startRenderer());
1603
- case 18:
1604
- return _context8.abrupt("return", Promise.reject(new Error("ConfiguratorController.startRenderer() - legacy product transition failed")));
1605
1684
  case 19:
1685
+ return _context8.abrupt("return", Promise.reject(new Error("ConfiguratorController.startRenderer() - legacy product transition failed")));
1686
+ case 20:
1606
1687
  configState = dState;
1607
- _context8.next = 25;
1688
+ _context8.next = 26;
1608
1689
  break;
1609
- case 22:
1610
- _context8.prev = 22;
1690
+ case 23:
1691
+ _context8.prev = 23;
1611
1692
  _context8.t0 = _context8["catch"](5);
1612
1693
  // config state is not available
1613
1694
  configState = null;
1614
- case 25:
1695
+ case 26:
1615
1696
  // required attributes with defaults for plattar-configurator node
1616
1697
  width = this.getAttribute("width") || "500px";
1617
1698
  height = this.getAttribute("height") || "500px";
@@ -1641,17 +1722,21 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
1641
1722
  }
1642
1723
  return accept(viewer);
1643
1724
  }));
1644
- case 41:
1725
+ case 42:
1645
1726
  case "end":
1646
1727
  return _context8.stop();
1647
1728
  }
1648
- }, _callee8, this, [[5, 22]]);
1649
- }))).apply(this, arguments);
1650
- }
1729
+ }, _callee8, this, [[5, 23]]);
1730
+ }));
1731
+ function startRenderer() {
1732
+ return _startRenderer.apply(this, arguments);
1733
+ }
1734
+ return startRenderer;
1735
+ }()
1651
1736
  }, {
1652
1737
  key: "initAR",
1653
- value: function initAR() {
1654
- return (_initAR = _initAR || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9() {
1738
+ value: function () {
1739
+ var _initAR = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9() {
1655
1740
  var dState, product, controller, arMode;
1656
1741
  return _regeneratorRuntime().wrap(function _callee9$(_context9) {
1657
1742
  while (1) switch (_context9.prev = _context9.next) {
@@ -1671,50 +1756,55 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
1671
1756
  // with new attributes
1672
1757
  product = dState.state.firstOfType("product");
1673
1758
  if (!product) {
1674
- _context9.next = 16;
1759
+ _context9.next = 17;
1675
1760
  break;
1676
1761
  }
1677
1762
  this.parent.lockObserver();
1678
1763
  this.parent.destroy();
1679
1764
  this.setAttribute("product-id", product.scene_product_id);
1765
+ this.removeAttribute("scene-id");
1680
1766
  this.parent.unlockObserver();
1681
1767
  controller = this.parent.create();
1682
1768
  if (!controller) {
1683
- _context9.next = 15;
1769
+ _context9.next = 16;
1684
1770
  break;
1685
1771
  }
1686
1772
  return _context9.abrupt("return", controller.initAR());
1687
- case 15:
1688
- return _context9.abrupt("return", Promise.reject(new Error("ConfiguratorController.initAR() - legacy product transition failed")));
1689
1773
  case 16:
1690
- _context9.next = 20;
1774
+ return _context9.abrupt("return", Promise.reject(new Error("ConfiguratorController.initAR() - legacy product transition failed")));
1775
+ case 17:
1776
+ _context9.next = 21;
1691
1777
  break;
1692
- case 18:
1693
- _context9.prev = 18;
1778
+ case 19:
1779
+ _context9.prev = 19;
1694
1780
  _context9.t0 = _context9["catch"](2);
1695
- case 20:
1781
+ case 21:
1696
1782
  arMode = this.getAttribute("ar-mode") || "generated";
1697
1783
  _context9.t1 = arMode.toLowerCase();
1698
- _context9.next = _context9.t1 === "inherited" ? 24 : _context9.t1 === "generated" ? 25 : 25;
1784
+ _context9.next = _context9.t1 === "inherited" ? 25 : _context9.t1 === "generated" ? 26 : 26;
1699
1785
  break;
1700
- case 24:
1701
- return _context9.abrupt("return", this._InitARInherited());
1702
1786
  case 25:
1703
- return _context9.abrupt("return", this._InitARGenerated());
1787
+ return _context9.abrupt("return", this._InitARInherited());
1704
1788
  case 26:
1789
+ return _context9.abrupt("return", this._InitARGenerated());
1790
+ case 27:
1705
1791
  case "end":
1706
1792
  return _context9.stop();
1707
1793
  }
1708
- }, _callee9, this, [[2, 18]]);
1709
- }))).apply(this, arguments);
1710
- }
1794
+ }, _callee9, this, [[2, 19]]);
1795
+ }));
1796
+ function initAR() {
1797
+ return _initAR.apply(this, arguments);
1798
+ }
1799
+ return initAR;
1800
+ }()
1711
1801
  /**
1712
1802
  * Private Function - This launches the Static/Inherited AR Mode
1713
1803
  */
1714
1804
  }, {
1715
1805
  key: "_InitARInherited",
1716
- value: function _InitARInherited() {
1717
- return (_InitARInherited2 = _InitARInherited2 || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10() {
1806
+ value: (function () {
1807
+ var _InitARInherited2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10() {
1718
1808
  var sceneID, state, first, sceneProductAR;
1719
1809
  return _regeneratorRuntime().wrap(function _callee10$(_context10) {
1720
1810
  while (1) switch (_context10.prev = _context10.next) {
@@ -1735,7 +1825,13 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
1735
1825
  _context10.next = 10;
1736
1826
  break;
1737
1827
  }
1738
- sceneProductAR = new scene_product_ar_1.SceneProductAR(first.scene_product_id, first.product_variation_id);
1828
+ //const sceneProductAR: SceneProductAR = new SceneProductAR(first.scene_product_id, first.product_variation_id);
1829
+ sceneProductAR = new scene_product_ar_1.SceneProductAR({
1830
+ productID: first.scene_product_id,
1831
+ variationID: first.product_variation_id,
1832
+ variationSKU: null,
1833
+ useARBanner: this.getBooleanAttribute("show-ar-banner")
1834
+ });
1739
1835
  return _context10.abrupt("return", sceneProductAR.init());
1740
1836
  case 10:
1741
1837
  throw new Error("ConfiguratorController.initAR() - invalid decoded config-state does not have any product states");
@@ -1744,15 +1840,20 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
1744
1840
  return _context10.stop();
1745
1841
  }
1746
1842
  }, _callee10, this);
1747
- }))).apply(this, arguments);
1748
- }
1843
+ }));
1844
+ function _InitARInherited() {
1845
+ return _InitARInherited2.apply(this, arguments);
1846
+ }
1847
+ return _InitARInherited;
1848
+ }()
1749
1849
  /**
1750
1850
  * Private Function - This launches the Dynamic/Generated AR Mode
1751
1851
  */
1852
+ )
1752
1853
  }, {
1753
1854
  key: "_InitARGenerated",
1754
- value: function _InitARGenerated() {
1755
- return (_InitARGenerated2 = _InitARGenerated2 || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11() {
1855
+ value: (function () {
1856
+ var _InitARGenerated2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11() {
1756
1857
  var sceneID, configAR;
1757
1858
  return _regeneratorRuntime().wrap(function _callee11$(_context11) {
1758
1859
  while (1) switch (_context11.prev = _context11.next) {
@@ -1769,15 +1870,24 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
1769
1870
  return this.getConfiguratorState();
1770
1871
  case 6:
1771
1872
  _context11.t1 = _context11.sent;
1772
- configAR = new _context11.t0(_context11.t1);
1873
+ _context11.t2 = this.getBooleanAttribute("show-ar-banner");
1874
+ _context11.t3 = {
1875
+ state: _context11.t1,
1876
+ useARBanner: _context11.t2
1877
+ };
1878
+ configAR = new _context11.t0(_context11.t3);
1773
1879
  return _context11.abrupt("return", configAR.init());
1774
- case 9:
1880
+ case 11:
1775
1881
  case "end":
1776
1882
  return _context11.stop();
1777
1883
  }
1778
1884
  }, _callee11, this);
1779
- }))).apply(this, arguments);
1780
- }
1885
+ }));
1886
+ function _InitARGenerated() {
1887
+ return _InitARGenerated2.apply(this, arguments);
1888
+ }
1889
+ return _InitARGenerated;
1890
+ }())
1781
1891
  }, {
1782
1892
  key: "removeRenderer",
1783
1893
  value: function removeRenderer() {
@@ -1823,7 +1933,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
1823
1933
  /**
1824
1934
  * All Plattar Controllers are derived from the same interface
1825
1935
  */
1826
- var PlattarController = /*#__PURE__*/function (_createConfiguratorState, _startAR, _startQRCode, _startARQRCode2) {
1936
+ var PlattarController = /*#__PURE__*/function () {
1827
1937
  function PlattarController(parent) {
1828
1938
  _classCallCheck(this, PlattarController);
1829
1939
  this._state = ControllerState.None;
@@ -1852,8 +1962,8 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
1852
1962
  }
1853
1963
  }, {
1854
1964
  key: "createConfiguratorState",
1855
- value: function createConfiguratorState() {
1856
- return (_createConfiguratorState = _createConfiguratorState || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12() {
1965
+ value: (function () {
1966
+ var _createConfiguratorState = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12() {
1857
1967
  var sceneID, configState, variationIDs, variationSKUs, decodedState, variationIDList, variationSKUList;
1858
1968
  return _regeneratorRuntime().wrap(function _callee12$(_context12) {
1859
1969
  while (1) switch (_context12.prev = _context12.next) {
@@ -1902,12 +2012,17 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
1902
2012
  return _context12.stop();
1903
2013
  }
1904
2014
  }, _callee12, this);
1905
- }))).apply(this, arguments);
1906
- }
2015
+ }));
2016
+ function createConfiguratorState() {
2017
+ return _createConfiguratorState.apply(this, arguments);
2018
+ }
2019
+ return createConfiguratorState;
2020
+ }()
1907
2021
  /**
1908
2022
  * Setup messenger observers to detect variation changes and apply to the internal
1909
2023
  * configuration state
1910
2024
  */
2025
+ )
1911
2026
  }, {
1912
2027
  key: "setupMessengerObservers",
1913
2028
  value: function setupMessengerObservers(viewer, configState) {
@@ -1950,8 +2065,8 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
1950
2065
  */
1951
2066
  }, {
1952
2067
  key: "startAR",
1953
- value: function startAR() {
1954
- return (_startAR = _startAR || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13() {
2068
+ value: (function () {
2069
+ var _startAR = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13() {
1955
2070
  var launcher;
1956
2071
  return _regeneratorRuntime().wrap(function _callee13$(_context13) {
1957
2072
  while (1) switch (_context13.prev = _context13.next) {
@@ -1966,17 +2081,22 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
1966
2081
  return _context13.stop();
1967
2082
  }
1968
2083
  }, _callee13, this);
1969
- }))).apply(this, arguments);
1970
- }
2084
+ }));
2085
+ function startAR() {
2086
+ return _startAR.apply(this, arguments);
2087
+ }
2088
+ return startAR;
2089
+ }()
1971
2090
  /**
1972
2091
  * Decide which QR Code to render according to the qr-type attribute
1973
2092
  * @param options
1974
2093
  * @returns
1975
2094
  */
2095
+ )
1976
2096
  }, {
1977
2097
  key: "startQRCode",
1978
- value: function startQRCode(_x5) {
1979
- return (_startQRCode = _startQRCode || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14(options) {
2098
+ value: (function () {
2099
+ var _startQRCode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14(options) {
1980
2100
  var qrType;
1981
2101
  return _regeneratorRuntime().wrap(function _callee14$(_context14) {
1982
2102
  while (1) switch (_context14.prev = _context14.next) {
@@ -1994,19 +2114,24 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
1994
2114
  return _context14.stop();
1995
2115
  }
1996
2116
  }, _callee14, this);
1997
- }))).apply(this, arguments);
1998
- }
2117
+ }));
2118
+ function startQRCode(_x5) {
2119
+ return _startQRCode.apply(this, arguments);
2120
+ }
2121
+ return startQRCode;
2122
+ }()
1999
2123
  /**
2000
2124
  * Displays a QR Code that sends the user direct to AR
2001
2125
  * @param options
2002
2126
  * @returns
2003
2127
  */
2128
+ )
2004
2129
  }, {
2005
2130
  key: "startARQRCode",
2006
- value: function startARQRCode(_x6) {
2007
- return (_startARQRCode2 = _startARQRCode2 || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15(options) {
2131
+ value: (function () {
2132
+ var _startARQRCode2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15(options) {
2008
2133
  var _this17 = this;
2009
- var opt, viewer, width, height, qrOptions, dst, configState, sceneID, embedType, productID, sceneProductID, variationID, variationSKU, arMode;
2134
+ var opt, viewer, width, height, qrOptions, dst, configState, sceneID, embedType, productID, sceneProductID, variationID, variationSKU, arMode, showBanner;
2010
2135
  return _regeneratorRuntime().wrap(function _callee15$(_context15) {
2011
2136
  while (1) switch (_context15.prev = _context15.next) {
2012
2137
  case 0:
@@ -2040,19 +2165,20 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
2040
2165
  variationID = this.getAttribute("variation-id");
2041
2166
  variationSKU = this.getAttribute("variation-sku");
2042
2167
  arMode = this.getAttribute("ar-mode");
2043
- _context15.prev = 22;
2044
- _context15.next = 25;
2168
+ showBanner = this.getAttribute("show-ar-banner");
2169
+ _context15.prev = 23;
2170
+ _context15.next = 26;
2045
2171
  return this.getConfiguratorState();
2046
- case 25:
2172
+ case 26:
2047
2173
  configState = _context15.sent.state.encode();
2048
- _context15.next = 31;
2174
+ _context15.next = 32;
2049
2175
  break;
2050
- case 28:
2051
- _context15.prev = 28;
2052
- _context15.t0 = _context15["catch"](22);
2176
+ case 29:
2177
+ _context15.prev = 29;
2178
+ _context15.t0 = _context15["catch"](23);
2053
2179
  // config state not available for some reason
2054
2180
  configState = null;
2055
- case 31:
2181
+ case 32:
2056
2182
  if (configState) {
2057
2183
  dst += "&config_state=" + configState;
2058
2184
  }
@@ -2077,6 +2203,9 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
2077
2203
  if (sceneID) {
2078
2204
  dst += "&scene_id=" + sceneID;
2079
2205
  }
2206
+ if (showBanner) {
2207
+ dst += "&show_ar_banner=" + showBanner;
2208
+ }
2080
2209
  viewer.setAttribute("url", opt.url || dst);
2081
2210
  this._state = ControllerState.QRCode;
2082
2211
  this._prevQROpt = opt;
@@ -2086,16 +2215,21 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
2086
2215
  return accept(viewer);
2087
2216
  };
2088
2217
  }));
2089
- case 43:
2218
+ case 45:
2090
2219
  case "end":
2091
2220
  return _context15.stop();
2092
2221
  }
2093
- }, _callee15, this, [[22, 28]]);
2094
- }))).apply(this, arguments);
2095
- }
2222
+ }, _callee15, this, [[23, 29]]);
2223
+ }));
2224
+ function startARQRCode(_x6) {
2225
+ return _startARQRCode2.apply(this, arguments);
2226
+ }
2227
+ return startARQRCode;
2228
+ }()
2096
2229
  /**
2097
2230
  * Returns the Parent Instance
2098
2231
  */
2232
+ )
2099
2233
  }, {
2100
2234
  key: "parent",
2101
2235
  get: function get() {
@@ -2111,6 +2245,17 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
2111
2245
  value: function getAttribute(attribute) {
2112
2246
  return this.parent ? this.parent.hasAttribute(attribute) ? this.parent.getAttribute(attribute) : null : null;
2113
2247
  }
2248
+ /**
2249
+ * Returns the specified attribute from the parent as a boolean
2250
+ * @param attribute - The name of the attribute
2251
+ * @returns - The attribute value
2252
+ */
2253
+ }, {
2254
+ key: "getBooleanAttribute",
2255
+ value: function getBooleanAttribute(attribute) {
2256
+ var _this$parent$getAttri;
2257
+ return this.parent ? this.parent.hasAttribute(attribute) ? ((_this$parent$getAttri = this.parent.getAttribute(attribute)) === null || _this$parent$getAttri === void 0 ? void 0 : _this$parent$getAttri.toLowerCase()) === "true" ? true : false : false : false;
2258
+ }
2114
2259
  /**
2115
2260
  * Sets a particular attribute into the HTML DOM
2116
2261
  *
@@ -2124,6 +2269,18 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
2124
2269
  this.parent.setAttribute(attribute, value);
2125
2270
  }
2126
2271
  }
2272
+ /**
2273
+ * Removes a particular attribute from HTML DOM
2274
+ *
2275
+ * @param attribute - The name of the attribute
2276
+ */
2277
+ }, {
2278
+ key: "removeAttribute",
2279
+ value: function removeAttribute(attribute) {
2280
+ if (this.parent) {
2281
+ this.parent.removeAttribute(attribute);
2282
+ }
2283
+ }
2127
2284
  /**
2128
2285
  * Appends the provided element into the shadow-root of the parent element
2129
2286
  * @param element - The element to append
@@ -2161,7 +2318,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
2161
2318
  * NOTE: As of 14th June 2023, this is now a legacy Controller and only used in legacy embeds
2162
2319
  * and should be deprecated from both documentation and previous integrations
2163
2320
  */
2164
- var ProductController = /*#__PURE__*/function (_plattar_controller_2, _getConfiguratorState2, _onAttributesUpdated2) {
2321
+ var ProductController = /*#__PURE__*/function (_plattar_controller_2) {
2165
2322
  _inherits(ProductController, _plattar_controller_2);
2166
2323
  var _super8 = _createSuper(ProductController);
2167
2324
  function ProductController() {
@@ -2170,8 +2327,8 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
2170
2327
  }
2171
2328
  _createClass(ProductController, [{
2172
2329
  key: "getConfiguratorState",
2173
- value: function getConfiguratorState() {
2174
- return (_getConfiguratorState2 = _getConfiguratorState2 || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16() {
2330
+ value: function () {
2331
+ var _getConfiguratorState2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16() {
2175
2332
  return _regeneratorRuntime().wrap(function _callee16$(_context16) {
2176
2333
  while (1) switch (_context16.prev = _context16.next) {
2177
2334
  case 0:
@@ -2181,12 +2338,16 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
2181
2338
  return _context16.stop();
2182
2339
  }
2183
2340
  }, _callee16);
2184
- }))).apply(this, arguments);
2185
- }
2341
+ }));
2342
+ function getConfiguratorState() {
2343
+ return _getConfiguratorState2.apply(this, arguments);
2344
+ }
2345
+ return getConfiguratorState;
2346
+ }()
2186
2347
  }, {
2187
2348
  key: "onAttributesUpdated",
2188
- value: function onAttributesUpdated(_x7) {
2189
- return (_onAttributesUpdated2 = _onAttributesUpdated2 || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee17(attributeName) {
2349
+ value: function () {
2350
+ var _onAttributesUpdated2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee17(attributeName) {
2190
2351
  var state, viewer, variationID;
2191
2352
  return _regeneratorRuntime().wrap(function _callee17$(_context17) {
2192
2353
  while (1) switch (_context17.prev = _context17.next) {
@@ -2214,8 +2375,12 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
2214
2375
  return _context17.stop();
2215
2376
  }
2216
2377
  }, _callee17, this);
2217
- }))).apply(this, arguments);
2218
- }
2378
+ }));
2379
+ function onAttributesUpdated(_x7) {
2380
+ return _onAttributesUpdated2.apply(this, arguments);
2381
+ }
2382
+ return onAttributesUpdated;
2383
+ }()
2219
2384
  }, {
2220
2385
  key: "startViewerQRCode",
2221
2386
  value: function startViewerQRCode(options) {
@@ -2308,6 +2473,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
2308
2473
  var variationID = _this19.getAttribute("variation-id");
2309
2474
  var variationSKU = _this19.getAttribute("variation-sku");
2310
2475
  var arMode = _this19.getAttribute("ar-mode");
2476
+ var showBanner = _this19.getAttribute("show-ar-banner");
2311
2477
  if (configState) {
2312
2478
  dst += "&config_state=" + configState;
2313
2479
  }
@@ -2332,6 +2498,9 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
2332
2498
  if (sceneID) {
2333
2499
  dst += "&scene_id=" + sceneID;
2334
2500
  }
2501
+ if (showBanner) {
2502
+ dst += "&show_ar_banner=" + showBanner;
2503
+ }
2335
2504
  viewer.setAttribute("url", opt.url || dst);
2336
2505
  viewer.onload = function () {
2337
2506
  return accept(viewer);
@@ -2396,7 +2565,13 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
2396
2565
  if (productID) {
2397
2566
  var variationID = _this21.getAttribute("variation-id");
2398
2567
  var variationSKU = _this21.getAttribute("variation-sku");
2399
- var product = new product_ar_1.ProductAR(productID, variationID, variationSKU);
2568
+ //const product: ProductAR = new ProductAR(productID, variationID, variationSKU);
2569
+ var product = new product_ar_1.ProductAR({
2570
+ productID: productID,
2571
+ variationID: variationID ? variationID : variationSKU ? null : "default",
2572
+ variationSKU: variationSKU,
2573
+ useARBanner: _this21.getBooleanAttribute("show-ar-banner")
2574
+ });
2400
2575
  return product.init().then(accept)["catch"](reject);
2401
2576
  }
2402
2577
  return reject(new Error("ProductController.initAR() - minimum required attributes not set, use product-id as a minimum"));
@@ -2442,7 +2617,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
2442
2617
  /**
2443
2618
  * Manages an instance of the <plattar-configurator> HTML Element
2444
2619
  */
2445
- var VTOController = /*#__PURE__*/function (_plattar_controller_3, _getConfiguratorState3, _onAttributesUpdated3, _startViewerQRCode2, _startRenderer2, _initAR2, _InitARInherited3, _InitARGenerated3) {
2620
+ var VTOController = /*#__PURE__*/function (_plattar_controller_3) {
2446
2621
  _inherits(VTOController, _plattar_controller_3);
2447
2622
  var _super9 = _createSuper(VTOController);
2448
2623
  function VTOController() {
@@ -2454,8 +2629,8 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
2454
2629
  }
2455
2630
  _createClass(VTOController, [{
2456
2631
  key: "getConfiguratorState",
2457
- value: function getConfiguratorState() {
2458
- return (_getConfiguratorState3 = _getConfiguratorState3 || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee18() {
2632
+ value: function () {
2633
+ var _getConfiguratorState3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee18() {
2459
2634
  return _regeneratorRuntime().wrap(function _callee18$(_context18) {
2460
2635
  while (1) switch (_context18.prev = _context18.next) {
2461
2636
  case 0:
@@ -2472,12 +2647,16 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
2472
2647
  return _context18.stop();
2473
2648
  }
2474
2649
  }, _callee18, this);
2475
- }))).apply(this, arguments);
2476
- }
2650
+ }));
2651
+ function getConfiguratorState() {
2652
+ return _getConfiguratorState3.apply(this, arguments);
2653
+ }
2654
+ return getConfiguratorState;
2655
+ }()
2477
2656
  }, {
2478
2657
  key: "onAttributesUpdated",
2479
- value: function onAttributesUpdated(_x8) {
2480
- return (_onAttributesUpdated3 = _onAttributesUpdated3 || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee19(attributeName) {
2658
+ value: function () {
2659
+ var _onAttributesUpdated3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee19(attributeName) {
2481
2660
  var state, viewer, variationIDs, variationIDsList, variationSKUs, variationSKUList, configState, _variationIDs2, _variationIDsList2, _configState2, _variationSKUs2, _variationSKUList2;
2482
2661
  return _regeneratorRuntime().wrap(function _callee19$(_context19) {
2483
2662
  while (1) switch (_context19.prev = _context19.next) {
@@ -2559,12 +2738,16 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
2559
2738
  return _context19.stop();
2560
2739
  }
2561
2740
  }, _callee19, this);
2562
- }))).apply(this, arguments);
2563
- }
2741
+ }));
2742
+ function onAttributesUpdated(_x8) {
2743
+ return _onAttributesUpdated3.apply(this, arguments);
2744
+ }
2745
+ return onAttributesUpdated;
2746
+ }()
2564
2747
  }, {
2565
2748
  key: "startViewerQRCode",
2566
- value: function startViewerQRCode(_x9) {
2567
- return (_startViewerQRCode2 = _startViewerQRCode2 || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee20(options) {
2749
+ value: function () {
2750
+ var _startViewerQRCode2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee20(options) {
2568
2751
  var _this23 = this;
2569
2752
  var sceneID, opt, viewer, width, height, dst, configState, showAR, productID, sceneProductID, variationID;
2570
2753
  return _regeneratorRuntime().wrap(function _callee20$(_context20) {
@@ -2645,12 +2828,16 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
2645
2828
  return _context20.stop();
2646
2829
  }
2647
2830
  }, _callee20, this, [[17, 23]]);
2648
- }))).apply(this, arguments);
2649
- }
2831
+ }));
2832
+ function startViewerQRCode(_x9) {
2833
+ return _startViewerQRCode2.apply(this, arguments);
2834
+ }
2835
+ return startViewerQRCode;
2836
+ }()
2650
2837
  }, {
2651
2838
  key: "startRenderer",
2652
- value: function startRenderer() {
2653
- return (_startRenderer2 = _startRenderer2 || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee21() {
2839
+ value: function () {
2840
+ var _startRenderer2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee21() {
2654
2841
  var _this24 = this;
2655
2842
  var sceneID, width, height, server, viewer, configState, showAR, productID, sceneProductID, variationID;
2656
2843
  return _regeneratorRuntime().wrap(function _callee21$(_context21) {
@@ -2722,12 +2909,16 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
2722
2909
  return _context21.stop();
2723
2910
  }
2724
2911
  }, _callee21, this, [[14, 20]]);
2725
- }))).apply(this, arguments);
2726
- }
2912
+ }));
2913
+ function startRenderer() {
2914
+ return _startRenderer2.apply(this, arguments);
2915
+ }
2916
+ return startRenderer;
2917
+ }()
2727
2918
  }, {
2728
2919
  key: "initAR",
2729
- value: function initAR() {
2730
- return (_initAR2 = _initAR2 || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee22() {
2920
+ value: function () {
2921
+ var _initAR2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee22() {
2731
2922
  var arMode;
2732
2923
  return _regeneratorRuntime().wrap(function _callee22$(_context22) {
2733
2924
  while (1) switch (_context22.prev = _context22.next) {
@@ -2757,15 +2948,19 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
2757
2948
  return _context22.stop();
2758
2949
  }
2759
2950
  }, _callee22, this);
2760
- }))).apply(this, arguments);
2761
- }
2951
+ }));
2952
+ function initAR() {
2953
+ return _initAR2.apply(this, arguments);
2954
+ }
2955
+ return initAR;
2956
+ }()
2762
2957
  /**
2763
2958
  * Private Function - This launches the Static/Inherited AR Mode
2764
2959
  */
2765
2960
  }, {
2766
2961
  key: "_InitARInherited",
2767
- value: function _InitARInherited() {
2768
- return (_InitARInherited3 = _InitARInherited3 || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee23() {
2962
+ value: (function () {
2963
+ var _InitARInherited3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee23() {
2769
2964
  var sceneID, state, first, sceneProductAR;
2770
2965
  return _regeneratorRuntime().wrap(function _callee23$(_context23) {
2771
2966
  while (1) switch (_context23.prev = _context23.next) {
@@ -2786,7 +2981,12 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
2786
2981
  _context23.next = 10;
2787
2982
  break;
2788
2983
  }
2789
- sceneProductAR = new __1.SceneProductAR(first.scene_product_id, first.product_variation_id);
2984
+ sceneProductAR = new __1.SceneProductAR({
2985
+ productID: first.scene_product_id,
2986
+ variationID: first.product_variation_id,
2987
+ variationSKU: null,
2988
+ useARBanner: this.getBooleanAttribute("show-ar-banner")
2989
+ });
2790
2990
  return _context23.abrupt("return", sceneProductAR.init());
2791
2991
  case 10:
2792
2992
  throw new Error("VTOController.initAR() - invalid decoded config-state does not have any product states");
@@ -2795,15 +2995,20 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
2795
2995
  return _context23.stop();
2796
2996
  }
2797
2997
  }, _callee23, this);
2798
- }))).apply(this, arguments);
2799
- }
2998
+ }));
2999
+ function _InitARInherited() {
3000
+ return _InitARInherited3.apply(this, arguments);
3001
+ }
3002
+ return _InitARInherited;
3003
+ }()
2800
3004
  /**
2801
3005
  * Private Function - This launches the Dynamic/Generated AR Mode
2802
3006
  */
3007
+ )
2803
3008
  }, {
2804
3009
  key: "_InitARGenerated",
2805
- value: function _InitARGenerated() {
2806
- return (_InitARGenerated3 = _InitARGenerated3 || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee24() {
3010
+ value: (function () {
3011
+ var _InitARGenerated3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee24() {
2807
3012
  var sceneID, configAR;
2808
3013
  return _regeneratorRuntime().wrap(function _callee24$(_context24) {
2809
3014
  while (1) switch (_context24.prev = _context24.next) {
@@ -2820,15 +3025,24 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
2820
3025
  return this.getConfiguratorState();
2821
3026
  case 6:
2822
3027
  _context24.t1 = _context24.sent;
2823
- configAR = new _context24.t0(_context24.t1);
3028
+ _context24.t2 = this.getBooleanAttribute("show-ar-banner");
3029
+ _context24.t3 = {
3030
+ state: _context24.t1,
3031
+ useARBanner: _context24.t2
3032
+ };
3033
+ configAR = new _context24.t0(_context24.t3);
2824
3034
  return _context24.abrupt("return", configAR.init());
2825
- case 9:
3035
+ case 11:
2826
3036
  case "end":
2827
3037
  return _context24.stop();
2828
3038
  }
2829
3039
  }, _callee24, this);
2830
- }))).apply(this, arguments);
2831
- }
3040
+ }));
3041
+ function _InitARGenerated() {
3042
+ return _InitARGenerated3.apply(this, arguments);
3043
+ }
3044
+ return _InitARGenerated;
3045
+ }())
2832
3046
  }, {
2833
3047
  key: "removeRenderer",
2834
3048
  value: function removeRenderer() {
@@ -2888,7 +3102,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
2888
3102
  * This is the primary <plattar-embed /> node that allows easy embedding
2889
3103
  * of Plattar related content
2890
3104
  */
2891
- var PlattarEmbed = /*#__PURE__*/function (_HTMLElement, _initAR3, _startAR2, _startViewer, _startQRCode2) {
3105
+ var PlattarEmbed = /*#__PURE__*/function (_HTMLElement) {
2892
3106
  _inherits(PlattarEmbed, _HTMLElement);
2893
3107
  var _super10 = _createSuper(PlattarEmbed);
2894
3108
  function PlattarEmbed() {
@@ -3063,8 +3277,8 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
3063
3277
  }
3064
3278
  }, {
3065
3279
  key: "initAR",
3066
- value: function initAR() {
3067
- return (_initAR3 = _initAR3 || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee25() {
3280
+ value: function () {
3281
+ var _initAR3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee25() {
3068
3282
  return _regeneratorRuntime().wrap(function _callee25$(_context25) {
3069
3283
  while (1) switch (_context25.prev = _context25.next) {
3070
3284
  case 0:
@@ -3080,12 +3294,16 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
3080
3294
  return _context25.stop();
3081
3295
  }
3082
3296
  }, _callee25, this);
3083
- }))).apply(this, arguments);
3084
- }
3297
+ }));
3298
+ function initAR() {
3299
+ return _initAR3.apply(this, arguments);
3300
+ }
3301
+ return initAR;
3302
+ }()
3085
3303
  }, {
3086
3304
  key: "startAR",
3087
- value: function startAR() {
3088
- return (_startAR2 = _startAR2 || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee26() {
3305
+ value: function () {
3306
+ var _startAR2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee26() {
3089
3307
  return _regeneratorRuntime().wrap(function _callee26$(_context26) {
3090
3308
  while (1) switch (_context26.prev = _context26.next) {
3091
3309
  case 0:
@@ -3101,12 +3319,16 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
3101
3319
  return _context26.stop();
3102
3320
  }
3103
3321
  }, _callee26, this);
3104
- }))).apply(this, arguments);
3105
- }
3322
+ }));
3323
+ function startAR() {
3324
+ return _startAR2.apply(this, arguments);
3325
+ }
3326
+ return startAR;
3327
+ }()
3106
3328
  }, {
3107
3329
  key: "startViewer",
3108
- value: function startViewer() {
3109
- return (_startViewer = _startViewer || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee27() {
3330
+ value: function () {
3331
+ var _startViewer = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee27() {
3110
3332
  return _regeneratorRuntime().wrap(function _callee27$(_context27) {
3111
3333
  while (1) switch (_context27.prev = _context27.next) {
3112
3334
  case 0:
@@ -3122,12 +3344,16 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
3122
3344
  return _context27.stop();
3123
3345
  }
3124
3346
  }, _callee27, this);
3125
- }))).apply(this, arguments);
3126
- }
3347
+ }));
3348
+ function startViewer() {
3349
+ return _startViewer.apply(this, arguments);
3350
+ }
3351
+ return startViewer;
3352
+ }()
3127
3353
  }, {
3128
3354
  key: "startQRCode",
3129
- value: function startQRCode() {
3130
- return (_startQRCode2 = _startQRCode2 || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee28() {
3355
+ value: function () {
3356
+ var _startQRCode2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee28() {
3131
3357
  var options,
3132
3358
  _args28 = arguments;
3133
3359
  return _regeneratorRuntime().wrap(function _callee28$(_context28) {
@@ -3146,8 +3372,12 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
3146
3372
  return _context28.stop();
3147
3373
  }
3148
3374
  }, _callee28, this);
3149
- }))).apply(this, arguments);
3150
- }
3375
+ }));
3376
+ function startQRCode() {
3377
+ return _startQRCode2.apply(this, arguments);
3378
+ }
3379
+ return startQRCode;
3380
+ }()
3151
3381
  /**
3152
3382
  * This will remove the currently active Renderer
3153
3383
  *
@@ -3172,6 +3402,25 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
3172
3402
  this._controller.onAttributesUpdated(attributeName);
3173
3403
  }
3174
3404
  }
3405
+ }, {
3406
+ key: "addEventListener",
3407
+ value: function addEventListener(type, listener, options) {
3408
+ var _this27 = this;
3409
+ // add to the element event listener
3410
+ _get(_getPrototypeOf(PlattarEmbed.prototype), "addEventListener", this).call(this, type, listener, options);
3411
+ var eventType = 'arclick';
3412
+ if (type === eventType) {
3413
+ // automatically enable `show-ar-banner` to true if an arclick event is added
3414
+ this.setAttribute('show-ar-banner', 'true');
3415
+ // if this is a redirect url from an AR Action - we need to fire the event listener now
3416
+ var url = new URL(location.href);
3417
+ if (url.searchParams.get('plattar_ar_action') === 'true') {
3418
+ setTimeout(function () {
3419
+ _this27.dispatchEvent(new Event(eventType));
3420
+ }, 200);
3421
+ }
3422
+ }
3423
+ }
3175
3424
  }]);
3176
3425
  return PlattarEmbed;
3177
3426
  }( /*#__PURE__*/_wrapNativeSuper(HTMLElement));
@@ -3318,7 +3567,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
3318
3567
  * Manages a Configuration State of multiple Products with multiple Variations
3319
3568
  * Allows easily changing
3320
3569
  */
3321
- var ConfiguratorState = /*#__PURE__*/function (_decodeState, _decodeScene) {
3570
+ var ConfiguratorState = /*#__PURE__*/function () {
3322
3571
  function ConfiguratorState() {
3323
3572
  var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
3324
3573
  _classCallCheck(this, ConfiguratorState);
@@ -3361,14 +3610,14 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
3361
3610
  _createClass(ConfiguratorState, [{
3362
3611
  key: "setVariationSKU",
3363
3612
  value: function setVariationSKU(productVariationSKU) {
3364
- var _this27 = this;
3613
+ var _this28 = this;
3365
3614
  var variationIDs = this._mappedVariationSKUValues.get(productVariationSKU);
3366
3615
  if (!variationIDs) {
3367
3616
  console.warn("ConfiguratorState.setVariationSKU() - Variation SKU of " + productVariationSKU + " is not defined in any variations");
3368
3617
  return;
3369
3618
  }
3370
3619
  variationIDs.forEach(function (variationID) {
3371
- _this27.setVariationID(variationID);
3620
+ _this28.setVariationID(variationID);
3372
3621
  });
3373
3622
  }
3374
3623
  /**
@@ -3685,8 +3934,8 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
3685
3934
  */
3686
3935
  }, {
3687
3936
  key: "decodeState",
3688
- value: function decodeState() {
3689
- return (_decodeState = _decodeState || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee29() {
3937
+ value: (function () {
3938
+ var _decodeState = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee29() {
3690
3939
  var sceneID,
3691
3940
  state,
3692
3941
  configState,
@@ -3724,18 +3973,23 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
3724
3973
  return _context29.stop();
3725
3974
  }
3726
3975
  }, _callee29);
3727
- }))).apply(this, arguments);
3728
- }
3976
+ }));
3977
+ function decodeState() {
3978
+ return _decodeState.apply(this, arguments);
3979
+ }
3980
+ return decodeState;
3981
+ }()
3729
3982
  /**
3730
3983
  * Generates a new ConfiguratorState instance from all SceneProducts and default
3731
3984
  * variations from the provided Scene ID
3732
3985
  * @param sceneID - the Scene ID to generate
3733
3986
  * @returns - Promise that resolves into a ConfiguratorState instance
3734
3987
  */
3988
+ )
3735
3989
  }, {
3736
3990
  key: "decodeScene",
3737
- value: function decodeScene() {
3738
- return (_decodeScene = _decodeScene || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee30() {
3991
+ value: (function () {
3992
+ var _decodeScene = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee30() {
3739
3993
  var sceneID,
3740
3994
  configState,
3741
3995
  fscene,
@@ -3817,8 +4071,12 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
3817
4071
  return _context30.stop();
3818
4072
  }
3819
4073
  }, _callee30);
3820
- }))).apply(this, arguments);
3821
- }
4074
+ }));
4075
+ function decodeScene() {
4076
+ return _decodeScene.apply(this, arguments);
4077
+ }
4078
+ return decodeScene;
4079
+ }())
3822
4080
  }]);
3823
4081
  return ConfiguratorState;
3824
4082
  }();
@@ -3940,7 +4198,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
3940
4198
  Object.defineProperty(exports, "__esModule", {
3941
4199
  value: true
3942
4200
  });
3943
- exports["default"] = "1.158.2";
4201
+ exports["default"] = "1.163.1";
3944
4202
  }, {}],
3945
4203
  17: [function (require, module, exports) {
3946
4204
  "use strict";
@@ -3948,36 +4206,38 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
3948
4206
  Object.defineProperty(exports, "__esModule", {
3949
4207
  value: true
3950
4208
  });
3951
- var ARViewer = /*#__PURE__*/_createClass(function ARViewer() {
3952
- _classCallCheck(this, ARViewer);
3953
- this.modelUrl = null;
3954
- this.modelUrl = null;
3955
- });
3956
- exports["default"] = ARViewer;
4209
+ exports.ARViewer = void 0;
4210
+ var ARViewer = /*#__PURE__*/function () {
4211
+ function ARViewer() {
4212
+ _classCallCheck(this, ARViewer);
4213
+ this.modelUrl = null;
4214
+ this.banner = null;
4215
+ }
4216
+ _createClass(ARViewer, [{
4217
+ key: "composedActionURL",
4218
+ get: function get() {
4219
+ var link = new URL(location.href);
4220
+ link.searchParams.set("plattar_ar_action", "true");
4221
+ return encodeURI(link.href);
4222
+ }
4223
+ }]);
4224
+ return ARViewer;
4225
+ }();
4226
+ exports.ARViewer = ARViewer;
3957
4227
  }, {}],
3958
4228
  18: [function (require, module, exports) {
3959
4229
  "use strict";
3960
4230
 
3961
- var __importDefault = this && this.__importDefault || function (mod) {
3962
- return mod && mod.__esModule ? mod : {
3963
- "default": mod
3964
- };
3965
- };
3966
4231
  Object.defineProperty(exports, "__esModule", {
3967
4232
  value: true
3968
4233
  });
3969
- var ar_viewer_1 = __importDefault(require("./ar-viewer"));
3970
- var QuicklookViewer = /*#__PURE__*/function (_ar_viewer_1$default) {
3971
- _inherits(QuicklookViewer, _ar_viewer_1$default);
4234
+ var ar_viewer_1 = require("./ar-viewer");
4235
+ var QuicklookViewer = /*#__PURE__*/function (_ar_viewer_1$ARViewer) {
4236
+ _inherits(QuicklookViewer, _ar_viewer_1$ARViewer);
3972
4237
  var _super11 = _createSuper(QuicklookViewer);
3973
4238
  function QuicklookViewer() {
3974
- var _this28;
3975
4239
  _classCallCheck(this, QuicklookViewer);
3976
- _this28 = _super11.call(this);
3977
- _this28.araction = null;
3978
- _this28.titleHTML = "&checkoutTitle=" + document.title + "&checkoutSubtitle=" + document.title;
3979
- _this28.arcallback = function () {};
3980
- return _this28;
4240
+ return _super11.call(this);
3981
4241
  }
3982
4242
  _createClass(QuicklookViewer, [{
3983
4243
  key: "nodeType",
@@ -3999,29 +4259,26 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
3999
4259
  var anchor = document.createElement("a");
4000
4260
  anchor.setAttribute("rel", "ar");
4001
4261
  anchor.appendChild(document.createElement("img"));
4262
+ var banner = this.banner;
4002
4263
  var url = this.modelUrl;
4003
- var araction = this.araction;
4004
- if (araction) {
4264
+ if (banner) {
4265
+ url += "#callToAction=".concat(banner.button);
4266
+ url += "&checkoutTitle=".concat(banner.title);
4267
+ url += "&checkoutSubtitle=".concat(banner.subtitle);
4005
4268
  var handleQuicklook = function handleQuicklook(event) {
4006
4269
  if (event.data === "_apple_ar_quicklook_button_tapped") {
4007
- _this29.arcallback();
4270
+ window.location.assign(_this29.composedActionURL);
4008
4271
  }
4009
- document.body.removeChild(anchor);
4010
- anchor.removeEventListener("message", handleQuicklook, false);
4011
4272
  };
4012
4273
  anchor.addEventListener("message", handleQuicklook, false);
4013
- document.body.appendChild(anchor);
4014
- url += "#callToAction=" + araction;
4015
- if (this.titleHTML) {
4016
- url += this.titleHTML;
4017
- }
4018
4274
  }
4275
+ document.body.appendChild(anchor);
4019
4276
  anchor.setAttribute("href", encodeURI(url));
4020
4277
  anchor.click();
4021
4278
  }
4022
4279
  }]);
4023
4280
  return QuicklookViewer;
4024
- }(ar_viewer_1["default"]);
4281
+ }(ar_viewer_1.ARViewer);
4025
4282
  exports["default"] = QuicklookViewer;
4026
4283
  }, {
4027
4284
  "./ar-viewer": 17
@@ -4029,17 +4286,12 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
4029
4286
  19: [function (require, module, exports) {
4030
4287
  "use strict";
4031
4288
 
4032
- var __importDefault = this && this.__importDefault || function (mod) {
4033
- return mod && mod.__esModule ? mod : {
4034
- "default": mod
4035
- };
4036
- };
4037
4289
  Object.defineProperty(exports, "__esModule", {
4038
4290
  value: true
4039
4291
  });
4040
- var ar_viewer_1 = __importDefault(require("./ar-viewer"));
4041
- var RealityViewer = /*#__PURE__*/function (_ar_viewer_1$default2) {
4042
- _inherits(RealityViewer, _ar_viewer_1$default2);
4292
+ var ar_viewer_1 = require("./ar-viewer");
4293
+ var RealityViewer = /*#__PURE__*/function (_ar_viewer_1$ARViewer2) {
4294
+ _inherits(RealityViewer, _ar_viewer_1$ARViewer2);
4043
4295
  var _super12 = _createSuper(RealityViewer);
4044
4296
  function RealityViewer() {
4045
4297
  _classCallCheck(this, RealityViewer);
@@ -4069,7 +4321,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
4069
4321
  }
4070
4322
  }]);
4071
4323
  return RealityViewer;
4072
- }(ar_viewer_1["default"]);
4324
+ }(ar_viewer_1.ARViewer);
4073
4325
  exports["default"] = RealityViewer;
4074
4326
  }, {
4075
4327
  "./ar-viewer": 17
@@ -4077,25 +4329,18 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
4077
4329
  20: [function (require, module, exports) {
4078
4330
  "use strict";
4079
4331
 
4080
- var __importDefault = this && this.__importDefault || function (mod) {
4081
- return mod && mod.__esModule ? mod : {
4082
- "default": mod
4083
- };
4084
- };
4085
4332
  Object.defineProperty(exports, "__esModule", {
4086
4333
  value: true
4087
4334
  });
4088
- var ar_viewer_1 = __importDefault(require("./ar-viewer"));
4089
- var SceneViewer = /*#__PURE__*/function (_ar_viewer_1$default3) {
4090
- _inherits(SceneViewer, _ar_viewer_1$default3);
4335
+ var ar_viewer_1 = require("./ar-viewer");
4336
+ var SceneViewer = /*#__PURE__*/function (_ar_viewer_1$ARViewer3) {
4337
+ _inherits(SceneViewer, _ar_viewer_1$ARViewer3);
4091
4338
  var _super13 = _createSuper(SceneViewer);
4092
4339
  function SceneViewer() {
4093
4340
  var _this30;
4094
4341
  _classCallCheck(this, SceneViewer);
4095
4342
  _this30 = _super13.call(this);
4096
- _this30.araction = null;
4097
4343
  _this30.isVertical = false;
4098
- _this30.titleHTML = "<b>" + document.title;
4099
4344
  _this30.isVertical = false;
4100
4345
  return _this30;
4101
4346
  }
@@ -4115,34 +4360,25 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
4115
4360
  if (!this.modelUrl) {
4116
4361
  throw new Error("SceneViewer.start() - model url not set, use SceneViewer.modelUrl");
4117
4362
  }
4118
- var araction = this.araction;
4119
- var composedLink = encodeURIComponent(location.href);
4120
- if (araction) {
4121
- var link = new URL(location.href);
4122
- link.searchParams.set("araction", araction);
4123
- composedLink = encodeURIComponent(link.href);
4124
- }
4125
- if (!composedLink) {
4126
- throw new Error("SceneViewer.start() - failed to create composition link, check parameters");
4127
- }
4128
- var linkOverride = encodeURIComponent(location.href + '#no-ar-fallback');
4129
- var intent = 'intent://arvr.google.com/scene-viewer/1.1';
4130
- intent += '?file=' + this.modelUrl;
4131
- intent += '&mode=ar_preferred';
4132
- intent += '&link=' + composedLink;
4133
- intent += '&title=<b>' + this.titleHTML;
4363
+ var linkOverride = encodeURIComponent("".concat(location.href, "#no-ar-fallback"));
4364
+ var intent = "intent://arvr.google.com/scene-viewer/1.1?file=".concat(this.modelUrl, "&mode=ar_preferred");
4365
+ var banner = this.banner;
4366
+ if (banner) {
4367
+ intent += "&title=<b>".concat(banner.title, "</b><br>").concat(banner.subtitle);
4368
+ intent += "&link=".concat(this.composedActionURL);
4369
+ }
4134
4370
  if (this.isVertical) {
4135
4371
  intent += '&enable_vertical_placement=true';
4136
4372
  }
4137
4373
  intent += ' #Intent;scheme=https;package=com.google.ar.core;action=android.intent.action.VIEW;';
4138
- intent += 'S.browser_fallback_url=' + linkOverride + ';end;';
4374
+ intent += "S.browser_fallback_url=".concat(linkOverride, ";end;");
4139
4375
  var anchor = document.createElement("a");
4140
4376
  anchor.setAttribute("href", intent);
4141
4377
  anchor.click();
4142
4378
  }
4143
4379
  }]);
4144
4380
  return SceneViewer;
4145
- }(ar_viewer_1["default"]);
4381
+ }(ar_viewer_1.ARViewer);
4146
4382
  exports["default"] = SceneViewer;
4147
4383
  }, {
4148
4384
  "./ar-viewer": 17
@@ -6801,7 +7037,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
6801
7037
  api_read: "https://localhost:3000/v3/",
6802
7038
  api_write: "https://localhost:3000/v3/",
6803
7039
  cdn: "https://cdn-dev.plattar.space/",
6804
- cdn_image: "https://images-dev.plattar.space/'",
7040
+ cdn_image: "https://images-dev.plattar.space/",
6805
7041
  analytics: "https://localhost:3000/api/v2/analytics/",
6806
7042
  type: "dev"
6807
7043
  };
@@ -8792,7 +9028,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
8792
9028
  "../types/trigger/trigger-image.js": 105
8793
9029
  }],
8794
9030
  107: [function (require, module, exports) {
8795
- module.exports = "1.154.1";
9031
+ module.exports = "1.159.1";
8796
9032
  }, {}],
8797
9033
  108: [function (require, module, exports) {
8798
9034
  var QRCodeStyling = require("qr-code-styling");
@@ -8997,7 +9233,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
8997
9233
  this._qrCode = new QRCodeStyling(this._options);
8998
9234
  this._qrCode.append(div);
8999
9235
  this._UpdateCanvas(width, height);
9000
- div.style.display = "block";
9236
+ div.style.display = "flex";
9001
9237
  return;
9002
9238
  }
9003
9239
  var newHash = hash({
@@ -9097,7 +9333,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
9097
9333
  "./version": 111
9098
9334
  }],
9099
9335
  111: [function (require, module, exports) {
9100
- module.exports = "1.150.2";
9336
+ module.exports = "1.160.1";
9101
9337
  }, {}],
9102
9338
  112: [function (require, module, exports) {
9103
9339
  "use strict";