solid-ui 2.4.25 → 2.4.26-6a9639ed

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 (75) hide show
  1. package/dist/main.js +254 -226
  2. package/dist/main.js.map +1 -1
  3. package/lib/acl/access-controller.js.map +1 -1
  4. package/lib/acl/access-groups.js.map +1 -1
  5. package/lib/acl/acl-control.js.map +1 -1
  6. package/lib/acl/acl.js.map +1 -1
  7. package/lib/acl/add-agent-buttons.js.map +1 -1
  8. package/lib/acl/index.js.map +1 -1
  9. package/lib/acl/styles.js.map +1 -1
  10. package/lib/chat/bookmarks.js.map +1 -1
  11. package/lib/chat/chatLogic.js.map +1 -1
  12. package/lib/chat/dateFolder.js.map +1 -1
  13. package/lib/chat/infinite.js.map +1 -1
  14. package/lib/chat/message.js.map +1 -1
  15. package/lib/chat/messageTools.js.map +1 -1
  16. package/lib/chat/thread.js.map +1 -1
  17. package/lib/create/create.js.map +1 -1
  18. package/lib/create/index.js.map +1 -1
  19. package/lib/debug.js.map +1 -1
  20. package/lib/folders.js.map +1 -1
  21. package/lib/footer/index.js.map +1 -1
  22. package/lib/footer/styleMap.js.map +1 -1
  23. package/lib/header/empty-profile.js.map +1 -1
  24. package/lib/header/index.js.map +1 -1
  25. package/lib/header/styleMap.js.map +1 -1
  26. package/lib/iconBase.js.map +1 -1
  27. package/lib/index.js.map +1 -1
  28. package/lib/jss/index.js.map +1 -1
  29. package/lib/log.js +7 -7
  30. package/lib/log.js.map +1 -1
  31. package/lib/login/login.js.map +1 -1
  32. package/lib/matrix/index.js.map +1 -1
  33. package/lib/matrix/matrix.js.map +1 -1
  34. package/lib/media/index.js.map +1 -1
  35. package/lib/media/media-capture.js.map +1 -1
  36. package/lib/messageArea.js.map +1 -1
  37. package/lib/noun_Camera_1618446_000000.js.map +1 -1
  38. package/lib/ns.js.map +1 -1
  39. package/lib/pad.js.map +1 -1
  40. package/lib/participation.js.map +1 -1
  41. package/lib/preferences.js.map +1 -1
  42. package/lib/signup/config-default.js.map +1 -1
  43. package/lib/signup/signup.js.map +1 -1
  44. package/lib/stories/decorators.js.map +1 -1
  45. package/lib/style.js.map +1 -1
  46. package/lib/style_multiSelect.js.map +1 -1
  47. package/lib/table.js.map +1 -1
  48. package/lib/tabs.js.map +1 -1
  49. package/lib/utils/headerFooterHelpers.js.map +1 -1
  50. package/lib/utils/index.js.map +1 -1
  51. package/lib/utils/label.js.map +1 -1
  52. package/lib/versionInfo.d.ts +2 -0
  53. package/lib/versionInfo.d.ts.map +1 -1
  54. package/lib/versionInfo.js +16 -14
  55. package/lib/versionInfo.js.map +1 -1
  56. package/lib/widgets/buttons/iconLinks.js.map +1 -1
  57. package/lib/widgets/buttons.js.map +1 -1
  58. package/lib/widgets/dragAndDrop.js.map +1 -1
  59. package/lib/widgets/error.js.map +1 -1
  60. package/lib/widgets/forms/autocomplete/autocompleteBar.js.map +1 -1
  61. package/lib/widgets/forms/autocomplete/autocompleteField.js.map +1 -1
  62. package/lib/widgets/forms/autocomplete/autocompletePicker.js.map +1 -1
  63. package/lib/widgets/forms/autocomplete/language.js.map +1 -1
  64. package/lib/widgets/forms/autocomplete/publicData.js.map +1 -1
  65. package/lib/widgets/forms/basic.js.map +1 -1
  66. package/lib/widgets/forms/comment.js.map +1 -1
  67. package/lib/widgets/forms/fieldFunction.js.map +1 -1
  68. package/lib/widgets/forms/fieldParams.js.map +1 -1
  69. package/lib/widgets/forms/formStyle.js.map +1 -1
  70. package/lib/widgets/forms.js.map +1 -1
  71. package/lib/widgets/index.js.map +1 -1
  72. package/lib/widgets/multiSelect.js.map +1 -1
  73. package/lib/widgets/peoplePicker.js.map +1 -1
  74. package/lib/widgets/widgetHelpers.js.map +1 -1
  75. package/package.json +19 -19
package/dist/main.js CHANGED
@@ -6320,13 +6320,13 @@ var LogLevel;
6320
6320
  /** @internal */
6321
6321
  exports.LogLevel = LogLevel;
6322
6322
  (function (LogLevel) {
6323
- LogLevel[LogLevel["Error"] = TERROR] = "Error";
6324
- LogLevel[LogLevel["Warning"] = TWARN] = "Warning";
6325
- LogLevel[LogLevel["Message"] = TMESG] = "Message";
6326
- LogLevel[LogLevel["Success"] = TSUCCESS] = "Success";
6327
- LogLevel[LogLevel["Info"] = TINFO] = "Info";
6328
- LogLevel[LogLevel["Debug"] = TDEBUG] = "Debug";
6329
- LogLevel[LogLevel["All"] = TALL] = "All";
6323
+ LogLevel[LogLevel["Error"] = 1] = "Error";
6324
+ LogLevel[LogLevel["Warning"] = 2] = "Warning";
6325
+ LogLevel[LogLevel["Message"] = 4] = "Message";
6326
+ LogLevel[LogLevel["Success"] = 8] = "Success";
6327
+ LogLevel[LogLevel["Info"] = 16] = "Info";
6328
+ LogLevel[LogLevel["Debug"] = 32] = "Debug";
6329
+ LogLevel[LogLevel["All"] = 63] = "All";
6330
6330
  })(LogLevel || (exports.LogLevel = LogLevel = {}));
6331
6331
  var _level = TERROR + TWARN + TMESG;
6332
6332
  /** @internal */
@@ -13119,26 +13119,28 @@ Object.defineProperty(exports, "__esModule", ({
13119
13119
  }));
13120
13120
  exports.versionInfo = void 0;
13121
13121
  var versionInfo = {
13122
- buildTime: '2023-02-01T17:35:54Z',
13123
- commit: '2c72c08ab081c4727898740b46ba8d28777f4e56',
13122
+ buildTime: '2023-03-03T08:57:16Z',
13123
+ commit: '6a9639ed3ed2cd0a96d3c6cd7446c3147bfd3582',
13124
13124
  npmInfo: {
13125
- 'solid-ui': '2.4.25',
13126
- npm: '8.19.3',
13127
- node: '14.21.2',
13128
- v8: '8.4.371.23-node.88',
13129
- uv: '1.42.0',
13125
+ 'solid-ui': '2.4.26',
13126
+ npm: '8.19.4',
13127
+ node: '16.19.1',
13128
+ v8: '9.4.146.26-node.24',
13129
+ uv: '1.43.0',
13130
13130
  zlib: '1.2.11',
13131
13131
  brotli: '1.0.9',
13132
13132
  ares: '1.18.1',
13133
- modules: '83',
13134
- nghttp2: '1.42.0',
13133
+ modules: '93',
13134
+ nghttp2: '1.47.0',
13135
13135
  napi: '8',
13136
- llhttp: '2.1.6',
13137
- openssl: '1.1.1s',
13138
- cldr: '40.0',
13139
- icu: '70.1',
13136
+ llhttp: '6.0.10',
13137
+ openssl: '1.1.1t+quic',
13138
+ cldr: '41.0',
13139
+ icu: '71.1',
13140
13140
  tz: '2022f',
13141
- unicode: '14.0'
13141
+ unicode: '14.0',
13142
+ ngtcp2: '0.8.1',
13143
+ nghttp3: '0.7.0'
13142
13144
  }
13143
13145
  };
13144
13146
  exports.versionInfo = versionInfo;
@@ -25644,7 +25646,10 @@ class ClientAuthentication {
25644
25646
  this.login = async (options, eventEmitter) => {
25645
25647
  var _a, _b;
25646
25648
  await this.sessionInfoManager.clear(options.sessionId);
25647
- const redirectUrl = (0, oidc_client_ext_1.removeOidcQueryParam)((_a = options.redirectUrl) !== null && _a !== void 0 ? _a : window.location.href);
25649
+ const redirectUrl = (_a = options.redirectUrl) !== null && _a !== void 0 ? _a : (0, oidc_client_ext_1.removeOidcQueryParam)(window.location.href);
25650
+ if (!(0, solid_client_authn_core_1.isValidRedirectUrl)(redirectUrl)) {
25651
+ throw new Error(`${redirectUrl} is not a valid redirect URL, it is either a malformed IRI or it includes a hash fragment.`);
25652
+ }
25648
25653
  await this.loginHandler.handle({
25649
25654
  ...options,
25650
25655
  redirectUrl,
@@ -26115,7 +26120,6 @@ exports["default"] = ClientRegistrar;
26115
26120
  Object.defineProperty(exports, "__esModule", ({ value: true }));
26116
26121
  exports.WELL_KNOWN_OPENID_CONFIG = void 0;
26117
26122
  const solid_client_authn_core_1 = __webpack_require__(/*! @inrupt/solid-client-authn-core */ "./node_modules/@inrupt/solid-client-authn-core/dist/index.js");
26118
- const urlPath_1 = __webpack_require__(/*! ../../util/urlPath */ "./node_modules/@inrupt/solid-client-authn-browser/dist/util/urlPath.js");
26119
26123
  exports.WELL_KNOWN_OPENID_CONFIG = ".well-known/openid-configuration";
26120
26124
  const issuerConfigKeyMap = {
26121
26125
  issuer: {
@@ -26221,7 +26225,7 @@ class IssuerConfigFetcher {
26221
26225
  }
26222
26226
  async fetchConfig(issuer) {
26223
26227
  let issuerConfig;
26224
- const openIdConfigUrl = (0, urlPath_1.appendToUrlPathname)(issuer, exports.WELL_KNOWN_OPENID_CONFIG);
26228
+ const openIdConfigUrl = new URL(exports.WELL_KNOWN_OPENID_CONFIG, issuer).href;
26225
26229
  const issuerConfigRequestBody = await window.fetch(openIdConfigUrl);
26226
26230
  try {
26227
26231
  issuerConfig = processConfig(await issuerConfigRequestBody.json());
@@ -26772,27 +26776,6 @@ exports["default"] = StorageUtilityBrowser;
26772
26776
 
26773
26777
  /***/ }),
26774
26778
 
26775
- /***/ "./node_modules/@inrupt/solid-client-authn-browser/dist/util/urlPath.js":
26776
- /*!******************************************************************************!*\
26777
- !*** ./node_modules/@inrupt/solid-client-authn-browser/dist/util/urlPath.js ***!
26778
- \******************************************************************************/
26779
- /***/ ((__unused_webpack_module, exports) => {
26780
-
26781
- "use strict";
26782
-
26783
- Object.defineProperty(exports, "__esModule", ({ value: true }));
26784
- exports.appendToUrlPathname = void 0;
26785
- function appendToUrlPathname(url, append) {
26786
- const parsedUrl = new URL(url);
26787
- const path = parsedUrl.pathname;
26788
- parsedUrl.pathname = `${path}${path.endsWith("/") ? "" : "/"}${append.startsWith("/") ? append.substring(1) : append}`;
26789
- return parsedUrl.toString();
26790
- }
26791
- exports.appendToUrlPathname = appendToUrlPathname;
26792
- //# sourceMappingURL=urlPath.js.map
26793
-
26794
- /***/ }),
26795
-
26796
26779
  /***/ "./node_modules/@inrupt/solid-client-authn-browser/node_modules/uuid/dist/commonjs-browser/index.js":
26797
26780
  /*!**********************************************************************************************************!*\
26798
26781
  !*** ./node_modules/@inrupt/solid-client-authn-browser/node_modules/uuid/dist/commonjs-browser/index.js ***!
@@ -27907,6 +27890,16 @@ async function getWebidFromTokenPayload(idToken, jwksIri, issuerIri, clientId) {
27907
27890
  }
27908
27891
  }
27909
27892
 
27893
+ function isValidRedirectUrl(redirectUrl) {
27894
+ try {
27895
+ const urlObject = new URL(redirectUrl);
27896
+ return urlObject.hash === "";
27897
+ }
27898
+ catch (e) {
27899
+ return false;
27900
+ }
27901
+ }
27902
+
27910
27903
  function isSupportedTokenType(token) {
27911
27904
  return typeof token === "string" && ["DPoP", "Bearer"].includes(token);
27912
27905
  }
@@ -28322,6 +28315,7 @@ exports.getSessionIdFromOauthState = getSessionIdFromOauthState;
28322
28315
  exports.getWebidFromTokenPayload = getWebidFromTokenPayload;
28323
28316
  exports.handleRegistration = handleRegistration;
28324
28317
  exports.isSupportedTokenType = isSupportedTokenType;
28318
+ exports.isValidRedirectUrl = isValidRedirectUrl;
28325
28319
  exports.loadOidcContextFromStorage = loadOidcContextFromStorage;
28326
28320
  exports.mockStorage = mockStorage;
28327
28321
  exports.mockStorageUtility = mockStorageUtility;
@@ -45273,7 +45267,7 @@ function () {
45273
45267
 
45274
45268
  return ConditionalRule;
45275
45269
  }();
45276
- var keyRegExp = /@media|@supports\s+/;
45270
+ var keyRegExp = /@container|@media|@supports\s+/;
45277
45271
  var pluginConditionalRule = {
45278
45272
  onCreateRule: function onCreateRule(key, styles, options) {
45279
45273
  return keyRegExp.test(key) ? new ConditionalRule(key, styles, options) : null;
@@ -46837,7 +46831,7 @@ var Jss =
46837
46831
  function () {
46838
46832
  function Jss(options) {
46839
46833
  this.id = instanceCounter++;
46840
- this.version = "10.9.2";
46834
+ this.version = "10.10.0";
46841
46835
  this.plugins = new PluginsRegistry();
46842
46836
  this.options = {
46843
46837
  id: {
@@ -54278,16 +54272,17 @@ var Fetcher = /*#__PURE__*/function () {
54278
54272
  var fetcher = this;
54279
54273
  // @ts-ignore
54280
54274
  if (fetcher.fetchQueue && fetcher.fetchQueue[uri]) {
54281
- console.log('Internal error - fetchQueue exists ' + uri);
54275
+ // console.log('Internal error - fetchQueue exists ' + uri)
54282
54276
  var promise = fetcher.fetchQueue[uri];
54283
54277
  if (promise['PromiseStatus'] === 'resolved') {
54284
54278
  delete fetcher.fetchQueue[uri];
54285
54279
  } else {
54286
54280
  // pending
54287
54281
  delete fetcher.fetchQueue[uri];
54288
- console.log('*** Fetcher: pending fetchQueue deleted ' + uri);
54282
+ // console.log('*** Fetcher: pending fetchQueue deleted ' + uri)
54289
54283
  }
54290
54284
  }
54285
+
54291
54286
  if (fetcher.requested[uri] && fetcher.requested[uri] !== 'done' && fetcher.requested[uri] !== 'failed' && fetcher.requested[uri] !== 404) {
54292
54287
  var msg = "Rdflib: fetcher: Destructive operation on <".concat(fetcher.requested[uri], "> file being fetched! ") + uri;
54293
54288
  console.error(msg);
@@ -61239,7 +61234,7 @@ contentType, callback, options) {
61239
61234
  documentString = sz.statementsToNTriples(newSts);
61240
61235
  return executeCallback(null, documentString);
61241
61236
  case _types__WEBPACK_IMPORTED_MODULE_0__.JSONLDContentType:
61242
- sz.setFlags('si'); // use turtle parameters
61237
+ sz.setFlags('si dr'); // turtle + dr (means no default, no relative prefix)
61243
61238
  documentString = sz.statementsToJsonld(newSts); // convert via turtle
61244
61239
  return executeCallback(null, documentString);
61245
61240
  case _types__WEBPACK_IMPORTED_MODULE_0__.NQuadsContentType:
@@ -61311,7 +61306,6 @@ __webpack_require__.r(__webpack_exports__);
61311
61306
 
61312
61307
 
61313
61308
 
61314
- // import * as jsonld from 'jsonld'
61315
61309
 
61316
61310
  function createSerializer(store) {
61317
61311
  return new Serializer(store);
@@ -61818,7 +61812,7 @@ var Serializer = /*#__PURE__*/function () {
61818
61812
  var termToN3 = termToN3Method.bind(this);
61819
61813
  function prefixDirectivesMethod() {
61820
61814
  var str = '';
61821
- if (this.defaultNamespace) {
61815
+ if (this.flags.indexOf('d') < 0 && this.defaultNamespace) {
61822
61816
  str += '@prefix : ' + this.explicitURI(this.defaultNamespace) + '.\n';
61823
61817
  }
61824
61818
  for (var ns in this.prefixes) {
@@ -62303,20 +62297,19 @@ var Serializer = /*#__PURE__*/function () {
62303
62297
  key: "statementsToJsonld",
62304
62298
  value: function statementsToJsonld(sts) {
62305
62299
  // ttl2jsonld creates context keys for all ttl prefix
62306
- // context keys must be full IRI
62307
- function findId(itemObj) {
62300
+ // context keys must be absolute IRI ttl2jsonld@0.0.8
62301
+ /* function findId (itemObj) {
62308
62302
  if (itemObj['@id']) {
62309
- var item = itemObj['@id'].split(':');
62310
- if (keys[item[0]]) itemObj['@id'] = jsonldObj['@context'][item[0]] + item[1];
62311
- }
62312
- var itemValues = Object.values(itemObj);
62313
- for (var i in itemValues) {
62314
- if (typeof itemValues[i] !== 'string') {
62315
- // @list contains array
62316
- findId(itemValues[i]);
62303
+ const item = itemObj['@id'].split(':')
62304
+ if (keys[item[0]]) itemObj['@id'] = jsonldObj['@context'][item[0]] + item[1]
62305
+ }
62306
+ const itemValues = Object.values(itemObj)
62307
+ for (const i in itemValues) {
62308
+ if (typeof itemValues[i] !== 'string') { // @list contains array
62309
+ findId(itemValues[i])
62317
62310
  }
62318
62311
  }
62319
- }
62312
+ } */
62320
62313
  var turtleDoc = this.statementsToN3(sts);
62321
62314
  var jsonldObj = _frogcat_ttl2jsonld__WEBPACK_IMPORTED_MODULE_4__.parse(turtleDoc);
62322
62315
  return JSON.stringify(jsonldObj, null, 2);
@@ -66818,15 +66811,13 @@ function createAclLogic(store) {
66818
66811
  var ns = ns_1.ns;
66819
66812
  function findAclDocUrl(url) {
66820
66813
  return __awaiter(this, void 0, void 0, function () {
66821
- var doc, docNode;
66814
+ var docNode;
66822
66815
  return __generator(this, function (_a) {
66823
66816
  switch (_a.label) {
66824
- case 0:
66825
- doc = store.sym(url);
66826
- return [4 /*yield*/, store.fetcher.load(doc)];
66817
+ case 0: return [4 /*yield*/, store.fetcher.load(url)];
66827
66818
  case 1:
66828
66819
  _a.sent();
66829
- docNode = store.any(doc, exports.ACL_LINK);
66820
+ docNode = store.any(url, exports.ACL_LINK);
66830
66821
  if (!docNode) {
66831
66822
  throw new Error("No ACL link discovered for ".concat(url));
66832
66823
  }
@@ -67634,7 +67625,7 @@ function createInboxLogic(store, profileLogic, utilityLogic, containerLogic, acl
67634
67625
  case 2: return [4 /*yield*/, profileLogic.getMainInbox(user)];
67635
67626
  case 3:
67636
67627
  inbox = _a.sent();
67637
- return [4 /*yield*/, containerLogic.getContainerMembers(inbox.value)];
67628
+ return [4 /*yield*/, containerLogic.getContainerMembers(inbox)];
67638
67629
  case 4:
67639
67630
  urls = _a.sent();
67640
67631
  return [2 /*return*/, urls.filter(function (url) { return !containerLogic.isContainer(url); })];
@@ -68790,19 +68781,21 @@ var rdflib_1 = __webpack_require__(/*! rdflib */ "./node_modules/rdflib/esm/inde
68790
68781
  function createContainerLogic(store) {
68791
68782
  function getContainerElements(containerNode) {
68792
68783
  return store
68793
- .statementsMatching(containerNode, (0, rdflib_1.sym)("http://www.w3.org/ns/ldp#contains"), undefined, containerNode.doc())
68784
+ .statementsMatching(containerNode, (0, rdflib_1.sym)("http://www.w3.org/ns/ldp#contains"), undefined)
68794
68785
  .map(function (st) { return st.object; });
68795
68786
  }
68796
68787
  function isContainer(url) {
68797
- return url.charAt(url.length - 1) === "/";
68788
+ var nodeToString = url.value;
68789
+ return nodeToString.charAt(nodeToString.length - 1) === "/";
68798
68790
  }
68799
68791
  function createContainer(url) {
68800
68792
  return __awaiter(this, void 0, void 0, function () {
68801
- var result;
68793
+ var stringToNode, result;
68802
68794
  return __generator(this, function (_a) {
68803
68795
  switch (_a.label) {
68804
68796
  case 0:
68805
- if (!isContainer(url)) {
68797
+ stringToNode = (0, rdflib_1.sym)(url);
68798
+ if (!isContainer(stringToNode)) {
68806
68799
  throw new Error("Not a container URL ".concat(url));
68807
68800
  }
68808
68801
  return [4 /*yield*/, store.fetcher._fetch(url, {
@@ -68826,16 +68819,12 @@ function createContainerLogic(store) {
68826
68819
  }
68827
68820
  function getContainerMembers(containerUrl) {
68828
68821
  return __awaiter(this, void 0, void 0, function () {
68829
- var containerNode, nodes;
68830
68822
  return __generator(this, function (_a) {
68831
68823
  switch (_a.label) {
68832
- case 0:
68833
- containerNode = store.sym(containerUrl);
68834
- return [4 /*yield*/, store.fetcher.load(containerNode)];
68824
+ case 0: return [4 /*yield*/, store.fetcher.load(containerUrl)];
68835
68825
  case 1:
68836
68826
  _a.sent();
68837
- nodes = getContainerElements(containerNode);
68838
- return [2 /*return*/, nodes.map(function (node) { return node.value; })];
68827
+ return [2 /*return*/, getContainerElements(containerUrl)];
68839
68828
  }
68840
68829
  });
68841
68830
  });
@@ -69021,28 +69010,30 @@ var CustomError_1 = __webpack_require__(/*! ../logic/CustomError */ "./node_modu
69021
69010
  var debug = __importStar(__webpack_require__(/*! ../util/debug */ "./node_modules/solid-logic/lib/util/debug.js"));
69022
69011
  var utils_1 = __webpack_require__(/*! ./utils */ "./node_modules/solid-logic/lib/util/utils.js");
69023
69012
  function createUtilityLogic(store, aclLogic, containerLogic) {
69024
- function recursiveDelete(url) {
69013
+ function recursiveDelete(containerNode) {
69025
69014
  return __awaiter(this, void 0, void 0, function () {
69026
- var aclDocUrl, containerMembers, e_1;
69015
+ var aclDocUrl, containerMembers, nodeToStringHere, e_1;
69027
69016
  return __generator(this, function (_a) {
69028
69017
  switch (_a.label) {
69029
69018
  case 0:
69030
69019
  _a.trys.push([0, 6, , 7]);
69031
- if (!containerLogic.isContainer(url)) return [3 /*break*/, 5];
69032
- return [4 /*yield*/, aclLogic.findAclDocUrl(url)];
69020
+ if (!containerLogic.isContainer(containerNode)) return [3 /*break*/, 5];
69021
+ return [4 /*yield*/, aclLogic.findAclDocUrl(containerNode)];
69033
69022
  case 1:
69034
69023
  aclDocUrl = _a.sent();
69035
69024
  return [4 /*yield*/, store.fetcher._fetch(aclDocUrl, { method: "DELETE" })];
69036
69025
  case 2:
69037
69026
  _a.sent();
69038
- return [4 /*yield*/, containerLogic.getContainerMembers(url)];
69027
+ return [4 /*yield*/, containerLogic.getContainerMembers(containerNode)];
69039
69028
  case 3:
69040
69029
  containerMembers = _a.sent();
69041
69030
  return [4 /*yield*/, Promise.all(containerMembers.map(function (url) { return recursiveDelete(url); }))];
69042
69031
  case 4:
69043
69032
  _a.sent();
69044
69033
  _a.label = 5;
69045
- case 5: return [2 /*return*/, store.fetcher._fetch(url, { method: "DELETE" })];
69034
+ case 5:
69035
+ nodeToStringHere = containerNode.value;
69036
+ return [2 /*return*/, store.fetcher._fetch(nodeToStringHere, { method: "DELETE" })];
69046
69037
  case 6:
69047
69038
  e_1 = _a.sent();
69048
69039
  return [3 /*break*/, 7];
@@ -69187,7 +69178,7 @@ function createUtilityLogic(store, aclLogic, containerLogic) {
69187
69178
  ''
69188
69179
  ].join('\n');
69189
69180
  }
69190
- return [4 /*yield*/, aclLogic.findAclDocUrl(options.target)];
69181
+ return [4 /*yield*/, aclLogic.findAclDocUrl((0, rdflib_1.sym)(options.target))];
69191
69182
  case 1:
69192
69183
  aclDocUrl = _a.sent();
69193
69184
  return [2 /*return*/, store.fetcher._fetch(aclDocUrl, {
@@ -73559,6 +73550,7 @@ __webpack_require__.r(__webpack_exports__);
73559
73550
  /* harmony export */ "getWebidFromTokenPayload": () => (/* binding */ getWebidFromTokenPayload),
73560
73551
  /* harmony export */ "handleRegistration": () => (/* binding */ handleRegistration),
73561
73552
  /* harmony export */ "isSupportedTokenType": () => (/* binding */ isSupportedTokenType),
73553
+ /* harmony export */ "isValidRedirectUrl": () => (/* binding */ isValidRedirectUrl),
73562
73554
  /* harmony export */ "loadOidcContextFromStorage": () => (/* binding */ loadOidcContextFromStorage),
73563
73555
  /* harmony export */ "mockStorage": () => (/* binding */ mockStorage),
73564
73556
  /* harmony export */ "mockStorageUtility": () => (/* binding */ mockStorageUtility),
@@ -73665,6 +73657,16 @@ async function getWebidFromTokenPayload(idToken, jwksIri, issuerIri, clientId) {
73665
73657
  }
73666
73658
  }
73667
73659
 
73660
+ function isValidRedirectUrl(redirectUrl) {
73661
+ try {
73662
+ const urlObject = new URL(redirectUrl);
73663
+ return urlObject.hash === "";
73664
+ }
73665
+ catch (e) {
73666
+ return false;
73667
+ }
73668
+ }
73669
+
73668
73670
  function isSupportedTokenType(token) {
73669
73671
  return typeof token === "string" && ["DPoP", "Bearer"].includes(token);
73670
73672
  }
@@ -74889,7 +74891,7 @@ __webpack_require__.r(__webpack_exports__);
74889
74891
  async function EmbeddedJWK(protectedHeader, token) {
74890
74892
  const joseHeader = {
74891
74893
  ...protectedHeader,
74892
- ...token.header,
74894
+ ...token === null || token === void 0 ? void 0 : token.header,
74893
74895
  };
74894
74896
  if (!(0,_lib_is_object_js__WEBPACK_IMPORTED_MODULE_1__["default"])(joseHeader.jwk)) {
74895
74897
  throw new _util_errors_js__WEBPACK_IMPORTED_MODULE_2__.JWSInvalid('"jwk" (JSON Web Key) Header Parameter must be a JSON object');
@@ -75034,7 +75036,7 @@ class LocalJWKSet {
75034
75036
  this._jwks = clone(jwks);
75035
75037
  }
75036
75038
  async getKey(protectedHeader, token) {
75037
- const { alg, kid } = { ...protectedHeader, ...token.header };
75039
+ const { alg, kid } = { ...protectedHeader, ...token === null || token === void 0 ? void 0 : token.header };
75038
75040
  const kty = getKtyFromAlg(alg);
75039
75041
  const candidates = this._jwks.keys.filter((jwk) => {
75040
75042
  let candidate = kty === jwk.kty;
@@ -75076,21 +75078,39 @@ class LocalJWKSet {
75076
75078
  throw new _util_errors_js__WEBPACK_IMPORTED_MODULE_1__.JWKSNoMatchingKey();
75077
75079
  }
75078
75080
  else if (length !== 1) {
75079
- throw new _util_errors_js__WEBPACK_IMPORTED_MODULE_1__.JWKSMultipleMatchingKeys();
75081
+ const error = new _util_errors_js__WEBPACK_IMPORTED_MODULE_1__.JWKSMultipleMatchingKeys();
75082
+ const { _cached } = this;
75083
+ error[Symbol.asyncIterator] = async function* () {
75084
+ for (const jwk of candidates) {
75085
+ try {
75086
+ yield await importWithAlgCache(_cached, jwk, alg);
75087
+ }
75088
+ catch (_a) {
75089
+ continue;
75090
+ }
75091
+ }
75092
+ };
75093
+ throw error;
75080
75094
  }
75081
- const cached = this._cached.get(jwk) || this._cached.set(jwk, {}).get(jwk);
75082
- if (cached[alg] === undefined) {
75083
- const keyObject = await (0,_key_import_js__WEBPACK_IMPORTED_MODULE_0__.importJWK)({ ...jwk, ext: true }, alg);
75084
- if (keyObject instanceof Uint8Array || keyObject.type !== 'public') {
75085
- throw new _util_errors_js__WEBPACK_IMPORTED_MODULE_1__.JWKSInvalid('JSON Web Key Set members must be public keys');
75086
- }
75087
- cached[alg] = keyObject;
75095
+ return importWithAlgCache(this._cached, jwk, alg);
75096
+ }
75097
+ }
75098
+ async function importWithAlgCache(cache, jwk, alg) {
75099
+ const cached = cache.get(jwk) || cache.set(jwk, {}).get(jwk);
75100
+ if (cached[alg] === undefined) {
75101
+ const key = await (0,_key_import_js__WEBPACK_IMPORTED_MODULE_0__.importJWK)({ ...jwk, ext: true }, alg);
75102
+ if (key instanceof Uint8Array || key.type !== 'public') {
75103
+ throw new _util_errors_js__WEBPACK_IMPORTED_MODULE_1__.JWKSInvalid('JSON Web Key Set members must be public keys');
75088
75104
  }
75089
- return cached[alg];
75105
+ cached[alg] = key;
75090
75106
  }
75107
+ return cached[alg];
75091
75108
  }
75092
75109
  function createLocalJWKSet(jwks) {
75093
- return LocalJWKSet.prototype.getKey.bind(new LocalJWKSet(jwks));
75110
+ const set = new LocalJWKSet(jwks);
75111
+ return async function (protectedHeader, token) {
75112
+ return set.getKey(protectedHeader, token);
75113
+ };
75094
75114
  }
75095
75115
 
75096
75116
 
@@ -75190,7 +75210,10 @@ class RemoteJWKSet extends _local_js__WEBPACK_IMPORTED_MODULE_3__.LocalJWKSet {
75190
75210
  }
75191
75211
  }
75192
75212
  function createRemoteJWKSet(url, options) {
75193
- return RemoteJWKSet.prototype.getKey.bind(new RemoteJWKSet(url, options));
75213
+ const set = new RemoteJWKSet(url, options);
75214
+ return async function (protectedHeader, token) {
75215
+ return set.getKey(protectedHeader, token);
75216
+ };
75194
75217
  }
75195
75218
 
75196
75219
 
@@ -76039,83 +76062,12 @@ __webpack_require__.r(__webpack_exports__);
76039
76062
  /* harmony import */ var _runtime_asn1_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../runtime/asn1.js */ "./node_modules/jose/dist/browser/runtime/asn1.js");
76040
76063
  /* harmony import */ var _runtime_jwk_to_key_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../runtime/jwk_to_key.js */ "./node_modules/jose/dist/browser/runtime/jwk_to_key.js");
76041
76064
  /* harmony import */ var _util_errors_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../util/errors.js */ "./node_modules/jose/dist/browser/util/errors.js");
76042
- /* harmony import */ var _lib_format_pem_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../lib/format_pem.js */ "./node_modules/jose/dist/browser/lib/format_pem.js");
76043
- /* harmony import */ var _lib_is_object_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../lib/is_object.js */ "./node_modules/jose/dist/browser/lib/is_object.js");
76044
-
76045
-
76065
+ /* harmony import */ var _lib_is_object_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../lib/is_object.js */ "./node_modules/jose/dist/browser/lib/is_object.js");
76046
76066
 
76047
76067
 
76048
76068
 
76049
76069
 
76050
76070
 
76051
- function getElement(seq) {
76052
- let result = [];
76053
- let next = 0;
76054
- while (next < seq.length) {
76055
- let nextPart = parseElement(seq.subarray(next));
76056
- result.push(nextPart);
76057
- next += nextPart.byteLength;
76058
- }
76059
- return result;
76060
- }
76061
- function parseElement(bytes) {
76062
- let position = 0;
76063
- let tag = bytes[0] & 0x1f;
76064
- position++;
76065
- if (tag === 0x1f) {
76066
- tag = 0;
76067
- while (bytes[position] >= 0x80) {
76068
- tag = tag * 128 + bytes[position] - 0x80;
76069
- position++;
76070
- }
76071
- tag = tag * 128 + bytes[position] - 0x80;
76072
- position++;
76073
- }
76074
- let length = 0;
76075
- if (bytes[position] < 0x80) {
76076
- length = bytes[position];
76077
- position++;
76078
- }
76079
- else if (length === 0x80) {
76080
- length = 0;
76081
- while (bytes[position + length] !== 0 || bytes[position + length + 1] !== 0) {
76082
- if (length > bytes.byteLength) {
76083
- throw new TypeError('invalid indefinite form length');
76084
- }
76085
- length++;
76086
- }
76087
- const byteLength = position + length + 2;
76088
- return {
76089
- byteLength,
76090
- contents: bytes.subarray(position, position + length),
76091
- raw: bytes.subarray(0, byteLength),
76092
- };
76093
- }
76094
- else {
76095
- let numberOfDigits = bytes[position] & 0x7f;
76096
- position++;
76097
- length = 0;
76098
- for (let i = 0; i < numberOfDigits; i++) {
76099
- length = length * 256 + bytes[position];
76100
- position++;
76101
- }
76102
- }
76103
- const byteLength = position + length;
76104
- return {
76105
- byteLength,
76106
- contents: bytes.subarray(position, byteLength),
76107
- raw: bytes.subarray(0, byteLength),
76108
- };
76109
- }
76110
- function spkiFromX509(buf) {
76111
- const tbsCertificate = getElement(getElement(parseElement(buf).contents)[0].contents);
76112
- return (0,_runtime_base64url_js__WEBPACK_IMPORTED_MODULE_0__.encodeBase64)(tbsCertificate[tbsCertificate[0].raw[0] === 0xa0 ? 6 : 5].raw);
76113
- }
76114
- function getSPKI(x509) {
76115
- const pem = x509.replace(/(?:-----(?:BEGIN|END) CERTIFICATE-----|\s)/g, '');
76116
- const raw = (0,_runtime_base64url_js__WEBPACK_IMPORTED_MODULE_0__.decodeBase64)(pem);
76117
- return (0,_lib_format_pem_js__WEBPACK_IMPORTED_MODULE_4__["default"])(spkiFromX509(raw), 'PUBLIC KEY');
76118
- }
76119
76071
  async function importSPKI(spki, alg, options) {
76120
76072
  if (typeof spki !== 'string' || spki.indexOf('-----BEGIN PUBLIC KEY-----') !== 0) {
76121
76073
  throw new TypeError('"spki" must be SPKI formatted string');
@@ -76126,14 +76078,7 @@ async function importX509(x509, alg, options) {
76126
76078
  if (typeof x509 !== 'string' || x509.indexOf('-----BEGIN CERTIFICATE-----') !== 0) {
76127
76079
  throw new TypeError('"x509" must be X.509 formatted string');
76128
76080
  }
76129
- let spki;
76130
- try {
76131
- spki = getSPKI(x509);
76132
- }
76133
- catch (cause) {
76134
- throw new TypeError('failed to parse the X.509 certificate', { cause });
76135
- }
76136
- return (0,_runtime_asn1_js__WEBPACK_IMPORTED_MODULE_1__.fromSPKI)(spki, alg, options);
76081
+ return (0,_runtime_asn1_js__WEBPACK_IMPORTED_MODULE_1__.fromX509)(x509, alg, options);
76137
76082
  }
76138
76083
  async function importPKCS8(pkcs8, alg, options) {
76139
76084
  if (typeof pkcs8 !== 'string' || pkcs8.indexOf('-----BEGIN PRIVATE KEY-----') !== 0) {
@@ -76143,13 +76088,10 @@ async function importPKCS8(pkcs8, alg, options) {
76143
76088
  }
76144
76089
  async function importJWK(jwk, alg, octAsKeyObject) {
76145
76090
  var _a;
76146
- if (!(0,_lib_is_object_js__WEBPACK_IMPORTED_MODULE_5__["default"])(jwk)) {
76091
+ if (!(0,_lib_is_object_js__WEBPACK_IMPORTED_MODULE_4__["default"])(jwk)) {
76147
76092
  throw new TypeError('JWK must be an object');
76148
76093
  }
76149
76094
  alg || (alg = jwk.alg);
76150
- if (typeof alg !== 'string' || !alg) {
76151
- throw new TypeError('"alg" argument is required when "jwk.alg" is not present');
76152
- }
76153
76095
  switch (jwk.kty) {
76154
76096
  case 'oct':
76155
76097
  if (typeof jwk.k !== 'string' || !jwk.k) {
@@ -76516,13 +76458,13 @@ function checkSigCryptoKey(key, alg, ...usages) {
76516
76458
  throw unusable(`SHA-${expected}`, 'algorithm.hash');
76517
76459
  break;
76518
76460
  }
76519
- case (0,_runtime_env_js__WEBPACK_IMPORTED_MODULE_0__.isCloudflareWorkers)() && 'EdDSA': {
76520
- if (!isAlgorithm(key.algorithm, 'NODE-ED25519'))
76521
- throw unusable('NODE-ED25519');
76522
- break;
76523
- }
76524
76461
  case 'EdDSA': {
76525
76462
  if (key.algorithm.name !== 'Ed25519' && key.algorithm.name !== 'Ed448') {
76463
+ if ((0,_runtime_env_js__WEBPACK_IMPORTED_MODULE_0__.isCloudflareWorkers)()) {
76464
+ if (isAlgorithm(key.algorithm, 'NODE-ED25519'))
76465
+ break;
76466
+ throw unusable('Ed25519, Ed448, or NODE-ED25519');
76467
+ }
76526
76468
  throw unusable('Ed25519 or Ed448');
76527
76469
  }
76528
76470
  break;
@@ -77338,6 +77280,7 @@ __webpack_require__.r(__webpack_exports__);
77338
77280
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
77339
77281
  /* harmony export */ "fromPKCS8": () => (/* binding */ fromPKCS8),
77340
77282
  /* harmony export */ "fromSPKI": () => (/* binding */ fromSPKI),
77283
+ /* harmony export */ "fromX509": () => (/* binding */ fromX509),
77341
77284
  /* harmony export */ "toPKCS8": () => (/* binding */ toPKCS8),
77342
77285
  /* harmony export */ "toSPKI": () => (/* binding */ toSPKI)
77343
77286
  /* harmony export */ });
@@ -77407,7 +77350,7 @@ const getNamedCurve = (keyData) => {
77407
77350
  }
77408
77351
  };
77409
77352
  const genericImport = async (replace, keyFormat, pem, alg, options) => {
77410
- var _a;
77353
+ var _a, _b;
77411
77354
  let algorithm;
77412
77355
  let keyUsages;
77413
77356
  const keyData = new Uint8Array(atob(pem.replace(replace, ''))
@@ -77458,12 +77401,6 @@ const genericImport = async (replace, keyFormat, pem, alg, options) => {
77458
77401
  keyUsages = isPublic ? [] : ['deriveBits'];
77459
77402
  break;
77460
77403
  }
77461
- case (0,_env_js__WEBPACK_IMPORTED_MODULE_0__.isCloudflareWorkers)() && 'EdDSA': {
77462
- const namedCurve = getNamedCurve(keyData).toUpperCase();
77463
- algorithm = { name: `NODE-${namedCurve}`, namedCurve: `NODE-${namedCurve}` };
77464
- keyUsages = isPublic ? ['verify'] : ['sign'];
77465
- break;
77466
- }
77467
77404
  case 'EdDSA':
77468
77405
  algorithm = { name: getNamedCurve(keyData) };
77469
77406
  keyUsages = isPublic ? ['verify'] : ['sign'];
@@ -77471,7 +77408,18 @@ const genericImport = async (replace, keyFormat, pem, alg, options) => {
77471
77408
  default:
77472
77409
  throw new _util_errors_js__WEBPACK_IMPORTED_MODULE_5__.JOSENotSupported('Invalid or unsupported "alg" (Algorithm) value');
77473
77410
  }
77474
- return _webcrypto_js__WEBPACK_IMPORTED_MODULE_1__["default"].subtle.importKey(keyFormat, keyData, algorithm, (_a = options === null || options === void 0 ? void 0 : options.extractable) !== null && _a !== void 0 ? _a : false, keyUsages);
77411
+ try {
77412
+ return await _webcrypto_js__WEBPACK_IMPORTED_MODULE_1__["default"].subtle.importKey(keyFormat, keyData, algorithm, (_a = options === null || options === void 0 ? void 0 : options.extractable) !== null && _a !== void 0 ? _a : false, keyUsages);
77413
+ }
77414
+ catch (err) {
77415
+ if (algorithm.name === 'Ed25519' &&
77416
+ (err === null || err === void 0 ? void 0 : err.name) === 'NotSupportedError' &&
77417
+ (0,_env_js__WEBPACK_IMPORTED_MODULE_0__.isCloudflareWorkers)()) {
77418
+ algorithm = { name: 'NODE-ED25519', namedCurve: 'NODE-ED25519' };
77419
+ return await _webcrypto_js__WEBPACK_IMPORTED_MODULE_1__["default"].subtle.importKey(keyFormat, keyData, algorithm, (_b = options === null || options === void 0 ? void 0 : options.extractable) !== null && _b !== void 0 ? _b : false, keyUsages);
77420
+ }
77421
+ throw err;
77422
+ }
77475
77423
  };
77476
77424
  const fromPKCS8 = (pem, alg, options) => {
77477
77425
  return genericImport(/(?:-----(?:BEGIN|END) PRIVATE KEY-----|\s)/g, 'pkcs8', pem, alg, options);
@@ -77479,6 +77427,84 @@ const fromPKCS8 = (pem, alg, options) => {
77479
77427
  const fromSPKI = (pem, alg, options) => {
77480
77428
  return genericImport(/(?:-----(?:BEGIN|END) PUBLIC KEY-----|\s)/g, 'spki', pem, alg, options);
77481
77429
  };
77430
+ function getElement(seq) {
77431
+ let result = [];
77432
+ let next = 0;
77433
+ while (next < seq.length) {
77434
+ let nextPart = parseElement(seq.subarray(next));
77435
+ result.push(nextPart);
77436
+ next += nextPart.byteLength;
77437
+ }
77438
+ return result;
77439
+ }
77440
+ function parseElement(bytes) {
77441
+ let position = 0;
77442
+ let tag = bytes[0] & 0x1f;
77443
+ position++;
77444
+ if (tag === 0x1f) {
77445
+ tag = 0;
77446
+ while (bytes[position] >= 0x80) {
77447
+ tag = tag * 128 + bytes[position] - 0x80;
77448
+ position++;
77449
+ }
77450
+ tag = tag * 128 + bytes[position] - 0x80;
77451
+ position++;
77452
+ }
77453
+ let length = 0;
77454
+ if (bytes[position] < 0x80) {
77455
+ length = bytes[position];
77456
+ position++;
77457
+ }
77458
+ else if (length === 0x80) {
77459
+ length = 0;
77460
+ while (bytes[position + length] !== 0 || bytes[position + length + 1] !== 0) {
77461
+ if (length > bytes.byteLength) {
77462
+ throw new TypeError('invalid indefinite form length');
77463
+ }
77464
+ length++;
77465
+ }
77466
+ const byteLength = position + length + 2;
77467
+ return {
77468
+ byteLength,
77469
+ contents: bytes.subarray(position, position + length),
77470
+ raw: bytes.subarray(0, byteLength),
77471
+ };
77472
+ }
77473
+ else {
77474
+ let numberOfDigits = bytes[position] & 0x7f;
77475
+ position++;
77476
+ length = 0;
77477
+ for (let i = 0; i < numberOfDigits; i++) {
77478
+ length = length * 256 + bytes[position];
77479
+ position++;
77480
+ }
77481
+ }
77482
+ const byteLength = position + length;
77483
+ return {
77484
+ byteLength,
77485
+ contents: bytes.subarray(position, byteLength),
77486
+ raw: bytes.subarray(0, byteLength),
77487
+ };
77488
+ }
77489
+ function spkiFromX509(buf) {
77490
+ const tbsCertificate = getElement(getElement(parseElement(buf).contents)[0].contents);
77491
+ return (0,_base64url_js__WEBPACK_IMPORTED_MODULE_3__.encodeBase64)(tbsCertificate[tbsCertificate[0].raw[0] === 0xa0 ? 6 : 5].raw);
77492
+ }
77493
+ function getSPKI(x509) {
77494
+ const pem = x509.replace(/(?:-----(?:BEGIN|END) CERTIFICATE-----|\s)/g, '');
77495
+ const raw = (0,_base64url_js__WEBPACK_IMPORTED_MODULE_3__.decodeBase64)(pem);
77496
+ return (0,_lib_format_pem_js__WEBPACK_IMPORTED_MODULE_4__["default"])(spkiFromX509(raw), 'PUBLIC KEY');
77497
+ }
77498
+ const fromX509 = (pem, alg, options) => {
77499
+ let spki;
77500
+ try {
77501
+ spki = getSPKI(pem);
77502
+ }
77503
+ catch (cause) {
77504
+ throw new TypeError('failed to parse the X.509 certificate', { cause });
77505
+ }
77506
+ return fromSPKI(spki, alg, options);
77507
+ };
77482
77508
 
77483
77509
 
77484
77510
  /***/ }),
@@ -78036,7 +78062,7 @@ function getModulusLengthOption(options) {
78036
78062
  return modulusLength;
78037
78063
  }
78038
78064
  async function generateKeyPair(alg, options) {
78039
- var _a, _b, _c;
78065
+ var _a, _b, _c, _d;
78040
78066
  let algorithm;
78041
78067
  let keyUsages;
78042
78068
  switch (alg) {
@@ -78086,17 +78112,6 @@ async function generateKeyPair(alg, options) {
78086
78112
  algorithm = { name: 'ECDSA', namedCurve: 'P-521' };
78087
78113
  keyUsages = ['sign', 'verify'];
78088
78114
  break;
78089
- case (0,_env_js__WEBPACK_IMPORTED_MODULE_0__.isCloudflareWorkers)() && 'EdDSA':
78090
- switch (options === null || options === void 0 ? void 0 : options.crv) {
78091
- case undefined:
78092
- case 'Ed25519':
78093
- algorithm = { name: 'NODE-ED25519', namedCurve: 'NODE-ED25519' };
78094
- keyUsages = ['sign', 'verify'];
78095
- break;
78096
- default:
78097
- throw new _util_errors_js__WEBPACK_IMPORTED_MODULE_2__.JOSENotSupported('Invalid or unsupported crv option provided');
78098
- }
78099
- break;
78100
78115
  case 'EdDSA':
78101
78116
  keyUsages = ['sign', 'verify'];
78102
78117
  const crv = (_a = options === null || options === void 0 ? void 0 : options.crv) !== null && _a !== void 0 ? _a : 'Ed25519';
@@ -78134,7 +78149,18 @@ async function generateKeyPair(alg, options) {
78134
78149
  default:
78135
78150
  throw new _util_errors_js__WEBPACK_IMPORTED_MODULE_2__.JOSENotSupported('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');
78136
78151
  }
78137
- return (_webcrypto_js__WEBPACK_IMPORTED_MODULE_1__["default"].subtle.generateKey(algorithm, (_c = options === null || options === void 0 ? void 0 : options.extractable) !== null && _c !== void 0 ? _c : false, keyUsages));
78152
+ try {
78153
+ return (await _webcrypto_js__WEBPACK_IMPORTED_MODULE_1__["default"].subtle.generateKey(algorithm, (_c = options === null || options === void 0 ? void 0 : options.extractable) !== null && _c !== void 0 ? _c : false, keyUsages));
78154
+ }
78155
+ catch (err) {
78156
+ if (algorithm.name === 'Ed25519' &&
78157
+ (err === null || err === void 0 ? void 0 : err.name) === 'NotSupportedError' &&
78158
+ (0,_env_js__WEBPACK_IMPORTED_MODULE_0__.isCloudflareWorkers)()) {
78159
+ algorithm = { name: 'NODE-ED25519', namedCurve: 'NODE-ED25519' };
78160
+ return (await _webcrypto_js__WEBPACK_IMPORTED_MODULE_1__["default"].subtle.generateKey(algorithm, (_d = options === null || options === void 0 ? void 0 : options.extractable) !== null && _d !== void 0 ? _d : false, keyUsages));
78161
+ }
78162
+ throw err;
78163
+ }
78138
78164
  }
78139
78165
 
78140
78166
 
@@ -78314,19 +78340,6 @@ function subtleMapping(jwk) {
78314
78340
  }
78315
78341
  break;
78316
78342
  }
78317
- case (0,_env_js__WEBPACK_IMPORTED_MODULE_0__.isCloudflareWorkers)() && 'OKP':
78318
- if (jwk.alg !== 'EdDSA') {
78319
- throw new _util_errors_js__WEBPACK_IMPORTED_MODULE_2__.JOSENotSupported('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');
78320
- }
78321
- switch (jwk.crv) {
78322
- case 'Ed25519':
78323
- algorithm = { name: 'NODE-ED25519', namedCurve: 'NODE-ED25519' };
78324
- keyUsages = jwk.d ? ['sign'] : ['verify'];
78325
- break;
78326
- default:
78327
- throw new _util_errors_js__WEBPACK_IMPORTED_MODULE_2__.JOSENotSupported('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');
78328
- }
78329
- break;
78330
78343
  case 'OKP': {
78331
78344
  switch (jwk.alg) {
78332
78345
  case 'EdDSA':
@@ -78352,6 +78365,9 @@ function subtleMapping(jwk) {
78352
78365
  }
78353
78366
  const parse = async (jwk) => {
78354
78367
  var _a, _b;
78368
+ if (!jwk.alg) {
78369
+ throw new TypeError('"alg" argument is required when "jwk.alg" is not present');
78370
+ }
78355
78371
  const { algorithm, keyUsages } = subtleMapping(jwk);
78356
78372
  const rest = [
78357
78373
  algorithm,
@@ -78364,7 +78380,18 @@ const parse = async (jwk) => {
78364
78380
  const keyData = { ...jwk };
78365
78381
  delete keyData.alg;
78366
78382
  delete keyData.use;
78367
- return _webcrypto_js__WEBPACK_IMPORTED_MODULE_1__["default"].subtle.importKey('jwk', keyData, ...rest);
78383
+ try {
78384
+ return await _webcrypto_js__WEBPACK_IMPORTED_MODULE_1__["default"].subtle.importKey('jwk', keyData, ...rest);
78385
+ }
78386
+ catch (err) {
78387
+ if (algorithm.name === 'Ed25519' &&
78388
+ (err === null || err === void 0 ? void 0 : err.name) === 'NotSupportedError' &&
78389
+ (0,_env_js__WEBPACK_IMPORTED_MODULE_0__.isCloudflareWorkers)()) {
78390
+ rest[0] = { name: 'NODE-ED25519', namedCurve: 'NODE-ED25519' };
78391
+ return await _webcrypto_js__WEBPACK_IMPORTED_MODULE_1__["default"].subtle.importKey('jwk', keyData, ...rest);
78392
+ }
78393
+ throw err;
78394
+ }
78368
78395
  };
78369
78396
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (parse);
78370
78397
 
@@ -78629,10 +78656,10 @@ function subtleDsa(alg, algorithm) {
78629
78656
  case 'ES384':
78630
78657
  case 'ES512':
78631
78658
  return { hash, name: 'ECDSA', namedCurve: algorithm.namedCurve };
78632
- case (0,_env_js__WEBPACK_IMPORTED_MODULE_0__.isCloudflareWorkers)() && 'EdDSA':
78633
- const { namedCurve } = algorithm;
78634
- return { name: namedCurve, namedCurve };
78635
78659
  case 'EdDSA':
78660
+ if ((0,_env_js__WEBPACK_IMPORTED_MODULE_0__.isCloudflareWorkers)() && algorithm.name === 'NODE-ED25519') {
78661
+ return { name: 'NODE-ED25519', namedCurve: 'NODE-ED25519' };
78662
+ }
78636
78663
  return { name: algorithm.name };
78637
78664
  default:
78638
78665
  throw new _util_errors_js__WEBPACK_IMPORTED_MODULE_1__.JOSENotSupported(`alg ${alg} is not supported either by JOSE or your javascript runtime`);
@@ -79056,6 +79083,7 @@ class JWKSMultipleMatchingKeys extends JOSEError {
79056
79083
  return 'ERR_JWKS_MULTIPLE_MATCHING_KEYS';
79057
79084
  }
79058
79085
  }
79086
+ Symbol.asyncIterator;
79059
79087
  class JWKSTimeout extends JOSEError {
79060
79088
  constructor() {
79061
79089
  super(...arguments);