@vertexvis/viewer 1.0.2-canary.20 → 1.0.2-canary.21

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/dist/cjs/{controller-CMJs6F-h.js → controller-C74GX70e.js} +60 -4
  2. package/dist/cjs/controller-C74GX70e.js.map +1 -0
  3. package/dist/cjs/index.cjs.js +1 -1
  4. package/dist/cjs/vertex-scene-tree.cjs.entry.js +1 -1
  5. package/dist/cjs/vertex-viewer-pin-group.cjs.entry.js +1 -1
  6. package/dist/collection/components/scene-tree/lib/jwt.js +1 -1
  7. package/dist/collection/components/scene-tree/lib/jwt.js.map +1 -1
  8. package/dist/components/index.js +1 -1
  9. package/dist/components/{p-B7C1GfGS.js → p-BmoTo_-J.js} +2 -2
  10. package/dist/components/p-CnYEgl0H.js +5 -0
  11. package/dist/components/p-CnYEgl0H.js.map +1 -0
  12. package/dist/components/vertex-scene-tree.js +1 -1
  13. package/dist/components/vertex-viewer-pin-group.js +1 -1
  14. package/dist/components/vertex-viewer-pin-tool.js +1 -1
  15. package/dist/esm/{controller-vXSti_qr.js → controller-CE2DwTNf.js} +60 -4
  16. package/dist/esm/controller-CE2DwTNf.js.map +1 -0
  17. package/dist/esm/index.js +1 -1
  18. package/dist/esm/index.mjs +1 -1
  19. package/dist/esm/vertex-scene-tree.entry.js +1 -1
  20. package/dist/esm/vertex-viewer-pin-group.entry.js +1 -1
  21. package/dist/types/components/scene-tree/lib/jwt.d.ts +1 -1
  22. package/dist/viewer/index.esm.js +1 -1
  23. package/dist/viewer/{p-4b5a62da.entry.js → p-06c99572.entry.js} +2 -2
  24. package/dist/viewer/{p-61188ccc.entry.js → p-72479c7e.entry.js} +2 -2
  25. package/dist/viewer/p-CnYEgl0H.js +5 -0
  26. package/dist/viewer/p-CnYEgl0H.js.map +1 -0
  27. package/dist/viewer/viewer.esm.js +1 -1
  28. package/package.json +8 -8
  29. package/dist/cjs/controller-CMJs6F-h.js.map +0 -1
  30. package/dist/components/p-BNfR95Px.js +0 -5
  31. package/dist/components/p-BNfR95Px.js.map +0 -1
  32. package/dist/esm/controller-vXSti_qr.js.map +0 -1
  33. package/dist/viewer/p-BNfR95Px.js +0 -5
  34. package/dist/viewer/p-BNfR95Px.js.map +0 -1
  35. /package/dist/components/{p-B7C1GfGS.js.map → p-BmoTo_-J.js.map} +0 -0
  36. /package/dist/viewer/{p-4b5a62da.entry.js.map → p-06c99572.entry.js.map} +0 -0
  37. /package/dist/viewer/{p-61188ccc.entry.js.map → p-72479c7e.entry.js.map} +0 -0
@@ -6541,10 +6541,66 @@ function webSocketSubscriptionTransportFactory(options) {
6541
6541
  }
6542
6542
  }
6543
6543
 
6544
- function e(e){this.message=e;}e.prototype=new Error,e.prototype.name="InvalidCharacterError";var r="undefined"!=typeof window&&window.atob&&window.atob.bind(window)||function(r){var t=String(r).replace(/=+$/,"");if(t.length%4==1)throw new e("'atob' failed: The string to be decoded is not correctly encoded.");for(var n,o,a=0,i=0,c="";o=t.charAt(i++);~o&&(n=a%4?64*n+o:o,a++%4)?c+=String.fromCharCode(255&n>>(-2*a&6)):0)o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(o);return c};function t(e){var t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw "Illegal base64url string!"}try{return function(e){return decodeURIComponent(r(e).replace(/(.)/g,(function(e,r){var t=r.charCodeAt(0).toString(16).toUpperCase();return t.length<2&&(t="0"+t),"%"+t})))}(t)}catch(e){return r(t)}}function n(e){this.message=e;}function o(e,r){if("string"!=typeof e)throw new n("Invalid token specified");var o=true===(r=r||{}).header?0:1;try{return JSON.parse(t(e.split(".")[o]))}catch(e){throw new n("Invalid token specified: "+e.message)}}n.prototype=new Error,n.prototype.name="InvalidTokenError";
6544
+ class InvalidTokenError extends Error {
6545
+ }
6546
+ InvalidTokenError.prototype.name = "InvalidTokenError";
6547
+ function b64DecodeUnicode(str) {
6548
+ return decodeURIComponent(atob(str).replace(/(.)/g, (m, p) => {
6549
+ let code = p.charCodeAt(0).toString(16).toUpperCase();
6550
+ if (code.length < 2) {
6551
+ code = "0" + code;
6552
+ }
6553
+ return "%" + code;
6554
+ }));
6555
+ }
6556
+ function base64UrlDecode(str) {
6557
+ let output = str.replace(/-/g, "+").replace(/_/g, "/");
6558
+ switch (output.length % 4) {
6559
+ case 0:
6560
+ break;
6561
+ case 2:
6562
+ output += "==";
6563
+ break;
6564
+ case 3:
6565
+ output += "=";
6566
+ break;
6567
+ default:
6568
+ throw new Error("base64 string is not of the correct length");
6569
+ }
6570
+ try {
6571
+ return b64DecodeUnicode(output);
6572
+ }
6573
+ catch (err) {
6574
+ return atob(output);
6575
+ }
6576
+ }
6577
+ function jwtDecode(token, options) {
6578
+ if (typeof token !== "string") {
6579
+ throw new InvalidTokenError("Invalid token specified: must be a string");
6580
+ }
6581
+ options || (options = {});
6582
+ const pos = options.header === true ? 0 : 1;
6583
+ const part = token.split(".")[pos];
6584
+ if (typeof part !== "string") {
6585
+ throw new InvalidTokenError(`Invalid token specified: missing part #${pos + 1}`);
6586
+ }
6587
+ let decoded;
6588
+ try {
6589
+ decoded = base64UrlDecode(part);
6590
+ }
6591
+ catch (e) {
6592
+ throw new InvalidTokenError(`Invalid token specified: invalid base64 for part #${pos + 1} (${e.message})`);
6593
+ }
6594
+ try {
6595
+ return JSON.parse(decoded);
6596
+ }
6597
+ catch (e) {
6598
+ throw new InvalidTokenError(`Invalid token specified: invalid json for part #${pos + 1} (${e.message})`);
6599
+ }
6600
+ }
6545
6601
 
6546
6602
  function decodeSceneTreeJwt(jwt) {
6547
- return o(jwt);
6603
+ return jwtDecode(jwt);
6548
6604
  }
6549
6605
 
6550
6606
  /**
@@ -7489,6 +7545,6 @@ exports.SceneTreeController = SceneTreeController;
7489
7545
  exports.SceneTreeErrorDetails = SceneTreeErrorDetails;
7490
7546
  exports.scene_tree_api_pb_serviceExports = scene_tree_api_pb_serviceExports;
7491
7547
  exports.webSocketSubscriptionTransportFactory = webSocketSubscriptionTransportFactory;
7492
- //# sourceMappingURL=controller-CMJs6F-h.js.map
7548
+ //# sourceMappingURL=controller-C74GX70e.js.map
7493
7549
 
7494
- //# sourceMappingURL=controller-CMJs6F-h.js.map
7550
+ //# sourceMappingURL=controller-C74GX70e.js.map