graphwise-reactodia 0.0.1-TR16 → 0.0.1-TR18

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 (48) hide show
  1. package/README.md +57 -0
  2. package/dist/cjs/error-code-BdRU0RQ9.js +36 -0
  3. package/dist/cjs/graphwise-reactodia.cjs.entry.js +270 -65
  4. package/dist/cjs/graphwise-reactodia.cjs.js +1 -1
  5. package/dist/cjs/{index-CII9aUQC.js → index-DtzCybH4.js} +16 -0
  6. package/dist/cjs/index.cjs.js +14 -4
  7. package/dist/cjs/loader.cjs.js +1 -1
  8. package/dist/collection/components/graphwise-reactodia/graphwise-reactodia.js +46 -4
  9. package/dist/collection/components/graphwise-reactodia/menu/graphwise-menu.js +4 -1
  10. package/dist/collection/components/graphwise-reactodia/models/error/error-cause.js +1 -0
  11. package/dist/collection/components/graphwise-reactodia/models/error/error-code.js +18 -0
  12. package/dist/collection/components/graphwise-reactodia/models/error/error-report.js +1 -0
  13. package/dist/collection/components/graphwise-reactodia/models/event/event-callback.js +1 -0
  14. package/dist/collection/components/graphwise-reactodia/models/event/event-detail.js +4 -0
  15. package/dist/collection/components/graphwise-reactodia/models/event/event-type.js +7 -0
  16. package/dist/collection/components/graphwise-reactodia/reactodia-app.js +53 -19
  17. package/dist/collection/components/graphwise-reactodia/services/diagram-storage/diagram-storage.service.js +20 -4
  18. package/dist/collection/components/graphwise-reactodia/services/error/error.service.js +78 -0
  19. package/dist/collection/components/graphwise-reactodia/services/event/event.service.js +23 -0
  20. package/dist/collection/index.js +3 -0
  21. package/dist/collection/pages/graphwise-reactodia/main.js +41 -0
  22. package/dist/esm/error-code-DHI2bePh.js +34 -0
  23. package/dist/esm/graphwise-reactodia.entry.js +268 -63
  24. package/dist/esm/graphwise-reactodia.js +2 -2
  25. package/dist/esm/{index-Cypw7ydc.js → index-DpCR6zMg.js} +16 -1
  26. package/dist/esm/index.js +5 -4
  27. package/dist/esm/loader.js +2 -2
  28. package/dist/graphwise-reactodia/graphwise-reactodia.esm.js +1 -1
  29. package/dist/graphwise-reactodia/index.esm.js +1 -1
  30. package/dist/graphwise-reactodia/p-DHI2bePh.js +1 -0
  31. package/dist/graphwise-reactodia/p-DpCR6zMg.js +2 -0
  32. package/dist/graphwise-reactodia/p-abfb5091.entry.js +1 -0
  33. package/dist/types/components/graphwise-reactodia/graphwise-reactodia.d.ts +9 -0
  34. package/dist/types/components/graphwise-reactodia/models/error/error-cause.d.ts +10 -0
  35. package/dist/types/components/graphwise-reactodia/models/error/error-code.d.ts +17 -0
  36. package/dist/types/components/graphwise-reactodia/models/error/error-report.d.ts +13 -0
  37. package/dist/types/components/graphwise-reactodia/models/event/event-callback.d.ts +5 -0
  38. package/dist/types/components/graphwise-reactodia/models/event/event-detail.d.ts +48 -0
  39. package/dist/types/components/graphwise-reactodia/models/event/event-type.d.ts +6 -0
  40. package/dist/types/components/graphwise-reactodia/reactodia-app.d.ts +1 -1
  41. package/dist/types/components/graphwise-reactodia/services/diagram-storage/diagram-storage.service.d.ts +1 -0
  42. package/dist/types/components/graphwise-reactodia/services/error/error.service.d.ts +41 -0
  43. package/dist/types/components/graphwise-reactodia/services/event/event.service.d.ts +16 -0
  44. package/dist/types/components.d.ts +21 -0
  45. package/dist/types/index.d.ts +5 -0
  46. package/package.json +1 -1
  47. package/dist/graphwise-reactodia/p-20637a6f.entry.js +0 -1
  48. package/dist/graphwise-reactodia/p-Cypw7ydc.js +0 -2
@@ -1,5 +1,5 @@
1
- import { r as registerInstance, h, H as Host, g as getElement } from './index-Cypw7ydc.js';
2
- import { CLEAR_DIAGRAM_STORAGE_EVENT } from './index.js';
1
+ import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-DpCR6zMg.js';
2
+ import { C as CLEAR_DIAGRAM_STORAGE_EVENT, E as EventType, a as ErrorCode } from './error-code-DHI2bePh.js';
3
3
 
4
4
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
5
5
 
@@ -6329,6 +6329,57 @@ var DefaultColorVariants = [
6329
6329
  "danger"
6330
6330
  ];
6331
6331
  //#endregion
6332
+ //#region src/data/decorated/decoratedDataProvider.ts
6333
+ /**
6334
+ * Utility graph data provider to wrap over another provider to modify
6335
+ * how the requests are made or alter the results.
6336
+ *
6337
+ * @category Data
6338
+ */
6339
+ var DecoratedDataProvider = class {
6340
+ baseProvider;
6341
+ decorator;
6342
+ constructor(options) {
6343
+ this.baseProvider = options.baseProvider;
6344
+ this.decorator = options.decorator;
6345
+ }
6346
+ get factory() {
6347
+ return this.baseProvider.factory;
6348
+ }
6349
+ decorate(method, params) {
6350
+ const bound = this.baseProvider[method].bind(this.baseProvider);
6351
+ const { decorator } = this;
6352
+ return decorator(method, params[0], bound);
6353
+ }
6354
+ knownElementTypes(params) {
6355
+ return this.decorate("knownElementTypes", [params]);
6356
+ }
6357
+ knownLinkTypes(params) {
6358
+ return this.decorate("knownLinkTypes", [params]);
6359
+ }
6360
+ elementTypes(params) {
6361
+ return this.decorate("elementTypes", [params]);
6362
+ }
6363
+ propertyTypes(params) {
6364
+ return this.decorate("propertyTypes", [params]);
6365
+ }
6366
+ linkTypes(params) {
6367
+ return this.decorate("linkTypes", [params]);
6368
+ }
6369
+ elements(params) {
6370
+ return this.decorate("elements", [params]);
6371
+ }
6372
+ links(params) {
6373
+ return this.decorate("links", [params]);
6374
+ }
6375
+ connectedLinkStats(params) {
6376
+ return this.decorate("connectedLinkStats", [params]);
6377
+ }
6378
+ lookup(params) {
6379
+ return this.decorate("lookup", [params]);
6380
+ }
6381
+ };
6382
+ //#endregion
6332
6383
  //#region src/data/decorated/emptyDataProvider.ts
6333
6384
  /**
6334
6385
  * Empty graph data provider, which always return nothing.
@@ -31331,7 +31382,7 @@ function Service(_serviceClass) {
31331
31382
  // no implementation needed. We only use the type checking of the parameter
31332
31383
  }
31333
31384
 
31334
- var __decorate$4 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
31385
+ var __decorate$5 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
31335
31386
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
31336
31387
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
31337
31388
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
@@ -31393,11 +31444,11 @@ let DiagramService = DiagramService_1 = class DiagramService {
31393
31444
  DiagramService.ID = 'DiagramService';
31394
31445
  DiagramService.NOTIFY_DEBOUNCE_MS = 300;
31395
31446
  DiagramService.HISTORY_CHANGED_EVENT = 'historyChanged';
31396
- DiagramService = DiagramService_1 = __decorate$4([
31447
+ DiagramService = DiagramService_1 = __decorate$5([
31397
31448
  Service
31398
31449
  ], DiagramService);
31399
31450
 
31400
- var __decorate$3 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
31451
+ var __decorate$4 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
31401
31452
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
31402
31453
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
31403
31454
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
@@ -31412,37 +31463,171 @@ let WindowService = class WindowService {
31412
31463
  }
31413
31464
  };
31414
31465
  WindowService.ID = 'WindowService';
31415
- WindowService = __decorate$3([
31466
+ WindowService = __decorate$4([
31416
31467
  Service
31417
31468
  ], WindowService);
31418
31469
 
31470
+ var __decorate$3 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
31471
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
31472
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
31473
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
31474
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
31475
+ };
31476
+ /**
31477
+ * Service for event based operations
31478
+ */
31479
+ let EventService = class EventService {
31480
+ /**
31481
+ * Announces an event to the host.
31482
+ *
31483
+ * @param detail The event detail.
31484
+ */
31485
+ emit(detail) {
31486
+ var _a;
31487
+ (_a = this.callback) === null || _a === void 0 ? void 0 : _a.call(this, detail);
31488
+ }
31489
+ /**
31490
+ * Subscribes to the emitted events, replacing the previous subscriber.
31491
+ *
31492
+ * @param callback Called with every emitted event.
31493
+ * @returns A {@link Subscription} that, when called, removes the callback, unless it has already been replaced.
31494
+ */
31495
+ subscribe(callback) {
31496
+ this.callback = callback;
31497
+ return () => {
31498
+ if (this.callback === callback) {
31499
+ this.callback = undefined;
31500
+ }
31501
+ };
31502
+ }
31503
+ /**
31504
+ * Subscribes to the host's "clear persisted diagram" command.
31505
+ *
31506
+ * @param onClear Called whenever the event fires.
31507
+ * @returns A {@link Subscription} that, when called, removes the listener.
31508
+ */
31509
+ subscribeToClearDiagramStorage(onClear) {
31510
+ const target = service(WindowService).getWindow();
31511
+ target.addEventListener(CLEAR_DIAGRAM_STORAGE_EVENT, onClear);
31512
+ return () => target.removeEventListener(CLEAR_DIAGRAM_STORAGE_EVENT, onClear);
31513
+ }
31514
+ };
31515
+ EventService.ID = 'EventService';
31516
+ EventService = __decorate$3([
31517
+ Service
31518
+ ], EventService);
31519
+
31419
31520
  var __decorate$2 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
31420
31521
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
31421
31522
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
31422
31523
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
31423
31524
  return c > 3 && r && Object.defineProperty(target, key, r), r;
31424
31525
  };
31526
+ var ErrorService_1;
31527
+ /**
31528
+ * Service that collects the failures of the wrapper and the fork, so they can be announced to the host.
31529
+ */
31530
+ let ErrorService = ErrorService_1 = class ErrorService {
31531
+ constructor() {
31532
+ this.eventService = service(EventService);
31533
+ this.reported = new WeakSet();
31534
+ }
31535
+ /**
31536
+ * Reports a failure to the host, unless it's an abort, or this exact error object is already reported
31537
+ * from another place.
31538
+ *
31539
+ * The same error object may be reported from different places. E.g. a query that fails while a diagram loads is
31540
+ * reported by the data provider decorator as `data-fetch`, and then reaches the `catch` around the load, which
31541
+ * reports it as `diagram-load`. Only the first one is announced.
31542
+ *
31543
+ * The `cause` is checked because the fork wraps whatever fails during a diagram import in a new error:
31544
+ *
31545
+ * ```ts
31546
+ * // reactodia-workspace/src/editor/dataDiagramModel.ts, importLayout
31547
+ * } catch (error) {
31548
+ * throw new Error('Reactodia: failed to import a layout', {cause: error});
31549
+ * }
31550
+ * ```
31551
+ *
31552
+ * We need to check the cause to make sure we don't report the same error/abort more than once.
31553
+ *
31554
+ * @param code The category of the failure.
31555
+ * @param thrown The thrown value.
31556
+ */
31557
+ report(code, thrown) {
31558
+ const causes = this.causeChain(thrown);
31559
+ if (this.isAbortedOrAlreadyReported(causes)) {
31560
+ return;
31561
+ }
31562
+ causes.forEach((cause) => this.reported.add(cause));
31563
+ this.eventService.emit({ type: EventType.ERROR, payload: { code, error: thrown } });
31564
+ }
31565
+ /**
31566
+ * Whether any link of the given cause chain is an abort or is already reported.
31567
+ */
31568
+ isAbortedOrAlreadyReported(causes) {
31569
+ return causes.some((cause) => cause.name === ErrorService_1.ABORT_ERROR_NAME || this.reported.has(cause));
31570
+ }
31571
+ /**
31572
+ * The thrown value followed by its `cause`, the cause of that, and so on, for as long as they are objects.
31573
+ */
31574
+ causeChain(thrown) {
31575
+ const causes = [];
31576
+ let current = thrown;
31577
+ while (typeof current === 'object' && current !== null && !causes.includes(current)) {
31578
+ causes.push(current);
31579
+ current = current.cause;
31580
+ }
31581
+ return causes;
31582
+ }
31583
+ };
31584
+ ErrorService.ID = 'ErrorService';
31585
+ ErrorService.ABORT_ERROR_NAME = 'AbortError';
31586
+ ErrorService = ErrorService_1 = __decorate$2([
31587
+ Service
31588
+ ], ErrorService);
31589
+
31590
+ var __decorate$1 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
31591
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
31592
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
31593
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
31594
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
31595
+ };
31425
31596
  var DiagramStorageService_1;
31426
31597
  /**
31427
31598
  * Service for local store-related diagram operations
31428
31599
  */
31429
31600
  let DiagramStorageService = DiagramStorageService_1 = class DiagramStorageService {
31601
+ constructor() {
31602
+ this.errorService = service(ErrorService);
31603
+ }
31430
31604
  /**
31431
31605
  * Load the persisted diagram from the local store, or `undefined` when nothing is stored (or the stored value
31432
31606
  * is unreadable).
31433
31607
  */
31434
31608
  load() {
31435
- const raw = this.storage.getItem(DiagramStorageService_1.STORAGE_KEY);
31436
- if (!raw) {
31609
+ try {
31610
+ const raw = this.storage.getItem(DiagramStorageService_1.STORAGE_KEY);
31611
+ if (!raw) {
31612
+ return undefined;
31613
+ }
31614
+ return JSON.parse(raw);
31615
+ }
31616
+ catch (error) {
31617
+ this.errorService.report(ErrorCode.LOCAL_DIAGRAM_READ, error);
31437
31618
  return undefined;
31438
31619
  }
31439
- return JSON.parse(raw);
31440
31620
  }
31441
31621
  /**
31442
31622
  * Persists the given diagram serialization.
31443
31623
  */
31444
31624
  save(diagram) {
31445
- this.storage.setItem(DiagramStorageService_1.STORAGE_KEY, JSON.stringify(diagram));
31625
+ try {
31626
+ this.storage.setItem(DiagramStorageService_1.STORAGE_KEY, JSON.stringify(diagram));
31627
+ }
31628
+ catch (error) {
31629
+ this.errorService.report(ErrorCode.LOCAL_DIAGRAM_SAVE, error);
31630
+ }
31446
31631
  }
31447
31632
  /**
31448
31633
  * Removes the persisted diagram. Used when a new view (a seed) should take precedence over
@@ -31460,37 +31645,10 @@ let DiagramStorageService = DiagramStorageService_1 = class DiagramStorageServic
31460
31645
  };
31461
31646
  DiagramStorageService.ID = 'DiagramStorageService';
31462
31647
  DiagramStorageService.STORAGE_KEY = 'diagram.state';
31463
- DiagramStorageService = DiagramStorageService_1 = __decorate$2([
31648
+ DiagramStorageService = DiagramStorageService_1 = __decorate$1([
31464
31649
  Service
31465
31650
  ], DiagramStorageService);
31466
31651
 
31467
- var __decorate$1 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
31468
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
31469
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
31470
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
31471
- return c > 3 && r && Object.defineProperty(target, key, r), r;
31472
- };
31473
- /**
31474
- * Service for event based operations
31475
- */
31476
- let EventService = class EventService {
31477
- /**
31478
- * Subscribes to the host's "clear persisted diagram" command.
31479
- *
31480
- * @param onClear Called whenever the event fires.
31481
- * @returns A {@link Subscription} that, when called, removes the listener.
31482
- */
31483
- subscribeToClearDiagramStorage(onClear) {
31484
- const target = service(WindowService).getWindow();
31485
- target.addEventListener(CLEAR_DIAGRAM_STORAGE_EVENT, onClear);
31486
- return () => target.removeEventListener(CLEAR_DIAGRAM_STORAGE_EVENT, onClear);
31487
- }
31488
- };
31489
- EventService.ID = 'EventService';
31490
- EventService = __decorate$1([
31491
- Service
31492
- ], EventService);
31493
-
31494
31652
  /**
31495
31653
  * A collection of {@link Subscription}s that can be released together. Components collect the
31496
31654
  * subscriptions they open and call {@link unsubscribeAll} on teardown so nothing is left
@@ -31652,6 +31810,7 @@ function GraphwiseMenu() {
31652
31810
  const t = useTranslation();
31653
31811
  const diagramFileService = service(DiagramFileService);
31654
31812
  const diagramService = service(DiagramService);
31813
+ const errorService = service(ErrorService);
31655
31814
  const downloadDiagram = () => {
31656
31815
  const timestamp = new Date().toISOString().replace(/[-:]|\.\d+Z$/g, '');
31657
31816
  diagramFileService.download(model.exportLayout(), `diagram-${timestamp}${DiagramFileService.FILE_EXTENSION}`);
@@ -31662,7 +31821,7 @@ function GraphwiseMenu() {
31662
31821
  await diagramService.importDiagram(model, model.dataProvider, diagram);
31663
31822
  }
31664
31823
  catch (error) {
31665
- console.error('Failed to upload the diagram', error);
31824
+ errorService.report(ErrorCode.DIAGRAM_IMPORT, error);
31666
31825
  }
31667
31826
  };
31668
31827
  return reactExports.createElement(reactExports.Fragment, null, reactExports.createElement(ToolbarActionClearAll, {}), reactExports.createElement(ToolbarActionExport, { kind: 'exportRaster' }), reactExports.createElement(ToolbarActionExport, { kind: 'exportSvg' }), reactExports.createElement(ToolbarActionExport, { kind: 'print' }), reactExports.createElement(ToolbarAction,
@@ -31700,18 +31859,36 @@ const subscriptions = new SubscriptionList();
31700
31859
  let diagramStorageSubscription;
31701
31860
  const diagramService = service(DiagramService);
31702
31861
  const diagramStorageService = service(DiagramStorageService);
31703
- const eventService = service(EventService);
31862
+ const eventService$1 = service(EventService);
31863
+ const errorService$1 = service(ErrorService);
31864
+ /**
31865
+ * Reports every failed data provider call, unless the call was aborted, and passes the failure on to the caller.
31866
+ */
31867
+ const reportDataFetchError = async (_method, params, body) => {
31868
+ var _a;
31869
+ try {
31870
+ return await body(params);
31871
+ }
31872
+ catch (error) {
31873
+ if (!((_a = params.signal) === null || _a === void 0 ? void 0 : _a.aborted)) {
31874
+ errorService$1.report(ErrorCode.DATA_FETCH, error);
31875
+ }
31876
+ throw error;
31877
+ }
31878
+ };
31704
31879
  /**
31705
31880
  * Builds a Reactodia {@link SparqlDataProvider} for the given endpoint using the supplied
31706
31881
  * query preset. The host owns the query configuration and always passes it in via props.
31882
+ * The provider is decorated, so its failed calls are reported.
31707
31883
  */
31708
31884
  function createDataProvider(props) {
31709
31885
  const { currentRepository, config, providerSettings } = props;
31710
- return new SparqlDataProvider({
31886
+ const baseProvider = new SparqlDataProvider({
31711
31887
  endpointUrl: currentRepository,
31712
31888
  queryMethod: 'POST',
31713
31889
  queryFunction: config.queryFunction
31714
31890
  }, providerSettings);
31891
+ return new DecoratedDataProvider({ baseProvider, decorator: reportDataFetchError });
31715
31892
  }
31716
31893
  /**
31717
31894
  * Places the seed entities on the canvas. Each IRI is added as a placeholder element, and data is then loaded for the
@@ -31779,7 +31956,7 @@ function subscribeToDiagramChange(model) {
31779
31956
  * @param model The diagram model whose edits are persisted
31780
31957
  */
31781
31958
  function onClearDiagramStorage(model) {
31782
- subscriptions.add(eventService.subscribeToClearDiagramStorage(() => {
31959
+ subscriptions.add(eventService$1.subscribeToClearDiagramStorage(() => {
31783
31960
  // re-subscribe, to avoid any pending debounced saves, which may write over the cleared diagram
31784
31961
  subscribeToDiagramChange(model);
31785
31962
  diagramStorageService.clear();
@@ -31806,22 +31983,31 @@ function ReactodiaApp(props) {
31806
31983
  const dataProvider = createDataProvider(props);
31807
31984
  const isReload = props.isReload;
31808
31985
  const savedDiagram = diagramStorageService.load();
31809
- if (isReload) {
31810
- // Reload the diagram that is currently on the canvas. This may happen when the host changes the provider
31811
- // settings, or when the user switches the language at runtime, since there is no existing mechanism to
31812
- // re-translate the UI at runtime (not for the UI labels at least)
31813
- await diagramService.importDiagram(model, dataProvider, currentDiagram, signal);
31814
- }
31815
- else if ((_a = config.seedIris) === null || _a === void 0 ? void 0 : _a.length) {
31816
- await seedIrisToCanvas(context, dataProvider, config.seedIris, signal);
31817
- }
31818
- else if ((_b = config.seedGraph) === null || _b === void 0 ? void 0 : _b.length) {
31819
- await seedGraphToCanvas(context, dataProvider, config.seedGraph, signal);
31986
+ try {
31987
+ if (isReload) {
31988
+ // Reload the diagram that is currently on the canvas. This may happen when the host changes the provider
31989
+ // settings, or when the user switches the language at runtime, since there is no existing mechanism to
31990
+ // re-translate the UI at runtime (not for the UI labels at least)
31991
+ await diagramService.importDiagram(model, dataProvider, currentDiagram, signal);
31992
+ }
31993
+ else if ((_a = config.seedIris) === null || _a === void 0 ? void 0 : _a.length) {
31994
+ await seedIrisToCanvas(context, dataProvider, config.seedIris, signal);
31995
+ }
31996
+ else if ((_b = config.seedGraph) === null || _b === void 0 ? void 0 : _b.length) {
31997
+ await seedGraphToCanvas(context, dataProvider, config.seedGraph, signal);
31998
+ }
31999
+ else {
32000
+ // Restore the previously saved layout when present, otherwise start empty. Either way this binds the
32001
+ // data provider (savedDiagram is undefined -> empty diagram), so the unified search/lookup works.
32002
+ await diagramService.importDiagram(model, dataProvider, savedDiagram, signal);
32003
+ }
31820
32004
  }
31821
- else {
31822
- // Restore the previously saved layout when present, otherwise start empty. Either way this binds the
31823
- // data provider (savedDiagram is undefined -> empty diagram), so the unified search/lookup works.
31824
- await diagramService.importDiagram(model, dataProvider, savedDiagram, signal);
32005
+ catch (error) {
32006
+ if (!signal.aborted) {
32007
+ errorService$1.report(ErrorCode.DIAGRAM_LOAD, error);
32008
+ }
32009
+ // rethrow, so the workspace shows the failure on its loading spinner
32010
+ throw error;
31825
32011
  }
31826
32012
  }, [language]);
31827
32013
  /**
@@ -31858,7 +32044,7 @@ function mountReactodia(container, props) {
31858
32044
  /**
31859
32045
  * Re-points the diagram at a new SPARQL endpoint by recreating it with a fresh data provider.
31860
32046
  * The canvas is reset to empty, matching the initial mount, since the data of another repository
31861
- * has nothing to do with the current graph.
32047
+ * has nothing to do with the current graph. A failure is reported, not thrown.
31862
32048
  */
31863
32049
  async function updateReactodia(props) {
31864
32050
  if (!workspaceContext) {
@@ -31866,7 +32052,12 @@ async function updateReactodia(props) {
31866
32052
  }
31867
32053
  const { model } = workspaceContext;
31868
32054
  const dataProvider = createDataProvider(props);
31869
- await model.createNewDiagram({ dataProvider });
32055
+ try {
32056
+ await model.createNewDiagram({ dataProvider });
32057
+ }
32058
+ catch (error) {
32059
+ errorService$1.report(ErrorCode.DIAGRAM_LOAD, error);
32060
+ }
31870
32061
  }
31871
32062
  /**
31872
32063
  * Serializes the current diagram so it can be restored after a remount (e.g. when a
@@ -31885,9 +32076,13 @@ function unmountReactodia(root) {
31885
32076
 
31886
32077
  const graphwiseReactodiaCss = "graphwise-reactodia{--_graphwise-reactodia-type-color-01:var(--graphwise-reactodia-type-color-01);--_graphwise-reactodia-type-color-02:var(--graphwise-reactodia-type-color-02);--_graphwise-reactodia-type-color-03:var(--graphwise-reactodia-type-color-03);--_graphwise-reactodia-type-color-04:var(--graphwise-reactodia-type-color-04);--_graphwise-reactodia-type-color-05:var(--graphwise-reactodia-type-color-05);--_graphwise-reactodia-type-color-06:var(--graphwise-reactodia-type-color-06);--_graphwise-reactodia-type-color-07:var(--graphwise-reactodia-type-color-07);--_graphwise-reactodia-type-color-08:var(--graphwise-reactodia-type-color-08);--_graphwise-reactodia-type-color-09:var(--graphwise-reactodia-type-color-09);--_graphwise-reactodia-type-color-10:var(--graphwise-reactodia-type-color-10);--_graphwise-reactodia-type-color-11:var(--graphwise-reactodia-type-color-11);--_graphwise-reactodia-type-color-12:var(--graphwise-reactodia-type-color-12);--_graphwise-reactodia-type-color-13:var(--graphwise-reactodia-type-color-13);--_graphwise-reactodia-type-color-14:var(--graphwise-reactodia-type-color-14);--_graphwise-reactodia-type-color-15:var(--graphwise-reactodia-type-color-15);--_graphwise-reactodia-type-color-16:var(--graphwise-reactodia-type-color-16);--_graphwise-reactodia-type-color-17:var(--graphwise-reactodia-type-color-17);--_graphwise-reactodia-type-color-18:var(--graphwise-reactodia-type-color-18);--_graphwise-reactodia-type-color-19:var(--graphwise-reactodia-type-color-19);--_graphwise-reactodia-type-color-20:var(--graphwise-reactodia-type-color-20);--_graphwise-reactodia-type-color-contrast:var(--graphwise-reactodia-type-color-contrast, #fff)}graphwise-reactodia{display:block;width:100%;height:100%}graphwise-reactodia .reactodia-container{position:relative;width:100%;height:100%}graphwise-reactodia .reactodia-selection-action__link{display:none}graphwise-reactodia .reactodia-standard-element__thumbnail:not(:has(img)){background:var(--reactodia-element-style-color);border-radius:50%;color:var(--_graphwise-reactodia-type-color-contrast)}";
31887
32078
 
32079
+ const errorService = service(ErrorService);
32080
+ const eventService = service(EventService);
31888
32081
  const GraphwiseReactodia = class {
31889
32082
  constructor(hostRef) {
31890
32083
  registerInstance(this, hostRef);
32084
+ this.eventEmitter = createEvent(this, "graphwiseReactodiaEvent");
32085
+ this.subscriptions = new SubscriptionList();
31891
32086
  /**
31892
32087
  * UI language code (e.g. `en`, `fr`) for the Reactodia interface. Defaults to English.
31893
32088
  */
@@ -31915,6 +32110,7 @@ const GraphwiseReactodia = class {
31915
32110
  this.renderGraph(true);
31916
32111
  }
31917
32112
  connectedCallback() {
32113
+ this.subscribeToEvents();
31918
32114
  this.renderGraph();
31919
32115
  }
31920
32116
  componentDidLoad() {
@@ -31922,13 +32118,17 @@ const GraphwiseReactodia = class {
31922
32118
  this.renderGraph();
31923
32119
  }
31924
32120
  disconnectedCallback() {
32121
+ this.subscriptions.unsubscribeAll();
31925
32122
  if (this.reactRoot) {
31926
32123
  unmountReactodia(this.reactRoot);
31927
32124
  this.reactRoot = undefined;
31928
32125
  }
31929
32126
  }
31930
32127
  render() {
31931
- return (h(Host, { key: 'a03aad892cb1947ab2426d77b3229e1324776c2c' }));
32128
+ return (h(Host, { key: '2e8541c791f478484c4bad64ad758df99aba2059' }));
32129
+ }
32130
+ subscribeToEvents() {
32131
+ this.subscriptions.add(eventService.subscribe((detail) => this.eventEmitter.emit(detail)));
31932
32132
  }
31933
32133
  renderGraph(isReloading) {
31934
32134
  var _a;
@@ -31936,13 +32136,13 @@ const GraphwiseReactodia = class {
31936
32136
  return;
31937
32137
  }
31938
32138
  if (!this.currentRepository) {
31939
- throw new Error('currentRepository is required');
32139
+ throw this.reportMissingPropError('currentRepository is required');
31940
32140
  }
31941
32141
  if (!((_a = this.config) === null || _a === void 0 ? void 0 : _a.queryFunction)) {
31942
- throw new Error('config.queryFunction is required');
32142
+ throw this.reportMissingPropError('config.queryFunction is required');
31943
32143
  }
31944
32144
  if (!this.providerSettings) {
31945
- throw new Error('providerSettings is required');
32145
+ throw this.reportMissingPropError('providerSettings is required');
31946
32146
  }
31947
32147
  if (!this.hostElement) {
31948
32148
  return;
@@ -31962,6 +32162,11 @@ const GraphwiseReactodia = class {
31962
32162
  this.reactRoot = mountReactodia(this.hostElement, props);
31963
32163
  }
31964
32164
  }
32165
+ reportMissingPropError(message) {
32166
+ const error = new Error(message);
32167
+ errorService.report(ErrorCode.MISSING_REQUIRED_PROP, error);
32168
+ return error;
32169
+ }
31965
32170
  get hostElement() { return getElement(this); }
31966
32171
  static get watchers() { return {
31967
32172
  "currentRepository": ["onCurrentRepositoryChange"],
@@ -1,5 +1,5 @@
1
- import { p as promiseResolve, b as bootstrapLazy } from './index-Cypw7ydc.js';
2
- export { s as setNonce } from './index-Cypw7ydc.js';
1
+ import { p as promiseResolve, b as bootstrapLazy } from './index-DpCR6zMg.js';
2
+ export { s as setNonce } from './index-DpCR6zMg.js';
3
3
  import { g as globalScripts } from './app-globals-CalY52z6.js';
4
4
 
5
5
  /*
@@ -287,6 +287,21 @@ var parsePropertyValue = (propValue, propType, isFormAssociated) => {
287
287
  return propValue;
288
288
  };
289
289
  var getElement = (ref) => getHostRef(ref).$hostElement$ ;
290
+
291
+ // src/runtime/event-emitter.ts
292
+ var createEvent = (ref, name, flags) => {
293
+ const elm = getElement(ref);
294
+ return {
295
+ emit: (detail) => {
296
+ return emitEvent(elm, name, {
297
+ bubbles: true,
298
+ composed: true,
299
+ cancelable: true,
300
+ detail
301
+ });
302
+ }
303
+ };
304
+ };
290
305
  var emitEvent = (elm, name, opts) => {
291
306
  const ev = plt.ce(name, opts);
292
307
  elm.dispatchEvent(ev);
@@ -1201,4 +1216,4 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
1201
1216
  // src/runtime/nonce.ts
1202
1217
  var setNonce = (nonce) => plt.$nonce$ = nonce;
1203
1218
 
1204
- export { Host as H, bootstrapLazy as b, getElement as g, h, promiseResolve as p, registerInstance as r, setNonce as s };
1219
+ export { Host as H, bootstrapLazy as b, createEvent as c, getElement as g, h, promiseResolve as p, registerInstance as r, setNonce as s };
package/dist/esm/index.js CHANGED
@@ -1,7 +1,8 @@
1
+ export { C as CLEAR_DIAGRAM_STORAGE_EVENT, a as ErrorCode, E as EventType } from './error-code-DHI2bePh.js';
2
+
1
3
  /**
2
- * Event name for clearing the local store state of the diagram. There is an event listener listening for it, which
3
- * will clear the local store state, whenever this event is fired.
4
+ * Name of the DOM event the `graphwise-reactodia` element dispatches for every event.
4
5
  */
5
- const CLEAR_DIAGRAM_STORAGE_EVENT = 'graphwise-reactodia:clear-diagram-storage';
6
+ const GRAPHWISE_REACTODIA_EVENT = 'graphwiseReactodiaEvent';
6
7
 
7
- export { CLEAR_DIAGRAM_STORAGE_EVENT };
8
+ export { GRAPHWISE_REACTODIA_EVENT };
@@ -1,5 +1,5 @@
1
- import { b as bootstrapLazy } from './index-Cypw7ydc.js';
2
- export { s as setNonce } from './index-Cypw7ydc.js';
1
+ import { b as bootstrapLazy } from './index-DpCR6zMg.js';
2
+ export { s as setNonce } from './index-DpCR6zMg.js';
3
3
  import { g as globalScripts } from './app-globals-CalY52z6.js';
4
4
 
5
5
  const defineCustomElements = async (win, options) => {
@@ -1 +1 @@
1
- import{p as e,b as r}from"./p-Cypw7ydc.js";export{s as setNonce}from"./p-Cypw7ydc.js";import{g as t}from"./p-CalY52z6.js";(()=>{const r=import.meta.url,t={};return""!==r&&(t.resourcesUrl=new URL(".",r).href),e(t)})().then((async e=>(await t(),r([["p-20637a6f",[[0,"graphwise-reactodia",{currentRepository:[1,"current-repository"],config:[16],language:[1],providerSettings:[16,"provider-settings"],theme:[1]},null,{currentRepository:["onCurrentRepositoryChange"],language:["onLanguageOrSettingsChange"],providerSettings:["onLanguageOrSettingsChange"],theme:["onThemeChange"]}]]]],e))));
1
+ import{p as e,b as r}from"./p-DpCR6zMg.js";export{s as setNonce}from"./p-DpCR6zMg.js";import{g as t}from"./p-CalY52z6.js";(()=>{const r=import.meta.url,t={};return""!==r&&(t.resourcesUrl=new URL(".",r).href),e(t)})().then((async e=>(await t(),r([["p-abfb5091",[[0,"graphwise-reactodia",{currentRepository:[1,"current-repository"],config:[16],language:[1],providerSettings:[16,"provider-settings"],theme:[1]},null,{currentRepository:["onCurrentRepositoryChange"],language:["onLanguageOrSettingsChange"],providerSettings:["onLanguageOrSettingsChange"],theme:["onThemeChange"]}]]]],e))));
@@ -1 +1 @@
1
- const a="graphwise-reactodia:clear-diagram-storage";export{a as CLEAR_DIAGRAM_STORAGE_EVENT}
1
+ export{C as CLEAR_DIAGRAM_STORAGE_EVENT,a as ErrorCode,E as EventType}from"./p-DHI2bePh.js";const e="graphwiseReactodiaEvent";export{e as GRAPHWISE_REACTODIA_EVENT}
@@ -0,0 +1 @@
1
+ const a="graphwise-reactodia:clear-diagram-storage";var r,i;!function(a){a.ERROR="error"}(r||(r={})),function(a){a.MISSING_REQUIRED_PROP="missing-required-prop",a.DATA_FETCH="data-fetch",a.DIAGRAM_LOAD="diagram-load",a.DIAGRAM_IMPORT="diagram-import",a.LOCAL_DIAGRAM_READ="local-diagram-read",a.LOCAL_DIAGRAM_SAVE="local-diagram-save"}(i||(i={}));export{a as C,r as E,i as a}
@@ -0,0 +1,2 @@
1
+ var e=Object.defineProperty,t=e=>{if(e.__stencil__getHostRef)return e.__stencil__getHostRef()},n=(e,t)=>{e.__stencil__getHostRef=()=>t,t.t=e},o=(e,t)=>(0,console.error)(e,t),l=new Map,i=new Map,s="slot-fb{display:contents}slot-fb[hidden]{display:none}",r="undefined"!=typeof window?window:{},c={o:0,l:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,t,n,o)=>e.addEventListener(t,n,o),rel:(e,t,n,o)=>e.removeEventListener(t,n,o),ce:(e,t)=>new CustomEvent(e,t)},u=e=>Promise.resolve(e),a=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync}catch(e){}return!1})(),f=!1,d=[],h=[],p=(e,t)=>n=>{e.push(n),f||(f=!0,t&&4&c.o?y(v):c.raf(v))},m=e=>{for(let t=0;t<e.length;t++)try{e[t](performance.now())}catch(e){o(e)}e.length=0},v=()=>{m(d),m(h),(f=d.length>0)&&c.raf(v)},y=e=>u().then(e),b=p(h,!0),$=e=>"object"==(e=typeof e)||"function"===e;function w(e){var t,n,o;return null!=(o=null==(n=null==(t=e.head)?void 0:t.querySelector('meta[name="csp-nonce"]'))?void 0:n.getAttribute("content"))?o:void 0}((t,n)=>{for(var o in n)e(t,o,{get:n[o],enumerable:!0})})({},{err:()=>S,map:()=>j,ok:()=>g,unwrap:()=>k,unwrapErr:()=>O});var g=e=>({isOk:!0,isErr:!1,value:e}),S=e=>({isOk:!1,isErr:!0,value:e});function j(e,t){if(e.isOk){const n=t(e.value);return n instanceof Promise?n.then((e=>g(e))):g(n)}if(e.isErr)return S(e.value);throw"should never get here"}var k=e=>{if(e.isOk)return e.value;throw e.value},O=e=>{if(e.isErr)return e.value;throw e.value},E=(e,t,...n)=>{let o=null,l=null,i=!1,s=!1;const r=[],c=t=>{for(let n=0;n<t.length;n++)o=t[n],Array.isArray(o)?c(o):null!=o&&"boolean"!=typeof o&&((i="function"!=typeof e&&!$(o))&&(o+=""),i&&s?r[r.length-1].i+=o:r.push(i?C(null,o):o),s=i)};c(n),t&&t.key&&(l=t.key);const u=C(e,null);return u.u=t,r.length>0&&(u.h=r),u.p=l,u},C=(e,t)=>({o:0,m:e,i:t,v:null,h:null,u:null,p:null}),M={},P=e=>{const t=(e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"))(e);return RegExp(`(^|[^@]|@(?!supports\\s+selector\\s*\\([^{]*?${t}))(${t}\\b)`,"g")};P("::slotted"),P(":host"),P(":host-context");var x,D=(e,t)=>null==e||$(e)?e:1&t?e+"":e,R=e=>t(e).$hostElement$,W=(e,t)=>{const n=R(e);return{emit:e=>A(n,t,{bubbles:!0,composed:!0,cancelable:!0,detail:e})}},A=(e,t,n)=>{const o=c.ce(t,n);return e.dispatchEvent(o),o},N=new WeakMap,U=e=>"sc-"+e.$,H=(e,t,n,o)=>{n!==o&&t.toLowerCase()},L=(e,t)=>{const n=e&&e.u||{},o=t.u||{};for(const e of T(Object.keys(n)))e in o||H(0,e,n[e],void 0);for(const e of T(Object.keys(o)))H(0,e,n[e],o[e])};function T(e){return e.includes("ref")?[...e.filter((e=>"ref"!==e)),"ref"]:e}var z=(e,t,n)=>{const o=t.h[n];let l,i,s=0;if(!r.document)throw Error("You are trying to render a Stencil component in an environment that doesn't support the DOM. Make sure to populate the [`window`](https://developer.mozilla.org/en-US/docs/Web/API/Window/window) object before rendering a component.");if(l=o.v=r.document.createElement(o.m),L(null,o),o.h)for(s=0;s<o.h.length;++s)i=z(e,o,s),i&&l.appendChild(i);return l["s-hn"]=x,l},F=(e,t,n,o,l,i)=>{let s,r=e;for(;l<=i;++l)o[l]&&(s=z(null,n,l),s&&(o[l].v=s,V(r,s,t)))},q=(e,t,n)=>{for(let o=t;o<=n;++o){const t=e[o];if(t){const e=t.v;e&&e.remove()}}},G=(e,t,n=!1)=>e.m===t.m&&(n?(n&&!e.p&&t.p&&(e.p=t.p),!0):e.p===t.p),I=(e,t,n=!1)=>{const o=t.v=e.v,l=e.h,i=t.h;L(e,t),null!==l&&null!==i?((e,t,n,o,l=!1)=>{let i,s,r=0,c=0,u=0,a=0,f=t.length-1,d=t[0],h=t[f],p=o.length-1,m=o[0],v=o[p];for(;r<=f&&c<=p;)if(null==d)d=t[++r];else if(null==h)h=t[--f];else if(null==m)m=o[++c];else if(null==v)v=o[--p];else if(G(d,m,l))I(d,m,l),d=t[++r],m=o[++c];else if(G(h,v,l))I(h,v,l),h=t[--f],v=o[--p];else if(G(d,v,l))I(d,v,l),V(e,d.v,h.v.nextSibling),d=t[++r],v=o[--p];else if(G(h,m,l))I(h,m,l),V(e,h.v,d.v),h=t[--f],m=o[++c];else{for(u=-1,a=r;a<=f;++a)if(t[a]&&null!==t[a].p&&t[a].p===m.p){u=a;break}u>=0?(s=t[u],s.m!==m.m?i=z(t&&t[c],n,u):(I(s,m,l),t[u]=void 0,i=s.v),m=o[++c]):(i=z(t&&t[c],n,c),m=o[++c]),i&&V(d.v.parentNode,i,d.v)}r>f?F(e,null==o[p+1]?null:o[p+1].v,n,o,c,p):c>p&&q(t,r,f)})(o,l,t,i,n):null!==i?F(o,null,t,i,0,i.length-1):!n&&null!==l&&q(l,0,l.length-1)},V=(e,t,n)=>null==e?void 0:e.insertBefore(t,n),Y=(e,t)=>{if(t&&!e.S&&t["s-p"]){const n=t["s-p"].push(new Promise((o=>e.S=()=>{t["s-p"].splice(n-1,1),o()})))}},_=(e,t)=>{if(e.o|=16,!(4&e.o))return Y(e,e.j),b((()=>B(e,t)));e.o|=512},B=(e,t)=>{const n=e.$hostElement$,o=e.t;if(!o)throw Error(`Can't render component <${n.tagName.toLowerCase()} /> with invalid Stencil runtime! Make sure this imported component is compiled with a \`externalRuntime: true\` flag. For more information, please refer to https://stenciljs.com/docs/custom-elements#externalruntime`);let l;return l=te(o,t?"componentWillLoad":"componentWillUpdate",void 0,n),l=J(l,(()=>te(o,"componentWillRender",void 0,n))),J(l,(()=>Q(e,o,t)))},J=(e,t)=>K(e)?e.then(t).catch((e=>{console.error(e),t()})):t(),K=e=>e instanceof Promise||e&&e.then&&"function"==typeof e.then,Q=async(e,t,n)=>{var o;const l=e.$hostElement$,u=l["s-rc"];n&&(e=>{const t=e.k;((e,t)=>{var n;const o=U(t),l=i.get(o);if(!r.document)return o;if(e=11===e.nodeType?e:r.document,l)if("string"==typeof l){let i,u=N.get(e=e.head||e);if(u||N.set(e,u=new Set),!u.has(o)){{i=r.document.createElement("style"),i.innerHTML=l;const o=null!=(n=c.O)?n:w(r.document);if(null!=o&&i.setAttribute("nonce",o),!(1&t.o))if("HEAD"===e.nodeName){const t=e.querySelectorAll("link[rel=preconnect]"),n=t.length>0?t[t.length-1].nextSibling:e.querySelector("style");e.insertBefore(i,(null==n?void 0:n.parentNode)===e?n:null)}else if("host"in e)if(a){const t=new CSSStyleSheet;t.replaceSync(l),e.adoptedStyleSheets=[t,...e.adoptedStyleSheets]}else{const t=e.querySelector("style");t?t.innerHTML=l+t.innerHTML:e.prepend(i)}else e.append(i);1&t.o&&e.insertBefore(i,null)}4&t.o&&(i.innerHTML+=s),u&&u.add(o)}}else e.adoptedStyleSheets.includes(l)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,l])})(e.$hostElement$.getRootNode(),t)})(e);X(e,t,l,n),u&&(u.map((e=>e())),l["s-rc"]=void 0);{const t=null!=(o=l["s-p"])?o:[],n=()=>Z(e);0===t.length?n():(Promise.all(t).then(n),e.o|=4,t.length=0)}},X=(e,t,n,l)=>{try{t=t.render(),e.o&=-17,e.o|=2,((e,t,n=!1)=>{const o=e.$hostElement$,l=e.C||C(null,null),i=(e=>e&&e.m===M)(t)?t:E(null,null,t);if(x=o.tagName,n&&i.u)for(const e of Object.keys(i.u))o.hasAttribute(e)&&!["key","ref","style","class"].includes(e)&&(i.u[e]=o[e]);i.m=null,i.o|=4,e.C=i,i.v=l.v=o,I(l,i,n)})(e,t,l)}catch(t){o(t,e.$hostElement$)}return null},Z=e=>{const t=e.$hostElement$,n=e.t,o=e.j;te(n,"componentDidRender",void 0,t),64&e.o?te(n,"componentDidUpdate",void 0,t):(e.o|=64,ne(t),te(n,"componentDidLoad",void 0,t),e.M(t),o||ee()),e.S&&(e.S(),e.S=void 0),512&e.o&&y((()=>_(e,!1))),e.o&=-517},ee=()=>{y((()=>A(r,"appload",{detail:{namespace:"graphwise-reactodia"}})))},te=(e,t,n,l)=>{if(e&&e[t])try{return e[t](n)}catch(e){o(e,l)}},ne=e=>e.classList.add("hydrated"),oe=(e,n,l,i)=>{const s=t(e);if(!s)throw Error(`Couldn't find host element for "${i.$}" as it is unknown to this Stencil runtime. This usually happens when integrating a 3rd party Stencil component with another Stencil component or application. Please reach out to the maintainers of the 3rd party Stencil component or report this on the Stencil Discord server (https://chat.stenciljs.com) or comment on this similar [GitHub issue](https://github.com/stenciljs/core/issues/5457).`);const r=s.$hostElement$,c=s.P.get(n),u=s.o,a=s.t;if(l=D(l,i.D[n][0]),(!(8&u)||void 0===c)&&l!==c&&(!Number.isNaN(c)||!Number.isNaN(l))&&(s.P.set(n,l),a)){if(i.R&&128&u){const e=i.R[n];e&&e.map((e=>{try{a[e](l,c,n)}catch(e){o(e,r)}}))}if(2==(18&u)){if(a.componentShouldUpdate&&!1===a.componentShouldUpdate(l,c,n))return;_(s,!1)}}},le=(e,n,o)=>{var l,i;const s=e.prototype;if(n.D||n.R||e.watchers){e.watchers&&!n.R&&(n.R=e.watchers);const r=Object.entries(null!=(l=n.D)?l:{});if(r.map((([e,[l]])=>{if(31&l||2&o&&32&l){const{get:i,set:r}=Object.getOwnPropertyDescriptor(s,e)||{};i&&(n.D[e][0]|=2048),r&&(n.D[e][0]|=4096),(1&o||!i)&&Object.defineProperty(s,e,{get(){{if(!(2048&n.D[e][0]))return((e,n)=>t(this).P.get(n))(0,e);const o=t(this),l=o?o.t:s;if(!l)return;return l[e]}},configurable:!0,enumerable:!0}),Object.defineProperty(s,e,{set(i){const s=t(this);if(r){const t=32&l?this[e]:s.$hostElement$[e];return void 0===t&&s.P.get(e)?i=s.P.get(e):!s.P.get(e)&&t&&s.P.set(e,t),r.call(this,D(i,l)),void oe(this,e,i=32&l?this[e]:s.$hostElement$[e],n)}{if(!(1&o&&4096&n.D[e][0]))return oe(this,e,i,n),void(1&o&&!s.t&&s.W.then((()=>{4096&n.D[e][0]&&s.t[e]!==s.P.get(e)&&(s.t[e]=i)})));const t=()=>{const t=s.t[e];!s.P.get(e)&&t&&s.P.set(e,t),s.t[e]=D(i,l),oe(this,e,s.t[e],n)};s.t?t():s.W.then((()=>t()))}}})}})),1&o){const o=new Map;s.attributeChangedCallback=function(e,l,i){c.jmp((()=>{var r;const c=o.get(e);if(this.hasOwnProperty(c))i=this[c],delete this[c];else{if(s.hasOwnProperty(c)&&"number"==typeof this[c]&&this[c]==i)return;if(null==c){const o=t(this),s=null==o?void 0:o.o;if(s&&!(8&s)&&128&s&&i!==l){const t=o.t,s=null==(r=n.R)?void 0:r[e];null==s||s.forEach((n=>{null!=t[n]&&t[n].call(t,i,l,e)}))}return}}const u=Object.getOwnPropertyDescriptor(s,c);(i=(null!==i||"boolean"!=typeof this[c])&&i)===this[c]||u.get&&!u.set||(this[c]=i)}))},e.observedAttributes=Array.from(new Set([...Object.keys(null!=(i=n.R)?i:{}),...r.filter((([e,t])=>15&t[0])).map((([e,t])=>{const n=t[1]||e;return o.set(n,e),n}))]))}}return e},ie=(e,t)=>{te(e,"connectedCallback",void 0,t)},se=(e,t)=>{te(e,"disconnectedCallback",void 0,t||e)},re=(e,n={})=>{var u;if(!r.document)return void console.warn("Stencil: No document found. Skipping bootstrapping lazy components.");const f=[],d=n.exclude||[],h=r.customElements,p=r.document.head,m=p.querySelector("meta[charset]"),v=r.document.createElement("style"),y=[];let b,$=!0;Object.assign(c,n),c.l=new URL(n.resourcesUrl||"./",r.document.baseURI).href;let g=!1;if(e.map((e=>{e[1].map((n=>{var s;const r={o:n[0],$:n[1],D:n[2],A:n[3]};4&r.o&&(g=!0),r.D=n[2],r.R=null!=(s=n[4])?s:{};const u=r.$,p=class extends HTMLElement{constructor(e){super(e),this.hasRegisteredEventListeners=!1,((e,t)=>{const n={o:0,$hostElement$:e,k:t,P:new Map};n.W=new Promise((e=>n.M=e)),e["s-p"]=[],e["s-rc"]=[];const o=n;e.__stencil__getHostRef=()=>o})(e=this,r)}connectedCallback(){this.hasRegisteredEventListeners||(this.hasRegisteredEventListeners=!0),b&&(clearTimeout(b),b=null),$?y.push(this):c.jmp((()=>(e=>{if(!(1&c.o)){const n=t(e),s=n.k,r=()=>{};if(1&n.o)(null==n?void 0:n.t)?ie(n.t,e):(null==n?void 0:n.W)&&n.W.then((()=>ie(n.t,e)));else{n.o|=1;{let t=e;for(;t=t.parentNode||t.host;)if(t["s-p"]){Y(n,n.j=t);break}}s.D&&Object.entries(s.D).map((([t,[n]])=>{if(31&n&&e.hasOwnProperty(t)){const n=e[t];delete e[t],e[t]=n}})),(async(e,t,n)=>{let s;if(!(32&t.o)){if(t.o|=32,n.N){const i=((e,t)=>{const n=e.$.replace(/-/g,"_"),i=e.N;if(!i)return;const s=l.get(i);return s?s[n]:import(`./${i}.entry.js`).then((e=>(l.set(i,e),e[n])),(e=>{o(e,t.$hostElement$)}))
2
+ /*!__STENCIL_STATIC_IMPORT_SWITCH__*/})(n,t);if(i&&"then"in i){const e=()=>{};s=await i,e()}else s=i;if(!s)throw Error(`Constructor for "${n.$}#${t.U}" was not found`);s.isProxied||(n.R=s.watchers,le(s,n,2),s.isProxied=!0);const r=()=>{};t.o|=8;try{new s(t)}catch(t){o(t,e)}t.o&=-9,t.o|=128,r(),ie(t.t,e)}else s=e.constructor,customElements.whenDefined(e.localName).then((()=>t.o|=128));if(s&&s.style){let e;"string"==typeof s.style&&(e=s.style);const t=U(n);if(!i.has(t)){const o=()=>{};((e,t,n)=>{let o=i.get(e);a&&n?(o=o||new CSSStyleSheet,"string"==typeof o?o=t:o.replaceSync(t)):o=t,i.set(e,o)})(t,e,!!(1&n.o)),o()}}}const r=t.j,c=()=>_(t,!0);r&&r["s-rc"]?r["s-rc"].push(c):c()})(e,n,s)}r()}})(this)))}disconnectedCallback(){c.jmp((()=>(async e=>{if(!(1&c.o)){const n=t(e);(null==n?void 0:n.t)?se(n.t,e):(null==n?void 0:n.W)&&n.W.then((()=>se(n.t,e)))}N.has(e)&&N.delete(e),e.shadowRoot&&N.has(e.shadowRoot)&&N.delete(e.shadowRoot)})(this))),c.raf((()=>{var e;const n=t(this),o=y.findIndex((e=>e===this));o>-1&&y.splice(o,1),(null==(e=null==n?void 0:n.C)?void 0:e.v)instanceof Node&&!n.C.v.isConnected&&delete n.C.v}))}componentOnReady(){return t(this).W}};r.N=e[0],d.includes(u)||h.get(u)||(f.push(u),h.define(u,le(p,r,1)))}))})),f.length>0&&(g&&(v.textContent+=s),v.textContent+=f.sort()+"{visibility:hidden}.hydrated{visibility:inherit}",v.innerHTML.length)){v.setAttribute("data-styles","");const e=null!=(u=c.O)?u:w(r.document);null!=e&&v.setAttribute("nonce",e),p.insertBefore(v,m?m.nextSibling:p.firstChild)}$=!1,y.length?y.map((e=>e.connectedCallback())):c.jmp((()=>b=setTimeout(ee,30)))},ce=e=>c.O=e;export{M as H,re as b,W as c,R as g,E as h,u as p,n as r,ce as s}