@limetech/lime-web-components 6.8.0 → 6.10.0
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/CHANGELOG.md +17 -0
- package/dist/ai-context/ai-context-registry.d.ts +252 -0
- package/dist/ai-context/ai-context-registry.d.ts.map +1 -0
- package/dist/ai-context/index.d.ts +3 -0
- package/dist/ai-context/index.d.ts.map +1 -0
- package/dist/ai-context/types.d.ts +15 -0
- package/dist/ai-context/types.d.ts.map +1 -0
- package/dist/index.cjs +3 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.esm.js +90 -88
- package/dist/index.esm.js.map +1 -1
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,20 @@
|
|
|
1
|
+
## [6.10.0](https://github.com/Lundalogik/lime-web-components/compare/v6.9.0...v6.10.0) (2026-02-13)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
* **ai-context:** add GatheredAIContext and update element registration ([e1ebb1d](https://github.com/Lundalogik/lime-web-components/commit/e1ebb1d51eb89290cbd64a252b1b42145c833d12))
|
|
8
|
+
* **ai-context:** allow getContext() to return null ([35209a4](https://github.com/Lundalogik/lime-web-components/commit/35209a4a6a456d2b3a7254b848d4af46d86cc380))
|
|
9
|
+
|
|
10
|
+
## [6.9.0](https://github.com/Lundalogik/lime-web-components/compare/v6.8.0...v6.9.0) (2026-01-28)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
* **ai-context:** add AIContextRegistry interface ([86ab2a9](https://github.com/Lundalogik/lime-web-components/commit/86ab2a9eb55a86b3bbd18680c0e24f96c5be3ac0))
|
|
17
|
+
|
|
1
18
|
## [6.8.0](https://github.com/Lundalogik/lime-web-components/compare/v6.7.0...v6.8.0) (2026-01-28)
|
|
2
19
|
|
|
3
20
|
|
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
import { LimeWebComponent } from '../core/lime-web-component';
|
|
2
|
+
import { LimeWebComponentContext } from '../core/context';
|
|
3
|
+
/**
|
|
4
|
+
* A value that can be safely serialized to JSON via JSON.stringify().
|
|
5
|
+
*
|
|
6
|
+
* This type excludes non-serializable values like:
|
|
7
|
+
* - `undefined` (use `null` instead)
|
|
8
|
+
* - `Date` (convert to ISO string first)
|
|
9
|
+
* - `Function`
|
|
10
|
+
* - `Symbol`
|
|
11
|
+
* - Circular references
|
|
12
|
+
*
|
|
13
|
+
* @alpha
|
|
14
|
+
* @group AI Context
|
|
15
|
+
*/
|
|
16
|
+
export type JsonValue = string | number | boolean | null | JsonValue[] | {
|
|
17
|
+
[key: string]: JsonValue;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Represents context information that a provider contributes to the AI chat.
|
|
21
|
+
*
|
|
22
|
+
* Each contribution is additive - all providers' contributions are collected
|
|
23
|
+
* into an array when the AI chat gathers context.
|
|
24
|
+
*
|
|
25
|
+
* @alpha
|
|
26
|
+
* @group AI Context
|
|
27
|
+
*/
|
|
28
|
+
export interface AIContextContribution {
|
|
29
|
+
/**
|
|
30
|
+
* Structured data about the current state.
|
|
31
|
+
*
|
|
32
|
+
* This data will be serialized and included in the AI prompt context.
|
|
33
|
+
* Keep the data focused and relevant to avoid filling the context window
|
|
34
|
+
* with noise.
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```typescript
|
|
38
|
+
* data: {
|
|
39
|
+
* currentObject: {
|
|
40
|
+
* limetype: 'deal',
|
|
41
|
+
* id: 123,
|
|
42
|
+
* descriptive: 'Acme Corp - Enterprise License'
|
|
43
|
+
* },
|
|
44
|
+
* availableRelations: ['company', 'person', 'activity']
|
|
45
|
+
* }
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
48
|
+
data?: Record<string, JsonValue>;
|
|
49
|
+
/**
|
|
50
|
+
* Describes the purpose of this component and what it shows.
|
|
51
|
+
*
|
|
52
|
+
* Use this to help the AI understand what the component is for,
|
|
53
|
+
* how users interact with it, and what the data represents.
|
|
54
|
+
* This is typically hardcoded by component developers.
|
|
55
|
+
*
|
|
56
|
+
* Do NOT use this to restate structured data in natural language.
|
|
57
|
+
* The AI can read the data directly.
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* ```typescript
|
|
61
|
+
* // Good: explains what the component is and does
|
|
62
|
+
* purpose: 'Shows a single aggregated value from a filter. ' +
|
|
63
|
+
* 'Clicking navigates to the explorer with that filter applied.'
|
|
64
|
+
*
|
|
65
|
+
* // Good: explains how to interpret the data
|
|
66
|
+
* purpose: 'Displays deals in a pipeline view grouped by stage. ' +
|
|
67
|
+
* 'Users drag deals between columns to change their stage.'
|
|
68
|
+
*
|
|
69
|
+
* // Bad: restates structured data
|
|
70
|
+
* purpose: 'The user is viewing deal 123.' // Use data instead
|
|
71
|
+
* ```
|
|
72
|
+
*/
|
|
73
|
+
purpose?: string;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* A fully enriched context contribution ready for the AI.
|
|
77
|
+
*
|
|
78
|
+
* This is the "output" of context gathering — includes the provider's
|
|
79
|
+
* contribution plus UI context information added by the registry.
|
|
80
|
+
*
|
|
81
|
+
* @alpha
|
|
82
|
+
* @group AI Context
|
|
83
|
+
*/
|
|
84
|
+
export interface GatheredAIContext extends AIContextContribution {
|
|
85
|
+
/**
|
|
86
|
+
* The component's LimeWebComponentContext at the time of gathering.
|
|
87
|
+
*
|
|
88
|
+
* Provides rich information about where this context originates:
|
|
89
|
+
* - `limetype`: What type of business object the component is working with
|
|
90
|
+
* - `id`: Which specific record (if any)
|
|
91
|
+
* - `parent`: Parent context for nested components
|
|
92
|
+
*
|
|
93
|
+
* Only present when the provider registered with an element reference.
|
|
94
|
+
*/
|
|
95
|
+
componentContext?: LimeWebComponentContext;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* A provider that contributes context information to the AI chat.
|
|
99
|
+
*
|
|
100
|
+
* Components register providers to share relevant state with the AI.
|
|
101
|
+
* When the AI chat needs context, it calls `getContext()` on all
|
|
102
|
+
* registered providers and collects their contributions.
|
|
103
|
+
*
|
|
104
|
+
* Typically, providers are registered when a component is created or
|
|
105
|
+
* connected to the DOM, and unregistered when disconnected. Alternatively,
|
|
106
|
+
* some components may register/unregister based on visibility if context
|
|
107
|
+
* should only be provided while the component is visible to the user.
|
|
108
|
+
*
|
|
109
|
+
* The `register()` method returns an unregister function for cleanup.
|
|
110
|
+
*
|
|
111
|
+
* @example
|
|
112
|
+
* Registering a provider in a Stencil component
|
|
113
|
+
* ```typescript
|
|
114
|
+
* @Component({ tag: 'my-custom-panel' })
|
|
115
|
+
* export class MyCustomPanel {
|
|
116
|
+
* @Element()
|
|
117
|
+
* private host: HTMLElement & LimeWebComponent;
|
|
118
|
+
*
|
|
119
|
+
* private unregisterContext: () => void;
|
|
120
|
+
*
|
|
121
|
+
* connectedCallback() {
|
|
122
|
+
* const registry = this.platform.get(PlatformServiceName.AIContextRegistry);
|
|
123
|
+
* this.unregisterContext = registry.register({
|
|
124
|
+
* contextType: 'my-custom-panel',
|
|
125
|
+
* getContext: () => ({
|
|
126
|
+
* purpose: 'Lets users select items for bulk operations. ' +
|
|
127
|
+
* 'Selected items can be exported or bulk-edited.',
|
|
128
|
+
* data: {
|
|
129
|
+
* selectedItemIds: this.selectedItems.map(i => i.id),
|
|
130
|
+
* selectionCount: this.selectedItems.length
|
|
131
|
+
* }
|
|
132
|
+
* })
|
|
133
|
+
* }, this.host);
|
|
134
|
+
* }
|
|
135
|
+
*
|
|
136
|
+
* disconnectedCallback() {
|
|
137
|
+
* this.unregisterContext?.();
|
|
138
|
+
* }
|
|
139
|
+
* }
|
|
140
|
+
* ```
|
|
141
|
+
*
|
|
142
|
+
* @alpha
|
|
143
|
+
* @group AI Context
|
|
144
|
+
*/
|
|
145
|
+
export interface AIContextProvider {
|
|
146
|
+
/**
|
|
147
|
+
* Semantic label for grouping related providers.
|
|
148
|
+
*
|
|
149
|
+
* Multiple providers can share the same contextType (e.g., multiple
|
|
150
|
+
* info-tiles on a page). Each registration gets a unique internal key,
|
|
151
|
+
* so there are no collisions. This label is used for debugging and
|
|
152
|
+
* potential future grouping/filtering of context.
|
|
153
|
+
*
|
|
154
|
+
* Use a descriptive name that identifies the component or feature type.
|
|
155
|
+
*/
|
|
156
|
+
readonly contextType: string;
|
|
157
|
+
/**
|
|
158
|
+
* Get context from this provider.
|
|
159
|
+
*
|
|
160
|
+
* Called when the AI chat needs to gather context from all providers.
|
|
161
|
+
* Should return data that the component already has available - this
|
|
162
|
+
* method is synchronous because providers should only return data
|
|
163
|
+
* that is already rendered on-screen.
|
|
164
|
+
*
|
|
165
|
+
* The implementation should be fast and avoid expensive operations
|
|
166
|
+
* since it's called on every message.
|
|
167
|
+
*
|
|
168
|
+
* @returns The context contribution, or `null` if no context is available
|
|
169
|
+
* (e.g., required state hasn't loaded yet).
|
|
170
|
+
*/
|
|
171
|
+
getContext(): AIContextContribution | null;
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Registry for AI context providers.
|
|
175
|
+
*
|
|
176
|
+
* The AIContextRegistry manages context providers that contribute information
|
|
177
|
+
* to the AI chat. Components register providers to share their state, and the
|
|
178
|
+
* AI chat gathers context from all providers when needed.
|
|
179
|
+
*
|
|
180
|
+
* @example
|
|
181
|
+
* Gathering context for an AI request
|
|
182
|
+
* ```typescript
|
|
183
|
+
* const registry = platform.get(PlatformServiceName.AIContextRegistry);
|
|
184
|
+
* const contributions = registry.gatherContext();
|
|
185
|
+
* ```
|
|
186
|
+
*
|
|
187
|
+
* @see {@link AIContextProvider} for provider interface
|
|
188
|
+
* @see {@link AIContextContribution} for contribution format
|
|
189
|
+
*
|
|
190
|
+
* @alpha
|
|
191
|
+
* @group AI Context
|
|
192
|
+
*/
|
|
193
|
+
export interface AIContextRegistry {
|
|
194
|
+
/**
|
|
195
|
+
* Register a context provider.
|
|
196
|
+
*
|
|
197
|
+
* The provider will be called when context is gathered via `gatherContext()`.
|
|
198
|
+
* Multiple providers with the same contextType can coexist - each registration
|
|
199
|
+
* gets a unique internal key.
|
|
200
|
+
*
|
|
201
|
+
* @param provider - The provider to register.
|
|
202
|
+
* @param element - Optional host element of the component registering this
|
|
203
|
+
* provider. When provided, enables the registry to:
|
|
204
|
+
* - Read the component's `LimeWebComponentContext` to enrich contributions
|
|
205
|
+
* - Skip providers whose elements are not currently connected to the DOM
|
|
206
|
+
* @returns A function to unregister the provider. Call this when the
|
|
207
|
+
* component is disconnected or the context is no longer relevant.
|
|
208
|
+
*
|
|
209
|
+
* @example
|
|
210
|
+
* ```typescript
|
|
211
|
+
* const unregister = registry.register({
|
|
212
|
+
* contextType: 'deal-card',
|
|
213
|
+
* getContext: () => ({
|
|
214
|
+
* purpose: 'Shows full details of a deal record. ' +
|
|
215
|
+
* 'Users can edit fields and manage related records.',
|
|
216
|
+
* data: {
|
|
217
|
+
* limetype: 'deal',
|
|
218
|
+
* id: this.dealId,
|
|
219
|
+
* descriptive: this.deal.descriptive
|
|
220
|
+
* }
|
|
221
|
+
* })
|
|
222
|
+
* }, this.host);
|
|
223
|
+
*
|
|
224
|
+
* // Later, when component is disconnected:
|
|
225
|
+
* unregister();
|
|
226
|
+
* ```
|
|
227
|
+
*/
|
|
228
|
+
register(provider: AIContextProvider, element?: HTMLElement & LimeWebComponent): () => void;
|
|
229
|
+
/**
|
|
230
|
+
* Get all registered providers.
|
|
231
|
+
*
|
|
232
|
+
* Useful for debugging or introspection.
|
|
233
|
+
*
|
|
234
|
+
* @returns Array of all registered providers.
|
|
235
|
+
*/
|
|
236
|
+
getProviders(): AIContextProvider[];
|
|
237
|
+
/**
|
|
238
|
+
* Gather context from all registered providers.
|
|
239
|
+
*
|
|
240
|
+
* Calls `getContext()` on each provider and collects the results.
|
|
241
|
+
* Providers that return `null` (indicating no context available) and
|
|
242
|
+
* providers that throw errors are skipped (errors log a warning).
|
|
243
|
+
*
|
|
244
|
+
* Each contribution is enriched with the component's `LimeWebComponentContext`
|
|
245
|
+
* if the provider was registered with an element reference.
|
|
246
|
+
*
|
|
247
|
+
* @returns An array of enriched context contributions, one from each
|
|
248
|
+
* provider that returned a non-null contribution.
|
|
249
|
+
*/
|
|
250
|
+
gatherContext(): GatheredAIContext[];
|
|
251
|
+
}
|
|
252
|
+
//# sourceMappingURL=ai-context-registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai-context-registry.d.ts","sourceRoot":"","sources":["../../src/ai-context/ai-context-registry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAE1D;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,SAAS,GACf,MAAM,GACN,MAAM,GACN,OAAO,GACP,IAAI,GACJ,SAAS,EAAE,GACX;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,CAAC;AAEnC;;;;;;;;GAQG;AACH,MAAM,WAAW,qBAAqB;IAClC;;;;;;;;;;;;;;;;;;OAkBG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IAEjC;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,iBAAkB,SAAQ,qBAAqB;IAC5D;;;;;;;;;OASG;IACH,gBAAgB,CAAC,EAAE,uBAAuB,CAAC;CAC9C;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AACH,MAAM,WAAW,iBAAiB;IAC9B;;;;;;;;;OASG;IACH,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAE7B;;;;;;;;;;;;;OAaG;IACH,UAAU,IAAI,qBAAqB,GAAG,IAAI,CAAC;CAC9C;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,WAAW,iBAAiB;IAC9B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAiCG;IACH,QAAQ,CACJ,QAAQ,EAAE,iBAAiB,EAC3B,OAAO,CAAC,EAAE,WAAW,GAAG,gBAAgB,GACzC,MAAM,IAAI,CAAC;IAEd;;;;;;OAMG;IACH,YAAY,IAAI,iBAAiB,EAAE,CAAC;IAEpC;;;;;;;;;;;;OAYG;IACH,aAAa,IAAI,iBAAiB,EAAE,CAAC;CACxC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ai-context/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { AIContextRegistry as Service } from './ai-context-registry';
|
|
2
|
+
declare const SERVICE_NAME = "aiContextRegistry";
|
|
3
|
+
declare module '../core/platform' {
|
|
4
|
+
interface PlatformServiceNameType {
|
|
5
|
+
/**
|
|
6
|
+
* @see {@link Service | AIContextRegistry}
|
|
7
|
+
*/
|
|
8
|
+
AIContextRegistry: typeof SERVICE_NAME;
|
|
9
|
+
}
|
|
10
|
+
interface LimeWebComponentPlatform {
|
|
11
|
+
get(name: PlatformServiceNameType['AIContextRegistry']): Service;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/ai-context/types.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,IAAI,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAErE,QAAA,MAAM,YAAY,sBAAsB,CAAC;AAIzC,OAAO,QAAQ,kBAAkB,CAAC;IAC9B,UAAU,uBAAuB;QAC7B;;WAEG;QACH,iBAAiB,EAAE,OAAO,YAAY,CAAC;KAC1C;IACD,UAAU,wBAAwB;QAC9B,GAAG,CAAC,IAAI,EAAE,uBAAuB,CAAC,mBAAmB,CAAC,GAAG,OAAO,CAAC;KACpE;CACJ"}
|
package/dist/index.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const N=require("@stencil/core");var p=typeof document<"u"?document.currentScript:null;const s={Route:"route"},ae="idle-state";function ue(e){return e&&["belongsto","hasone","hasmany","hasandbelongstomany"].includes(e.type)}function le(e){return e&&["belongsto","hasone"].includes(e.type)}function fe(e){return e&&["time","timeofday","date","year","quarter","month"].includes(e.type)}function pe(e){return e&&["string","text","phone","link"].includes(e.type)}function de(e){return e&&["decimal","percent"].includes(e.type)}const me="state.limetypes";s.LimeTypeRepository=me;var w=function(e,t){return w=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(r[o]=n[o])},w(e,t)};function b(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");w(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}function A(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const N=require("@stencil/core");var p=typeof document<"u"?document.currentScript:null;const s={Route:"route"},ae="idle-state";function ue(e){return e&&["belongsto","hasone","hasmany","hasandbelongstomany"].includes(e.type)}function le(e){return e&&["belongsto","hasone"].includes(e.type)}function fe(e){return e&&["time","timeofday","date","year","quarter","month"].includes(e.type)}function pe(e){return e&&["string","text","phone","link"].includes(e.type)}function de(e){return e&&["decimal","percent"].includes(e.type)}const me="state.limetypes";s.LimeTypeRepository=me;var w=function(e,t){return w=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(r[o]=n[o])},w(e,t)};function b(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");w(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}function A(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function I(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),o,i=[],c;try{for(;(t===void 0||t-- >0)&&!(o=n.next()).done;)i.push(o.value)}catch(a){c={error:a}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return i}function j(e,t,r){if(r||arguments.length===2)for(var n=0,o=t.length,i;n<o;n++)(i||!(n in t))&&(i||(i=Array.prototype.slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))}function d(e){return typeof e=="function"}function W(e){var t=function(n){Error.call(n),n.stack=new Error().stack},r=e(t);return r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r}var R=W(function(e){return function(r){e(this),this.message=r?r.length+` errors occurred during unsubscription:
|
|
2
2
|
`+r.map(function(n,o){return o+1+") "+n.toString()}).join(`
|
|
3
|
-
`):"",this.name="UnsubscriptionError",this.errors=r}});function L(e,t){if(e){var r=e.indexOf(t);0<=r&&e.splice(r,1)}}var _=(function(){function e(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var t,r,n,o,i;if(!this.closed){this.closed=!0;var c=this._parentage;if(c)if(this._parentage=null,Array.isArray(c))try{for(var a=A(c),u=a.next();!u.done;u=a.next()){var O=u.value;O.remove(this)}}catch(f){t={error:f}}finally{try{u&&!u.done&&(r=a.return)&&r.call(a)}finally{if(t)throw t.error}}else c.remove(this);var M=this.initialTeardown;if(d(M))try{M()}catch(f){i=f instanceof R?f.errors:[f]}var T=this._finalizers;if(T){this._finalizers=null;try{for(var v=A(T),y=v.next();!y.done;y=v.next()){var se=y.value;try{U(se)}catch(f){i=i??[],f instanceof R?i=I(I([],j(i)),j(f.errors)):i.push(f)}}}catch(f){n={error:f}}finally{try{y&&!y.done&&(o=v.return)&&o.call(v)}finally{if(n)throw n.error}}}if(i)throw new R(i)}},e.prototype.add=function(t){var r;if(t&&t!==this)if(this.closed)U(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(r=this._finalizers)!==null&&r!==void 0?r:[]).push(t)}},e.prototype._hasParent=function(t){var r=this._parentage;return r===t||Array.isArray(r)&&r.includes(t)},e.prototype._addParent=function(t){var r=this._parentage;this._parentage=Array.isArray(r)?(r.push(t),r):r?[r,t]:t},e.prototype._removeParent=function(t){var r=this._parentage;r===t?this._parentage=null:Array.isArray(r)&&L(r,t)},e.prototype.remove=function(t){var r=this._finalizers;r&&L(r,t),t instanceof e&&t._removeParent(this)},e.EMPTY=(function(){var t=new e;return t.closed=!0,t})(),e})(),G=_.EMPTY;function Q(e){return e instanceof _||e&&"closed"in e&&d(e.remove)&&d(e.add)&&d(e.unsubscribe)}function U(e){d(e)?e():e.unsubscribe()}var he={Promise:void 0},ye={setTimeout:function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];return setTimeout.apply(void 0,I([e,t],j(r)))},clearTimeout:function(e){return clearTimeout(e)},delegate:void 0};function be(e){ye.setTimeout(function(){throw e})}function $(){}function E(e){e()}var Y=(function(e){b(t,e);function t(r){var n=e.call(this)||this;return n.isStopped=!1,r?(n.destination=r,Q(r)&&r.add(n)):n.destination=Se,n}return t.create=function(r,n,o){return new D(r,n,o)},t.prototype.next=function(r){this.isStopped||this._next(r)},t.prototype.error=function(r){this.isStopped||(this.isStopped=!0,this._error(r))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(r){this.destination.next(r)},t.prototype._error=function(r){try{this.destination.error(r)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t})(_),ve=(function(){function e(t){this.partialObserver=t}return e.prototype.next=function(t){var r=this.partialObserver;if(r.next)try{r.next(t)}catch(n){g(n)}},e.prototype.error=function(t){var r=this.partialObserver;if(r.error)try{r.error(t)}catch(n){g(n)}else g(t)},e.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(r){g(r)}},e})(),D=(function(e){b(t,e);function t(r,n,o){var i=e.call(this)||this,c;return d(r)||!r?c={next:r??void 0,error:n??void 0,complete:o??void 0}:c=r,i.destination=new ve(c),i}return t})(Y);function g(e){be(e)}function ge(e){throw e}var Se={closed:!0,next:$,error:ge,complete:$},Ee=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})();function Ce(e){return e}function _e(e){return e.length===0?Ce:e.length===1?e[0]:function(r){return e.reduce(function(n,o){return o(n)},r)}}var F=(function(){function e(t){t&&(this._subscribe=t)}return e.prototype.lift=function(t){var r=new e;return r.source=this,r.operator=t,r},e.prototype.subscribe=function(t,r,n){var o=this,i=Re(t)?t:new D(t,r,n);return E(function(){var c=o,a=c.operator,u=c.source;i.add(a?a.call(i,u):u?o._subscribe(i):o._trySubscribe(i))}),i},e.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(r){t.error(r)}},e.prototype.forEach=function(t,r){var n=this;return r=V(r),new r(function(o,i){var c=new D({next:function(a){try{t(a)}catch(u){i(u),c.unsubscribe()}},error:i,complete:o});n.subscribe(c)})},e.prototype._subscribe=function(t){var r;return(r=this.source)===null||r===void 0?void 0:r.subscribe(t)},e.prototype[Ee]=function(){return this},e.prototype.pipe=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return _e(t)(this)},e.prototype.toPromise=function(t){var r=this;return t=V(t),new t(function(n,o){var i;r.subscribe(function(c){return i=c},function(c){return o(c)},function(){return n(i)})})},e.create=function(t){return new e(t)},e})();function V(e){var t;return(t=e??he.Promise)!==null&&t!==void 0?t:Promise}function Oe(e){return e&&d(e.next)&&d(e.error)&&d(e.complete)}function Re(e){return e&&e instanceof Y||Oe(e)&&Q(e)}var Pe=W(function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),K=(function(e){b(t,e);function t(){var r=e.call(this)||this;return r.closed=!1,r.currentObservers=null,r.observers=[],r.isStopped=!1,r.hasError=!1,r.thrownError=null,r}return t.prototype.lift=function(r){var n=new k(this,this);return n.operator=r,n},t.prototype._throwIfClosed=function(){if(this.closed)throw new Pe},t.prototype.next=function(r){var n=this;E(function(){var o,i;if(n._throwIfClosed(),!n.isStopped){n.currentObservers||(n.currentObservers=Array.from(n.observers));try{for(var c=A(n.currentObservers),a=c.next();!a.done;a=c.next()){var u=a.value;u.next(r)}}catch(O){o={error:O}}finally{try{a&&!a.done&&(i=c.return)&&i.call(c)}finally{if(o)throw o.error}}}})},t.prototype.error=function(r){var n=this;E(function(){if(n._throwIfClosed(),!n.isStopped){n.hasError=n.isStopped=!0,n.thrownError=r;for(var o=n.observers;o.length;)o.shift().error(r)}})},t.prototype.complete=function(){var r=this;E(function(){if(r._throwIfClosed(),!r.isStopped){r.isStopped=!0;for(var n=r.observers;n.length;)n.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var r;return((r=this.observers)===null||r===void 0?void 0:r.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(r){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,r)},t.prototype._subscribe=function(r){return this._throwIfClosed(),this._checkFinalizedStatuses(r),this._innerSubscribe(r)},t.prototype._innerSubscribe=function(r){var n=this,o=this,i=o.hasError,c=o.isStopped,a=o.observers;return i||c?G:(this.currentObservers=null,a.push(r),new _(function(){n.currentObservers=null,L(a,r)}))},t.prototype._checkFinalizedStatuses=function(r){var n=this,o=n.hasError,i=n.thrownError,c=n.isStopped;o?r.error(i):c&&r.complete()},t.prototype.asObservable=function(){var r=new F;return r.source=this,r},t.create=function(r,n){return new k(r,n)},t})(F),k=(function(e){b(t,e);function t(r,n){var o=e.call(this)||this;return o.destination=r,o.source=n,o}return t.prototype.next=function(r){var n,o;(o=(n=this.destination)===null||n===void 0?void 0:n.next)===null||o===void 0||o.call(n,r)},t.prototype.error=function(r){var n,o;(o=(n=this.destination)===null||n===void 0?void 0:n.error)===null||o===void 0||o.call(n,r)},t.prototype.complete=function(){var r,n;(n=(r=this.destination)===null||r===void 0?void 0:r.complete)===null||n===void 0||n.call(r)},t.prototype._subscribe=function(r){var n,o;return(o=(n=this.source)===null||n===void 0?void 0:n.subscribe(r))!==null&&o!==void 0?o:G},t})(K),we=(function(e){b(t,e);function t(r){var n=e.call(this)||this;return n._value=r,n}return Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),t.prototype._subscribe=function(r){var n=e.prototype._subscribe.call(this,r);return!n.closed&&r.next(this._value),n},t.prototype.getValue=function(){var r=this,n=r.hasError,o=r.thrownError,i=r._value;if(n)throw o;return this._throwIfClosed(),i},t.prototype.next=function(r){e.prototype.next.call(this,this._value=r)},t})(K);function Ae(e){return e}function l(e,t){return(r,n)=>{const o=je(r,n,e,t);o.length===1&&Ie(r,o)}}const B=new WeakMap,C=new WeakMap,X=new WeakMap;function je(e,t,r,n){let o=B.get(e);return o||(o=[],B.set(e,o)),o.push({options:r,name:t,optionFactory:n.optionFactory||Ae,service:{name:n.name,method:n.method||"subscribe"}}),o}function Ie(e,t){e.connectedCallback=J(e.connectedCallback,t),e.componentWillLoad=Le(e.componentWillLoad,t),e.componentDidUnload=H(e.componentDidUnload),e.disconnectedCallback=H(e.disconnectedCallback)}function J(e,t){return async function(...r){X.set(this,!0),C.set(this,[]),await Z(this);const n=new we(this.context);Ne(this,"context",n);for(const o of t)o.options=o.optionFactory(o.options,this),De(o.options)&&(o.options.context=n),xe(this,o);if(e)return e.apply(this,r)}}function Le(e,t){return async function(...r){return X.get(this)===!0?(await Z(this),e?e.apply(this,r):void 0):J(e,t).apply(this,r)}}function H(e){return async function(...t){let r;return e&&(r=e.apply(this,t)),Me(this),r}}function De(e){return"context"in e}function Z(e){const t=[];return e.platform||t.push(q(e,"platform")),e.context||t.push(q(e,"context")),t.length===0?Promise.resolve():Promise.all(t)}function q(e,t){const r=N.getElement(e);return new Promise(n=>{Object.defineProperty(r,t,{configurable:!0,set:o=>{delete r[t],r[t]=o,n()}})})}function Ne(e,t,r){const n=N.getElement(e),{get:o,set:i}=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(n),t);Object.defineProperty(n,t,{configurable:!0,get:o,set:function(c){i.call(this,c),r.next(c)}})}function xe(e,t){const r=Ue(e,t);if(typeof r!="function")return;C.get(e).push(r)}function Me(e){const t=C.get(e);for(const r of t)r();C.set(e,[])}function Te(e,t){return r=>{e[t]=r}}function Ue(e,t){const r={...t.options};$e(r,e);const n=t.service.name,o=e.platform;if(!o.has(n))throw new Error(`Service ${n} does not exist`);return o.get(n)[t.service.method](Te(e,t.name),r)}function $e(e,t){e.filter&&(e.filter=e.filter.map(r=>r.bind(t))),e.map&&(e.map=e.map.map(r=>r.bind(t)))}function Fe(e={}){const t={name:s.LimeTypeRepository};return l(e,t)}function Ve(e={}){const t={name:s.LimeTypeRepository};return e.map=[ke,...e.map||[]],e.context=null,l(e,t)}function ke(e){const{limetype:t}=this.context;return e[t]}const Be=e=>t=>Object.values(t).find(x(e));function He(e,t){return Object.values(e.properties).filter(r=>r.type===t)}function qe(e,t){return Object.values(e.properties).find(x(t))}function We(e,t){return e.properties[t]}const x=e=>t=>t?.label===e,Ge="state.limeobjects";s.LimeObjectRepository=Ge;function Qe(e={}){const t={name:s.LimeObjectRepository,optionFactory:Xe};return l(e,t)}function Ye(e={}){const t={name:s.LimeObjectRepository};return e.map=[Ke,...e.map||[]],e.context=null,l(e,t)}function Ke(e){const{limetype:t,id:r}=this.context;if(e[t])return e[t].find(n=>n.id===r)}function Xe(e,t){return e.getLimetype&&(e.limetype=e.getLimetype(t)),e}var z=(e=>(e.Received="command.received",e.Handled="command.handled",e.Failed="command.failed",e))(z||{});function m(e){return t=>{Je(t,e.id),Ze(t,e.id)}}function Je(e,t){e.commandId=t}function Ze(e,t){Object.defineProperty(e,Symbol.hasInstance,{value:r=>te(r).includes(t)})}function ee(e){return typeof e=="string"?e:e&&e.constructor&&e.constructor.commandId?e.constructor.commandId:e&&e.commandId?e.commandId:null}function te(e){let t=[],r,n=e;for(;r=ee(n);)t=[...t,r],n=Object.getPrototypeOf(n);return[...new Set(t)]}const ze="commandBus";s.CommandBus=ze;var et=Object.getOwnPropertyDescriptor,tt=(e,t,r,n)=>{for(var o=n>1?void 0:n?et(t,r):t,i=e.length-1,c;i>=0;i--)(c=e[i])&&(o=c(o)||o);return o};const rt="limeobject.bulk-create-dialog";exports.BulkCreateDialogCommand=class{context;filter;relation};exports.BulkCreateDialogCommand=tt([m({id:rt})],exports.BulkCreateDialogCommand);var nt=Object.getOwnPropertyDescriptor,ot=(e,t,r,n)=>{for(var o=n>1?void 0:n?nt(t,r):t,i=e.length-1,c;i>=0;i--)(c=e[i])&&(o=c(o)||o);return o};const it="limeobject.create-dialog";exports.CreateLimeobjectDialogCommand=class{limetype;limeobject;route=!1;title;subtitle;context;autoAttachRelation;saveCommand};exports.CreateLimeobjectDialogCommand=ot([m({id:it})],exports.CreateLimeobjectDialogCommand);var ct=Object.getOwnPropertyDescriptor,st=(e,t,r,n)=>{for(var o=n>1?void 0:n?ct(t,r):t,i=e.length-1,c;i>=0;i--)(c=e[i])&&(o=c(o)||o);return o};const at="limeobject.delete-object";exports.DeleteObjectCommand=class{context};exports.DeleteObjectCommand=st([m({id:at})],exports.DeleteObjectCommand);var ut=Object.getOwnPropertyDescriptor,lt=(e,t,r,n)=>{for(var o=n>1?void 0:n?ut(t,r):t,i=e.length-1,c;i>=0;i--)(c=e[i])&&(o=c(o)||o);return o};const ft="limeobject.object-access";exports.OpenObjectAccessDialogCommand=class{context};exports.OpenObjectAccessDialogCommand=lt([m({id:ft})],exports.OpenObjectAccessDialogCommand);var pt=Object.getOwnPropertyDescriptor,dt=(e,t,r,n)=>{for(var o=n>1?void 0:n?pt(t,r):t,i=e.length-1,c;i>=0;i--)(c=e[i])&&(o=c(o)||o);return o};const mt="limeobject.save-object";exports.SaveLimeObjectCommand=class{context;limeobject;route=!1;label};exports.SaveLimeObjectCommand=dt([m({id:mt})],exports.SaveLimeObjectCommand);var re=(e=>(e.AND="AND",e.OR="OR",e.NOT="!",e.EQUALS="=",e.NOT_EQUALS="!=",e.GREATER=">",e.LESS="<",e.IN="IN",e.BEGINS="=?",e.LIKE="?",e.LESS_OR_EQUAL="<=",e.GREATER_OR_EQUAL=">=",e.ENDS="=$",e))(re||{});const ht={Count:"COUNT",Sum:"SUM",Average:"AVG",Maximum:"MAX",Minimum:"MIN"},yt="query";s.Query=yt;const bt={Get:"GET",Post:"POST",Put:"PUT",Delete:"DELETE",Patch:"PATCH"},vt="http";s.Http=vt;const gt="eventDispatcher";s.EventDispatcher=gt;const St="translate";s.Translate=St;const Et="dialog";s.Dialog=Et;const Ct="keybindingRegistry";s.KeybindingRegistry=Ct;const _t="navigator";s.Navigator=_t;function Ot(e){const t={name:s.Navigator};return l({context:null,...e},t)}var Rt=Object.getOwnPropertyDescriptor,Pt=(e,t,r,n)=>{for(var o=n>1?void 0:n?Rt(t,r):t,i=e.length-1,c;i>=0;i--)(c=e[i])&&(o=c(o)||o);return o};const wt="navigator.navigate";exports.NavigateCommand=class{path;query;hash;state};exports.NavigateCommand=Pt([m({id:wt})],exports.NavigateCommand);const At="notifications";s.Notification=At;const jt="routeRegistry";s.RouteRegistry=jt;var ne=(e=>(e.Pending="PENDING",e.Started="STARTED",e.Retry="RETRY",e.Success="SUCCESS",e.Failure="FAILURE",e))(ne||{}),oe=(e=>(e.Created="task.created",e.Success="task.success",e.Failed="task.failed",e))(oe||{});const It="state.tasks";s.TaskRepository=It;const Lt="state.configs";s.ConfigRepository=Lt;function Dt(e){const t={name:s.ConfigRepository};return l(e,t)}const Nt="state.device";s.Device=Nt;function xt(e={}){const t={name:s.Device};return l(e,t)}const Mt="state.filters";s.FilterRepository=Mt;function Tt(e={}){const t={name:s.FilterRepository};return l(e,t)}const Ut="state.user-data";s.UserDataRepository=Ut;function $t(e={}){const t={name:s.UserDataRepository};return l(e,t)}const Ft="state.application";s.Application=Ft;function Vt(e={}){const t={name:s.Application};return e.map=[kt,...e.map||[]],l(e,t)}function kt(e){return e.applicationName}function Bt(e={}){const t={name:s.Application};return e.map=[Ht,...e.map||[]],l(e,t)}function Ht(e){return e.currentUser}function qt(e={}){const t={name:s.Application};return e.map=[Wt,...e.map||[]],l(e,t)}function Wt(e){return e.session}const Gt="userPreferences";s.UserPreferencesRepository=Gt;const Qt="datetimeformatter";s.DateTimeFormatter=Qt;function Yt(e){return e.type==="limeobject"}function Kt(e){return e.type==="action"}const Xt="conditionRegistry";s.ConditionRegistry=Xt;const Jt="viewFactoryRegistry";s.ViewFactoryRegistry=Jt;const Zt="webComponentRegistry";s.WebComponentRegistry=Zt;const zt="state.notifications";s.NotificationRepository=zt;const er="pollerFactory";s.PollerFactory=er;const tr={Debug:"debug",Info:"info",Warn:"warn",Error:"error"},rr="logger";s.Logger=rr;let h,S;function ie(e){const t=window.Lime?.logger?.createLogger;return typeof t!="function"?(console.warn(`Logger factory is not configured. Returning console logger for scope "${e}".`),console):(S===void 0&&(S=ce(nr())),S&&(e=`${S}:${e}`),t(e))}function nr(){return h!==void 0?h:{url:typeof document>"u"?require("url").pathToFileURL(__filename).href:p&&p.tagName.toUpperCase()==="SCRIPT"&&p.src||new URL("index.cjs",document.baseURI).href}!==void 0&&typeof(typeof document>"u"?require("url").pathToFileURL(__filename).href:p&&p.tagName.toUpperCase()==="SCRIPT"&&p.src||new URL("index.cjs",document.baseURI).href)=="string"?(h=typeof document>"u"?require("url").pathToFileURL(__filename).href:p&&p.tagName.toUpperCase()==="SCRIPT"&&p.src||new URL("index.cjs",document.baseURI).href,h):(h=or(),h)}function or(){try{const e=new Error(".").stack;if(!e)return null;const t=e.split(`
|
|
4
|
-
`);for(const r of t){const n=r.match(/(https?:\/\/[^)\s:]+)/);if(n)return n[1]}return null}catch{return null}}function ce(e){if(!e)return null;const t=ir(e)||cr(e)||sr(e)||ar(e);return t||null}function ir(e){const t=/\/([^/]+)-lwc-components\//,r=e.match(t);return r?r[1]:null}function cr(e){const t=/\/packages\/(?:@[^/]+\/)?([^/]+)/,r=e.match(t);return r?r[1]:null}function sr(e){const t=e.indexOf("+");if(t===-1)return null;const r=e.slice(0,t),n=r.lastIndexOf("/");return n===-1?null:r.slice(n+1)}function ar(e){const t=/\/static\/([^/]+)\//,r=e.match(t);return r?r[1]:null}const ur={Low:"low",Medium:"medium",High:"high",Critical:"critical"},lr="problemRepository";s.ProblemRepository=lr;let P=null;function
|
|
3
|
+
`):"",this.name="UnsubscriptionError",this.errors=r}});function L(e,t){if(e){var r=e.indexOf(t);0<=r&&e.splice(r,1)}}var _=(function(){function e(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var t,r,n,o,i;if(!this.closed){this.closed=!0;var c=this._parentage;if(c)if(this._parentage=null,Array.isArray(c))try{for(var a=A(c),u=a.next();!u.done;u=a.next()){var O=u.value;O.remove(this)}}catch(f){t={error:f}}finally{try{u&&!u.done&&(r=a.return)&&r.call(a)}finally{if(t)throw t.error}}else c.remove(this);var M=this.initialTeardown;if(d(M))try{M()}catch(f){i=f instanceof R?f.errors:[f]}var T=this._finalizers;if(T){this._finalizers=null;try{for(var v=A(T),y=v.next();!y.done;y=v.next()){var se=y.value;try{$(se)}catch(f){i=i??[],f instanceof R?i=j(j([],I(i)),I(f.errors)):i.push(f)}}}catch(f){n={error:f}}finally{try{y&&!y.done&&(o=v.return)&&o.call(v)}finally{if(n)throw n.error}}}if(i)throw new R(i)}},e.prototype.add=function(t){var r;if(t&&t!==this)if(this.closed)$(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(r=this._finalizers)!==null&&r!==void 0?r:[]).push(t)}},e.prototype._hasParent=function(t){var r=this._parentage;return r===t||Array.isArray(r)&&r.includes(t)},e.prototype._addParent=function(t){var r=this._parentage;this._parentage=Array.isArray(r)?(r.push(t),r):r?[r,t]:t},e.prototype._removeParent=function(t){var r=this._parentage;r===t?this._parentage=null:Array.isArray(r)&&L(r,t)},e.prototype.remove=function(t){var r=this._finalizers;r&&L(r,t),t instanceof e&&t._removeParent(this)},e.EMPTY=(function(){var t=new e;return t.closed=!0,t})(),e})(),G=_.EMPTY;function Q(e){return e instanceof _||e&&"closed"in e&&d(e.remove)&&d(e.add)&&d(e.unsubscribe)}function $(e){d(e)?e():e.unsubscribe()}var he={Promise:void 0},ye={setTimeout:function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];return setTimeout.apply(void 0,j([e,t],I(r)))},clearTimeout:function(e){return clearTimeout(e)},delegate:void 0};function be(e){ye.setTimeout(function(){throw e})}function U(){}function E(e){e()}var Y=(function(e){b(t,e);function t(r){var n=e.call(this)||this;return n.isStopped=!1,r?(n.destination=r,Q(r)&&r.add(n)):n.destination=Se,n}return t.create=function(r,n,o){return new D(r,n,o)},t.prototype.next=function(r){this.isStopped||this._next(r)},t.prototype.error=function(r){this.isStopped||(this.isStopped=!0,this._error(r))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(r){this.destination.next(r)},t.prototype._error=function(r){try{this.destination.error(r)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t})(_),ve=(function(){function e(t){this.partialObserver=t}return e.prototype.next=function(t){var r=this.partialObserver;if(r.next)try{r.next(t)}catch(n){g(n)}},e.prototype.error=function(t){var r=this.partialObserver;if(r.error)try{r.error(t)}catch(n){g(n)}else g(t)},e.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(r){g(r)}},e})(),D=(function(e){b(t,e);function t(r,n,o){var i=e.call(this)||this,c;return d(r)||!r?c={next:r??void 0,error:n??void 0,complete:o??void 0}:c=r,i.destination=new ve(c),i}return t})(Y);function g(e){be(e)}function ge(e){throw e}var Se={closed:!0,next:U,error:ge,complete:U},Ee=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})();function Ce(e){return e}function _e(e){return e.length===0?Ce:e.length===1?e[0]:function(r){return e.reduce(function(n,o){return o(n)},r)}}var F=(function(){function e(t){t&&(this._subscribe=t)}return e.prototype.lift=function(t){var r=new e;return r.source=this,r.operator=t,r},e.prototype.subscribe=function(t,r,n){var o=this,i=Re(t)?t:new D(t,r,n);return E(function(){var c=o,a=c.operator,u=c.source;i.add(a?a.call(i,u):u?o._subscribe(i):o._trySubscribe(i))}),i},e.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(r){t.error(r)}},e.prototype.forEach=function(t,r){var n=this;return r=V(r),new r(function(o,i){var c=new D({next:function(a){try{t(a)}catch(u){i(u),c.unsubscribe()}},error:i,complete:o});n.subscribe(c)})},e.prototype._subscribe=function(t){var r;return(r=this.source)===null||r===void 0?void 0:r.subscribe(t)},e.prototype[Ee]=function(){return this},e.prototype.pipe=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return _e(t)(this)},e.prototype.toPromise=function(t){var r=this;return t=V(t),new t(function(n,o){var i;r.subscribe(function(c){return i=c},function(c){return o(c)},function(){return n(i)})})},e.create=function(t){return new e(t)},e})();function V(e){var t;return(t=e??he.Promise)!==null&&t!==void 0?t:Promise}function Oe(e){return e&&d(e.next)&&d(e.error)&&d(e.complete)}function Re(e){return e&&e instanceof Y||Oe(e)&&Q(e)}var Pe=W(function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),K=(function(e){b(t,e);function t(){var r=e.call(this)||this;return r.closed=!1,r.currentObservers=null,r.observers=[],r.isStopped=!1,r.hasError=!1,r.thrownError=null,r}return t.prototype.lift=function(r){var n=new k(this,this);return n.operator=r,n},t.prototype._throwIfClosed=function(){if(this.closed)throw new Pe},t.prototype.next=function(r){var n=this;E(function(){var o,i;if(n._throwIfClosed(),!n.isStopped){n.currentObservers||(n.currentObservers=Array.from(n.observers));try{for(var c=A(n.currentObservers),a=c.next();!a.done;a=c.next()){var u=a.value;u.next(r)}}catch(O){o={error:O}}finally{try{a&&!a.done&&(i=c.return)&&i.call(c)}finally{if(o)throw o.error}}}})},t.prototype.error=function(r){var n=this;E(function(){if(n._throwIfClosed(),!n.isStopped){n.hasError=n.isStopped=!0,n.thrownError=r;for(var o=n.observers;o.length;)o.shift().error(r)}})},t.prototype.complete=function(){var r=this;E(function(){if(r._throwIfClosed(),!r.isStopped){r.isStopped=!0;for(var n=r.observers;n.length;)n.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var r;return((r=this.observers)===null||r===void 0?void 0:r.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(r){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,r)},t.prototype._subscribe=function(r){return this._throwIfClosed(),this._checkFinalizedStatuses(r),this._innerSubscribe(r)},t.prototype._innerSubscribe=function(r){var n=this,o=this,i=o.hasError,c=o.isStopped,a=o.observers;return i||c?G:(this.currentObservers=null,a.push(r),new _(function(){n.currentObservers=null,L(a,r)}))},t.prototype._checkFinalizedStatuses=function(r){var n=this,o=n.hasError,i=n.thrownError,c=n.isStopped;o?r.error(i):c&&r.complete()},t.prototype.asObservable=function(){var r=new F;return r.source=this,r},t.create=function(r,n){return new k(r,n)},t})(F),k=(function(e){b(t,e);function t(r,n){var o=e.call(this)||this;return o.destination=r,o.source=n,o}return t.prototype.next=function(r){var n,o;(o=(n=this.destination)===null||n===void 0?void 0:n.next)===null||o===void 0||o.call(n,r)},t.prototype.error=function(r){var n,o;(o=(n=this.destination)===null||n===void 0?void 0:n.error)===null||o===void 0||o.call(n,r)},t.prototype.complete=function(){var r,n;(n=(r=this.destination)===null||r===void 0?void 0:r.complete)===null||n===void 0||n.call(r)},t.prototype._subscribe=function(r){var n,o;return(o=(n=this.source)===null||n===void 0?void 0:n.subscribe(r))!==null&&o!==void 0?o:G},t})(K),we=(function(e){b(t,e);function t(r){var n=e.call(this)||this;return n._value=r,n}return Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),t.prototype._subscribe=function(r){var n=e.prototype._subscribe.call(this,r);return!n.closed&&r.next(this._value),n},t.prototype.getValue=function(){var r=this,n=r.hasError,o=r.thrownError,i=r._value;if(n)throw o;return this._throwIfClosed(),i},t.prototype.next=function(r){e.prototype.next.call(this,this._value=r)},t})(K);function Ae(e){return e}function l(e,t){return(r,n)=>{const o=Ie(r,n,e,t);o.length===1&&je(r,o)}}const B=new WeakMap,C=new WeakMap,X=new WeakMap;function Ie(e,t,r,n){let o=B.get(e);return o||(o=[],B.set(e,o)),o.push({options:r,name:t,optionFactory:n.optionFactory||Ae,service:{name:n.name,method:n.method||"subscribe"}}),o}function je(e,t){e.connectedCallback=J(e.connectedCallback,t),e.componentWillLoad=Le(e.componentWillLoad,t),e.componentDidUnload=H(e.componentDidUnload),e.disconnectedCallback=H(e.disconnectedCallback)}function J(e,t){return async function(...r){X.set(this,!0),C.set(this,[]),await Z(this);const n=new we(this.context);Ne(this,"context",n);for(const o of t)o.options=o.optionFactory(o.options,this),De(o.options)&&(o.options.context=n),xe(this,o);if(e)return e.apply(this,r)}}function Le(e,t){return async function(...r){return X.get(this)===!0?(await Z(this),e?e.apply(this,r):void 0):J(e,t).apply(this,r)}}function H(e){return async function(...t){let r;return e&&(r=e.apply(this,t)),Me(this),r}}function De(e){return"context"in e}function Z(e){const t=[];return e.platform||t.push(q(e,"platform")),e.context||t.push(q(e,"context")),t.length===0?Promise.resolve():Promise.all(t)}function q(e,t){const r=N.getElement(e);return new Promise(n=>{Object.defineProperty(r,t,{configurable:!0,set:o=>{delete r[t],r[t]=o,n()}})})}function Ne(e,t,r){const n=N.getElement(e),{get:o,set:i}=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(n),t);Object.defineProperty(n,t,{configurable:!0,get:o,set:function(c){i.call(this,c),r.next(c)}})}function xe(e,t){const r=$e(e,t);if(typeof r!="function")return;C.get(e).push(r)}function Me(e){const t=C.get(e);for(const r of t)r();C.set(e,[])}function Te(e,t){return r=>{e[t]=r}}function $e(e,t){const r={...t.options};Ue(r,e);const n=t.service.name,o=e.platform;if(!o.has(n))throw new Error(`Service ${n} does not exist`);return o.get(n)[t.service.method](Te(e,t.name),r)}function Ue(e,t){e.filter&&(e.filter=e.filter.map(r=>r.bind(t))),e.map&&(e.map=e.map.map(r=>r.bind(t)))}function Fe(e={}){const t={name:s.LimeTypeRepository};return l(e,t)}function Ve(e={}){const t={name:s.LimeTypeRepository};return e.map=[ke,...e.map||[]],e.context=null,l(e,t)}function ke(e){const{limetype:t}=this.context;return e[t]}const Be=e=>t=>Object.values(t).find(x(e));function He(e,t){return Object.values(e.properties).filter(r=>r.type===t)}function qe(e,t){return Object.values(e.properties).find(x(t))}function We(e,t){return e.properties[t]}const x=e=>t=>t?.label===e,Ge="state.limeobjects";s.LimeObjectRepository=Ge;function Qe(e={}){const t={name:s.LimeObjectRepository,optionFactory:Xe};return l(e,t)}function Ye(e={}){const t={name:s.LimeObjectRepository};return e.map=[Ke,...e.map||[]],e.context=null,l(e,t)}function Ke(e){const{limetype:t,id:r}=this.context;if(e[t])return e[t].find(n=>n.id===r)}function Xe(e,t){return e.getLimetype&&(e.limetype=e.getLimetype(t)),e}var z=(e=>(e.Received="command.received",e.Handled="command.handled",e.Failed="command.failed",e))(z||{});function m(e){return t=>{Je(t,e.id),Ze(t,e.id)}}function Je(e,t){e.commandId=t}function Ze(e,t){Object.defineProperty(e,Symbol.hasInstance,{value:r=>te(r).includes(t)})}function ee(e){return typeof e=="string"?e:e&&e.constructor&&e.constructor.commandId?e.constructor.commandId:e&&e.commandId?e.commandId:null}function te(e){let t=[],r,n=e;for(;r=ee(n);)t=[...t,r],n=Object.getPrototypeOf(n);return[...new Set(t)]}const ze="commandBus";s.CommandBus=ze;var et=Object.getOwnPropertyDescriptor,tt=(e,t,r,n)=>{for(var o=n>1?void 0:n?et(t,r):t,i=e.length-1,c;i>=0;i--)(c=e[i])&&(o=c(o)||o);return o};const rt="limeobject.bulk-create-dialog";exports.BulkCreateDialogCommand=class{context;filter;relation};exports.BulkCreateDialogCommand=tt([m({id:rt})],exports.BulkCreateDialogCommand);var nt=Object.getOwnPropertyDescriptor,ot=(e,t,r,n)=>{for(var o=n>1?void 0:n?nt(t,r):t,i=e.length-1,c;i>=0;i--)(c=e[i])&&(o=c(o)||o);return o};const it="limeobject.create-dialog";exports.CreateLimeobjectDialogCommand=class{limetype;limeobject;route=!1;title;subtitle;context;autoAttachRelation;saveCommand};exports.CreateLimeobjectDialogCommand=ot([m({id:it})],exports.CreateLimeobjectDialogCommand);var ct=Object.getOwnPropertyDescriptor,st=(e,t,r,n)=>{for(var o=n>1?void 0:n?ct(t,r):t,i=e.length-1,c;i>=0;i--)(c=e[i])&&(o=c(o)||o);return o};const at="limeobject.delete-object";exports.DeleteObjectCommand=class{context};exports.DeleteObjectCommand=st([m({id:at})],exports.DeleteObjectCommand);var ut=Object.getOwnPropertyDescriptor,lt=(e,t,r,n)=>{for(var o=n>1?void 0:n?ut(t,r):t,i=e.length-1,c;i>=0;i--)(c=e[i])&&(o=c(o)||o);return o};const ft="limeobject.object-access";exports.OpenObjectAccessDialogCommand=class{context};exports.OpenObjectAccessDialogCommand=lt([m({id:ft})],exports.OpenObjectAccessDialogCommand);var pt=Object.getOwnPropertyDescriptor,dt=(e,t,r,n)=>{for(var o=n>1?void 0:n?pt(t,r):t,i=e.length-1,c;i>=0;i--)(c=e[i])&&(o=c(o)||o);return o};const mt="limeobject.save-object";exports.SaveLimeObjectCommand=class{context;limeobject;route=!1;label};exports.SaveLimeObjectCommand=dt([m({id:mt})],exports.SaveLimeObjectCommand);var re=(e=>(e.AND="AND",e.OR="OR",e.NOT="!",e.EQUALS="=",e.NOT_EQUALS="!=",e.GREATER=">",e.LESS="<",e.IN="IN",e.BEGINS="=?",e.LIKE="?",e.LESS_OR_EQUAL="<=",e.GREATER_OR_EQUAL=">=",e.ENDS="=$",e))(re||{});const ht={Count:"COUNT",Sum:"SUM",Average:"AVG",Maximum:"MAX",Minimum:"MIN"},yt="query";s.Query=yt;const bt={Get:"GET",Post:"POST",Put:"PUT",Delete:"DELETE",Patch:"PATCH"},vt="http";s.Http=vt;const gt="eventDispatcher";s.EventDispatcher=gt;const St="translate";s.Translate=St;const Et="dialog";s.Dialog=Et;const Ct="keybindingRegistry";s.KeybindingRegistry=Ct;const _t="navigator";s.Navigator=_t;function Ot(e){const t={name:s.Navigator};return l({context:null,...e},t)}var Rt=Object.getOwnPropertyDescriptor,Pt=(e,t,r,n)=>{for(var o=n>1?void 0:n?Rt(t,r):t,i=e.length-1,c;i>=0;i--)(c=e[i])&&(o=c(o)||o);return o};const wt="navigator.navigate";exports.NavigateCommand=class{path;query;hash;state};exports.NavigateCommand=Pt([m({id:wt})],exports.NavigateCommand);const At="notifications";s.Notification=At;const It="routeRegistry";s.RouteRegistry=It;var ne=(e=>(e.Pending="PENDING",e.Started="STARTED",e.Retry="RETRY",e.Success="SUCCESS",e.Failure="FAILURE",e))(ne||{}),oe=(e=>(e.Created="task.created",e.Success="task.success",e.Failed="task.failed",e))(oe||{});const jt="state.tasks";s.TaskRepository=jt;const Lt="state.configs";s.ConfigRepository=Lt;function Dt(e){const t={name:s.ConfigRepository};return l(e,t)}const Nt="state.device";s.Device=Nt;function xt(e={}){const t={name:s.Device};return l(e,t)}const Mt="state.filters";s.FilterRepository=Mt;function Tt(e={}){const t={name:s.FilterRepository};return l(e,t)}const $t="state.user-data";s.UserDataRepository=$t;function Ut(e={}){const t={name:s.UserDataRepository};return l(e,t)}const Ft="state.application";s.Application=Ft;function Vt(e={}){const t={name:s.Application};return e.map=[kt,...e.map||[]],l(e,t)}function kt(e){return e.applicationName}function Bt(e={}){const t={name:s.Application};return e.map=[Ht,...e.map||[]],l(e,t)}function Ht(e){return e.currentUser}function qt(e={}){const t={name:s.Application};return e.map=[Wt,...e.map||[]],l(e,t)}function Wt(e){return e.session}const Gt="userPreferences";s.UserPreferencesRepository=Gt;const Qt="datetimeformatter";s.DateTimeFormatter=Qt;function Yt(e){return e.type==="limeobject"}function Kt(e){return e.type==="action"}const Xt="conditionRegistry";s.ConditionRegistry=Xt;const Jt="viewFactoryRegistry";s.ViewFactoryRegistry=Jt;const Zt="webComponentRegistry";s.WebComponentRegistry=Zt;const zt="state.notifications";s.NotificationRepository=zt;const er="pollerFactory";s.PollerFactory=er;const tr={Debug:"debug",Info:"info",Warn:"warn",Error:"error"},rr="logger";s.Logger=rr;let h,S;function ie(e){const t=window.Lime?.logger?.createLogger;return typeof t!="function"?(console.warn(`Logger factory is not configured. Returning console logger for scope "${e}".`),console):(S===void 0&&(S=ce(nr())),S&&(e=`${S}:${e}`),t(e))}function nr(){return h!==void 0?h:{url:typeof document>"u"?require("url").pathToFileURL(__filename).href:p&&p.tagName.toUpperCase()==="SCRIPT"&&p.src||new URL("index.cjs",document.baseURI).href}!==void 0&&typeof(typeof document>"u"?require("url").pathToFileURL(__filename).href:p&&p.tagName.toUpperCase()==="SCRIPT"&&p.src||new URL("index.cjs",document.baseURI).href)=="string"?(h=typeof document>"u"?require("url").pathToFileURL(__filename).href:p&&p.tagName.toUpperCase()==="SCRIPT"&&p.src||new URL("index.cjs",document.baseURI).href,h):(h=or(),h)}function or(){try{const e=new Error(".").stack;if(!e)return null;const t=e.split(`
|
|
4
|
+
`);for(const r of t){const n=r.match(/(https?:\/\/[^)\s:]+)/);if(n)return n[1]}return null}catch{return null}}function ce(e){if(!e)return null;const t=ir(e)||cr(e)||sr(e)||ar(e);return t||null}function ir(e){const t=/\/([^/]+)-lwc-components\//,r=e.match(t);return r?r[1]:null}function cr(e){const t=/\/packages\/(?:@[^/]+\/)?([^/]+)/,r=e.match(t);return r?r[1]:null}function sr(e){const t=e.indexOf("+");if(t===-1)return null;const r=e.slice(0,t),n=r.lastIndexOf("/");return n===-1?null:r.slice(n+1)}function ar(e){const t=/\/static\/([^/]+)\//,r=e.match(t);return r?r[1]:null}const ur={Low:"low",Medium:"medium",High:"high",Critical:"critical"},lr="problemRepository";s.ProblemRepository=lr;const fr="aiContextRegistry";s.AIContextRegistry=fr;let P=null;function pr(e,t){P||(P=ie("uncaught-error"));const r={};t&&(r.element=t.tagName,t.id&&(r.elementId=t.id));const n=e instanceof Error?e.message:String(e),o=e instanceof Error?e:void 0;P.error(n,o,r)}try{N.setErrorHandler(pr)}catch{}exports.AggregateOperator=ht;exports.Command=m;exports.CommandEventName=z;exports.HttpMethod=bt;exports.IdleStateEventName=ae;exports.LogLevel=tr;exports.Operator=re;exports.PlatformServiceName=s;exports.ProblemSeverity=ur;exports.SelectApplicationName=Vt;exports.SelectConfig=Dt;exports.SelectCurrentLimeObject=Ye;exports.SelectCurrentLimeType=Ve;exports.SelectCurrentUser=Bt;exports.SelectDevice=xt;exports.SelectFilters=Tt;exports.SelectLimeObjects=Qe;exports.SelectLimeTypes=Fe;exports.SelectQueryParam=Ot;exports.SelectSession=qt;exports.SelectUserData=Ut;exports.TaskEventType=oe;exports.TaskState=ne;exports.createLogger=ie;exports.findLimetypeByLabel=Be;exports.getCommandId=ee;exports.getCommandIds=te;exports.getPackageNameFromUrl=ce;exports.getPropertiesByType=He;exports.getPropertyByLabel=qe;exports.getPropertyByName=We;exports.hasLabel=x;exports.isActionCondition=Kt;exports.isDate=fe;exports.isFloat=de;exports.isLimeObjectCondition=Yt;exports.isRelation=ue;exports.isSingleRelation=le;exports.isString=pe;
|
|
5
5
|
//# sourceMappingURL=index.cjs.map
|