@qaecy/cue-ui 0.0.22 → 0.0.24

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.
package/README.md CHANGED
@@ -10,8 +10,10 @@ Drop them into any HTML page — no build step required.
10
10
  | `<cue-logo>` | Animated QAECY logo |
11
11
  | `<cue-document-viewer>` | Document viewer with Cue SDK integration (PDF, BIM, CAD, images, spreadsheets, …) |
12
12
  | `<cue-document-list>` | Lazy document list that fetches metadata from the Cue SDK |
13
+ | `<cue-entity-list>` | Lazy entity list that fetches entity data from the Cue SDK |
14
+ | `<cue-entity-viewer>` | Full entity detail view — info, relationships, documents, and optional map |
13
15
  | `<cue-id-builder>` | Interactive IFC/SPARQL ID builder |
14
- | `<cue-block-project-documents>` | Project documents content block |
16
+ | `<cue-block-project-documents>` | Project documents content block with charts and statistics |
15
17
 
16
18
  ---
17
19
 
@@ -25,7 +27,7 @@ The library ships as a **single script** that lazy-loads only the components you
25
27
  <head>
26
28
  <meta charset="utf-8" />
27
29
  <title>My Cue App</title>
28
- <!-- Component styles (menu, cards, typography, …) -->
30
+ <!-- Optional: component styles -->
29
31
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@qaecy/cue-ui/styles.css" />
30
32
  <style>
31
33
  body {
@@ -51,12 +53,12 @@ The library ships as a **single script** that lazy-loads only the components you
51
53
  <div id="viewer-host" style="flex:1; display:contents;"></div>
52
54
 
53
55
  <!--
54
- Single loader script. Angular boots once; only the requested
55
- components are downloaded as separate lazy chunks.
56
+ 1. Single loader script. Angular boots once; only requested components
57
+ are downloaded as separate lazy chunks.
56
58
 
57
- List components in data-components that will be created dynamically
58
- (not present in the HTML at load time). Statically placed tags are
59
- detected automatically.
59
+ data-components lists components that will be created dynamically
60
+ (i.e. not present in the HTML at load time). Statically placed tags
61
+ are detected automatically and do not need to be listed here.
60
62
  -->
61
63
  <script
62
64
  src="https://cdn.jsdelivr.net/npm/@qaecy/cue-ui/index.js"
@@ -64,19 +66,22 @@ The library ships as a **single script** that lazy-loads only the components you
64
66
  data-components="cue-document-viewer"
65
67
  ></script>
66
68
 
67
- <!-- Cue SDK + app logic -->
69
+ <!-- 2. Cue SDK + app logic -->
68
70
  <script type="module">
69
71
  import { Cue } from 'https://cdn.jsdelivr.net/npm/@qaecy/cue-sdk/dist/index.esm.js';
70
72
 
73
+ // 3. Authenticate
71
74
  const cue = new Cue();
72
75
  await cue.auth.signIn('google');
73
76
 
77
+ // 4. Mount the document viewer once the custom element is registered
74
78
  await customElements.whenDefined('cue-document-viewer');
75
79
 
76
80
  const viewer = document.createElement('cue-document-viewer');
77
- // Set as JS properties, not HTML attributes
81
+
82
+ // Required: authenticated SDK instance (must be set as a property, not an attribute)
78
83
  viewer.cue = cue;
79
- viewer.uuid = 'your-document-uuid';
84
+ viewer.uuid = 'your-document-uuid'; // or 'uuid?page=3' to open at a page
80
85
  viewer.projectId = 'your-project-id';
81
86
 
82
87
  document.getElementById('viewer-host').appendChild(viewer);
@@ -88,7 +93,7 @@ The library ships as a **single script** that lazy-loads only the components you
88
93
  ### Installing via npm
89
94
 
90
95
  ```bash
91
- npm install @qaecy/cue-ui
96
+ npm install @qaecy/cue-sdk @qaecy/cue-ui
92
97
  ```
93
98
 
94
99
  ```js
@@ -112,299 +117,67 @@ Renders the animated QAECY logo. Adapts automatically to light/dark mode.
112
117
  | `continuous` | `boolean` | `false` | Loops the draw animation |
113
118
 
114
119
  ```html
115
- <!-- Static logo — detected automatically -->
120
+ <!-- Static logo -->
116
121
  <cue-logo size="l"></cue-logo>
117
122
 
123
+ <!-- Animated on load -->
124
+ <cue-logo size="m" active></cue-logo>
125
+
118
126
  <!-- Continuously looping -->
119
127
  <cue-logo continuous></cue-logo>
120
128
  ```
121
129
 
122
- > **Loader** — add `cue-logo` to `data-components` if you create it dynamically. Statically placed tags are detected automatically. See [CDN quickstart](#cdn-quickstart).
130
+ > **Loader** — add `cue-logo` to `data-components` if you create it dynamically; otherwise it is detected automatically. See [CDN quickstart](#cdn-quickstart).
123
131
 
124
132
  ---
125
133
 
126
- ## `<cue-document-viewer>`
127
-
128
- Fetches and renders a Cue document. Automatically picks the best viewer based on file type. Requires an authenticated `Cue` SDK instance.
129
-
130
- | Property | Type | Required | Description |
131
- | ----------- | -------------------- | -------- | ------------------------------------------------------------------------------------ |
132
- | `cue` | `Cue` (SDK instance) | ✅ | Authenticated Cue SDK instance. **Set as a JS property**, not an HTML attribute. |
133
- | `uuid` | `string` | ✅ | Document UUID. Append `?page=N` to open at a specific page, e.g. `'abc-123?page=5'`. |
134
- | `projectId` | `string` | ✅ | Cue project (space) ID the document belongs to. |
135
-
136
- Language is managed globally by the SDK via `cue.api.language` / `cue.api.setLanguage(lang)`.
137
- Document metadata caching is managed by the SDK; the component reuses SDK-owned per-project state automatically.
134
+ ## `<cue-entity-list>`
138
135
 
139
- Supported file types: PDF, IFC/BIM, DXF/CAD, images (PNG, JPG, SVG, …), Markdown, plain text, CSV/XLSX spreadsheets.
136
+ Renders a lazy-loaded entity table. Pass `iris`, a `sdkState` containing a `CueProjectEntities` instance, and optionally a Mapbox token for location views.
140
137
 
141
- > **Loader** add `cue-document-viewer` to `data-components` if you create it dynamically. See [CDN quickstart](#cdn-quickstart).
138
+ | Property | Type | Required | Description |
139
+ | -------------------- | --------------------- | -------- | ------------------------------------------------------------------------------------ |
140
+ | `iris` | `string[]` | ✅ | Entity IRIs to display in the list. |
141
+ | `sdkState` | `{ cue?; entities? }` | ✅ | SDK context. Provide at least `entities` (`CueProjectEntities` instance). |
142
+ | `mapboxToken` | `string` | ❌ | Mapbox access token. Required only if entity location data should be shown on a map. |
143
+ | `paginationPageSize` | `number` | ❌ | Number of rows shown per page in the grid paginator. Default: `10`. |
142
144
 
143
- ---
145
+ The component emits two events:
144
146
 
145
- ## `<cue-document-list>`
146
-
147
- Renders a lazy-loaded document table. Pass a `projectId`, `uuids`, and `sdkState`; the component requests metadata and categories internally.
148
-
149
- | Property | Type | Required | Description |
150
- | -------------------------------- | --------------------------------------------------------------------- | -------- | -------------------------------------------------------------------------------------- |
151
- | `projectId` | `string` | ✅ | Cue project (space) ID. |
152
- | `uuids` | `string[]` | ✅ | Document UUIDs to display. |
153
- | `sdkState` | `{ cue?; view?; documents?; language?; availableContentCategories? }` | ✅ | SDK context. Provide at least one of `cue`, `view`, or `documents`. |
154
- | `simple` | `boolean` | ❌ | Renders a compact list + paginator instead of ag-grid/flip/settings. Default: `false`. |
155
- | `pageSize` | `number` | ❌ | Host-controlled page size. Default: `10`. |
156
- | `prefetchPages` | `number` | ❌ | Lazy-load buffer size multiplier (`pageSize × prefetchPages`). Default: `3`. |
157
- | `showOpenInDocumentViewerAction` | `boolean` | ❌ | Shows "Open in document viewer" menu item. Default: `false`. |
158
- | `showOpenInFileManagerAction` | `boolean` | ❌ | Shows "Open in file manager" menu item. Default: `false`. |
159
- | `customMenuItems` | `Array<{ label; icon?; action }>` | ❌ | Custom context-menu entries appended after the standard menu items. |
160
-
161
- Set `simple = true` for a narrow sidebar-style document list (no ag-grid, no column settings, no flip card).
147
+ | Event | Payload | Description |
148
+ | ------------- | ----------- | ------------------------------------------- |
149
+ | `rowClicked` | `EntityRow` | Fires when the user clicks a row. |
150
+ | `clickedOpen` | `EntityRow` | Fires when the user opens an entity detail. |
162
151
 
163
152
  ```js
164
- const list = document.querySelector('cue-document-list');
165
-
166
- list.customMenuItems = [
167
- {
168
- label: 'Copy UUID',
169
- icon: 'copy',
170
- action: (document) => {
171
- navigator.clipboard.writeText(document.id);
172
- },
173
- },
174
- ];
175
- ```
176
-
177
- > **Loader** — add `cue-document-list` to `data-components` if you create it dynamically. See [CDN quickstart](#cdn-quickstart).
178
-
179
- ---
180
-
181
- ## Dependency: `@qaecy/cue-sdk`
182
-
183
- The `cue-document-viewer` and `cue-document-list` components require an authenticated [`Cue`](https://www.npmjs.com/package/@qaecy/cue-sdk) instance. The SDK handles authentication and all data fetching — the components never make direct network calls.
184
-
185
- ```js
186
- import { Cue } from 'https://cdn.jsdelivr.net/npm/@qaecy/cue-sdk/dist/index.esm.js';
187
-
188
- const cue = new Cue();
189
- await cue.auth.signIn('google'); // or 'microsoft', 'email', etc.
190
- ```
191
-
192
- ---
193
-
194
- ## Theming
195
-
196
- All visual properties are driven by CSS custom properties defined on `:root`. Because the components do **not** use Shadow DOM, you can override any variable from your own stylesheet — no `::part()` or `::slotted()` selectors needed.
197
-
198
- ### Colors
199
-
200
- ```css
201
- :root {
202
- /* Brand palette */
203
- --cue-color-blue: #2859e1;
204
- --cue-color-green: #e2f552; /* accent */
205
-
206
- /* Semantic color keys — override these to retheme without touching raw values */
207
- --cue-primary: var(--cue-color-blue);
208
- --cue-primaryContrast: #ffffff;
209
-
210
- --cue-accent: var(--cue-color-green);
211
- --cue-accentContrast: #121c2b;
212
-
213
- --cue-main-background: #f5f6f9;
214
- --cue-main-foreground: #121c2b;
215
-
216
- --cue-border-color: #d9d9d9;
217
- }
218
- ```
219
-
220
- Apply a dark theme by adding the `dark` class to `<body>`:
221
-
222
- ```css
223
- body.dark {
224
- --cue-main-background: #121c2b;
225
- --cue-main-foreground: #ffffff;
226
- --cue-default: #0e1827;
227
- --cue-defaultContrast: #f5f6f9;
228
- --cue-border-color: #404955;
229
- }
230
- ```
231
-
232
- ### Typography
233
-
234
- ```css
235
- :root {
236
- --cue-font-family: 'Inter', sans-serif; /* swap out Poppins */
237
-
238
- --cue-font-weight-regular: 400;
239
- --cue-font-weight-medium: 500;
240
- --cue-font-weight-semibold: 600;
241
- }
242
- ```
243
-
244
- > The default font is **Poppins**, loaded via the bundled stylesheet. If you override `--cue-font-family`, load your chosen font yourself (e.g. via Google Fonts).
245
-
246
- ### Spacing & element sizes
247
-
248
- ```css
249
- :root {
250
- /* Gap / padding scale */
251
- --cue-dim-gap-xs: 0.25rem;
252
- --cue-dim-gap-s: 0.5rem;
253
- --cue-dim-gap-m: 1rem;
254
- --cue-dim-gap-l: 1.875rem;
255
-
256
- /* Interactive element heights */
257
- --cue-dim-elem-s: 2rem; /* small buttons, inputs */
258
- --cue-dim-elem-m: 2.75rem; /* default */
259
- --cue-dim-elem-l: 3.5rem; /* large */
260
- }
261
- ```
262
-
263
- ### Minimal brand override example
264
-
265
- ```html
266
- <style>
267
- :root {
268
- --cue-primary: #7c3aed; /* violet */
269
- --cue-primaryContrast: #ffffff;
270
- --cue-accent: #f59e0b; /* amber */
271
- --cue-accentContrast: #1c1917;
272
- --cue-font-family: 'Inter', sans-serif;
273
- }
274
- </style>
275
- ```
276
-
277
- ## Components
278
-
279
- | Custom element | Import path | Description |
280
- | ----------------------- | ------------------------------- | --------------------------------------------------------------------------------- |
281
- | `<cue-card>` | `@qaecy/cue-ui/card` | Reusable card container with variants, padding, and optional shadow |
282
- | `<cue-logo>` | `@qaecy/cue-ui/logo` | Animated QAECY logo |
283
- | `<cue-document-list>` | `@qaecy/cue-ui/document-list` | Lazy document list that fetches metadata internally from Cue SDK state |
284
- | `<cue-document-viewer>` | `@qaecy/cue-ui/document-viewer` | Document viewer with Cue SDK integration (PDF, BIM, CAD, images, spreadsheets, …) |
285
-
286
- ---
287
-
288
- ## CDN quickstart
289
-
290
- The entire library ships as a **single script** that lazy-loads only the components you request — no `npm install` needed.
291
-
292
- ```html
293
- <!doctype html>
294
- <html lang="en">
295
- <head>
296
- <meta charset="utf-8" />
297
- <title>My Cue App</title>
298
- <!-- Optional: component styles -->
299
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@qaecy/cue-ui/styles.css" />
300
- <style>
301
- body {
302
- margin: 0;
303
- height: 100vh;
304
- display: flex;
305
- flex-direction: column;
306
- }
307
- cue-logo {
308
- width: 160px;
309
- padding: 1rem;
310
- }
311
- cue-document-viewer {
312
- flex: 1;
313
- }
314
- </style>
315
- </head>
316
- <body>
317
- <!-- Static elements are detected automatically -->
318
- <cue-logo size="m"></cue-logo>
319
-
320
- <!-- Document viewer (populated via JS below) -->
321
- <div id="viewer-host" style="flex:1; display:contents;"></div>
322
-
323
- <!--
324
- 1. Single loader script. Angular boots once; only requested components
325
- are downloaded as separate lazy chunks.
326
-
327
- data-components lists components that will be created dynamically
328
- (i.e. not present in the HTML at load time). Statically placed tags
329
- are detected automatically and do not need to be listed here.
330
- -->
331
- <script
332
- src="https://cdn.jsdelivr.net/npm/@qaecy/cue-ui/index.js"
333
- type="module"
334
- data-components="cue-document-viewer"
335
- ></script>
336
-
337
- <!-- 2. Cue SDK + app logic -->
338
- <script type="module">
339
- import { Cue } from 'https://cdn.jsdelivr.net/npm/@qaecy/cue-sdk/dist/index.esm.js';
340
-
341
- // 3. Authenticate
342
- const cue = new Cue();
343
- await cue.auth.signIn('google');
344
-
345
- // 4. Mount the document viewer once the custom element is registered
346
- await customElements.whenDefined('cue-document-viewer');
347
-
348
- const viewer = document.createElement('cue-document-viewer');
349
-
350
- // Required: authenticated SDK instance (must be set as a property, not an attribute)
351
- viewer.cue = cue;
352
- viewer.uuid = 'your-document-uuid'; // or 'uuid?page=3' to open at a page
353
- viewer.projectId = 'your-project-id';
354
-
355
- document.getElementById('viewer-host').appendChild(viewer);
356
- </script>
357
- </body>
358
- </html>
359
- ```
360
-
361
- ---
362
-
363
- ## `<cue-logo>`
364
-
365
- Renders the animated QAECY logo. Adapts automatically to light/dark mode.
153
+ await customElements.whenDefined('cue-entity-list');
366
154
 
367
- | Property / attribute | Type | Default | Description |
368
- | -------------------- | ------------------- | ------- | -------------------------------- |
369
- | `size` | `'s' \| 'm' \| 'l'` | `'m'` | Size preset |
370
- | `active` | `boolean` | `true` | Triggers the draw animation once |
371
- | `continuous` | `boolean` | `false` | Loops the draw animation |
155
+ const list = document.createElement('cue-entity-list');
372
156
 
373
- ```html
374
- <!-- Static logo -->
375
- <cue-logo size="l"></cue-logo>
157
+ // sdkState must be set as a JS property, not an HTML attribute
158
+ list.sdkState = { entities: cue.project('your-project-id').entities };
159
+ list.iris = ['https://example.com/entity/uuid-1', 'https://example.com/entity/uuid-2'];
160
+ list.paginationPageSize = 25;
376
161
 
377
- <!-- Animated on load -->
378
- <cue-logo size="m" active></cue-logo>
162
+ list.addEventListener('rowClicked', (e) => console.log('Row clicked:', e.detail));
163
+ list.addEventListener('clickedOpen', (e) => console.log('Open entity:', e.detail));
379
164
 
380
- <!-- Continuously looping -->
381
- <cue-logo continuous></cue-logo>
165
+ document.getElementById('list-host').appendChild(list);
382
166
  ```
383
167
 
384
- > **Loader** — add `cue-logo` to `data-components` if you create it dynamically; otherwise it is detected automatically. See [CDN quickstart](#cdn-quickstart).
168
+ > **Loader** — add `cue-entity-list` to `data-components` if you create it dynamically; otherwise it is detected automatically. See [CDN quickstart](#cdn-quickstart).
385
169
 
386
170
  ---
387
171
 
388
- ## `<cue-card>`
172
+ ## `<cue-id-builder>`
389
173
 
390
- Renders the core Cue card container as a standalone web component.
391
-
392
- | Property / attribute | Type | Default | Description |
393
- | -------------------- | ------------------------------------------------------------- | ----------- | --------------------------------- |
394
- | `variant` | `'default' \| 'primary' \| 'secondary' \| 'accent' \| 'fade'` | `'default'` | Visual variant |
395
- | `padded` | `boolean` | `true` | Adds internal card padding |
396
- | `shadow` | `boolean` | `false` | Adds drop shadow |
397
- | `scrollable` | `boolean` | `false` | Enables internal scroll container |
398
- | `maxHeight` | `string` | `undefined` | Max host height, e.g. `'320px'` |
399
- | `style` | `string` | `''` | Additional inline style string |
174
+ A self-contained interactive tool that converts a text string into a context-based GUID (used for IFC/SPARQL identifiers). No external inputs required — drop it in and it works standalone.
400
175
 
401
176
  ```html
402
- <cue-card variant="primary" padded="true" shadow="true" style="height: 180px;">
403
- Card content
404
- </cue-card>
177
+ <cue-id-builder></cue-id-builder>
405
178
  ```
406
179
 
407
- > **Loader** — add `cue-card` to `data-components` if you create it dynamically; otherwise it is detected automatically. See [CDN quickstart](#cdn-quickstart).
180
+ > **Loader** — add `cue-id-builder` to `data-components` if you create it dynamically; otherwise it is detected automatically. See [CDN quickstart](#cdn-quickstart).
408
181
 
409
182
  ---
410
183
 
@@ -418,7 +191,7 @@ Fetches and renders a Cue document. Automatically picks the best viewer based on
418
191
  | `uuid` | `string` | ✅ | Document UUID. Append `?page=N` to open at a specific page, e.g. `'abc-123?page=5'`. |
419
192
  | `projectId` | `string` | ✅ | Cue project (space) ID the document belongs to. |
420
193
 
421
- Language is managed globally by the SDK via `cue.api.language` / `cue.api.setLanguage(lang)` and applies to all language-sensitive requests.
194
+ Language is managed globally by the SDK via `cue.api.language` / `cue.api.setLanguage(lang)` and applies to all language-sensitive requests.
422
195
  Document metadata caching is also managed by the SDK; the component reuses SDK-owned per-project document state automatically.
423
196
 
424
197
  Supported file types: PDF, IFC/BIM, DXF/CAD, images (PNG, JPG, SVG, …), Markdown, plain text, CSV/XLSX spreadsheets.
@@ -476,28 +249,94 @@ list.customMenuItems = [
476
249
 
477
250
  ---
478
251
 
479
- ## Dependency: `@qaecy/cue-sdk`
252
+ ## `<cue-block-project-documents>`
253
+
254
+ A content block that visualises project document statistics — documents by content category, by file type, total size, and duplicates — using interactive pie charts.
480
255
 
481
- The `cue-document-viewer` component requires an authenticated [`Cue`](https://www.npmjs.com/package/@qaecy/cue-sdk) instance. The SDK handles authentication and all data fetching — the component itself never makes direct network calls.
256
+ | Property | Type | Required | Description |
257
+ | -------- | ---------------------- | -------- | ------------------------------------------------------------------------------------------------ |
258
+ | `data` | `ProjectDocumentsData` | ❌ | Document statistics payload. The component renders empty until set. |
259
+ | `config` | `BlockConfig` | ✅ | Block configuration including `projectId`, `handlers`, and privileges. **Set as a JS property.** |
482
260
 
483
261
  ```js
484
- import { Cue } from 'https://cdn.jsdelivr.net/npm/@qaecy/cue-sdk/dist/index.esm.js';
262
+ await customElements.whenDefined('cue-block-project-documents');
485
263
 
486
- const cue = new Cue();
487
- await cue.auth.signIn('google'); // or 'microsoft', 'email', etc.
264
+ const block = document.createElement('cue-block-project-documents');
265
+
266
+ block.config = {
267
+ projectId: 'your-project-id',
268
+ graphIsSaturated: false,
269
+ privileges: { canEdit: false },
270
+ portalBaseURL: 'https://app.qaecy.com',
271
+ resourceBaseURL: 'https://cue.qaecy.com/r/',
272
+ };
273
+
274
+ block.data = {
275
+ documentsBySuffix: { pdf: { count: 12, size: 4096000 } },
276
+ documentsByContentCategory: { drawings: { count: 5, size: 1024000 } },
277
+ duplicateCount: 2,
278
+ };
279
+
280
+ document.getElementById('block-host').appendChild(block);
488
281
  ```
489
282
 
490
- When using npm:
283
+ > **Loader** — add `cue-block-project-documents` to `data-components` if you create it dynamically; otherwise it is detected automatically. See [CDN quickstart](#cdn-quickstart).
491
284
 
492
- ```bash
493
- npm install @qaecy/cue-sdk @qaecy/cue-ui
285
+ ---
286
+
287
+ ## `<cue-entity-viewer>`
288
+
289
+ Renders the full detail view for a single entity: an info panel (label + categories), a relationship graph, linked documents, and an optional location map.
290
+
291
+ Requires an authenticated `Cue` SDK instance. Internally creates `CueProjectEntities` and `CueProjectDocuments` instances and wires all data-fetching automatically.
292
+
293
+ | Property | Type | Required | Description |
294
+ | ------------- | -------------------- | -------- | ----------------------------------------------------------------------------------------- |
295
+ | `cue` | `Cue` (SDK instance) | ✅ | Authenticated Cue SDK instance. **Set as a JS property**, not an HTML attribute. |
296
+ | `projectId` | `string` | ✅ | Cue project (space) ID that the entity belongs to. |
297
+ | `iri` | `string` | ✅ | Full RDF IRI of the entity to display, e.g. `'https://cue.qaecy.com/r/{project}/{uuid}'`. |
298
+ | `mapboxToken` | `string` | ❌ | Mapbox access token. Required to show entity location on a map. Omit to hide the map tab. |
299
+
300
+ The component emits one event:
301
+
302
+ | Event | Payload | Description |
303
+ | ------------ | -------- | ------------------------------------------------------- |
304
+ | `openEntity` | `string` | Entity UUID when the user navigates to a linked entity. |
305
+
306
+ ```js
307
+ await customElements.whenDefined('cue-entity-viewer');
308
+
309
+ const viewer = document.createElement('cue-entity-viewer');
310
+
311
+ // Required: set as JS properties, not HTML attributes
312
+ viewer.cue = cue;
313
+ viewer.projectId = 'your-project-id';
314
+ viewer.iri = 'https://cue.qaecy.com/r/your-project-id/entity-uuid';
315
+
316
+ // Optional: enable the location map tab
317
+ viewer.mapboxToken = 'pk.eyJ1…';
318
+
319
+ // Navigate within your app when the user opens a related entity
320
+ viewer.addEventListener('openEntity', (e) => {
321
+ viewer.iri = `https://cue.qaecy.com/r/your-project-id/${e.detail}`;
322
+ });
323
+
324
+ document.getElementById('viewer-host').appendChild(viewer);
494
325
  ```
495
326
 
327
+ > **Loader** — add `cue-entity-viewer` to `data-components` if you create it dynamically; otherwise it is detected automatically. See [CDN quickstart](#cdn-quickstart).
328
+
329
+ ---
330
+
331
+ ## Dependency: `@qaecy/cue-sdk`
332
+
333
+ The `cue-document-viewer`, `cue-document-list`, `cue-entity-list`, and `cue-entity-viewer` components require an authenticated [`Cue`](https://www.npmjs.com/package/@qaecy/cue-sdk) instance. The SDK handles authentication and all data fetching — the components never make direct network calls.
334
+
496
335
  ```js
497
- import { Cue } from '@qaecy/cue-sdk';
498
- import '@qaecy/cue-ui/card';
499
- import '@qaecy/cue-ui/document-viewer';
500
- import '@qaecy/cue-ui/logo';
336
+ import { Cue } from 'https://cdn.jsdelivr.net/npm/@qaecy/cue-sdk/dist/index.esm.js';
337
+
338
+ const cue = new Cue();
339
+ await cue.auth.signIn('google'); // or 'microsoft', 'email', etc.
501
340
  ```
502
341
 
503
342
  ---
package/common.js CHANGED
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkcue_ui=self.webpackChunkcue_ui||[]).push([[76],{2014(M,m,o){o.d(m,{z:()=>f});var n=o(7705),s=o(2271),a=o(5547);const r=["*"];let f=(()=>{class t{justify=(0,n.hFB)("start");size=(0,n.hFB)("l");widthStyle=(0,s.EW)(()=>`var(--cue-button-label-padding-${this.size()}-x)`);static \u0275fac=function(d){return new(d||t)};static \u0275cmp=a.VBU({type:t,selectors:[["cue-button-padder"]],inputs:{justify:[1,"justify"],size:[1,"size"]},ngContentSelectors:r,decls:2,vars:4,template:function(d,u){1&d&&(a.NAR(),a.rj2(0,"div"),a.SdG(1),a.eux()),2&d&&a.xc7("justify-content",u.justify())("min-width",u.widthStyle())},styles:["div[_ngcontent-%COMP%]{display:flex;align-items:center;min-height:1px}"]})}return t})()},6034(M,m,o){o.d(m,{y:()=>B});var n=o(7705),s=o(7598),a=o(9769),r=o(5187),f=o(2271),t=o(5547);const l=["*"];let i=(()=>{class c{style=(0,n.hFB)("");gap=(0,n.hFB)("m");columns=(0,n.hFB)(1);getStyles=(0,f.EW)(()=>`\n grid-template-columns: repeat(${this.columns()}, minmax(0, 1fr));\n gap: var(--cue-grid-gap-${this.gap()});\n ${this.style()}\n `);static \u0275fac=function(g){return new(g||c)};static \u0275cmp=t.VBU({type:c,selectors:[["cue-grid"]],hostVars:2,hostBindings:function(g,e){2&g&&t.Aen(e.getStyles())},inputs:{style:[1,"style"],gap:[1,"gap"],columns:[1,"columns"]},ngContentSelectors:l,decls:1,vars:0,template:function(g,e){1&g&&(t.NAR(),t.SdG(0))},styles:["[_nghost-%COMP%]{display:grid}"]})}return c})();var d=o(2245),u=o(5381),h=o(29);const b=["*"];function _(c,L){if(1&c&&(t.j41(0,"cue-typography",2),t.EFF(1),t.k0s()),2&c){const p=t.XpG();t.R7$(),t.SpI(" ",p.label()," ")}}let B=(()=>{class c{label=(0,n.hFB)("");variant=(0,n.hFB)("default");shadow=(0,n.hFB)(!1);padded=(0,n.hFB)(!0);showCloseBtn=(0,n.hFB)(!0);position=(0,n.hFB)("top-left");clickedClose=(0,n.CGW)();margin=(0,n.hFB)("0.5rem");close(p){p.stopPropagation(),p.stopImmediatePropagation(),this.clickedClose.emit()}static \u0275fac=function(g){return new(g||c)};static \u0275cmp=t.VBU({type:c,selectors:[["cue-draggable-card"]],inputs:{label:[1,"label"],variant:[1,"variant"],shadow:[1,"shadow"],padded:[1,"padded"],showCloseBtn:[1,"showCloseBtn"],position:[1,"position"],margin:[1,"margin"]},outputs:{clickedClose:"clickedClose"},ngContentSelectors:b,decls:8,vars:14,consts:[["cdkDrag","",1,"panel",3,"variant","shadow","padded"],["justify","end"],["size","l"],[2,"width","100%"],["name","close",2,"cursor","pointer",3,"click"]],template:function(g,e){1&g&&(t.NAR(),t.j41(0,"cue-card",0)(1,"cue-typography")(2,"cue-grid")(3,"cue-flexcontainer",1),t.nVh(4,_,2,1,"cue-typography",2),t.nrm(5,"span",3),t.j41(6,"cue-svg-icon",4),t.bIt("click",function(y){return e.close(y)}),t.k0s()(),t.SdG(7),t.k0s()()()),2&g&&(t.xc7("top","top-left"===e.position()||"top-right"===e.position()?e.margin():"null")("bottom","bottom-left"===e.position()||"bottom-right"===e.position()?e.margin():"null")("left","top-left"===e.position()||"bottom-left"===e.position()?e.margin():"null")("right","top-right"===e.position()||"bottom-right"===e.position()?e.margin():"null"),t.Y8G("variant",e.variant())("shadow",e.shadow())("padded",e.padded()),t.R7$(3),t.xc7("padding",e.padded()?"0":"10px"),t.R7$(),t.vxM(e.label()&&"undefined"!==e.label()?4:-1))},dependencies:[a.MD,r.Z,i,d.o,u.n,h.A,s.T1],styles:[".panel[_ngcontent-%COMP%]{position:absolute;width:fit-content}"]})}return c})()},3191(M,m,o){o.d(m,{g:()=>a});var n=o(467),s=o(5802);let a=(()=>{class r{searchPage(t,l,i){return(0,n.A)(function*(){if(!i||!i.trim())return[];const d=i.toLowerCase(),u=yield t.getPage(l),h=u.getViewport({scale:1}),_=(yield u.getTextContent()).items,I=[];let B="";const c=[],L=[];for(let e=0;e<_.length;e++){const y=_[e].str??"";for(let v=0;v<y.length;v++)B+=y[v],c.push(e),L.push(v)}const p=B.toLowerCase();let g=0;for(;g<p.length;){const e=p.indexOf(d,g);if(-1===e)break;const O=e+d.length-1;g=e+1;const y=new Set;for(let D=e;D<=O;D++)y.add(c[D]);let v=1/0,C=1/0,T=-1/0,A=-1/0;for(const D of y){const S=_[D],[w,W,q,K,P,E]=S.transform,k=S.width??0,F=S.height??Math.abs(w||K||12),x=Math.sqrt(w*w+W*W)||1,z=w/x,V=W/x,Y=q/x,X=K/x,ot=[[P,E],[P+z*k,E+V*k],[P+z*k+Y*F,E+V*k+X*F],[P+Y*F,E+X*F]];for(const[nt,st]of ot){const[H,Z]=h.convertToViewportPoint(nt,st);v=Math.min(v,H),C=Math.min(C,Z),T=Math.max(T,H),A=Math.max(A,Z)}}const N=h.width,R=h.height,U=.005*N,j=.005*R,J=(C-j)/R*100,G=(T-v+2*U)/N*100,$=(A-C+2*j)/R*100;G>0&&$>0&&I.push({page:l,xywhStr:`percent:${((v-U)/N*100).toFixed(2)},${J.toFixed(2)},${G.toFixed(2)},${$.toFixed(2)}`})}return I})()}searchAll(t,l){var i=this;return(0,n.A)(function*(){if(!l||!l.trim())return[];const d=t.numPages,u=[];for(let h=1;h<=d;h++){const b=yield i.searchPage(t,h,l);u.push(...b)}return u})()}static \u0275fac=function(l){return new(l||r)};static \u0275prov=s.jDH({token:r,factory:r.\u0275fac,providedIn:"root"})}return r})()},6170(M,m,o){o.d(m,{R:()=>f});var n=o(7705),s=o(5802),a=o(2271),r=o(5547);let f=(()=>{class t{destroyRef=(0,s.WQX)(s.abz);_isDarkMode=(0,s.vPA)(this.hasDarkClass());isDarkMode=(0,a.EW)(()=>this._isDarkMode());darkModeChange=(0,n.CGW)();constructor(){const i=new MutationObserver(d=>{d.forEach(u=>{if("attributes"===u.type&&"class"===u.attributeName){const h=this.hasDarkClass();h!==this._isDarkMode()&&this._isDarkMode.set(h)}})});i.observe(document.body,{attributes:!0,attributeFilter:["class"]}),this.destroyRef.onDestroy(()=>i.disconnect()),(0,s.QZP)(()=>{this.darkModeChange.emit(this._isDarkMode()),document.documentElement.style.colorScheme=this._isDarkMode()?"dark":"light"})}hasDarkClass(){return document.body.classList.contains("dark")}toggleDarkMode(){document.body.classList.toggle("dark")}static \u0275fac=function(d){return new(d||t)};static \u0275dir=r.FsC({type:t,selectors:[["","cueDarkMode",""]],outputs:{darkModeChange:"darkModeChange"},exportAs:["darkModeDetector"]})}return t})()},1493(M,m,o){function n(s,a=!1,r=1){const f=a?1e3:1024;if(Math.abs(s)<f)return s+" B";const t=a?["kB","MB","GB","TB","PB","EB","ZB","YB"]:["KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"];let l=-1;const i=10**r;do{s/=f,++l}while(Math.round(Math.abs(s)*i)/i>=f&&l<t.length-1);return s.toFixed(r)+" "+t[l]}o.d(m,{b:()=>n})},7573(M,m,o){o.d(m,{E:()=>n});const n={qcy:"https://dev.qaecy.com/ont#","qcy-e":"https://dev.qaecy.com/enum#","qcy-f":"https://dev.qaecy.com/functions#",obc:"https://w3id.org/obc#",dicc:"https://w3id.org/digitalconstruction/0.5/Contexts#",dicv:"https://w3id.org/digitalconstruction/0.5/Variables#",dice:"https://w3id.org/digitalconstruction/0.5/Entities#",dicp:"https://w3id.org/digitalconstruction/0.5/Processes#",dica:"https://w3id.org/digitalconstruction/0.5/Agents#",dici:"https://w3id.org/digitalconstruction/0.5/Information#",dicbm:"https://w3id.org/digitalconstruction/0.5/Materials#",dicob:"https://w3id.org/digitalconstruction/0.5/Occupancy#",dicl:"https://w3id.org/digitalconstruction/0.5/Lifecycle#",dices:"https://w3id.org/digitalconstruction/0.5/Energy#",dicu:"https://w3id.org/digitalconstruction/0.5/Units#",diclvl:"https://w3id.org/digitalconstruction/0.5/Levels#",dicstg:"https://w3id.org/digitalconstruction/0.5/Stages#"}}}]);
1
+ "use strict";(self.webpackChunkcue_ui=self.webpackChunkcue_ui||[]).push([[76],{2014(x,M,i){i.d(M,{z:()=>b});var l=i(7705),c=i(2271),u=i(5547);const g=["*"];let b=(()=>{class o{justify=(0,l.hFB)("start");size=(0,l.hFB)("l");widthStyle=(0,c.EW)(()=>`var(--cue-button-label-padding-${this.size()}-x)`);static \u0275fac=function(a){return new(a||o)};static \u0275cmp=u.VBU({type:o,selectors:[["cue-button-padder"]],inputs:{justify:[1,"justify"],size:[1,"size"]},ngContentSelectors:g,decls:2,vars:4,template:function(a,d){1&a&&(u.NAR(),u.rj2(0,"div"),u.SdG(1),u.eux()),2&a&&u.xc7("justify-content",d.justify())("min-width",d.widthStyle())},styles:["div[_ngcontent-%COMP%]{display:flex;align-items:center;min-height:1px}"]})}return o})()},6034(x,M,i){i.d(M,{y:()=>f});var l=i(7705),c=i(7598),u=i(9769),g=i(5187),b=i(2271),o=i(5547);const n=["*"];let y=(()=>{class t{style=(0,l.hFB)("");gap=(0,l.hFB)("m");columns=(0,l.hFB)(1);getStyles=(0,b.EW)(()=>`\n grid-template-columns: repeat(${this.columns()}, minmax(0, 1fr));\n gap: var(--cue-grid-gap-${this.gap()});\n ${this.style()}\n `);static \u0275fac=function(v){return new(v||t)};static \u0275cmp=o.VBU({type:t,selectors:[["cue-grid"]],hostVars:2,hostBindings:function(v,m){2&v&&o.Aen(m.getStyles())},inputs:{style:[1,"style"],gap:[1,"gap"],columns:[1,"columns"]},ngContentSelectors:n,decls:1,vars:0,template:function(v,m){1&v&&(o.NAR(),o.SdG(0))},styles:["[_nghost-%COMP%]{display:grid}"]})}return t})();var a=i(2245),d=i(5381),e=i(29);const r=["*"];function h(t,p){if(1&t&&(o.j41(0,"cue-typography",2),o.EFF(1),o.k0s()),2&t){const _=o.XpG();o.R7$(),o.SpI(" ",_.label()," ")}}let f=(()=>{class t{label=(0,l.hFB)("");variant=(0,l.hFB)("default");shadow=(0,l.hFB)(!1);padded=(0,l.hFB)(!0);showCloseBtn=(0,l.hFB)(!0);position=(0,l.hFB)("top-left");clickedClose=(0,l.CGW)();margin=(0,l.hFB)("0.5rem");close(_){_.stopPropagation(),_.stopImmediatePropagation(),this.clickedClose.emit()}static \u0275fac=function(v){return new(v||t)};static \u0275cmp=o.VBU({type:t,selectors:[["cue-draggable-card"]],inputs:{label:[1,"label"],variant:[1,"variant"],shadow:[1,"shadow"],padded:[1,"padded"],showCloseBtn:[1,"showCloseBtn"],position:[1,"position"],margin:[1,"margin"]},outputs:{clickedClose:"clickedClose"},ngContentSelectors:r,decls:8,vars:14,consts:[["cdkDrag","",1,"panel",3,"variant","shadow","padded"],["justify","end"],["size","l"],[2,"width","100%"],["name","close",2,"cursor","pointer",3,"click"]],template:function(v,m){1&v&&(o.NAR(),o.j41(0,"cue-card",0)(1,"cue-typography")(2,"cue-grid")(3,"cue-flexcontainer",1),o.nVh(4,h,2,1,"cue-typography",2),o.nrm(5,"span",3),o.j41(6,"cue-svg-icon",4),o.bIt("click",function(D){return m.close(D)}),o.k0s()(),o.SdG(7),o.k0s()()()),2&v&&(o.xc7("top","top-left"===m.position()||"top-right"===m.position()?m.margin():"null")("bottom","bottom-left"===m.position()||"bottom-right"===m.position()?m.margin():"null")("left","top-left"===m.position()||"bottom-left"===m.position()?m.margin():"null")("right","top-right"===m.position()||"bottom-right"===m.position()?m.margin():"null"),o.Y8G("variant",m.variant())("shadow",m.shadow())("padded",m.padded()),o.R7$(3),o.xc7("padding",m.padded()?"0":"10px"),o.R7$(),o.vxM(m.label()&&"undefined"!==m.label()?4:-1))},dependencies:[u.MD,g.Z,y,a.Typography,d.n,e.A,c.T1],styles:[".panel[_ngcontent-%COMP%]{position:absolute;width:fit-content}"]})}return t})()},6756(x,M,i){i.d(M,{BK:()=>l,In:()=>a,Kz:()=>d,Mc:()=>r,U6:()=>u,g0:()=>h,g8:()=>g,r:()=>c,u9:()=>o});const l=["#2B5DE6","#1A2B50","#C5E045","#6FA8FF","#00C2E0","#5847EB","#008585","#4ADE80","#0F4C81","#8B5CF6","#FACC15","#FB923C","#F43F5E","#E879F9","#D97706","#334155","#64748B","#94A3B8","#C7D2FE","#F8FAFC"];function c(t){switch(t){case"primary":default:return"#2859e1";case"accent":return"#e2f552";case"tertiary":return"#ffffff"}}function u(t){switch(t){case"primary":default:return"#1744c2";case"accent":return"#b8cc3f";case"tertiary":return"#eeeeee"}}function g(t){const[p,_,v]=function b(t,p){if(void 0===t)return[];const v=window.getComputedStyle(t.nativeElement);return p.map(m=>v.getPropertyValue(m).trim()||"")}(t,["--cue-chart-text-color","--cue-chart-border-background-color","--chart-graph-edge-color"]);return{text:p,borderBackground:_,edgeColor:v}}const o={fontFamily:"Poppins, sans-serif",fontWeight:"normal",color:"#333"};function a(t){return t>=1e6?`${(t/1e6).toFixed(1)}m`:t>=1e3?`${(t/1e3).toFixed(0)}k`:t.toString()}function d(t,p,_,v){if(1===v)return t;const m=s(t),P=s(p),D=_/(v-1);return`rgb(${Math.round(m.r+(P.r-m.r)*D)}, ${Math.round(m.g+(P.g-m.g)*D)}, ${Math.round(m.b+(P.b-m.b)*D)})`}const r=(t,p)=>void 0===p?t:p.children??[];function h(t,p,_=.05,v="Other"){const m=t.reduce((C,E)=>C+f(E),0),P=[],D=[];if(t.forEach(C=>{let E,T;E=void 0===C.value&&Array.isArray(C.children)&&C.children.length>0?C.children.reduce((F,L)=>F+f(L),0):void 0!==C.value?C.value:0,Array.isArray(C.children)&&C.children.length>0&&(T=h(C.children,p,_,v));const A={...C,value:E,children:T};p&&m>0&&E/m<_?D.push(A):P.push(A)}),p&&D.length>0){const C=D.reduce((E,T)=>E+T.value,0);P.push({id:"__grouped_small__",name:v,value:C,children:D,isGroup:!0})}return P}function s(t){const p=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return p?{r:parseInt(p[1],16),g:parseInt(p[2],16),b:parseInt(p[3],16)}:{r:0,g:0,b:0}}function f(t){return"number"==typeof t.value?t.value:Array.isArray(t.children)&&t.children.length>0?t.children.reduce((p,_)=>p+f(_),0):0}},9134(x,M,i){i.d(M,{v:()=>b});var l=i(7705),c=i(6034),u=i(7517),g=i(5547);let b=(()=>{class o{title=(0,l.hFB)("Legend");layers=(0,l.hFB)([]);position=(0,l.hFB)("top-left");close=(0,l.CGW)();visibilityChange=(0,l.CGW)();layerChange=(0,l.CGW)();visibilityAll=(0,l.CGW)();static \u0275fac=function(a){return new(a||o)};static \u0275cmp=g.VBU({type:o,selectors:[["cue-color-legend-panel"]],inputs:{title:[1,"title"],layers:[1,"layers"],position:[1,"position"]},outputs:{close:"close",visibilityChange:"visibilityChange",layerChange:"layerChange",visibilityAll:"visibilityAll"},decls:3,vars:4,consts:[[3,"clickedClose","label","padded","position"],[1,"content"],[3,"visibilityAll","layerChange","visibilityChange","layers"]],template:function(a,d){1&a&&(g.j41(0,"cue-draggable-card",0),g.bIt("clickedClose",function(){return d.close.emit()}),g.j41(1,"div",1)(2,"cue-layer-legend",2),g.bIt("visibilityAll",function(r){return d.visibilityAll.emit(r)})("layerChange",function(r){return d.layerChange.emit(r)})("visibilityChange",function(r){return d.visibilityChange.emit(r)}),g.k0s()()()),2&a&&(g.Y8G("label",d.title())("padded",!1)("position",d.position()),g.R7$(2),g.Y8G("layers",d.layers()))},dependencies:[c.y,u.P],styles:[".content[_ngcontent-%COMP%]{padding-left:10px;padding-right:10px;margin-bottom:30px;font-size:.8em;max-height:200px;max-width:180px;overflow:auto}"]})}return o})()},7517(x,M,i){i.d(M,{P:()=>h});var l=i(7705),c=i(2271),u=i(2245),g=i(1359),b=i(5381),o=i(5802),n=i(5547);const y=(s,f)=>f.category;function a(s,f){if(1&s){const t=n.RV6();n.j41(0,"cue-flexcontainer",1)(1,"cue-checkbox",2),n.bIt("checkedChange",function(){o.eBV(t);const _=n.XpG();return o.Njj(_.toggleAll())}),n.k0s()()}if(2&s){const t=n.XpG();n.R7$(),n.Y8G("checked",t.allVisible())}}function d(s,f){if(1&s&&(n.j41(0,"cue-typography",3),n.EFF(1),n.k0s()),2&s){const t=n.XpG().$implicit;n.R7$(),n.JRh(t.category)}}function e(s,f){if(1&s){const t=n.RV6();n.j41(0,"cue-flexcontainer",1)(1,"cue-checkbox",4),n.bIt("checkedChange",function(){const _=o.eBV(t).$implicit,v=n.XpG(2);return o.Njj(v.toggleSingle(_))}),n.k0s(),n.j41(2,"cue-typography",5),n.bIt("click",function(){const _=o.eBV(t).$implicit,v=n.XpG(2);return o.Njj(v.toggleSingle(_))}),n.EFF(3),n.k0s()()}if(2&s){const t=f.$implicit;n.R7$(),n.Y8G("checked",t.visible)("color",t.color),n.R7$(2),n.JRh(t.label)}}function r(s,f){if(1&s&&(n.nVh(0,d,2,1,"cue-typography",3),n.Z7z(1,e,4,3,"cue-flexcontainer",1,n.Vm6)),2&s){const t=f.$implicit;n.vxM(t.category?0:-1),n.R7$(),n.Dyx(t.items)}}let h=(()=>{class s{layers=(0,l.geq)([]);visibilityChange=(0,l.CGW)();layerChange=(0,l.CGW)();visibilityAll=(0,l.CGW)();showCheckAll=(0,c.EW)(()=>this.layers().length>1);allVisible=(0,c.EW)(()=>this.layers().every(t=>t.visible));groupedLayers=(0,c.EW)(()=>{const t=[];for(const p of this.layers()){const _=p.category,v=t.find(m=>m.category===_);v?v.items.push(p):t.push({category:_,items:[p]})}return t});toggleAll(){const t=this.allVisible(),p=this.layers().map(_=>(_.visible=!t,_));this.layers.update(()=>[...p]),this.visibilityAll.emit(t),this.emitChange()}toggleSingle(t){t.visible=!t.visible,this.layerChange.emit(t),this.layers.update(()=>[...this.layers()]),this.emitChange()}emitChange(){this.visibilityChange.emit(this.layers())}static \u0275fac=function(p){return new(p||s)};static \u0275cmp=n.VBU({type:s,selectors:[["cue-layer-legend"]],inputs:{layers:[1,"layers"]},outputs:{layers:"layersChange",visibilityChange:"visibilityChange",layerChange:"layerChange",visibilityAll:"visibilityAll"},decls:4,vars:1,consts:[["direction","column"],["align","center","justify","start",2,"width","100%"],["size","s",3,"checkedChange","checked"],["variant","label",2,"margin-top","4px","opacity","0.6"],["size","s",3,"checkedChange","checked","color"],[2,"cursor","pointer",3,"click"]],template:function(p,_){1&p&&(n.j41(0,"cue-flexcontainer",0),n.nVh(1,a,2,1,"cue-flexcontainer",1),n.Z7z(2,r,3,1,null,null,y),n.k0s()),2&p&&(n.R7$(),n.vxM(_.showCheckAll()?1:-1),n.R7$(),n.Dyx(_.groupedLayers()))},dependencies:[b.n,u.Typography,g.S],encapsulation:2,changeDetection:0})}return s})()},4613(x,M,i){i.d(M,{Logo:()=>o});var l=i(7705),c=i(5802),u=i(5547),g=i(2271),b=i(6170);let o=(()=>{class n{size=(0,l.hFB)("m");sizeMap={xs:"40px",s:"80px",m:"160px",l:"222px"};active=(0,l.hFB)(!0,{transform:l.L39});continuous=(0,l.hFB)(!1,{transform:l.L39});isDarkMode=(0,l.geq)(!1);handleDarkModeChange(a){this.isDarkMode.set(a),-1===this.raf&&this.animate()}colorA=(0,g.EW)(()=>this.isDarkMode()?[221,246,18]:[18,28,43]);colorB=[0,202,204];paths=[];raf=-1;appearTime=0;disappearTime=0;tip=0;toe=0;mix=[0,0,0];norm=0;animate=a=>{if(void 0!==a&&(this.tip=Math.min(1,6e-4*(a-this.appearTime)),this.active()||(this.toe=Math.min(1,6e-4*(a-this.disappearTime)))),this.paths.forEach((d,e)=>{this.norm=1/this.paths.length*e,this.mix=this.mixRgb(this.colorA(),this.colorB,Math.max(0,Math.min(1,15*(this.tip-this.norm)))),d.setAttribute("stroke",this.tip*this.paths.length>e&&(this.active()||this.toe*this.paths.length<e)?this.rgbToSvg(this.mix):"transparent")}),this.tip>=1&&(this.active()||this.toe>=1))return this.continuous()?void setTimeout(()=>{this.appearTime=performance.now(),this.tip=0,this.toe=0,this.raf=requestAnimationFrame(this.animate)},500):void(this.raf=-1);this.raf=requestAnimationFrame(this.animate)};activate(){this.appearTime=performance.now(),this.animate(this.appearTime)}deactivate(){this.disappearTime=performance.now(),-1===this.raf&&this.animate(this.disappearTime)}mixChannel(a,d,e){return parseInt((a*e+d*(1-e)).toFixed())}mixRgb(a,d,e){return[this.mixChannel(a[0],d[0],e),this.mixChannel(a[1],d[1],e),this.mixChannel(a[2],d[2],e)]}rgbToSvg(a){return`rgb(${a[0]},${a[1]},${a[2]})`}constructor(){(0,c.QZP)(()=>{this.active()?this.activate():this.deactivate()}),(0,c.QZP)(()=>{this.isDarkMode(),this.animate()});const a=(0,c.WQX)(u.aKT);(0,u.mal)({read:()=>{if(this.paths.length)return;const d=a.nativeElement.querySelector("svg"),e=a.nativeElement.querySelector("#original-path");if(!e)return;const r=e.getTotalLength(),s=[];for(let f=0;f<400;f++){const t=e.getPointAtLength(r/400*f);s.push({x:parseFloat(t.x.toFixed(2)),y:parseFloat(t.y.toFixed(2))})}s.push(e.getPointAtLength(r)),s.reverse(),s.forEach((f,t)=>{if(0===t||1===t)return;const p=document.createElementNS("http://www.w3.org/2000/svg","path");p.setAttribute("d",`M${s[t-2].x},${s[t-2].y}L${s[t-1].x},${s[t-1].y}L${f.x},${f.y}`),p.setAttribute("fill","none"),p.setAttribute("stroke","transparent"),p.setAttribute("stroke-width",e?.getAttribute("stroke-width")||"1"),p.setAttribute("stroke-miterlimit",e?.getAttribute("stroke-miterlimit")||"1"),d.appendChild(p),this.paths.push(p)})}})}ngOnDestroy(){this.paths=[],cancelAnimationFrame(this.raf),this.raf=-1}static \u0275fac=function(d){return new(d||n)};static \u0275cmp=u.VBU({type:n,selectors:[["cue-logo"]],hostVars:2,hostBindings:function(d,e){2&d&&u.xc7("width",e.sizeMap[e.size()])},inputs:{size:[1,"size"],active:[1,"active"],continuous:[1,"continuous"],isDarkMode:[1,"isDarkMode"]},outputs:{isDarkMode:"isDarkModeChange"},decls:2,vars:0,consts:[["cueDarkMode","","xmlns","http://www.w3.org/2000/svg","viewBox","0 0 221.545 86.191","width","222","height","86","overflow","visible",3,"darkModeChange"],["id","original-path","fill","none","stroke","transparent","stroke-miterlimit","10","stroke-width","12","d","M216.046 56.638s-10.561 24.201-36.192 22.991c-25.631-1.21-22.771-24.751-20.351-37.622 2.42-12.871 10.451-20.351 16.831-18.041 6.283 2.275 8.03 9.68 2.09 21.891-5.94 12.211-21.341 37.567-35.862 33.992-12.413-3.056-13.281-23.162-13.281-23.162V29.762v26.925c0 14.471-12.47 23.212-24.672 23.212s-24.672-8.301-24.672-23.212V29.829l-.006.105v13.031c0 20.416-16.55 36.966-36.966 36.966S6 63.381 6 42.966 22.55 6 42.966 6c6.91 0 13.377 1.896 18.91 5.196"]],template:function(d,e){1&d&&(c.qSk(),u.j41(0,"svg",0),u.bIt("darkModeChange",function(h){return e.handleDarkModeChange(h)}),u.nrm(1,"path",1),u.k0s())},dependencies:[b.R],styles:["[_nghost-%COMP%]{display:block}svg[_ngcontent-%COMP%]{flex:1;display:block;width:100%;height:auto}"]})}return n})()},2306(x,M,i){i.d(M,{AA:()=>g,ux:()=>b,yY:()=>u});var l=i(140),c=i(8402);class u{mapboxToken;contextMenu={showProperties:!0,showFlyTo:!0};toolbar=new g}class g{hidden=!1;position="bottom";margin="20px";displayZoom=!0;displayGeofenceDraw=!1;displayLayerToggle=!0;clearGeofenceAfterDraw=!0}class b{label;id;collection=new l.o;color;visible=!0;cluster=!0;zoomToFit=!0;category;constructor(n,y=(0,c.A)()){this.label=n,this.id=y}}},3191(x,M,i){i.d(M,{g:()=>u});var l=i(467),c=i(5802);let u=(()=>{class g{searchPage(o,n,y){return(0,l.A)(function*(){if(!y||!y.trim())return[];const a=y.toLowerCase(),d=yield o.getPage(n),e=d.getViewport({scale:1}),h=(yield d.getTextContent()).items,s=[];let f="";const t=[],p=[];for(let m=0;m<h.length;m++){const D=h[m].str??"";for(let C=0;C<D.length;C++)f+=D[C],t.push(m),p.push(C)}const _=f.toLowerCase();let v=0;for(;v<_.length;){const m=_.indexOf(a,v);if(-1===m)break;const P=m+a.length-1;v=m+1;const D=new Set;for(let O=m;O<=P;O++)D.add(t[O]);let C=1/0,E=1/0,T=-1/0,A=-1/0;for(const O of D){const U=h[O],[B,N,q,j,k,I]=U.transform,W=U.width??0,w=U.height??Math.abs(B||j||12),R=Math.sqrt(B*B+N*N)||1,S=B/R,z=N/R,Y=q/R,X=j/R,ne=[[k,I],[k+S*W,I+z*W],[k+S*W+Y*w,I+z*W+X*w],[k+Y*w,I+X*w]];for(const[oe,re]of ne){const[Z,H]=e.convertToViewportPoint(oe,re);C=Math.min(C,Z),E=Math.min(E,H),T=Math.max(T,Z),A=Math.max(A,H)}}const F=e.width,L=e.height,$=.005*F,V=.005*L,J=(E-V)/L*100,K=(T-C+2*$)/F*100,G=(A-E+2*V)/L*100;K>0&&G>0&&s.push({page:n,xywhStr:`percent:${((C-$)/F*100).toFixed(2)},${J.toFixed(2)},${K.toFixed(2)},${G.toFixed(2)}`})}return s})()}searchAll(o,n){var y=this;return(0,l.A)(function*(){if(!n||!n.trim())return[];const a=o.numPages,d=[];for(let e=1;e<=a;e++){const r=yield y.searchPage(o,e,n);d.push(...r)}return d})()}static \u0275fac=function(n){return new(n||g)};static \u0275prov=c.jDH({token:g,factory:g.\u0275fac,providedIn:"root"})}return g})()},6170(x,M,i){i.d(M,{R:()=>b});var l=i(7705),c=i(5802),u=i(2271),g=i(5547);let b=(()=>{class o{destroyRef=(0,c.WQX)(c.abz);_isDarkMode=(0,c.vPA)(this.hasDarkClass());isDarkMode=(0,u.EW)(()=>this._isDarkMode());darkModeChange=(0,l.CGW)();constructor(){const y=new MutationObserver(a=>{a.forEach(d=>{if("attributes"===d.type&&"class"===d.attributeName){const e=this.hasDarkClass();e!==this._isDarkMode()&&this._isDarkMode.set(e)}})});y.observe(document.body,{attributes:!0,attributeFilter:["class"]}),this.destroyRef.onDestroy(()=>y.disconnect()),(0,c.QZP)(()=>{this.darkModeChange.emit(this._isDarkMode()),document.documentElement.style.colorScheme=this._isDarkMode()?"dark":"light"})}hasDarkClass(){return document.body.classList.contains("dark")}toggleDarkMode(){document.body.classList.toggle("dark")}static \u0275fac=function(a){return new(a||o)};static \u0275dir=g.FsC({type:o,selectors:[["","cueDarkMode",""]],outputs:{darkModeChange:"darkModeChange"},exportAs:["darkModeDetector"]})}return o})()},140(x,M,i){i.d(M,{o:()=>l});class l{type="FeatureCollection";features=[];bbox;id;constructor(u=[]){this.features=u}addFeature(u){this.features.push(u)}removeFeature(u){return this.features.splice(u,1)[0]}getFeatureCount(){return this.features.length}clear(){this.features=[]}}},58(x,M,i){function l(e){let r=0,h=-1,s=-1;for(let f=0;f<e.length;f++)if("("===e[f])r++,1===r&&(h=f+1);else if(")"===e[f]&&(r--,0===r)){s=f;break}return-1!==h&&-1!==s?e.substring(h,s):null}i.d(M,{S:()=>a,n:()=>d});class c{x;y;z;constructor(r,h,s){this.x=r,this.y=h,this.z=s}}class u{points;constructor(r){this.points=r}}class g{lines;constructor(r){this.lines=r}}function a(e){if(e){if((e=e.trim().toUpperCase()).startsWith("POINT"))return function o(e){e=e.trim().toUpperCase();const h=l(e)?.split(" ")??[];return e.includes("POINT Z")?new c(parseFloat(h[0]),parseFloat(h[1]),parseFloat(h[2])):new c(parseFloat(h[0]),parseFloat(h[1]))}(e);if(e.startsWith("LINESTRING"))return function b(e){const r=l(e=e.trim().toUpperCase()),h=[];return r?.split(",").map(s=>s.trim().split(" ").map(f=>parseFloat(f))).map(s=>{h.push(new c(s[0],s[1],s[2]))}),new u(h)}(e);if(e.startsWith("POLYGON"))return function n(e){const r=l(e=e.trim().toUpperCase());if(!r)return new g([]);const h=r.match(/\(([^)]+)\)/g);if(!h)return new g([]);const s=h.map(f=>{const t=l(f);return t?t.split(",").map(p=>{const _=p.trim().split(" ");return _.length>=3?new c(parseFloat(_[0]),parseFloat(_[1]),parseFloat(_[2])):new c(parseFloat(_[0]),parseFloat(_[1]))}):[]});return new g(s)}(e)}}function d(e){if(e instanceof c)return{type:"Point",coordinates:void 0!==e.z?[e.x,e.y,e.z]:[e.x,e.y]};if(e instanceof u)return{type:"LineString",coordinates:e.points.map(r=>void 0!==r.z?[r.x,r.y,r.z]:[r.x,r.y])};if(e instanceof g)return{type:"Polygon",coordinates:e.lines.map(r=>r.map(h=>void 0!==h.z?[h.x,h.y,h.z]:[h.x,h.y]))};throw new Error("Unknown WKT type")}},5332(x,M,i){i.d(M,{k:()=>g});for(var c=[],u=0;u<256;++u)c.push((u+256).toString(16).slice(1));function g(n,y=0){return(c[n[y+0]]+c[n[y+1]]+c[n[y+2]]+c[n[y+3]]+"-"+c[n[y+4]]+c[n[y+5]]+"-"+c[n[y+6]]+c[n[y+7]]+"-"+c[n[y+8]]+c[n[y+9]]+"-"+c[n[y+10]]+c[n[y+11]]+c[n[y+12]]+c[n[y+13]]+c[n[y+14]]+c[n[y+15]]).toLowerCase()}},8402(x,M,i){i.d(M,{A:()=>y});const c={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};var u,g=new Uint8Array(16);function b(){if(!u&&!(u=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return u(g)}var o=i(5332);const y=function n(a,d,e){if(c.randomUUID&&!d&&!a)return c.randomUUID();var r=(a=a||{}).random||(a.rng||b)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,d){e=e||0;for(var h=0;h<16;++h)d[e+h]=r[h];return d}return(0,o.k)(r)}},7106(x,M,i){function l(c,u){this.v=c,this.k=u}i.d(M,{A:()=>l})},600(x,M,i){i.d(M,{A:()=>c});var l=i(7106);function c(g){return function(){return new u(g.apply(this,arguments))}}function u(g){var b,o;function n(a,d){try{var e=g[a](d),r=e.value,h=r instanceof l.A;Promise.resolve(h?r.v:r).then(function(s){if(h){var f="return"===a?"return":"next";if(!r.k||s.done)return n(f,s);s=g[f](s).value}y(e.done?"return":"normal",s)},function(s){n("throw",s)})}catch(s){y("throw",s)}}function y(a,d){switch(a){case"return":b.resolve({value:d,done:!0});break;case"throw":b.reject(d);break;default:b.resolve({value:d,done:!1})}(b=b.next)?n(b.key,b.arg):o=null}this._invoke=function(a,d){return new Promise(function(e,r){var h={key:a,arg:d,resolve:e,reject:r,next:null};o?o=o.next=h:(b=o=h,n(a,d))})},"function"!=typeof g.return&&(this.return=void 0)}u.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},u.prototype.next=function(g){return this._invoke("next",g)},u.prototype.throw=function(g){return this._invoke("throw",g)},u.prototype.return=function(g){return this._invoke("return",g)}}}]);