@kya-os/consent 0.1.37 → 0.1.39
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/dist/bundle/index.d.ts +12 -0
- package/dist/bundle/index.d.ts.map +1 -1
- package/dist/bundle/index.js +12 -0
- package/dist/bundle/index.js.map +1 -1
- package/dist/bundle/inline.d.ts.map +1 -1
- package/dist/bundle/inline.js +2 -2
- package/dist/bundle/inline.js.map +1 -1
- package/dist/bundle/shell.d.ts +23 -0
- package/dist/bundle/shell.d.ts.map +1 -1
- package/dist/bundle/shell.js +25 -1
- package/dist/bundle/shell.js.map +1 -1
- package/dist/capabilities/index.d.ts +7 -0
- package/dist/capabilities/index.d.ts.map +1 -0
- package/dist/capabilities/index.js +7 -0
- package/dist/capabilities/index.js.map +1 -0
- package/dist/capabilities/registry.d.ts +29 -0
- package/dist/capabilities/registry.d.ts.map +1 -0
- package/dist/capabilities/registry.js +178 -0
- package/dist/capabilities/registry.js.map +1 -0
- package/dist/cedar/compile.d.ts +30 -0
- package/dist/cedar/compile.d.ts.map +1 -0
- package/dist/cedar/compile.js +55 -0
- package/dist/cedar/compile.js.map +1 -0
- package/dist/cedar/explain.d.ts +22 -0
- package/dist/cedar/explain.d.ts.map +1 -0
- package/dist/cedar/explain.js +72 -0
- package/dist/cedar/explain.js.map +1 -0
- package/dist/cedar/index.d.ts +8 -0
- package/dist/cedar/index.d.ts.map +1 -0
- package/dist/cedar/index.js +8 -0
- package/dist/cedar/index.js.map +1 -0
- package/dist/cjs/bundle/index.js +19 -1
- package/dist/cjs/bundle/index.js.map +1 -1
- package/dist/cjs/bundle/inline.js +2 -2
- package/dist/cjs/bundle/inline.js.map +1 -1
- package/dist/cjs/bundle/shell.js +25 -1
- package/dist/cjs/bundle/shell.js.map +1 -1
- package/dist/cjs/capabilities/index.js +12 -0
- package/dist/cjs/capabilities/index.js.map +1 -0
- package/dist/cjs/capabilities/registry.js +182 -0
- package/dist/cjs/capabilities/registry.js.map +1 -0
- package/dist/cjs/cedar/compile.js +59 -0
- package/dist/cjs/cedar/compile.js.map +1 -0
- package/dist/cjs/cedar/explain.js +75 -0
- package/dist/cjs/cedar/explain.js.map +1 -0
- package/dist/cjs/cedar/index.js +14 -0
- package/dist/cjs/cedar/index.js.map +1 -0
- package/dist/cjs/components/consent-action-bar.js +138 -0
- package/dist/cjs/components/consent-action-bar.js.map +1 -0
- package/dist/cjs/components/consent-agent-header.js +205 -0
- package/dist/cjs/components/consent-agent-header.js.map +1 -0
- package/dist/cjs/components/consent-capabilities-screen.js +309 -0
- package/dist/cjs/components/consent-capabilities-screen.js.map +1 -0
- package/dist/cjs/components/consent-capability-card.js +340 -0
- package/dist/cjs/components/consent-capability-card.js.map +1 -0
- package/dist/cjs/components/consent-footer.js +99 -0
- package/dist/cjs/components/consent-footer.js.map +1 -0
- package/dist/cjs/components/consent-revocation-notice.js +101 -0
- package/dist/cjs/components/consent-revocation-notice.js.map +1 -0
- package/dist/cjs/components/index.js +14 -1
- package/dist/cjs/components/index.js.map +1 -1
- package/dist/cjs/components/mcp-consent.js +176 -7
- package/dist/cjs/components/mcp-consent.js.map +1 -1
- package/dist/cjs/copy/index.js +12 -0
- package/dist/cjs/copy/index.js.map +1 -0
- package/dist/cjs/copy/tokens.js +101 -0
- package/dist/cjs/copy/tokens.js.map +1 -0
- package/dist/cjs/index.js +8 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/mcp-app/index.js +15 -0
- package/dist/cjs/mcp-app/index.js.map +1 -0
- package/dist/cjs/mcp-app/inline.js +20 -0
- package/dist/cjs/mcp-app/inline.js.map +1 -0
- package/dist/cjs/mcp-app/types.js +10 -0
- package/dist/cjs/mcp-app/types.js.map +1 -0
- package/dist/cjs/popup/index.js +15 -0
- package/dist/cjs/popup/index.js.map +1 -0
- package/dist/cjs/popup/launcher.js +77 -0
- package/dist/cjs/popup/launcher.js.map +1 -0
- package/dist/cjs/schemas/capabilities.schemas.js +129 -0
- package/dist/cjs/schemas/capabilities.schemas.js.map +1 -0
- package/dist/cjs/schemas/config.schemas.js +18 -0
- package/dist/cjs/schemas/config.schemas.js.map +1 -1
- package/dist/cjs/schemas/index.js +1 -0
- package/dist/cjs/schemas/index.js.map +1 -1
- package/dist/cjs/styles/index.js +1 -0
- package/dist/cjs/styles/index.js.map +1 -1
- package/dist/cjs/styles/theme.js +86 -0
- package/dist/cjs/styles/theme.js.map +1 -0
- package/dist/cjs/types/capabilities.types.js +12 -0
- package/dist/cjs/types/capabilities.types.js.map +1 -0
- package/dist/cjs/types/index.js +1 -0
- package/dist/cjs/types/index.js.map +1 -1
- package/dist/components/consent-action-bar.d.ts +30 -0
- package/dist/components/consent-action-bar.d.ts.map +1 -0
- package/dist/components/consent-action-bar.js +135 -0
- package/dist/components/consent-action-bar.js.map +1 -0
- package/dist/components/consent-agent-header.d.ts +31 -0
- package/dist/components/consent-agent-header.d.ts.map +1 -0
- package/dist/components/consent-agent-header.js +202 -0
- package/dist/components/consent-agent-header.js.map +1 -0
- package/dist/components/consent-capabilities-screen.d.ts +62 -0
- package/dist/components/consent-capabilities-screen.d.ts.map +1 -0
- package/dist/components/consent-capabilities-screen.js +306 -0
- package/dist/components/consent-capabilities-screen.js.map +1 -0
- package/dist/components/consent-capability-card.d.ts +44 -0
- package/dist/components/consent-capability-card.d.ts.map +1 -0
- package/dist/components/consent-capability-card.js +337 -0
- package/dist/components/consent-capability-card.js.map +1 -0
- package/dist/components/consent-footer.d.ts +22 -0
- package/dist/components/consent-footer.d.ts.map +1 -0
- package/dist/components/consent-footer.js +96 -0
- package/dist/components/consent-footer.js.map +1 -0
- package/dist/components/consent-revocation-notice.d.ts +22 -0
- package/dist/components/consent-revocation-notice.d.ts.map +1 -0
- package/dist/components/consent-revocation-notice.js +98 -0
- package/dist/components/consent-revocation-notice.js.map +1 -0
- package/dist/components/index.d.ts +6 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +7 -0
- package/dist/components/index.js.map +1 -1
- package/dist/components/mcp-consent.d.ts +41 -0
- package/dist/components/mcp-consent.d.ts.map +1 -1
- package/dist/components/mcp-consent.js +176 -7
- package/dist/components/mcp-consent.js.map +1 -1
- package/dist/consent.js +1578 -210
- package/dist/consent.min.js +727 -96
- package/dist/copy/index.d.ts +8 -0
- package/dist/copy/index.d.ts.map +1 -0
- package/dist/copy/index.js +7 -0
- package/dist/copy/index.js.map +1 -0
- package/dist/copy/tokens.d.ts +93 -0
- package/dist/copy/tokens.d.ts.map +1 -0
- package/dist/copy/tokens.js +97 -0
- package/dist/copy/tokens.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -1
- package/dist/mcp-app/index.d.ts +10 -0
- package/dist/mcp-app/index.d.ts.map +1 -0
- package/dist/mcp-app/index.js +9 -0
- package/dist/mcp-app/index.js.map +1 -0
- package/dist/mcp-app/inline.d.ts +16 -0
- package/dist/mcp-app/inline.d.ts.map +1 -0
- package/dist/mcp-app/inline.js +16 -0
- package/dist/mcp-app/inline.js.map +1 -0
- package/dist/mcp-app/types.d.ts +33 -0
- package/dist/mcp-app/types.d.ts.map +1 -0
- package/dist/mcp-app/types.js +8 -0
- package/dist/mcp-app/types.js.map +1 -0
- package/dist/popup/index.d.ts +8 -0
- package/dist/popup/index.d.ts.map +1 -0
- package/dist/popup/index.js +7 -0
- package/dist/popup/index.js.map +1 -0
- package/dist/popup/launcher.d.ts +81 -0
- package/dist/popup/launcher.d.ts.map +1 -0
- package/dist/popup/launcher.js +71 -0
- package/dist/popup/launcher.js.map +1 -0
- package/dist/schemas/api.schemas.d.ts +234 -30
- package/dist/schemas/api.schemas.d.ts.map +1 -1
- package/dist/schemas/capabilities.schemas.d.ts +186 -0
- package/dist/schemas/capabilities.schemas.d.ts.map +1 -0
- package/dist/schemas/capabilities.schemas.js +123 -0
- package/dist/schemas/capabilities.schemas.js.map +1 -0
- package/dist/schemas/config.schemas.d.ts +332 -36
- package/dist/schemas/config.schemas.d.ts.map +1 -1
- package/dist/schemas/config.schemas.js +18 -0
- package/dist/schemas/config.schemas.js.map +1 -1
- package/dist/schemas/index.d.ts +1 -0
- package/dist/schemas/index.d.ts.map +1 -1
- package/dist/schemas/index.js +1 -0
- package/dist/schemas/index.js.map +1 -1
- package/dist/styles/index.d.ts +1 -0
- package/dist/styles/index.d.ts.map +1 -1
- package/dist/styles/index.js +1 -0
- package/dist/styles/index.js.map +1 -1
- package/dist/styles/theme.d.ts +72 -0
- package/dist/styles/theme.d.ts.map +1 -0
- package/dist/styles/theme.js +81 -0
- package/dist/styles/theme.js.map +1 -0
- package/dist/types/capabilities.types.d.ts +126 -0
- package/dist/types/capabilities.types.d.ts.map +1 -0
- package/dist/types/capabilities.types.js +11 -0
- package/dist/types/capabilities.types.js.map +1 -0
- package/dist/types/config.types.d.ts +33 -0
- package/dist/types/config.types.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +1 -0
- package/dist/types/index.js.map +1 -1
- package/package.json +15 -8
package/dist/consent.js
CHANGED
|
@@ -9,10 +9,10 @@ var __decorateClass = (decorators, target, key, kind) => {
|
|
|
9
9
|
return result;
|
|
10
10
|
};
|
|
11
11
|
|
|
12
|
-
// ../../node_modules/.pnpm/@lit+reactive-element@2.1.
|
|
12
|
+
// ../../node_modules/.pnpm/@lit+reactive-element@2.1.2/node_modules/@lit/reactive-element/css-tag.js
|
|
13
13
|
var t = globalThis;
|
|
14
14
|
var e = t.ShadowRoot && (void 0 === t.ShadyCSS || t.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype;
|
|
15
|
-
var s = Symbol();
|
|
15
|
+
var s = /* @__PURE__ */ Symbol();
|
|
16
16
|
var o = /* @__PURE__ */ new WeakMap();
|
|
17
17
|
var n = class {
|
|
18
18
|
constructor(t6, e8, o8) {
|
|
@@ -34,15 +34,15 @@ var n = class {
|
|
|
34
34
|
};
|
|
35
35
|
var r = (t6) => new n("string" == typeof t6 ? t6 : t6 + "", void 0, s);
|
|
36
36
|
var i = (t6, ...e8) => {
|
|
37
|
-
const o8 = 1 === t6.length ? t6[0] : e8.reduce((
|
|
37
|
+
const o8 = 1 === t6.length ? t6[0] : e8.reduce((e9, s4, o9) => e9 + ((t7) => {
|
|
38
38
|
if (true === t7._$cssResult$) return t7.cssText;
|
|
39
39
|
if ("number" == typeof t7) return t7;
|
|
40
40
|
throw Error("Value passed to 'css' function must be a 'css' function result: " + t7 + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.");
|
|
41
|
-
})(s4) + t6[o9 + 1]
|
|
41
|
+
})(s4) + t6[o9 + 1], t6[0]);
|
|
42
42
|
return new n(o8, t6, s);
|
|
43
43
|
};
|
|
44
44
|
var S = (s4, o8) => {
|
|
45
|
-
if (e) s4.adoptedStyleSheets = o8.map((
|
|
45
|
+
if (e) s4.adoptedStyleSheets = o8.map((t6) => t6 instanceof CSSStyleSheet ? t6 : t6.styleSheet);
|
|
46
46
|
else for (const e8 of o8) {
|
|
47
47
|
const o9 = document.createElement("style"), n5 = t.litNonce;
|
|
48
48
|
void 0 !== n5 && o9.setAttribute("nonce", n5), o9.textContent = e8.cssText, s4.appendChild(o9);
|
|
@@ -54,7 +54,7 @@ var c = e ? (t6) => t6 : (t6) => t6 instanceof CSSStyleSheet ? ((t7) => {
|
|
|
54
54
|
return r(e8);
|
|
55
55
|
})(t6) : t6;
|
|
56
56
|
|
|
57
|
-
// ../../node_modules/.pnpm/@lit+reactive-element@2.1.
|
|
57
|
+
// ../../node_modules/.pnpm/@lit+reactive-element@2.1.2/node_modules/@lit/reactive-element/reactive-element.js
|
|
58
58
|
var { is: i2, defineProperty: e2, getOwnPropertyDescriptor: h, getOwnPropertyNames: r2, getOwnPropertySymbols: o2, getPrototypeOf: n2 } = Object;
|
|
59
59
|
var a = globalThis;
|
|
60
60
|
var c2 = a.trustedTypes;
|
|
@@ -92,7 +92,7 @@ var u = { toAttribute(t6, s4) {
|
|
|
92
92
|
} };
|
|
93
93
|
var f = (t6, s4) => !i2(t6, s4);
|
|
94
94
|
var b = { attribute: true, type: String, converter: u, reflect: false, useDefault: false, hasChanged: f };
|
|
95
|
-
Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), a.litPropertyMetadata ?? (a.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
|
|
95
|
+
Symbol.metadata ?? (Symbol.metadata = /* @__PURE__ */ Symbol("metadata")), a.litPropertyMetadata ?? (a.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
|
|
96
96
|
var y = class extends HTMLElement {
|
|
97
97
|
static addInitializer(t6) {
|
|
98
98
|
this._$Ei(), (this.l ?? (this.l = [])).push(t6);
|
|
@@ -102,7 +102,7 @@ var y = class extends HTMLElement {
|
|
|
102
102
|
}
|
|
103
103
|
static createProperty(t6, s4 = b) {
|
|
104
104
|
if (s4.state && (s4.attribute = false), this._$Ei(), this.prototype.hasOwnProperty(t6) && ((s4 = Object.create(s4)).wrapped = true), this.elementProperties.set(t6, s4), !s4.noAccessor) {
|
|
105
|
-
const i6 = Symbol(), h3 = this.getPropertyDescriptor(t6, i6, s4);
|
|
105
|
+
const i6 = /* @__PURE__ */ Symbol(), h3 = this.getPropertyDescriptor(t6, i6, s4);
|
|
106
106
|
void 0 !== h3 && e2(this.prototype, t6, h3);
|
|
107
107
|
}
|
|
108
108
|
}
|
|
@@ -159,7 +159,7 @@ var y = class extends HTMLElement {
|
|
|
159
159
|
super(), this._$Ep = void 0, this.isUpdatePending = false, this.hasUpdated = false, this._$Em = null, this._$Ev();
|
|
160
160
|
}
|
|
161
161
|
_$Ev() {
|
|
162
|
-
this._$ES = new Promise((
|
|
162
|
+
this._$ES = new Promise((t6) => this.enableUpdating = t6), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), this.constructor.l?.forEach((t6) => t6(this));
|
|
163
163
|
}
|
|
164
164
|
addController(t6) {
|
|
165
165
|
(this._$EO ?? (this._$EO = /* @__PURE__ */ new Set())).add(t6), void 0 !== this.renderRoot && this.isConnected && t6.hostConnected?.();
|
|
@@ -177,12 +177,12 @@ var y = class extends HTMLElement {
|
|
|
177
177
|
return S(t6, this.constructor.elementStyles), t6;
|
|
178
178
|
}
|
|
179
179
|
connectedCallback() {
|
|
180
|
-
this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this.enableUpdating(true), this._$EO?.forEach((
|
|
180
|
+
this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this.enableUpdating(true), this._$EO?.forEach((t6) => t6.hostConnected?.());
|
|
181
181
|
}
|
|
182
182
|
enableUpdating(t6) {
|
|
183
183
|
}
|
|
184
184
|
disconnectedCallback() {
|
|
185
|
-
this._$EO?.forEach((
|
|
185
|
+
this._$EO?.forEach((t6) => t6.hostDisconnected?.());
|
|
186
186
|
}
|
|
187
187
|
attributeChangedCallback(t6, s4, i6) {
|
|
188
188
|
this._$AK(t6, i6);
|
|
@@ -203,10 +203,10 @@ var y = class extends HTMLElement {
|
|
|
203
203
|
this[e8] = r7 ?? this._$Ej?.get(e8) ?? r7, this._$Em = null;
|
|
204
204
|
}
|
|
205
205
|
}
|
|
206
|
-
requestUpdate(t6, s4, i6) {
|
|
206
|
+
requestUpdate(t6, s4, i6, e8 = false, h3) {
|
|
207
207
|
if (void 0 !== t6) {
|
|
208
|
-
const
|
|
209
|
-
if (i6 ?? (i6 =
|
|
208
|
+
const r7 = this.constructor;
|
|
209
|
+
if (false === e8 && (h3 = this[t6]), i6 ?? (i6 = r7.getPropertyOptions(t6)), !((i6.hasChanged ?? f)(h3, s4) || i6.useDefault && i6.reflect && h3 === this._$Ej?.get(t6) && !this.hasAttribute(r7._$Eu(t6, i6)))) return;
|
|
210
210
|
this.C(t6, s4, i6);
|
|
211
211
|
}
|
|
212
212
|
false === this.isUpdatePending && (this._$ES = this._$EP());
|
|
@@ -243,7 +243,7 @@ var y = class extends HTMLElement {
|
|
|
243
243
|
let t6 = false;
|
|
244
244
|
const s4 = this._$AL;
|
|
245
245
|
try {
|
|
246
|
-
t6 = this.shouldUpdate(s4), t6 ? (this.willUpdate(s4), this._$EO?.forEach((
|
|
246
|
+
t6 = this.shouldUpdate(s4), t6 ? (this.willUpdate(s4), this._$EO?.forEach((t7) => t7.hostUpdate?.()), this.update(s4)) : this._$EM();
|
|
247
247
|
} catch (s5) {
|
|
248
248
|
throw t6 = false, this._$EM(), s5;
|
|
249
249
|
}
|
|
@@ -252,7 +252,7 @@ var y = class extends HTMLElement {
|
|
|
252
252
|
willUpdate(t6) {
|
|
253
253
|
}
|
|
254
254
|
_$AE(t6) {
|
|
255
|
-
this._$EO?.forEach((
|
|
255
|
+
this._$EO?.forEach((t7) => t7.hostUpdated?.()), this.hasUpdated || (this.hasUpdated = true, this.firstUpdated(t6)), this.updated(t6);
|
|
256
256
|
}
|
|
257
257
|
_$EM() {
|
|
258
258
|
this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = false;
|
|
@@ -267,105 +267,106 @@ var y = class extends HTMLElement {
|
|
|
267
267
|
return true;
|
|
268
268
|
}
|
|
269
269
|
update(t6) {
|
|
270
|
-
this._$Eq && (this._$Eq = this._$Eq.forEach((
|
|
270
|
+
this._$Eq && (this._$Eq = this._$Eq.forEach((t7) => this._$ET(t7, this[t7]))), this._$EM();
|
|
271
271
|
}
|
|
272
272
|
updated(t6) {
|
|
273
273
|
}
|
|
274
274
|
firstUpdated(t6) {
|
|
275
275
|
}
|
|
276
276
|
};
|
|
277
|
-
y.elementStyles = [], y.shadowRootOptions = { mode: "open" }, y[d("elementProperties")] = /* @__PURE__ */ new Map(), y[d("finalized")] = /* @__PURE__ */ new Map(), p?.({ ReactiveElement: y }), (a.reactiveElementVersions ?? (a.reactiveElementVersions = [])).push("2.1.
|
|
277
|
+
y.elementStyles = [], y.shadowRootOptions = { mode: "open" }, y[d("elementProperties")] = /* @__PURE__ */ new Map(), y[d("finalized")] = /* @__PURE__ */ new Map(), p?.({ ReactiveElement: y }), (a.reactiveElementVersions ?? (a.reactiveElementVersions = [])).push("2.1.2");
|
|
278
278
|
|
|
279
|
-
// ../../node_modules/.pnpm/lit-html@3.3.
|
|
279
|
+
// ../../node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/lit-html.js
|
|
280
280
|
var t2 = globalThis;
|
|
281
|
-
var i3 =
|
|
282
|
-
var s2 =
|
|
283
|
-
var e3 = "
|
|
284
|
-
var h2 =
|
|
285
|
-
var o3 =
|
|
286
|
-
var n3 =
|
|
287
|
-
var r3 =
|
|
288
|
-
var l2 =
|
|
289
|
-
var c3 = (
|
|
290
|
-
var a2 =
|
|
291
|
-
var u2 =
|
|
292
|
-
var d2 = "[
|
|
293
|
-
var f2 =
|
|
294
|
-
var v =
|
|
295
|
-
var _ =
|
|
296
|
-
var m =
|
|
281
|
+
var i3 = (t6) => t6;
|
|
282
|
+
var s2 = t2.trustedTypes;
|
|
283
|
+
var e3 = s2 ? s2.createPolicy("lit-html", { createHTML: (t6) => t6 }) : void 0;
|
|
284
|
+
var h2 = "$lit$";
|
|
285
|
+
var o3 = `lit$${Math.random().toFixed(9).slice(2)}$`;
|
|
286
|
+
var n3 = "?" + o3;
|
|
287
|
+
var r3 = `<${n3}>`;
|
|
288
|
+
var l2 = document;
|
|
289
|
+
var c3 = () => l2.createComment("");
|
|
290
|
+
var a2 = (t6) => null === t6 || "object" != typeof t6 && "function" != typeof t6;
|
|
291
|
+
var u2 = Array.isArray;
|
|
292
|
+
var d2 = (t6) => u2(t6) || "function" == typeof t6?.[Symbol.iterator];
|
|
293
|
+
var f2 = "[ \n\f\r]";
|
|
294
|
+
var v = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g;
|
|
295
|
+
var _ = /-->/g;
|
|
296
|
+
var m = />/g;
|
|
297
|
+
var p2 = RegExp(`>|${f2}(?:([^\\s"'>=/]+)(${f2}*=${f2}*(?:[^
|
|
297
298
|
\f\r"'\`<>=]|("|')|))|$)`, "g");
|
|
298
|
-
var
|
|
299
|
-
var
|
|
300
|
-
var
|
|
301
|
-
var
|
|
302
|
-
var
|
|
303
|
-
var
|
|
304
|
-
var
|
|
305
|
-
var
|
|
306
|
-
var
|
|
307
|
-
var
|
|
308
|
-
var
|
|
309
|
-
function
|
|
310
|
-
if (!
|
|
311
|
-
return void 0 !==
|
|
299
|
+
var g = /'/g;
|
|
300
|
+
var $ = /"/g;
|
|
301
|
+
var y2 = /^(?:script|style|textarea|title)$/i;
|
|
302
|
+
var x = (t6) => (i6, ...s4) => ({ _$litType$: t6, strings: i6, values: s4 });
|
|
303
|
+
var b2 = x(1);
|
|
304
|
+
var w = x(2);
|
|
305
|
+
var T = x(3);
|
|
306
|
+
var E = /* @__PURE__ */ Symbol.for("lit-noChange");
|
|
307
|
+
var A = /* @__PURE__ */ Symbol.for("lit-nothing");
|
|
308
|
+
var C = /* @__PURE__ */ new WeakMap();
|
|
309
|
+
var P = l2.createTreeWalker(l2, 129);
|
|
310
|
+
function V(t6, i6) {
|
|
311
|
+
if (!u2(t6) || !t6.hasOwnProperty("raw")) throw Error("invalid template strings array");
|
|
312
|
+
return void 0 !== e3 ? e3.createHTML(i6) : i6;
|
|
312
313
|
}
|
|
313
|
-
var
|
|
314
|
-
const s4 = t6.length - 1,
|
|
315
|
-
let
|
|
314
|
+
var N = (t6, i6) => {
|
|
315
|
+
const s4 = t6.length - 1, e8 = [];
|
|
316
|
+
let n5, l3 = 2 === i6 ? "<svg>" : 3 === i6 ? "<math>" : "", c4 = v;
|
|
316
317
|
for (let i7 = 0; i7 < s4; i7++) {
|
|
317
318
|
const s5 = t6[i7];
|
|
318
|
-
let a3, u3, d3 = -1,
|
|
319
|
-
for (;
|
|
320
|
-
const x2 = c4 ===
|
|
321
|
-
l3 += c4 ===
|
|
319
|
+
let a3, u3, d3 = -1, f3 = 0;
|
|
320
|
+
for (; f3 < s5.length && (c4.lastIndex = f3, u3 = c4.exec(s5), null !== u3); ) f3 = c4.lastIndex, c4 === v ? "!--" === u3[1] ? c4 = _ : void 0 !== u3[1] ? c4 = m : void 0 !== u3[2] ? (y2.test(u3[2]) && (n5 = RegExp("</" + u3[2], "g")), c4 = p2) : void 0 !== u3[3] && (c4 = p2) : c4 === p2 ? ">" === u3[0] ? (c4 = n5 ?? v, d3 = -1) : void 0 === u3[1] ? d3 = -2 : (d3 = c4.lastIndex - u3[2].length, a3 = u3[1], c4 = void 0 === u3[3] ? p2 : '"' === u3[3] ? $ : g) : c4 === $ || c4 === g ? c4 = p2 : c4 === _ || c4 === m ? c4 = v : (c4 = p2, n5 = void 0);
|
|
321
|
+
const x2 = c4 === p2 && t6[i7 + 1].startsWith("/>") ? " " : "";
|
|
322
|
+
l3 += c4 === v ? s5 + r3 : d3 >= 0 ? (e8.push(a3), s5.slice(0, d3) + h2 + s5.slice(d3) + o3 + x2) : s5 + o3 + (-2 === d3 ? i7 : x2);
|
|
322
323
|
}
|
|
323
|
-
return [
|
|
324
|
+
return [V(t6, l3 + (t6[s4] || "<?>") + (2 === i6 ? "</svg>" : 3 === i6 ? "</math>" : "")), e8];
|
|
324
325
|
};
|
|
325
|
-
var
|
|
326
|
-
constructor({ strings: t6, _$litType$:
|
|
326
|
+
var S2 = class _S {
|
|
327
|
+
constructor({ strings: t6, _$litType$: i6 }, e8) {
|
|
327
328
|
let r7;
|
|
328
329
|
this.parts = [];
|
|
329
|
-
let
|
|
330
|
-
const u3 = t6.length - 1, d3 = this.parts, [f3, v2] =
|
|
331
|
-
if (this.el =
|
|
330
|
+
let l3 = 0, a3 = 0;
|
|
331
|
+
const u3 = t6.length - 1, d3 = this.parts, [f3, v2] = N(t6, i6);
|
|
332
|
+
if (this.el = _S.createElement(f3, e8), P.currentNode = this.el.content, 2 === i6 || 3 === i6) {
|
|
332
333
|
const t7 = this.el.content.firstChild;
|
|
333
334
|
t7.replaceWith(...t7.childNodes);
|
|
334
335
|
}
|
|
335
|
-
for (; null !== (r7 =
|
|
336
|
+
for (; null !== (r7 = P.nextNode()) && d3.length < u3; ) {
|
|
336
337
|
if (1 === r7.nodeType) {
|
|
337
|
-
if (r7.hasAttributes()) for (const t7 of r7.getAttributeNames()) if (t7.endsWith(
|
|
338
|
-
const
|
|
339
|
-
d3.push({ type: 1, index:
|
|
340
|
-
} else t7.startsWith(
|
|
341
|
-
if (
|
|
342
|
-
const t7 = r7.textContent.split(
|
|
343
|
-
if (
|
|
344
|
-
r7.textContent =
|
|
345
|
-
for (let
|
|
346
|
-
r7.append(t7[
|
|
338
|
+
if (r7.hasAttributes()) for (const t7 of r7.getAttributeNames()) if (t7.endsWith(h2)) {
|
|
339
|
+
const i7 = v2[a3++], s4 = r7.getAttribute(t7).split(o3), e9 = /([.?@])?(.*)/.exec(i7);
|
|
340
|
+
d3.push({ type: 1, index: l3, name: e9[2], strings: s4, ctor: "." === e9[1] ? I : "?" === e9[1] ? L : "@" === e9[1] ? z : H }), r7.removeAttribute(t7);
|
|
341
|
+
} else t7.startsWith(o3) && (d3.push({ type: 6, index: l3 }), r7.removeAttribute(t7));
|
|
342
|
+
if (y2.test(r7.tagName)) {
|
|
343
|
+
const t7 = r7.textContent.split(o3), i7 = t7.length - 1;
|
|
344
|
+
if (i7 > 0) {
|
|
345
|
+
r7.textContent = s2 ? s2.emptyScript : "";
|
|
346
|
+
for (let s4 = 0; s4 < i7; s4++) r7.append(t7[s4], c3()), P.nextNode(), d3.push({ type: 2, index: ++l3 });
|
|
347
|
+
r7.append(t7[i7], c3());
|
|
347
348
|
}
|
|
348
349
|
}
|
|
349
|
-
} else if (8 === r7.nodeType) if (r7.data ===
|
|
350
|
+
} else if (8 === r7.nodeType) if (r7.data === n3) d3.push({ type: 2, index: l3 });
|
|
350
351
|
else {
|
|
351
352
|
let t7 = -1;
|
|
352
|
-
for (; -1 !== (t7 = r7.data.indexOf(
|
|
353
|
+
for (; -1 !== (t7 = r7.data.indexOf(o3, t7 + 1)); ) d3.push({ type: 7, index: l3 }), t7 += o3.length - 1;
|
|
353
354
|
}
|
|
354
|
-
|
|
355
|
+
l3++;
|
|
355
356
|
}
|
|
356
357
|
}
|
|
357
358
|
static createElement(t6, i6) {
|
|
358
|
-
const s4 =
|
|
359
|
+
const s4 = l2.createElement("template");
|
|
359
360
|
return s4.innerHTML = t6, s4;
|
|
360
361
|
}
|
|
361
362
|
};
|
|
362
|
-
function
|
|
363
|
-
if (i6 ===
|
|
363
|
+
function M(t6, i6, s4 = t6, e8) {
|
|
364
|
+
if (i6 === E) return i6;
|
|
364
365
|
let h3 = void 0 !== e8 ? s4._$Co?.[e8] : s4._$Cl;
|
|
365
|
-
const o8 =
|
|
366
|
-
return h3?.constructor !== o8 && (h3?._$AO?.(false), void 0 === o8 ? h3 = void 0 : (h3 = new o8(t6), h3._$AT(t6, s4, e8)), void 0 !== e8 ? (s4._$Co ?? (s4._$Co = []))[e8] = h3 : s4._$Cl = h3), void 0 !== h3 && (i6 =
|
|
366
|
+
const o8 = a2(i6) ? void 0 : i6._$litDirective$;
|
|
367
|
+
return h3?.constructor !== o8 && (h3?._$AO?.(false), void 0 === o8 ? h3 = void 0 : (h3 = new o8(t6), h3._$AT(t6, s4, e8)), void 0 !== e8 ? (s4._$Co ?? (s4._$Co = []))[e8] = h3 : s4._$Cl = h3), void 0 !== h3 && (i6 = M(t6, h3._$AS(t6, i6.values), h3, e8)), i6;
|
|
367
368
|
}
|
|
368
|
-
var
|
|
369
|
+
var R = class {
|
|
369
370
|
constructor(t6, i6) {
|
|
370
371
|
this._$AV = [], this._$AN = void 0, this._$AD = t6, this._$AM = i6;
|
|
371
372
|
}
|
|
@@ -376,29 +377,29 @@ var M = class {
|
|
|
376
377
|
return this._$AM._$AU;
|
|
377
378
|
}
|
|
378
379
|
u(t6) {
|
|
379
|
-
const { el: { content: i6 }, parts: s4 } = this._$AD, e8 = (t6?.creationScope ??
|
|
380
|
-
|
|
381
|
-
let h3 =
|
|
382
|
-
for (; void 0 !==
|
|
383
|
-
if (o8 ===
|
|
380
|
+
const { el: { content: i6 }, parts: s4 } = this._$AD, e8 = (t6?.creationScope ?? l2).importNode(i6, true);
|
|
381
|
+
P.currentNode = e8;
|
|
382
|
+
let h3 = P.nextNode(), o8 = 0, n5 = 0, r7 = s4[0];
|
|
383
|
+
for (; void 0 !== r7; ) {
|
|
384
|
+
if (o8 === r7.index) {
|
|
384
385
|
let i7;
|
|
385
|
-
2 ===
|
|
386
|
+
2 === r7.type ? i7 = new k(h3, h3.nextSibling, this, t6) : 1 === r7.type ? i7 = new r7.ctor(h3, r7.name, r7.strings, this, t6) : 6 === r7.type && (i7 = new Z(h3, this, t6)), this._$AV.push(i7), r7 = s4[++n5];
|
|
386
387
|
}
|
|
387
|
-
o8 !==
|
|
388
|
+
o8 !== r7?.index && (h3 = P.nextNode(), o8++);
|
|
388
389
|
}
|
|
389
|
-
return
|
|
390
|
+
return P.currentNode = l2, e8;
|
|
390
391
|
}
|
|
391
392
|
p(t6) {
|
|
392
393
|
let i6 = 0;
|
|
393
394
|
for (const s4 of this._$AV) void 0 !== s4 && (void 0 !== s4.strings ? (s4._$AI(t6, s4, i6), i6 += s4.strings.length - 2) : s4._$AI(t6[i6])), i6++;
|
|
394
395
|
}
|
|
395
396
|
};
|
|
396
|
-
var
|
|
397
|
+
var k = class _k {
|
|
397
398
|
get _$AU() {
|
|
398
399
|
return this._$AM?._$AU ?? this._$Cv;
|
|
399
400
|
}
|
|
400
401
|
constructor(t6, i6, s4, e8) {
|
|
401
|
-
this.type = 2, this._$AH =
|
|
402
|
+
this.type = 2, this._$AH = A, this._$AN = void 0, this._$AA = t6, this._$AB = i6, this._$AM = s4, this.options = e8, this._$Cv = e8?.isConnected ?? true;
|
|
402
403
|
}
|
|
403
404
|
get parentNode() {
|
|
404
405
|
let t6 = this._$AA.parentNode;
|
|
@@ -412,7 +413,7 @@ var R = class _R {
|
|
|
412
413
|
return this._$AB;
|
|
413
414
|
}
|
|
414
415
|
_$AI(t6, i6 = this) {
|
|
415
|
-
t6 =
|
|
416
|
+
t6 = M(this, t6, i6), a2(t6) ? t6 === A || null == t6 || "" === t6 ? (this._$AH !== A && this._$AR(), this._$AH = A) : t6 !== this._$AH && t6 !== E && this._(t6) : void 0 !== t6._$litType$ ? this.$(t6) : void 0 !== t6.nodeType ? this.T(t6) : d2(t6) ? this.k(t6) : this._(t6);
|
|
416
417
|
}
|
|
417
418
|
O(t6) {
|
|
418
419
|
return this._$AA.parentNode.insertBefore(t6, this._$AB);
|
|
@@ -421,38 +422,38 @@ var R = class _R {
|
|
|
421
422
|
this._$AH !== t6 && (this._$AR(), this._$AH = this.O(t6));
|
|
422
423
|
}
|
|
423
424
|
_(t6) {
|
|
424
|
-
this._$AH !==
|
|
425
|
+
this._$AH !== A && a2(this._$AH) ? this._$AA.nextSibling.data = t6 : this.T(l2.createTextNode(t6)), this._$AH = t6;
|
|
425
426
|
}
|
|
426
427
|
$(t6) {
|
|
427
|
-
const { values: i6, _$litType$: s4 } = t6, e8 = "number" == typeof s4 ? this._$AC(t6) : (void 0 === s4.el && (s4.el =
|
|
428
|
+
const { values: i6, _$litType$: s4 } = t6, e8 = "number" == typeof s4 ? this._$AC(t6) : (void 0 === s4.el && (s4.el = S2.createElement(V(s4.h, s4.h[0]), this.options)), s4);
|
|
428
429
|
if (this._$AH?._$AD === e8) this._$AH.p(i6);
|
|
429
430
|
else {
|
|
430
|
-
const t7 = new
|
|
431
|
+
const t7 = new R(e8, this), s5 = t7.u(this.options);
|
|
431
432
|
t7.p(i6), this.T(s5), this._$AH = t7;
|
|
432
433
|
}
|
|
433
434
|
}
|
|
434
435
|
_$AC(t6) {
|
|
435
|
-
let i6 =
|
|
436
|
-
return void 0 === i6 &&
|
|
436
|
+
let i6 = C.get(t6.strings);
|
|
437
|
+
return void 0 === i6 && C.set(t6.strings, i6 = new S2(t6)), i6;
|
|
437
438
|
}
|
|
438
439
|
k(t6) {
|
|
439
|
-
|
|
440
|
+
u2(this._$AH) || (this._$AH = [], this._$AR());
|
|
440
441
|
const i6 = this._$AH;
|
|
441
442
|
let s4, e8 = 0;
|
|
442
|
-
for (const h3 of t6) e8 === i6.length ? i6.push(s4 = new
|
|
443
|
+
for (const h3 of t6) e8 === i6.length ? i6.push(s4 = new _k(this.O(c3()), this.O(c3()), this, this.options)) : s4 = i6[e8], s4._$AI(h3), e8++;
|
|
443
444
|
e8 < i6.length && (this._$AR(s4 && s4._$AB.nextSibling, e8), i6.length = e8);
|
|
444
445
|
}
|
|
445
|
-
_$AR(t6 = this._$AA.nextSibling,
|
|
446
|
-
for (this._$AP?.(false, true,
|
|
447
|
-
const
|
|
448
|
-
t6.remove(), t6 =
|
|
446
|
+
_$AR(t6 = this._$AA.nextSibling, s4) {
|
|
447
|
+
for (this._$AP?.(false, true, s4); t6 !== this._$AB; ) {
|
|
448
|
+
const s5 = i3(t6).nextSibling;
|
|
449
|
+
i3(t6).remove(), t6 = s5;
|
|
449
450
|
}
|
|
450
451
|
}
|
|
451
452
|
setConnected(t6) {
|
|
452
453
|
void 0 === this._$AM && (this._$Cv = t6, this._$AP?.(t6));
|
|
453
454
|
}
|
|
454
455
|
};
|
|
455
|
-
var
|
|
456
|
+
var H = class {
|
|
456
457
|
get tagName() {
|
|
457
458
|
return this.element.tagName;
|
|
458
459
|
}
|
|
@@ -460,53 +461,53 @@ var k = class {
|
|
|
460
461
|
return this._$AM._$AU;
|
|
461
462
|
}
|
|
462
463
|
constructor(t6, i6, s4, e8, h3) {
|
|
463
|
-
this.type = 1, this._$AH =
|
|
464
|
+
this.type = 1, this._$AH = A, this._$AN = void 0, this.element = t6, this.name = i6, this._$AM = e8, this.options = h3, s4.length > 2 || "" !== s4[0] || "" !== s4[1] ? (this._$AH = Array(s4.length - 1).fill(new String()), this.strings = s4) : this._$AH = A;
|
|
464
465
|
}
|
|
465
466
|
_$AI(t6, i6 = this, s4, e8) {
|
|
466
467
|
const h3 = this.strings;
|
|
467
468
|
let o8 = false;
|
|
468
|
-
if (void 0 === h3) t6 =
|
|
469
|
+
if (void 0 === h3) t6 = M(this, t6, i6, 0), o8 = !a2(t6) || t6 !== this._$AH && t6 !== E, o8 && (this._$AH = t6);
|
|
469
470
|
else {
|
|
470
471
|
const e9 = t6;
|
|
471
472
|
let n5, r7;
|
|
472
|
-
for (t6 = h3[0], n5 = 0; n5 < h3.length - 1; n5++) r7 =
|
|
473
|
+
for (t6 = h3[0], n5 = 0; n5 < h3.length - 1; n5++) r7 = M(this, e9[s4 + n5], i6, n5), r7 === E && (r7 = this._$AH[n5]), o8 || (o8 = !a2(r7) || r7 !== this._$AH[n5]), r7 === A ? t6 = A : t6 !== A && (t6 += (r7 ?? "") + h3[n5 + 1]), this._$AH[n5] = r7;
|
|
473
474
|
}
|
|
474
475
|
o8 && !e8 && this.j(t6);
|
|
475
476
|
}
|
|
476
477
|
j(t6) {
|
|
477
|
-
t6 ===
|
|
478
|
+
t6 === A ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t6 ?? "");
|
|
478
479
|
}
|
|
479
480
|
};
|
|
480
|
-
var
|
|
481
|
+
var I = class extends H {
|
|
481
482
|
constructor() {
|
|
482
483
|
super(...arguments), this.type = 3;
|
|
483
484
|
}
|
|
484
485
|
j(t6) {
|
|
485
|
-
this.element[this.name] = t6 ===
|
|
486
|
+
this.element[this.name] = t6 === A ? void 0 : t6;
|
|
486
487
|
}
|
|
487
488
|
};
|
|
488
|
-
var
|
|
489
|
+
var L = class extends H {
|
|
489
490
|
constructor() {
|
|
490
491
|
super(...arguments), this.type = 4;
|
|
491
492
|
}
|
|
492
493
|
j(t6) {
|
|
493
|
-
this.element.toggleAttribute(this.name, !!t6 && t6 !==
|
|
494
|
+
this.element.toggleAttribute(this.name, !!t6 && t6 !== A);
|
|
494
495
|
}
|
|
495
496
|
};
|
|
496
|
-
var
|
|
497
|
+
var z = class extends H {
|
|
497
498
|
constructor(t6, i6, s4, e8, h3) {
|
|
498
499
|
super(t6, i6, s4, e8, h3), this.type = 5;
|
|
499
500
|
}
|
|
500
501
|
_$AI(t6, i6 = this) {
|
|
501
|
-
if ((t6 =
|
|
502
|
-
const s4 = this._$AH, e8 = t6 ===
|
|
502
|
+
if ((t6 = M(this, t6, i6, 0) ?? A) === E) return;
|
|
503
|
+
const s4 = this._$AH, e8 = t6 === A && s4 !== A || t6.capture !== s4.capture || t6.once !== s4.once || t6.passive !== s4.passive, h3 = t6 !== A && (s4 === A || e8);
|
|
503
504
|
e8 && this.element.removeEventListener(this.name, this, s4), h3 && this.element.addEventListener(this.name, this, t6), this._$AH = t6;
|
|
504
505
|
}
|
|
505
506
|
handleEvent(t6) {
|
|
506
507
|
"function" == typeof this._$AH ? this._$AH.call(this.options?.host ?? this.element, t6) : this._$AH.handleEvent(t6);
|
|
507
508
|
}
|
|
508
509
|
};
|
|
509
|
-
var
|
|
510
|
+
var Z = class {
|
|
510
511
|
constructor(t6, i6, s4) {
|
|
511
512
|
this.element = t6, this.type = 6, this._$AN = void 0, this._$AM = i6, this.options = s4;
|
|
512
513
|
}
|
|
@@ -514,22 +515,22 @@ var z = class {
|
|
|
514
515
|
return this._$AM._$AU;
|
|
515
516
|
}
|
|
516
517
|
_$AI(t6) {
|
|
517
|
-
|
|
518
|
+
M(this, t6);
|
|
518
519
|
}
|
|
519
520
|
};
|
|
520
|
-
var
|
|
521
|
-
|
|
522
|
-
var
|
|
521
|
+
var B = t2.litHtmlPolyfillSupport;
|
|
522
|
+
B?.(S2, k), (t2.litHtmlVersions ?? (t2.litHtmlVersions = [])).push("3.3.2");
|
|
523
|
+
var D = (t6, i6, s4) => {
|
|
523
524
|
const e8 = s4?.renderBefore ?? i6;
|
|
524
525
|
let h3 = e8._$litPart$;
|
|
525
526
|
if (void 0 === h3) {
|
|
526
527
|
const t7 = s4?.renderBefore ?? null;
|
|
527
|
-
e8._$litPart$ = h3 = new
|
|
528
|
+
e8._$litPart$ = h3 = new k(i6.insertBefore(c3(), t7), t7, void 0, s4 ?? {});
|
|
528
529
|
}
|
|
529
530
|
return h3._$AI(t6), h3;
|
|
530
531
|
};
|
|
531
532
|
|
|
532
|
-
// ../../node_modules/.pnpm/lit-element@4.2.
|
|
533
|
+
// ../../node_modules/.pnpm/lit-element@4.2.2/node_modules/lit-element/lit-element.js
|
|
533
534
|
var s3 = globalThis;
|
|
534
535
|
var i4 = class extends y {
|
|
535
536
|
constructor() {
|
|
@@ -542,7 +543,7 @@ var i4 = class extends y {
|
|
|
542
543
|
}
|
|
543
544
|
update(t6) {
|
|
544
545
|
const r7 = this.render();
|
|
545
|
-
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t6), this._$Do =
|
|
546
|
+
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t6), this._$Do = D(r7, this.renderRoot, this.renderOptions);
|
|
546
547
|
}
|
|
547
548
|
connectedCallback() {
|
|
548
549
|
super.connectedCallback(), this._$Do?.setConnected(true);
|
|
@@ -551,22 +552,22 @@ var i4 = class extends y {
|
|
|
551
552
|
super.disconnectedCallback(), this._$Do?.setConnected(false);
|
|
552
553
|
}
|
|
553
554
|
render() {
|
|
554
|
-
return
|
|
555
|
+
return E;
|
|
555
556
|
}
|
|
556
557
|
};
|
|
557
558
|
i4._$litElement$ = true, i4["finalized"] = true, s3.litElementHydrateSupport?.({ LitElement: i4 });
|
|
558
559
|
var o4 = s3.litElementPolyfillSupport;
|
|
559
560
|
o4?.({ LitElement: i4 });
|
|
560
|
-
(s3.litElementVersions ?? (s3.litElementVersions = [])).push("4.2.
|
|
561
|
+
(s3.litElementVersions ?? (s3.litElementVersions = [])).push("4.2.2");
|
|
561
562
|
|
|
562
|
-
// ../../node_modules/.pnpm/@lit+reactive-element@2.1.
|
|
563
|
+
// ../../node_modules/.pnpm/@lit+reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/custom-element.js
|
|
563
564
|
var t3 = (t6) => (e8, o8) => {
|
|
564
|
-
void 0 !== o8 ? o8.addInitializer((
|
|
565
|
+
void 0 !== o8 ? o8.addInitializer(() => {
|
|
565
566
|
customElements.define(t6, e8);
|
|
566
|
-
})
|
|
567
|
+
}) : customElements.define(t6, e8);
|
|
567
568
|
};
|
|
568
569
|
|
|
569
|
-
// ../../node_modules/.pnpm/@lit+reactive-element@2.1.
|
|
570
|
+
// ../../node_modules/.pnpm/@lit+reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/property.js
|
|
570
571
|
var o5 = { attribute: true, type: String, converter: u, reflect: false, hasChanged: f };
|
|
571
572
|
var r4 = (t6 = o5, e8, r7) => {
|
|
572
573
|
const { kind: n5, metadata: i6 } = r7;
|
|
@@ -575,7 +576,7 @@ var r4 = (t6 = o5, e8, r7) => {
|
|
|
575
576
|
const { name: o8 } = r7;
|
|
576
577
|
return { set(r8) {
|
|
577
578
|
const n6 = e8.get.call(this);
|
|
578
|
-
e8.set.call(this, r8), this.requestUpdate(o8, n6, t6);
|
|
579
|
+
e8.set.call(this, r8), this.requestUpdate(o8, n6, t6, true, r8);
|
|
579
580
|
}, init(e9) {
|
|
580
581
|
return void 0 !== e9 && this.C(o8, void 0, t6, e9), e9;
|
|
581
582
|
} };
|
|
@@ -584,7 +585,7 @@ var r4 = (t6 = o5, e8, r7) => {
|
|
|
584
585
|
const { name: o8 } = r7;
|
|
585
586
|
return function(r8) {
|
|
586
587
|
const n6 = this[o8];
|
|
587
|
-
e8.call(this, r8), this.requestUpdate(o8, n6, t6);
|
|
588
|
+
e8.call(this, r8), this.requestUpdate(o8, n6, t6, true, r8);
|
|
588
589
|
};
|
|
589
590
|
}
|
|
590
591
|
throw Error("Unsupported decorator location: " + n5);
|
|
@@ -596,15 +597,15 @@ function n4(t6) {
|
|
|
596
597
|
})(t6, e8, o8);
|
|
597
598
|
}
|
|
598
599
|
|
|
599
|
-
// ../../node_modules/.pnpm/@lit+reactive-element@2.1.
|
|
600
|
+
// ../../node_modules/.pnpm/@lit+reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/state.js
|
|
600
601
|
function r5(r7) {
|
|
601
602
|
return n4({ ...r7, state: true, attribute: false });
|
|
602
603
|
}
|
|
603
604
|
|
|
604
|
-
// ../../node_modules/.pnpm/@lit+reactive-element@2.1.
|
|
605
|
+
// ../../node_modules/.pnpm/@lit+reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/base.js
|
|
605
606
|
var e4 = (e8, t6, c4) => (c4.configurable = true, c4.enumerable = true, Reflect.decorate && "object" != typeof t6 && Object.defineProperty(e8, t6, c4), c4);
|
|
606
607
|
|
|
607
|
-
// ../../node_modules/.pnpm/@lit+reactive-element@2.1.
|
|
608
|
+
// ../../node_modules/.pnpm/@lit+reactive-element@2.1.2/node_modules/@lit/reactive-element/decorators/query-all.js
|
|
608
609
|
var e5;
|
|
609
610
|
function r6(r7) {
|
|
610
611
|
return (n5, o8) => e4(n5, o8, { get() {
|
|
@@ -634,7 +635,7 @@ var ConsentButton = class extends i4 {
|
|
|
634
635
|
}
|
|
635
636
|
}
|
|
636
637
|
render() {
|
|
637
|
-
return
|
|
638
|
+
return b2`
|
|
638
639
|
<button
|
|
639
640
|
part="button"
|
|
640
641
|
type="button"
|
|
@@ -642,7 +643,7 @@ var ConsentButton = class extends i4 {
|
|
|
642
643
|
aria-busy=${this.loading}
|
|
643
644
|
@click=${this.handleClick}
|
|
644
645
|
>
|
|
645
|
-
${this.loading ?
|
|
646
|
+
${this.loading ? b2`<span class="spinner"></span>` : null}
|
|
646
647
|
<slot></slot>
|
|
647
648
|
</button>
|
|
648
649
|
`;
|
|
@@ -777,7 +778,7 @@ var ConsentCheckbox = class extends i4 {
|
|
|
777
778
|
);
|
|
778
779
|
}
|
|
779
780
|
render() {
|
|
780
|
-
return
|
|
781
|
+
return b2`
|
|
781
782
|
<label part="label">
|
|
782
783
|
<input
|
|
783
784
|
part="checkbox"
|
|
@@ -961,18 +962,18 @@ var ConsentInput = class extends i4 {
|
|
|
961
962
|
}
|
|
962
963
|
renderPasswordToggle() {
|
|
963
964
|
if (this.type !== "password") return null;
|
|
964
|
-
const icon = this.showPassword ?
|
|
965
|
+
const icon = this.showPassword ? b2`
|
|
965
966
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
966
967
|
<path d="M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24"/>
|
|
967
968
|
<line x1="1" y1="1" x2="23" y2="23"/>
|
|
968
969
|
</svg>
|
|
969
|
-
` :
|
|
970
|
+
` : b2`
|
|
970
971
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
971
972
|
<path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"/>
|
|
972
973
|
<circle cx="12" cy="12" r="3"/>
|
|
973
974
|
</svg>
|
|
974
975
|
`;
|
|
975
|
-
return
|
|
976
|
+
return b2`
|
|
976
977
|
<button
|
|
977
978
|
type="button"
|
|
978
979
|
class="password-toggle"
|
|
@@ -986,11 +987,11 @@ var ConsentInput = class extends i4 {
|
|
|
986
987
|
}
|
|
987
988
|
render() {
|
|
988
989
|
const inputType = this.type === "password" && this.showPassword ? "text" : this.type;
|
|
989
|
-
return
|
|
990
|
+
return b2`
|
|
990
991
|
<div class="field">
|
|
991
|
-
${this.label ?
|
|
992
|
+
${this.label ? b2`
|
|
992
993
|
<label part="label" for="input">
|
|
993
|
-
${this.label}${this.required ?
|
|
994
|
+
${this.label}${this.required ? b2`<span class="required">*</span>` : null}
|
|
994
995
|
</label>
|
|
995
996
|
` : null}
|
|
996
997
|
<div class="input-wrapper${this.error ? " has-error" : ""}">
|
|
@@ -1009,7 +1010,7 @@ var ConsentInput = class extends i4 {
|
|
|
1009
1010
|
/>
|
|
1010
1011
|
${this.renderPasswordToggle()}
|
|
1011
1012
|
</div>
|
|
1012
|
-
${this.error ?
|
|
1013
|
+
${this.error ? b2`<div class="error-message">${this.error}</div>` : null}
|
|
1013
1014
|
</div>
|
|
1014
1015
|
`;
|
|
1015
1016
|
}
|
|
@@ -1190,7 +1191,7 @@ var ConsentShell = class extends i4 {
|
|
|
1190
1191
|
}
|
|
1191
1192
|
renderLogo() {
|
|
1192
1193
|
if (this.logoUrl) {
|
|
1193
|
-
return
|
|
1194
|
+
return b2`
|
|
1194
1195
|
<img
|
|
1195
1196
|
class="logo"
|
|
1196
1197
|
src=${this.logoUrl}
|
|
@@ -1198,7 +1199,7 @@ var ConsentShell = class extends i4 {
|
|
|
1198
1199
|
/>
|
|
1199
1200
|
`;
|
|
1200
1201
|
}
|
|
1201
|
-
return
|
|
1202
|
+
return b2`
|
|
1202
1203
|
<div class="default-icon">
|
|
1203
1204
|
<svg
|
|
1204
1205
|
xmlns="http://www.w3.org/2000/svg"
|
|
@@ -1226,11 +1227,11 @@ var ConsentShell = class extends i4 {
|
|
|
1226
1227
|
}
|
|
1227
1228
|
}
|
|
1228
1229
|
render() {
|
|
1229
|
-
return
|
|
1230
|
+
return b2`
|
|
1230
1231
|
<div class="container" part="container">
|
|
1231
1232
|
<header class="header" part="header">
|
|
1232
1233
|
${this.renderLogo()}
|
|
1233
|
-
${this.companyName ?
|
|
1234
|
+
${this.companyName ? b2`<div class="company-name">${this.companyName}</div>` : null}
|
|
1234
1235
|
<h1 class="title">${this.pageTitle}</h1>
|
|
1235
1236
|
</header>
|
|
1236
1237
|
|
|
@@ -1461,9 +1462,9 @@ var ConsentPermissions = class extends i4 {
|
|
|
1461
1462
|
renderIcon() {
|
|
1462
1463
|
switch (this.iconStyle) {
|
|
1463
1464
|
case "bullet":
|
|
1464
|
-
return
|
|
1465
|
+
return b2`<div class="icon icon-bullet"></div>`;
|
|
1465
1466
|
case "shield":
|
|
1466
|
-
return
|
|
1467
|
+
return b2`
|
|
1467
1468
|
<div class="icon icon-shield">
|
|
1468
1469
|
<svg
|
|
1469
1470
|
xmlns="http://www.w3.org/2000/svg"
|
|
@@ -1477,7 +1478,7 @@ var ConsentPermissions = class extends i4 {
|
|
|
1477
1478
|
</div>
|
|
1478
1479
|
`;
|
|
1479
1480
|
default:
|
|
1480
|
-
return
|
|
1481
|
+
return b2`
|
|
1481
1482
|
<div class="icon icon-check">
|
|
1482
1483
|
<svg
|
|
1483
1484
|
xmlns="http://www.w3.org/2000/svg"
|
|
@@ -1494,9 +1495,9 @@ var ConsentPermissions = class extends i4 {
|
|
|
1494
1495
|
}
|
|
1495
1496
|
renderPermissionItem(scope) {
|
|
1496
1497
|
const isSelected = this.selectedScopes.has(scope.id);
|
|
1497
|
-
return
|
|
1498
|
+
return b2`
|
|
1498
1499
|
<li class="permission-item" part="item">
|
|
1499
|
-
${this.interactive ?
|
|
1500
|
+
${this.interactive ? b2`
|
|
1500
1501
|
<input
|
|
1501
1502
|
type="checkbox"
|
|
1502
1503
|
class="checkbox"
|
|
@@ -1512,9 +1513,9 @@ var ConsentPermissions = class extends i4 {
|
|
|
1512
1513
|
<div class="content">
|
|
1513
1514
|
<span class="label">
|
|
1514
1515
|
${scope.label}
|
|
1515
|
-
${scope.required ?
|
|
1516
|
+
${scope.required ? b2`<span class="required-badge">Required</span>` : null}
|
|
1516
1517
|
</span>
|
|
1517
|
-
${scope.description ?
|
|
1518
|
+
${scope.description ? b2`<div class="description">${scope.description}</div>` : null}
|
|
1518
1519
|
</div>
|
|
1519
1520
|
</li>
|
|
1520
1521
|
`;
|
|
@@ -1522,9 +1523,9 @@ var ConsentPermissions = class extends i4 {
|
|
|
1522
1523
|
render() {
|
|
1523
1524
|
const scopes = this.normalizedScopes;
|
|
1524
1525
|
if (scopes.length === 0) {
|
|
1525
|
-
return
|
|
1526
|
+
return b2`<div class="empty">No permissions requested</div>`;
|
|
1526
1527
|
}
|
|
1527
|
-
return
|
|
1528
|
+
return b2`
|
|
1528
1529
|
<ul class="permission-list" part="list" role="list">
|
|
1529
1530
|
${scopes.map((scope) => this.renderPermissionItem(scope))}
|
|
1530
1531
|
</ul>
|
|
@@ -1752,7 +1753,7 @@ var ConsentTerms = class extends i4 {
|
|
|
1752
1753
|
}
|
|
1753
1754
|
renderLink(text, url) {
|
|
1754
1755
|
if (url) {
|
|
1755
|
-
return
|
|
1756
|
+
return b2`<a
|
|
1756
1757
|
href=${url}
|
|
1757
1758
|
target="_blank"
|
|
1758
1759
|
rel="noopener noreferrer"
|
|
@@ -1761,11 +1762,11 @@ var ConsentTerms = class extends i4 {
|
|
|
1761
1762
|
>${text}</a
|
|
1762
1763
|
>`;
|
|
1763
1764
|
}
|
|
1764
|
-
return
|
|
1765
|
+
return b2`<span>${text}</span>`;
|
|
1765
1766
|
}
|
|
1766
1767
|
render() {
|
|
1767
1768
|
const hasPrivacy = this.privacyText && this.privacyUrl;
|
|
1768
|
-
return
|
|
1769
|
+
return b2`
|
|
1769
1770
|
<label part="label">
|
|
1770
1771
|
<input
|
|
1771
1772
|
part="checkbox"
|
|
@@ -1779,11 +1780,11 @@ var ConsentTerms = class extends i4 {
|
|
|
1779
1780
|
/>
|
|
1780
1781
|
<span class="text">
|
|
1781
1782
|
${this.labelPrefix} ${this.renderLink(this.text, this.url)}
|
|
1782
|
-
${hasPrivacy ?
|
|
1783
|
+
${hasPrivacy ? b2`
|
|
1783
1784
|
${this.conjunction}
|
|
1784
1785
|
${this.renderLink(this.privacyText, this.privacyUrl)}
|
|
1785
|
-
` :
|
|
1786
|
-
${this.required ?
|
|
1786
|
+
` : A}
|
|
1787
|
+
${this.required ? b2`<span class="required">*</span>` : A}
|
|
1787
1788
|
</span>
|
|
1788
1789
|
</label>
|
|
1789
1790
|
`;
|
|
@@ -1936,7 +1937,7 @@ ConsentTerms = __decorateClass([
|
|
|
1936
1937
|
t3("consent-terms")
|
|
1937
1938
|
], ConsentTerms);
|
|
1938
1939
|
|
|
1939
|
-
// ../../node_modules/.pnpm/lit-html@3.3.
|
|
1940
|
+
// ../../node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/directive.js
|
|
1940
1941
|
var t4 = { ATTRIBUTE: 1, CHILD: 2, PROPERTY: 3, BOOLEAN_ATTRIBUTE: 4, EVENT: 5, ELEMENT: 6 };
|
|
1941
1942
|
var e6 = (t6) => (...e8) => ({ _$litDirective$: t6, values: e8 });
|
|
1942
1943
|
var i5 = class {
|
|
@@ -1956,14 +1957,14 @@ var i5 = class {
|
|
|
1956
1957
|
}
|
|
1957
1958
|
};
|
|
1958
1959
|
|
|
1959
|
-
// ../../node_modules/.pnpm/lit-html@3.3.
|
|
1960
|
+
// ../../node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/directives/unsafe-html.js
|
|
1960
1961
|
var e7 = class extends i5 {
|
|
1961
1962
|
constructor(i6) {
|
|
1962
|
-
if (super(i6), this.it =
|
|
1963
|
+
if (super(i6), this.it = A, i6.type !== t4.CHILD) throw Error(this.constructor.directiveName + "() can only be used in child bindings");
|
|
1963
1964
|
}
|
|
1964
1965
|
render(r7) {
|
|
1965
|
-
if (r7 ===
|
|
1966
|
-
if (r7 ===
|
|
1966
|
+
if (r7 === A || null == r7) return this._t = void 0, this.it = r7;
|
|
1967
|
+
if (r7 === E) return r7;
|
|
1967
1968
|
if ("string" != typeof r7) throw Error(this.constructor.directiveName + "() called with a non-string value");
|
|
1968
1969
|
if (r7 === this.it) return this._t;
|
|
1969
1970
|
this.it = r7;
|
|
@@ -1974,7 +1975,7 @@ var e7 = class extends i5 {
|
|
|
1974
1975
|
e7.directiveName = "unsafeHTML", e7.resultType = 1;
|
|
1975
1976
|
var o6 = e6(e7);
|
|
1976
1977
|
|
|
1977
|
-
// ../../node_modules/.pnpm/lit-html@3.3.
|
|
1978
|
+
// ../../node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/directives/unsafe-svg.js
|
|
1978
1979
|
var t5 = class extends e7 {
|
|
1979
1980
|
};
|
|
1980
1981
|
t5.directiveName = "unsafeSVG", t5.resultType = 2;
|
|
@@ -2080,11 +2081,11 @@ var ConsentOAuthButton = class extends i4 {
|
|
|
2080
2081
|
renderProviderIcon() {
|
|
2081
2082
|
if (this.customIcon) {
|
|
2082
2083
|
const sanitized = sanitizeSvg(this.customIcon);
|
|
2083
|
-
return
|
|
2084
|
+
return b2`<div class="icon">${o7(sanitized)}</div>`;
|
|
2084
2085
|
}
|
|
2085
2086
|
switch (this.provider) {
|
|
2086
2087
|
case "google":
|
|
2087
|
-
return
|
|
2088
|
+
return b2`
|
|
2088
2089
|
<div class="icon">
|
|
2089
2090
|
<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
|
2090
2091
|
<path
|
|
@@ -2107,7 +2108,7 @@ var ConsentOAuthButton = class extends i4 {
|
|
|
2107
2108
|
</div>
|
|
2108
2109
|
`;
|
|
2109
2110
|
case "microsoft":
|
|
2110
|
-
return
|
|
2111
|
+
return b2`
|
|
2111
2112
|
<div class="icon">
|
|
2112
2113
|
<svg viewBox="0 0 21 21" xmlns="http://www.w3.org/2000/svg">
|
|
2113
2114
|
<rect x="1" y="1" width="9" height="9" fill="#f25022" />
|
|
@@ -2118,7 +2119,7 @@ var ConsentOAuthButton = class extends i4 {
|
|
|
2118
2119
|
</div>
|
|
2119
2120
|
`;
|
|
2120
2121
|
case "apple":
|
|
2121
|
-
return
|
|
2122
|
+
return b2`
|
|
2122
2123
|
<div class="icon">
|
|
2123
2124
|
<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
|
2124
2125
|
<path
|
|
@@ -2129,7 +2130,7 @@ var ConsentOAuthButton = class extends i4 {
|
|
|
2129
2130
|
</div>
|
|
2130
2131
|
`;
|
|
2131
2132
|
case "github":
|
|
2132
|
-
return
|
|
2133
|
+
return b2`
|
|
2133
2134
|
<div class="icon">
|
|
2134
2135
|
<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
|
2135
2136
|
<path
|
|
@@ -2140,7 +2141,7 @@ var ConsentOAuthButton = class extends i4 {
|
|
|
2140
2141
|
</div>
|
|
2141
2142
|
`;
|
|
2142
2143
|
case "twitter":
|
|
2143
|
-
return
|
|
2144
|
+
return b2`
|
|
2144
2145
|
<div class="icon">
|
|
2145
2146
|
<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
|
2146
2147
|
<path
|
|
@@ -2151,7 +2152,7 @@ var ConsentOAuthButton = class extends i4 {
|
|
|
2151
2152
|
</div>
|
|
2152
2153
|
`;
|
|
2153
2154
|
case "facebook":
|
|
2154
|
-
return
|
|
2155
|
+
return b2`
|
|
2155
2156
|
<div class="icon">
|
|
2156
2157
|
<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
|
2157
2158
|
<path
|
|
@@ -2162,7 +2163,7 @@ var ConsentOAuthButton = class extends i4 {
|
|
|
2162
2163
|
</div>
|
|
2163
2164
|
`;
|
|
2164
2165
|
default:
|
|
2165
|
-
return
|
|
2166
|
+
return A;
|
|
2166
2167
|
}
|
|
2167
2168
|
}
|
|
2168
2169
|
updated(changedProperties) {
|
|
@@ -2176,7 +2177,7 @@ var ConsentOAuthButton = class extends i4 {
|
|
|
2176
2177
|
}
|
|
2177
2178
|
render() {
|
|
2178
2179
|
const isLoading = this.loading || this.redirecting;
|
|
2179
|
-
return
|
|
2180
|
+
return b2`
|
|
2180
2181
|
<button
|
|
2181
2182
|
part="button"
|
|
2182
2183
|
type="button"
|
|
@@ -2189,7 +2190,7 @@ var ConsentOAuthButton = class extends i4 {
|
|
|
2189
2190
|
"
|
|
2190
2191
|
aria-busy=${isLoading}
|
|
2191
2192
|
>
|
|
2192
|
-
${isLoading ?
|
|
2193
|
+
${isLoading ? b2`<span class="spinner"></span>` : this.renderProviderIcon()}
|
|
2193
2194
|
<span class="text" part="text">${this.displayText}</span>
|
|
2194
2195
|
</button>
|
|
2195
2196
|
`;
|
|
@@ -2475,7 +2476,7 @@ var ConsentOTPInput = class extends i4 {
|
|
|
2475
2476
|
renderDigitInput(index) {
|
|
2476
2477
|
const digit = this.digits[index] || "";
|
|
2477
2478
|
const isFilled = digit !== "";
|
|
2478
|
-
return
|
|
2479
|
+
return b2`
|
|
2479
2480
|
<input
|
|
2480
2481
|
part="input"
|
|
2481
2482
|
type=${this.inputType}
|
|
@@ -2495,7 +2496,7 @@ var ConsentOTPInput = class extends i4 {
|
|
|
2495
2496
|
`;
|
|
2496
2497
|
}
|
|
2497
2498
|
render() {
|
|
2498
|
-
return
|
|
2499
|
+
return b2`
|
|
2499
2500
|
<div class="container" part="container" role="group" aria-label="One-time password input">
|
|
2500
2501
|
${Array.from({ length: this.length }, (_2, i6) => this.renderDigitInput(i6))}
|
|
2501
2502
|
</div>
|
|
@@ -2615,6 +2616,1229 @@ ConsentOTPInput = __decorateClass([
|
|
|
2615
2616
|
t3("consent-otp-input")
|
|
2616
2617
|
], ConsentOTPInput);
|
|
2617
2618
|
|
|
2619
|
+
// src/copy/tokens.ts
|
|
2620
|
+
var CONSENT_COPY_TOKENS = {
|
|
2621
|
+
eyebrow: {
|
|
2622
|
+
/** Light theme (consent screen). */
|
|
2623
|
+
permissionRequest: "PERMISSION REQUEST",
|
|
2624
|
+
/** Dark theme (gateway). `{Brand}` → operator-set brand name. */
|
|
2625
|
+
gatewayBrand: "{Brand} Gateway"
|
|
2626
|
+
},
|
|
2627
|
+
headline: {
|
|
2628
|
+
/**
|
|
2629
|
+
* `{Agent}` → agent display name (serif italic at render time).
|
|
2630
|
+
* `{Verb}` → operator verb, default "use".
|
|
2631
|
+
* `{Org}` → organization display name (serif italic at render time).
|
|
2632
|
+
*/
|
|
2633
|
+
template: "{Agent} would like to {Verb} at {Org} for you."
|
|
2634
|
+
},
|
|
2635
|
+
subhead: {
|
|
2636
|
+
/** `{Agent}` → agent display name. */
|
|
2637
|
+
template: "Pick what {Agent} is allowed to do on your behalf. You stay in charge \u2014 change or cancel anytime."
|
|
2638
|
+
},
|
|
2639
|
+
agentTile: {
|
|
2640
|
+
verifiedPill: "Verified",
|
|
2641
|
+
unverifiedPill: "UNVERIFIED",
|
|
2642
|
+
/** `{Vendor}` → vendor name. `{Surface}` → surface label. */
|
|
2643
|
+
metaTemplate: "Made by {Vendor} \xB7 Asking from your {Surface} \xB7 {Connected}",
|
|
2644
|
+
connectedJustNow: "Connected just now",
|
|
2645
|
+
/** `{Minutes}` → minutes since connection. */
|
|
2646
|
+
connectedMinutesAgo: "Connected {Minutes} min ago"
|
|
2647
|
+
},
|
|
2648
|
+
section: {
|
|
2649
|
+
/** `{Agent}` → agent display name (uppercased at render time). */
|
|
2650
|
+
capabilitiesHeader: "WHAT {Agent} CAN DO FOR YOU",
|
|
2651
|
+
tapToToggle: "Tap to toggle",
|
|
2652
|
+
/** Used in the dark gateway theme. */
|
|
2653
|
+
permissionsRequested: "PERMISSIONS REQUESTED"
|
|
2654
|
+
},
|
|
2655
|
+
capabilityRow: {
|
|
2656
|
+
higherRiskChip: "HIGHER RISK",
|
|
2657
|
+
viewPolicyLink: "View policy",
|
|
2658
|
+
/** Disclosure title above the raw Cedar. */
|
|
2659
|
+
rawPolicyTitle: "Cedar policy",
|
|
2660
|
+
/** Disclosure title above the plain-language gloss. */
|
|
2661
|
+
glossTitle: "What this allows",
|
|
2662
|
+
/** Used in the gloss when no resource is extractable. */
|
|
2663
|
+
glossUnknownResource: "this deployment"
|
|
2664
|
+
},
|
|
2665
|
+
footer: {
|
|
2666
|
+
/**
|
|
2667
|
+
* `{RevocationPath}` → e.g. "Account → Connected Agents".
|
|
2668
|
+
* `{Org}` → organization display name.
|
|
2669
|
+
*/
|
|
2670
|
+
revocationTemplate: "You can change or revoke any of these permissions anytime under {RevocationPath} at {Org}.",
|
|
2671
|
+
/** `{Days}` → inactivity days, default 90. */
|
|
2672
|
+
inactivityTemplate: "Permissions automatically expire after {Days} days of inactivity."
|
|
2673
|
+
},
|
|
2674
|
+
actions: {
|
|
2675
|
+
/** Light theme primary. `{Agent}` → agent display name. */
|
|
2676
|
+
allowAgentTemplate: "Allow {Agent}",
|
|
2677
|
+
/** Dark theme primary. */
|
|
2678
|
+
allowAccess: "Allow access",
|
|
2679
|
+
/** Light theme secondary. */
|
|
2680
|
+
notNow: "Not now",
|
|
2681
|
+
/** Dark theme secondary. */
|
|
2682
|
+
deny: "Deny"
|
|
2683
|
+
},
|
|
2684
|
+
attribution: {
|
|
2685
|
+
/** Light theme. */
|
|
2686
|
+
protectedBy: "Protected by Checkpoint",
|
|
2687
|
+
/** Dark theme. */
|
|
2688
|
+
securedBy: "Secured by Checkpoint",
|
|
2689
|
+
howThisWorks: "How does this work?"
|
|
2690
|
+
}
|
|
2691
|
+
};
|
|
2692
|
+
function formatToken(template, values) {
|
|
2693
|
+
return template.replace(/\{(\w+)\}/g, (match, key) => {
|
|
2694
|
+
const value = values[key];
|
|
2695
|
+
return value === void 0 ? match : String(value);
|
|
2696
|
+
});
|
|
2697
|
+
}
|
|
2698
|
+
|
|
2699
|
+
// src/components/consent-agent-header.ts
|
|
2700
|
+
var ConsentAgentHeader = class extends i4 {
|
|
2701
|
+
constructor() {
|
|
2702
|
+
super(...arguments);
|
|
2703
|
+
this.agentName = "";
|
|
2704
|
+
this.vendor = "";
|
|
2705
|
+
this.surfaceLabel = "";
|
|
2706
|
+
this.verified = false;
|
|
2707
|
+
this.logoUrl = "";
|
|
2708
|
+
this.connectedAt = "";
|
|
2709
|
+
}
|
|
2710
|
+
renderConnectedFragment() {
|
|
2711
|
+
if (!this.connectedAt) {
|
|
2712
|
+
return CONSENT_COPY_TOKENS.agentTile.connectedJustNow;
|
|
2713
|
+
}
|
|
2714
|
+
const ts = Date.parse(this.connectedAt);
|
|
2715
|
+
if (Number.isNaN(ts)) {
|
|
2716
|
+
return CONSENT_COPY_TOKENS.agentTile.connectedJustNow;
|
|
2717
|
+
}
|
|
2718
|
+
const minutes = Math.max(0, Math.floor((Date.now() - ts) / 6e4));
|
|
2719
|
+
if (minutes < 1) {
|
|
2720
|
+
return CONSENT_COPY_TOKENS.agentTile.connectedJustNow;
|
|
2721
|
+
}
|
|
2722
|
+
return formatToken(CONSENT_COPY_TOKENS.agentTile.connectedMinutesAgo, {
|
|
2723
|
+
Minutes: minutes
|
|
2724
|
+
});
|
|
2725
|
+
}
|
|
2726
|
+
renderMeta() {
|
|
2727
|
+
if (!this.vendor && !this.surfaceLabel) {
|
|
2728
|
+
return this.renderConnectedFragment();
|
|
2729
|
+
}
|
|
2730
|
+
return formatToken(CONSENT_COPY_TOKENS.agentTile.metaTemplate, {
|
|
2731
|
+
Vendor: this.vendor || "\u2014",
|
|
2732
|
+
Surface: this.surfaceLabel || "this device",
|
|
2733
|
+
Connected: this.renderConnectedFragment()
|
|
2734
|
+
});
|
|
2735
|
+
}
|
|
2736
|
+
render() {
|
|
2737
|
+
const initial = (this.agentName || "?").trim().charAt(0).toUpperCase();
|
|
2738
|
+
const verifiedLabel = this.verified ? CONSENT_COPY_TOKENS.agentTile.verifiedPill : CONSENT_COPY_TOKENS.agentTile.unverifiedPill;
|
|
2739
|
+
const verifiedClass = this.verified ? "verified" : "unverified";
|
|
2740
|
+
return b2`
|
|
2741
|
+
<div class="tile" part="tile">
|
|
2742
|
+
<div class="logo" aria-hidden="true">
|
|
2743
|
+
${this.logoUrl ? b2`<img src="${this.logoUrl}" alt="" />` : b2`<div class="placeholder">${initial}</div>`}
|
|
2744
|
+
</div>
|
|
2745
|
+
<div class="body">
|
|
2746
|
+
<div class="row-name">
|
|
2747
|
+
<span class="name">${this.agentName || A}</span>
|
|
2748
|
+
<span class="pill ${verifiedClass}" part="pill">
|
|
2749
|
+
${verifiedLabel}
|
|
2750
|
+
</span>
|
|
2751
|
+
</div>
|
|
2752
|
+
<div class="meta">${this.renderMeta()}</div>
|
|
2753
|
+
</div>
|
|
2754
|
+
</div>
|
|
2755
|
+
`;
|
|
2756
|
+
}
|
|
2757
|
+
};
|
|
2758
|
+
ConsentAgentHeader.styles = i`
|
|
2759
|
+
:host {
|
|
2760
|
+
display: block;
|
|
2761
|
+
width: 100%;
|
|
2762
|
+
}
|
|
2763
|
+
|
|
2764
|
+
.tile {
|
|
2765
|
+
display: flex;
|
|
2766
|
+
align-items: center;
|
|
2767
|
+
gap: 16px;
|
|
2768
|
+
padding: 16px 18px;
|
|
2769
|
+
border-radius: 14px;
|
|
2770
|
+
background: var(--cs-surface-inset, transparent);
|
|
2771
|
+
border: 1px solid var(--cs-surface-border, transparent);
|
|
2772
|
+
}
|
|
2773
|
+
|
|
2774
|
+
.logo {
|
|
2775
|
+
width: 44px;
|
|
2776
|
+
height: 44px;
|
|
2777
|
+
border-radius: 12px;
|
|
2778
|
+
flex-shrink: 0;
|
|
2779
|
+
background: var(--cs-surface-card, #fff);
|
|
2780
|
+
display: flex;
|
|
2781
|
+
align-items: center;
|
|
2782
|
+
justify-content: center;
|
|
2783
|
+
overflow: hidden;
|
|
2784
|
+
border: 1px solid var(--cs-surface-border, transparent);
|
|
2785
|
+
}
|
|
2786
|
+
|
|
2787
|
+
.logo img {
|
|
2788
|
+
width: 100%;
|
|
2789
|
+
height: 100%;
|
|
2790
|
+
object-fit: cover;
|
|
2791
|
+
}
|
|
2792
|
+
|
|
2793
|
+
.logo .placeholder {
|
|
2794
|
+
width: 100%;
|
|
2795
|
+
height: 100%;
|
|
2796
|
+
background: var(--cs-surface-accent, #0F172A);
|
|
2797
|
+
color: var(--cs-surface-accent-text, #fff);
|
|
2798
|
+
display: flex;
|
|
2799
|
+
align-items: center;
|
|
2800
|
+
justify-content: center;
|
|
2801
|
+
font-weight: 600;
|
|
2802
|
+
font-size: 18px;
|
|
2803
|
+
}
|
|
2804
|
+
|
|
2805
|
+
.body {
|
|
2806
|
+
display: flex;
|
|
2807
|
+
flex-direction: column;
|
|
2808
|
+
gap: 4px;
|
|
2809
|
+
min-width: 0;
|
|
2810
|
+
}
|
|
2811
|
+
|
|
2812
|
+
.row-name {
|
|
2813
|
+
display: flex;
|
|
2814
|
+
align-items: center;
|
|
2815
|
+
gap: 10px;
|
|
2816
|
+
flex-wrap: wrap;
|
|
2817
|
+
}
|
|
2818
|
+
|
|
2819
|
+
.name {
|
|
2820
|
+
font-size: 16px;
|
|
2821
|
+
font-weight: 600;
|
|
2822
|
+
color: var(--cs-text-primary, #0F172A);
|
|
2823
|
+
letter-spacing: -0.01em;
|
|
2824
|
+
}
|
|
2825
|
+
|
|
2826
|
+
.pill {
|
|
2827
|
+
display: inline-flex;
|
|
2828
|
+
align-items: center;
|
|
2829
|
+
gap: 4px;
|
|
2830
|
+
padding: 2px 8px;
|
|
2831
|
+
border-radius: 999px;
|
|
2832
|
+
font-size: 11px;
|
|
2833
|
+
font-weight: 600;
|
|
2834
|
+
letter-spacing: 0.04em;
|
|
2835
|
+
}
|
|
2836
|
+
|
|
2837
|
+
.pill.verified {
|
|
2838
|
+
background: var(--cs-pill-verified-bg, #DCFCE7);
|
|
2839
|
+
color: var(--cs-pill-verified-text, #166534);
|
|
2840
|
+
}
|
|
2841
|
+
|
|
2842
|
+
.pill.unverified {
|
|
2843
|
+
background: var(--cs-pill-unverified-bg, #F1F5F9);
|
|
2844
|
+
color: var(--cs-pill-unverified-text, #475569);
|
|
2845
|
+
letter-spacing: 0.08em;
|
|
2846
|
+
}
|
|
2847
|
+
|
|
2848
|
+
.meta {
|
|
2849
|
+
font-size: 12px;
|
|
2850
|
+
color: var(--cs-text-tertiary, #64748B);
|
|
2851
|
+
line-height: 1.5;
|
|
2852
|
+
}
|
|
2853
|
+
`;
|
|
2854
|
+
__decorateClass([
|
|
2855
|
+
n4({ type: String })
|
|
2856
|
+
], ConsentAgentHeader.prototype, "agentName", 2);
|
|
2857
|
+
__decorateClass([
|
|
2858
|
+
n4({ type: String })
|
|
2859
|
+
], ConsentAgentHeader.prototype, "vendor", 2);
|
|
2860
|
+
__decorateClass([
|
|
2861
|
+
n4({ type: String })
|
|
2862
|
+
], ConsentAgentHeader.prototype, "surfaceLabel", 2);
|
|
2863
|
+
__decorateClass([
|
|
2864
|
+
n4({ type: Boolean })
|
|
2865
|
+
], ConsentAgentHeader.prototype, "verified", 2);
|
|
2866
|
+
__decorateClass([
|
|
2867
|
+
n4({ type: String })
|
|
2868
|
+
], ConsentAgentHeader.prototype, "logoUrl", 2);
|
|
2869
|
+
__decorateClass([
|
|
2870
|
+
n4({ type: String })
|
|
2871
|
+
], ConsentAgentHeader.prototype, "connectedAt", 2);
|
|
2872
|
+
ConsentAgentHeader = __decorateClass([
|
|
2873
|
+
t3("consent-agent-header")
|
|
2874
|
+
], ConsentAgentHeader);
|
|
2875
|
+
|
|
2876
|
+
// src/cedar/explain.ts
|
|
2877
|
+
var ACTION_SINGLE = /action\s*==\s*Action::"([^"]+)"/g;
|
|
2878
|
+
var ACTION_LIST = /action\s+in\s*\[([^\]]+)\]/g;
|
|
2879
|
+
var ACTION_STRING_IN_LIST = /Action::"([^"]+)"/g;
|
|
2880
|
+
var RESOURCE_IN = /resource\s+in\s+([^,)\n]+)/i;
|
|
2881
|
+
var RESOURCE_EQ = /resource\s*==\s*([^,)\n]+)/i;
|
|
2882
|
+
var CONDITION_BLOCK = /(when|unless)\s*\{([^}]+)\}/g;
|
|
2883
|
+
function explainCedarFragment(cedar) {
|
|
2884
|
+
return {
|
|
2885
|
+
actions: extractActions(cedar),
|
|
2886
|
+
resource: extractResource(cedar),
|
|
2887
|
+
conditions: extractConditions(cedar)
|
|
2888
|
+
};
|
|
2889
|
+
}
|
|
2890
|
+
function extractActions(cedar) {
|
|
2891
|
+
const actions = /* @__PURE__ */ new Set();
|
|
2892
|
+
for (const match of cedar.matchAll(ACTION_SINGLE)) {
|
|
2893
|
+
if (match[1]) actions.add(match[1]);
|
|
2894
|
+
}
|
|
2895
|
+
for (const listMatch of cedar.matchAll(ACTION_LIST)) {
|
|
2896
|
+
const inner = listMatch[1];
|
|
2897
|
+
if (!inner) continue;
|
|
2898
|
+
for (const stringMatch of inner.matchAll(ACTION_STRING_IN_LIST)) {
|
|
2899
|
+
if (stringMatch[1]) actions.add(stringMatch[1]);
|
|
2900
|
+
}
|
|
2901
|
+
}
|
|
2902
|
+
return Array.from(actions);
|
|
2903
|
+
}
|
|
2904
|
+
function extractResource(cedar) {
|
|
2905
|
+
const inMatch = RESOURCE_IN.exec(cedar);
|
|
2906
|
+
if (inMatch && inMatch[1]) {
|
|
2907
|
+
return inMatch[1].trim();
|
|
2908
|
+
}
|
|
2909
|
+
const eqMatch = RESOURCE_EQ.exec(cedar);
|
|
2910
|
+
if (eqMatch && eqMatch[1]) {
|
|
2911
|
+
return eqMatch[1].trim();
|
|
2912
|
+
}
|
|
2913
|
+
return "";
|
|
2914
|
+
}
|
|
2915
|
+
function extractConditions(cedar) {
|
|
2916
|
+
const conditions = [];
|
|
2917
|
+
for (const match of cedar.matchAll(CONDITION_BLOCK)) {
|
|
2918
|
+
const keyword = match[1];
|
|
2919
|
+
const body = match[2];
|
|
2920
|
+
if (!keyword || !body) continue;
|
|
2921
|
+
conditions.push(`${keyword} ${body.trim().replace(/\s+/g, " ")}`);
|
|
2922
|
+
}
|
|
2923
|
+
return conditions;
|
|
2924
|
+
}
|
|
2925
|
+
|
|
2926
|
+
// src/components/consent-capability-card.ts
|
|
2927
|
+
var ConsentCapabilityCard = class extends i4 {
|
|
2928
|
+
constructor() {
|
|
2929
|
+
super(...arguments);
|
|
2930
|
+
this.capabilityId = "";
|
|
2931
|
+
this.label = "";
|
|
2932
|
+
this.description = "";
|
|
2933
|
+
this.icon = "neutral";
|
|
2934
|
+
this.riskLevel = "low";
|
|
2935
|
+
this.checked = false;
|
|
2936
|
+
this.compiledCedar = "";
|
|
2937
|
+
this.policyOpen = false;
|
|
2938
|
+
}
|
|
2939
|
+
toggleChecked() {
|
|
2940
|
+
this.checked = !this.checked;
|
|
2941
|
+
const detail = {
|
|
2942
|
+
id: this.capabilityId,
|
|
2943
|
+
checked: this.checked
|
|
2944
|
+
};
|
|
2945
|
+
this.dispatchEvent(
|
|
2946
|
+
new CustomEvent("capability-toggle", {
|
|
2947
|
+
detail,
|
|
2948
|
+
bubbles: true,
|
|
2949
|
+
composed: true
|
|
2950
|
+
})
|
|
2951
|
+
);
|
|
2952
|
+
}
|
|
2953
|
+
togglePolicy() {
|
|
2954
|
+
this.policyOpen = !this.policyOpen;
|
|
2955
|
+
}
|
|
2956
|
+
isHigherRisk() {
|
|
2957
|
+
return this.riskLevel === "high" || this.riskLevel === "critical";
|
|
2958
|
+
}
|
|
2959
|
+
renderIcon() {
|
|
2960
|
+
return iconSvgFor(this.icon);
|
|
2961
|
+
}
|
|
2962
|
+
renderPolicy() {
|
|
2963
|
+
if (!this.policyOpen) return A;
|
|
2964
|
+
if (!this.compiledCedar) return A;
|
|
2965
|
+
const explanation = explainCedarFragment(this.compiledCedar);
|
|
2966
|
+
const tokens = CONSENT_COPY_TOKENS.capabilityRow;
|
|
2967
|
+
return b2`
|
|
2968
|
+
<div class="policy-disclosure" part="policy">
|
|
2969
|
+
<h4>${tokens.glossTitle}</h4>
|
|
2970
|
+
<ul>
|
|
2971
|
+
${explanation.actions.length === 0 ? b2`<li>—</li>` : explanation.actions.map(
|
|
2972
|
+
(action) => b2`<li><code>${action}</code></li>`
|
|
2973
|
+
)}
|
|
2974
|
+
</ul>
|
|
2975
|
+
${explanation.resource ? b2`<p>
|
|
2976
|
+
On <code>${explanation.resource}</code>
|
|
2977
|
+
</p>` : b2`<p>On ${tokens.glossUnknownResource}</p>`}
|
|
2978
|
+
<h4>${tokens.rawPolicyTitle}</h4>
|
|
2979
|
+
<pre><code>${this.compiledCedar}</code></pre>
|
|
2980
|
+
</div>
|
|
2981
|
+
`;
|
|
2982
|
+
}
|
|
2983
|
+
render() {
|
|
2984
|
+
const tokens = CONSENT_COPY_TOKENS.capabilityRow;
|
|
2985
|
+
return b2`
|
|
2986
|
+
<div class="row" part="row">
|
|
2987
|
+
<button
|
|
2988
|
+
class="checkbox"
|
|
2989
|
+
part="checkbox"
|
|
2990
|
+
role="checkbox"
|
|
2991
|
+
aria-checked="${String(this.checked)}"
|
|
2992
|
+
aria-label="${this.label}"
|
|
2993
|
+
@click=${this.toggleChecked}
|
|
2994
|
+
type="button"
|
|
2995
|
+
>
|
|
2996
|
+
${this.checked ? b2`<span class="check-mark">✓</span>` : A}
|
|
2997
|
+
</button>
|
|
2998
|
+
<div class="icon-tile" aria-hidden="true">${this.renderIcon()}</div>
|
|
2999
|
+
<div class="body">
|
|
3000
|
+
<div class="row-label">
|
|
3001
|
+
<span><strong>${this.label}</strong> <span class="description">${this.description}</span></span>
|
|
3002
|
+
${this.isHigherRisk() ? b2`<span class="risk-chip">${tokens.higherRiskChip}</span>` : A}
|
|
3003
|
+
</div>
|
|
3004
|
+
<button
|
|
3005
|
+
class="policy-toggle"
|
|
3006
|
+
type="button"
|
|
3007
|
+
@click=${this.togglePolicy}
|
|
3008
|
+
aria-expanded="${String(this.policyOpen)}"
|
|
3009
|
+
>
|
|
3010
|
+
${tokens.viewPolicyLink}
|
|
3011
|
+
</button>
|
|
3012
|
+
${this.renderPolicy()}
|
|
3013
|
+
</div>
|
|
3014
|
+
</div>
|
|
3015
|
+
`;
|
|
3016
|
+
}
|
|
3017
|
+
};
|
|
3018
|
+
ConsentCapabilityCard.styles = i`
|
|
3019
|
+
:host {
|
|
3020
|
+
display: block;
|
|
3021
|
+
border-bottom: 1px solid var(--cs-surface-border, rgba(15, 23, 42, 0.08));
|
|
3022
|
+
}
|
|
3023
|
+
|
|
3024
|
+
:host(:last-of-type) {
|
|
3025
|
+
border-bottom: none;
|
|
3026
|
+
}
|
|
3027
|
+
|
|
3028
|
+
.row {
|
|
3029
|
+
display: grid;
|
|
3030
|
+
grid-template-columns: 22px 36px 1fr;
|
|
3031
|
+
gap: 14px;
|
|
3032
|
+
padding: 16px 0;
|
|
3033
|
+
align-items: flex-start;
|
|
3034
|
+
}
|
|
3035
|
+
|
|
3036
|
+
.checkbox {
|
|
3037
|
+
width: 22px;
|
|
3038
|
+
height: 22px;
|
|
3039
|
+
border-radius: 6px;
|
|
3040
|
+
border: 1.5px solid var(--cs-text-secondary, #334155);
|
|
3041
|
+
background: transparent;
|
|
3042
|
+
cursor: pointer;
|
|
3043
|
+
display: flex;
|
|
3044
|
+
align-items: center;
|
|
3045
|
+
justify-content: center;
|
|
3046
|
+
padding: 0;
|
|
3047
|
+
transition: background 0.12s ease, border-color 0.12s ease;
|
|
3048
|
+
}
|
|
3049
|
+
|
|
3050
|
+
.checkbox[aria-checked="true"] {
|
|
3051
|
+
background: var(--cs-surface-accent, #0F172A);
|
|
3052
|
+
border-color: var(--cs-surface-accent, #0F172A);
|
|
3053
|
+
}
|
|
3054
|
+
|
|
3055
|
+
.checkbox:focus-visible {
|
|
3056
|
+
outline: 2px solid var(--cs-focus-ring, #0F172A);
|
|
3057
|
+
outline-offset: 2px;
|
|
3058
|
+
}
|
|
3059
|
+
|
|
3060
|
+
.check-mark {
|
|
3061
|
+
color: var(--cs-surface-accent-text, #fff);
|
|
3062
|
+
font-size: 14px;
|
|
3063
|
+
line-height: 1;
|
|
3064
|
+
}
|
|
3065
|
+
|
|
3066
|
+
.icon-tile {
|
|
3067
|
+
width: 36px;
|
|
3068
|
+
height: 36px;
|
|
3069
|
+
border-radius: 10px;
|
|
3070
|
+
background: var(--cs-surface-inset, #F1ECE2);
|
|
3071
|
+
display: flex;
|
|
3072
|
+
align-items: center;
|
|
3073
|
+
justify-content: center;
|
|
3074
|
+
color: var(--cs-text-secondary, #334155);
|
|
3075
|
+
}
|
|
3076
|
+
|
|
3077
|
+
.icon-tile svg {
|
|
3078
|
+
width: 18px;
|
|
3079
|
+
height: 18px;
|
|
3080
|
+
}
|
|
3081
|
+
|
|
3082
|
+
.body {
|
|
3083
|
+
display: flex;
|
|
3084
|
+
flex-direction: column;
|
|
3085
|
+
gap: 6px;
|
|
3086
|
+
min-width: 0;
|
|
3087
|
+
}
|
|
3088
|
+
|
|
3089
|
+
.row-label {
|
|
3090
|
+
display: flex;
|
|
3091
|
+
align-items: center;
|
|
3092
|
+
gap: 10px;
|
|
3093
|
+
flex-wrap: wrap;
|
|
3094
|
+
font-size: 14.5px;
|
|
3095
|
+
color: var(--cs-text-primary, #0F172A);
|
|
3096
|
+
line-height: 1.45;
|
|
3097
|
+
}
|
|
3098
|
+
|
|
3099
|
+
.row-label strong {
|
|
3100
|
+
font-weight: 600;
|
|
3101
|
+
}
|
|
3102
|
+
|
|
3103
|
+
.description {
|
|
3104
|
+
color: var(--cs-text-secondary, #334155);
|
|
3105
|
+
}
|
|
3106
|
+
|
|
3107
|
+
.risk-chip {
|
|
3108
|
+
display: inline-flex;
|
|
3109
|
+
padding: 2px 8px;
|
|
3110
|
+
border-radius: 999px;
|
|
3111
|
+
font-size: 10.5px;
|
|
3112
|
+
font-weight: 700;
|
|
3113
|
+
letter-spacing: 0.06em;
|
|
3114
|
+
background: var(--cs-chip-risk-bg, #FCE7B6);
|
|
3115
|
+
color: var(--cs-chip-risk-text, #7A4F00);
|
|
3116
|
+
}
|
|
3117
|
+
|
|
3118
|
+
.policy-toggle {
|
|
3119
|
+
align-self: flex-start;
|
|
3120
|
+
background: none;
|
|
3121
|
+
border: none;
|
|
3122
|
+
padding: 0;
|
|
3123
|
+
font-size: 12px;
|
|
3124
|
+
font-weight: 500;
|
|
3125
|
+
color: var(--cs-text-tertiary, #64748B);
|
|
3126
|
+
text-decoration: underline;
|
|
3127
|
+
text-underline-offset: 2px;
|
|
3128
|
+
cursor: pointer;
|
|
3129
|
+
}
|
|
3130
|
+
|
|
3131
|
+
.policy-toggle:focus-visible {
|
|
3132
|
+
outline: 2px solid var(--cs-focus-ring, #0F172A);
|
|
3133
|
+
outline-offset: 2px;
|
|
3134
|
+
}
|
|
3135
|
+
|
|
3136
|
+
.policy-disclosure {
|
|
3137
|
+
margin-top: 8px;
|
|
3138
|
+
border-radius: 10px;
|
|
3139
|
+
background: var(--cs-surface-inset, #F1ECE2);
|
|
3140
|
+
padding: 10px 12px;
|
|
3141
|
+
font-size: 12px;
|
|
3142
|
+
color: var(--cs-text-secondary, #334155);
|
|
3143
|
+
display: flex;
|
|
3144
|
+
flex-direction: column;
|
|
3145
|
+
gap: 8px;
|
|
3146
|
+
}
|
|
3147
|
+
|
|
3148
|
+
.policy-disclosure h4 {
|
|
3149
|
+
margin: 0;
|
|
3150
|
+
font-size: 11px;
|
|
3151
|
+
letter-spacing: 0.08em;
|
|
3152
|
+
text-transform: uppercase;
|
|
3153
|
+
color: var(--cs-text-tertiary, #64748B);
|
|
3154
|
+
}
|
|
3155
|
+
|
|
3156
|
+
.policy-disclosure pre {
|
|
3157
|
+
margin: 0;
|
|
3158
|
+
font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
|
|
3159
|
+
font-size: 11.5px;
|
|
3160
|
+
line-height: 1.5;
|
|
3161
|
+
white-space: pre-wrap;
|
|
3162
|
+
word-break: break-word;
|
|
3163
|
+
color: var(--cs-text-primary, #0F172A);
|
|
3164
|
+
}
|
|
3165
|
+
|
|
3166
|
+
.policy-disclosure ul {
|
|
3167
|
+
margin: 0;
|
|
3168
|
+
padding-left: 18px;
|
|
3169
|
+
}
|
|
3170
|
+
`;
|
|
3171
|
+
__decorateClass([
|
|
3172
|
+
n4({ type: String })
|
|
3173
|
+
], ConsentCapabilityCard.prototype, "capabilityId", 2);
|
|
3174
|
+
__decorateClass([
|
|
3175
|
+
n4({ type: String })
|
|
3176
|
+
], ConsentCapabilityCard.prototype, "label", 2);
|
|
3177
|
+
__decorateClass([
|
|
3178
|
+
n4({ type: String })
|
|
3179
|
+
], ConsentCapabilityCard.prototype, "description", 2);
|
|
3180
|
+
__decorateClass([
|
|
3181
|
+
n4({ type: String })
|
|
3182
|
+
], ConsentCapabilityCard.prototype, "icon", 2);
|
|
3183
|
+
__decorateClass([
|
|
3184
|
+
n4({ type: String })
|
|
3185
|
+
], ConsentCapabilityCard.prototype, "riskLevel", 2);
|
|
3186
|
+
__decorateClass([
|
|
3187
|
+
n4({ type: Boolean, reflect: true })
|
|
3188
|
+
], ConsentCapabilityCard.prototype, "checked", 2);
|
|
3189
|
+
__decorateClass([
|
|
3190
|
+
n4({ type: String, attribute: "compiled-cedar" })
|
|
3191
|
+
], ConsentCapabilityCard.prototype, "compiledCedar", 2);
|
|
3192
|
+
__decorateClass([
|
|
3193
|
+
r5()
|
|
3194
|
+
], ConsentCapabilityCard.prototype, "policyOpen", 2);
|
|
3195
|
+
ConsentCapabilityCard = __decorateClass([
|
|
3196
|
+
t3("consent-capability-card")
|
|
3197
|
+
], ConsentCapabilityCard);
|
|
3198
|
+
function iconSvgFor(icon) {
|
|
3199
|
+
switch (icon) {
|
|
3200
|
+
case "search":
|
|
3201
|
+
return b2`<svg viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"><circle cx="9" cy="9" r="5.25"/><path d="m13.25 13.25 3.5 3.5"/></svg>`;
|
|
3202
|
+
case "cart":
|
|
3203
|
+
return b2`<svg viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"><path d="M3 3h2l1.4 9.4a1.5 1.5 0 0 0 1.5 1.3h7.6a1.5 1.5 0 0 0 1.5-1.2L18 6H6"/><circle cx="9" cy="17" r="1.2"/><circle cx="15" cy="17" r="1.2"/></svg>`;
|
|
3204
|
+
case "card":
|
|
3205
|
+
return b2`<svg viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"><rect x="2.5" y="4.5" width="15" height="11" rx="2"/><path d="M2.5 9h15"/><path d="M5.5 13h3"/></svg>`;
|
|
3206
|
+
case "pin":
|
|
3207
|
+
return b2`<svg viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"><path d="M10 17s-5.5-5-5.5-9a5.5 5.5 0 1 1 11 0c0 4-5.5 9-5.5 9z"/><circle cx="10" cy="8" r="2"/></svg>`;
|
|
3208
|
+
case "pin-new":
|
|
3209
|
+
return b2`<svg viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"><path d="M10 17s-5.5-5-5.5-9a5.5 5.5 0 1 1 11 0c0 4-5.5 9-5.5 9z"/><path d="M10 6v4"/><path d="M8 8h4"/></svg>`;
|
|
3210
|
+
case "shield":
|
|
3211
|
+
return b2`<svg viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"><path d="M10 2.5 4 5v5.5C4 14 6.5 16.5 10 17.5c3.5-1 6-3.5 6-7V5z"/></svg>`;
|
|
3212
|
+
case "key":
|
|
3213
|
+
return b2`<svg viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"><circle cx="7" cy="13" r="3.25"/><path d="m9.5 11 6.5-6.5"/><path d="m13.5 7 2 2"/></svg>`;
|
|
3214
|
+
case "tools":
|
|
3215
|
+
return b2`<svg viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"><path d="m4 4 6 6"/><path d="m10 4 6 6"/><path d="m4 16 12-12"/></svg>`;
|
|
3216
|
+
case "user":
|
|
3217
|
+
return b2`<svg viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"><circle cx="10" cy="7" r="3"/><path d="M3 17a7 7 0 0 1 14 0"/></svg>`;
|
|
3218
|
+
case "calendar":
|
|
3219
|
+
return b2`<svg viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="4" width="14" height="13" rx="2"/><path d="M3 8h14"/><path d="M7 2v4M13 2v4"/></svg>`;
|
|
3220
|
+
case "lock":
|
|
3221
|
+
return b2`<svg viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"><rect x="4" y="9" width="12" height="8" rx="2"/><path d="M7 9V6a3 3 0 0 1 6 0v3"/></svg>`;
|
|
3222
|
+
case "eye":
|
|
3223
|
+
return b2`<svg viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"><path d="M2 10s3-6 8-6 8 6 8 6-3 6-8 6-8-6-8-6z"/><circle cx="10" cy="10" r="2.25"/></svg>`;
|
|
3224
|
+
case "send":
|
|
3225
|
+
return b2`<svg viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"><path d="m17 3-7 7-2 7-3-9z"/></svg>`;
|
|
3226
|
+
case "package":
|
|
3227
|
+
return b2`<svg viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"><path d="m10 2 7 4v8l-7 4-7-4V6z"/><path d="m3 6 7 4 7-4"/><path d="M10 18V10"/></svg>`;
|
|
3228
|
+
default:
|
|
3229
|
+
return b2`<svg viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"><circle cx="10" cy="10" r="5"/></svg>`;
|
|
3230
|
+
}
|
|
3231
|
+
}
|
|
3232
|
+
|
|
3233
|
+
// src/components/consent-action-bar.ts
|
|
3234
|
+
var ConsentActionBar = class extends i4 {
|
|
3235
|
+
constructor() {
|
|
3236
|
+
super(...arguments);
|
|
3237
|
+
this.agentName = "";
|
|
3238
|
+
this.theme = "light";
|
|
3239
|
+
this.disabled = false;
|
|
3240
|
+
this.loading = false;
|
|
3241
|
+
}
|
|
3242
|
+
emitAllow() {
|
|
3243
|
+
if (this.disabled || this.loading) return;
|
|
3244
|
+
this.dispatchEvent(
|
|
3245
|
+
new CustomEvent("consent-allow", { bubbles: true, composed: true })
|
|
3246
|
+
);
|
|
3247
|
+
}
|
|
3248
|
+
emitDeny() {
|
|
3249
|
+
if (this.loading) return;
|
|
3250
|
+
this.dispatchEvent(
|
|
3251
|
+
new CustomEvent("consent-deny", { bubbles: true, composed: true })
|
|
3252
|
+
);
|
|
3253
|
+
}
|
|
3254
|
+
render() {
|
|
3255
|
+
const allowLabel = this.theme === "dark" ? CONSENT_COPY_TOKENS.actions.allowAccess : `${formatToken(CONSENT_COPY_TOKENS.actions.allowAgentTemplate, {
|
|
3256
|
+
Agent: this.agentName || "this agent"
|
|
3257
|
+
})} \u2192`;
|
|
3258
|
+
const denyLabel = this.theme === "dark" ? CONSENT_COPY_TOKENS.actions.deny : CONSENT_COPY_TOKENS.actions.notNow;
|
|
3259
|
+
return b2`
|
|
3260
|
+
<button
|
|
3261
|
+
class="primary"
|
|
3262
|
+
type="button"
|
|
3263
|
+
?disabled=${this.disabled || this.loading}
|
|
3264
|
+
@click=${this.emitAllow}
|
|
3265
|
+
>
|
|
3266
|
+
${allowLabel}
|
|
3267
|
+
</button>
|
|
3268
|
+
<button
|
|
3269
|
+
class="secondary"
|
|
3270
|
+
type="button"
|
|
3271
|
+
?disabled=${this.loading}
|
|
3272
|
+
@click=${this.emitDeny}
|
|
3273
|
+
>
|
|
3274
|
+
${denyLabel}
|
|
3275
|
+
</button>
|
|
3276
|
+
`;
|
|
3277
|
+
}
|
|
3278
|
+
};
|
|
3279
|
+
ConsentActionBar.styles = i`
|
|
3280
|
+
:host {
|
|
3281
|
+
display: flex;
|
|
3282
|
+
flex-direction: column;
|
|
3283
|
+
gap: 4px;
|
|
3284
|
+
width: 100%;
|
|
3285
|
+
}
|
|
3286
|
+
|
|
3287
|
+
button {
|
|
3288
|
+
width: 100%;
|
|
3289
|
+
padding: 14px 18px;
|
|
3290
|
+
border-radius: 999px;
|
|
3291
|
+
font-size: 15px;
|
|
3292
|
+
font-weight: 500;
|
|
3293
|
+
font-family: inherit;
|
|
3294
|
+
cursor: pointer;
|
|
3295
|
+
transition: opacity 0.15s ease, transform 0.05s ease;
|
|
3296
|
+
border: none;
|
|
3297
|
+
}
|
|
3298
|
+
|
|
3299
|
+
button:disabled {
|
|
3300
|
+
opacity: 0.5;
|
|
3301
|
+
cursor: not-allowed;
|
|
3302
|
+
}
|
|
3303
|
+
|
|
3304
|
+
button:focus-visible {
|
|
3305
|
+
outline: 2px solid var(--cs-focus-ring, #0F172A);
|
|
3306
|
+
outline-offset: 3px;
|
|
3307
|
+
}
|
|
3308
|
+
|
|
3309
|
+
.primary {
|
|
3310
|
+
background: var(--cs-surface-accent, #0F172A);
|
|
3311
|
+
color: var(--cs-surface-accent-text, #FFFFFF);
|
|
3312
|
+
}
|
|
3313
|
+
|
|
3314
|
+
.primary:hover:not(:disabled) {
|
|
3315
|
+
opacity: 0.92;
|
|
3316
|
+
}
|
|
3317
|
+
|
|
3318
|
+
.secondary {
|
|
3319
|
+
background: transparent;
|
|
3320
|
+
color: var(--cs-text-secondary, #334155);
|
|
3321
|
+
padding: 10px 18px;
|
|
3322
|
+
font-weight: 500;
|
|
3323
|
+
}
|
|
3324
|
+
|
|
3325
|
+
.secondary:hover:not(:disabled) {
|
|
3326
|
+
color: var(--cs-text-primary, #0F172A);
|
|
3327
|
+
}
|
|
3328
|
+
`;
|
|
3329
|
+
__decorateClass([
|
|
3330
|
+
n4({ type: String })
|
|
3331
|
+
], ConsentActionBar.prototype, "agentName", 2);
|
|
3332
|
+
__decorateClass([
|
|
3333
|
+
n4({ type: String })
|
|
3334
|
+
], ConsentActionBar.prototype, "theme", 2);
|
|
3335
|
+
__decorateClass([
|
|
3336
|
+
n4({ type: Boolean })
|
|
3337
|
+
], ConsentActionBar.prototype, "disabled", 2);
|
|
3338
|
+
__decorateClass([
|
|
3339
|
+
n4({ type: Boolean })
|
|
3340
|
+
], ConsentActionBar.prototype, "loading", 2);
|
|
3341
|
+
ConsentActionBar = __decorateClass([
|
|
3342
|
+
t3("consent-action-bar")
|
|
3343
|
+
], ConsentActionBar);
|
|
3344
|
+
|
|
3345
|
+
// src/components/consent-footer.ts
|
|
3346
|
+
var ConsentFooter = class extends i4 {
|
|
3347
|
+
constructor() {
|
|
3348
|
+
super(...arguments);
|
|
3349
|
+
this.theme = "light";
|
|
3350
|
+
this.howItWorksUrl = "";
|
|
3351
|
+
}
|
|
3352
|
+
render() {
|
|
3353
|
+
const attribution = this.theme === "dark" ? CONSENT_COPY_TOKENS.attribution.securedBy : CONSENT_COPY_TOKENS.attribution.protectedBy;
|
|
3354
|
+
return b2`
|
|
3355
|
+
<span class="left">
|
|
3356
|
+
<svg
|
|
3357
|
+
class="check"
|
|
3358
|
+
viewBox="0 0 16 16"
|
|
3359
|
+
fill="none"
|
|
3360
|
+
stroke="currentColor"
|
|
3361
|
+
stroke-width="1.8"
|
|
3362
|
+
stroke-linecap="round"
|
|
3363
|
+
stroke-linejoin="round"
|
|
3364
|
+
aria-hidden="true"
|
|
3365
|
+
>
|
|
3366
|
+
<path d="m3.5 8.5 3 3 6-6.5" />
|
|
3367
|
+
</svg>
|
|
3368
|
+
${attribution}
|
|
3369
|
+
</span>
|
|
3370
|
+
${this.howItWorksUrl ? b2`<a href="${this.howItWorksUrl}" target="_blank" rel="noopener">
|
|
3371
|
+
${CONSENT_COPY_TOKENS.attribution.howThisWorks}
|
|
3372
|
+
</a>` : b2`<span>${CONSENT_COPY_TOKENS.attribution.howThisWorks}</span>`}
|
|
3373
|
+
`;
|
|
3374
|
+
}
|
|
3375
|
+
};
|
|
3376
|
+
ConsentFooter.styles = i`
|
|
3377
|
+
:host {
|
|
3378
|
+
display: flex;
|
|
3379
|
+
align-items: center;
|
|
3380
|
+
justify-content: space-between;
|
|
3381
|
+
gap: 16px;
|
|
3382
|
+
padding-top: 12px;
|
|
3383
|
+
font-size: 12px;
|
|
3384
|
+
color: var(--cs-text-tertiary, #64748B);
|
|
3385
|
+
border-top: 1px solid var(--cs-surface-border, transparent);
|
|
3386
|
+
}
|
|
3387
|
+
|
|
3388
|
+
.left {
|
|
3389
|
+
display: inline-flex;
|
|
3390
|
+
align-items: center;
|
|
3391
|
+
gap: 6px;
|
|
3392
|
+
}
|
|
3393
|
+
|
|
3394
|
+
.check {
|
|
3395
|
+
width: 14px;
|
|
3396
|
+
height: 14px;
|
|
3397
|
+
color: var(--cs-text-secondary, #334155);
|
|
3398
|
+
}
|
|
3399
|
+
|
|
3400
|
+
a {
|
|
3401
|
+
color: inherit;
|
|
3402
|
+
text-decoration: underline;
|
|
3403
|
+
text-underline-offset: 2px;
|
|
3404
|
+
}
|
|
3405
|
+
|
|
3406
|
+
a:hover {
|
|
3407
|
+
color: var(--cs-text-primary, #0F172A);
|
|
3408
|
+
}
|
|
3409
|
+
`;
|
|
3410
|
+
__decorateClass([
|
|
3411
|
+
n4({ type: String })
|
|
3412
|
+
], ConsentFooter.prototype, "theme", 2);
|
|
3413
|
+
__decorateClass([
|
|
3414
|
+
n4({ type: String })
|
|
3415
|
+
], ConsentFooter.prototype, "howItWorksUrl", 2);
|
|
3416
|
+
ConsentFooter = __decorateClass([
|
|
3417
|
+
t3("consent-footer")
|
|
3418
|
+
], ConsentFooter);
|
|
3419
|
+
|
|
3420
|
+
// src/components/consent-revocation-notice.ts
|
|
3421
|
+
var ConsentRevocationNotice = class extends i4 {
|
|
3422
|
+
constructor() {
|
|
3423
|
+
super(...arguments);
|
|
3424
|
+
this.revocationPath = "Account \u2192 Connected Agents";
|
|
3425
|
+
this.orgName = "this site";
|
|
3426
|
+
this.inactivityDays = 90;
|
|
3427
|
+
}
|
|
3428
|
+
render() {
|
|
3429
|
+
const revoke = formatToken(CONSENT_COPY_TOKENS.footer.revocationTemplate, {
|
|
3430
|
+
RevocationPath: this.revocationPath,
|
|
3431
|
+
Org: this.orgName
|
|
3432
|
+
});
|
|
3433
|
+
const inactivity = formatToken(
|
|
3434
|
+
CONSENT_COPY_TOKENS.footer.inactivityTemplate,
|
|
3435
|
+
{ Days: this.inactivityDays }
|
|
3436
|
+
);
|
|
3437
|
+
return b2`
|
|
3438
|
+
<svg
|
|
3439
|
+
class="icon"
|
|
3440
|
+
viewBox="0 0 20 20"
|
|
3441
|
+
fill="none"
|
|
3442
|
+
stroke="currentColor"
|
|
3443
|
+
stroke-width="1.6"
|
|
3444
|
+
stroke-linecap="round"
|
|
3445
|
+
stroke-linejoin="round"
|
|
3446
|
+
aria-hidden="true"
|
|
3447
|
+
>
|
|
3448
|
+
<circle cx="10" cy="10" r="7.5" />
|
|
3449
|
+
<path d="M10 6v4l2.5 1.5" />
|
|
3450
|
+
</svg>
|
|
3451
|
+
<div class="content">
|
|
3452
|
+
<span>${revoke}</span>
|
|
3453
|
+
<span>${inactivity}</span>
|
|
3454
|
+
</div>
|
|
3455
|
+
`;
|
|
3456
|
+
}
|
|
3457
|
+
};
|
|
3458
|
+
ConsentRevocationNotice.styles = i`
|
|
3459
|
+
:host {
|
|
3460
|
+
display: flex;
|
|
3461
|
+
align-items: flex-start;
|
|
3462
|
+
gap: 10px;
|
|
3463
|
+
padding: 12px 14px;
|
|
3464
|
+
border-radius: 12px;
|
|
3465
|
+
background: var(--cs-surface-inset, #F1ECE2);
|
|
3466
|
+
color: var(--cs-text-secondary, #334155);
|
|
3467
|
+
font-size: 12.5px;
|
|
3468
|
+
line-height: 1.5;
|
|
3469
|
+
}
|
|
3470
|
+
|
|
3471
|
+
.icon {
|
|
3472
|
+
width: 16px;
|
|
3473
|
+
height: 16px;
|
|
3474
|
+
flex-shrink: 0;
|
|
3475
|
+
margin-top: 2px;
|
|
3476
|
+
color: var(--cs-text-tertiary, #64748B);
|
|
3477
|
+
}
|
|
3478
|
+
|
|
3479
|
+
.content {
|
|
3480
|
+
display: flex;
|
|
3481
|
+
flex-direction: column;
|
|
3482
|
+
gap: 4px;
|
|
3483
|
+
}
|
|
3484
|
+
|
|
3485
|
+
em {
|
|
3486
|
+
font-style: normal;
|
|
3487
|
+
color: var(--cs-text-primary, #0F172A);
|
|
3488
|
+
font-weight: 500;
|
|
3489
|
+
}
|
|
3490
|
+
`;
|
|
3491
|
+
__decorateClass([
|
|
3492
|
+
n4({ type: String })
|
|
3493
|
+
], ConsentRevocationNotice.prototype, "revocationPath", 2);
|
|
3494
|
+
__decorateClass([
|
|
3495
|
+
n4({ type: String })
|
|
3496
|
+
], ConsentRevocationNotice.prototype, "orgName", 2);
|
|
3497
|
+
__decorateClass([
|
|
3498
|
+
n4({ type: Number })
|
|
3499
|
+
], ConsentRevocationNotice.prototype, "inactivityDays", 2);
|
|
3500
|
+
ConsentRevocationNotice = __decorateClass([
|
|
3501
|
+
t3("consent-revocation-notice")
|
|
3502
|
+
], ConsentRevocationNotice);
|
|
3503
|
+
|
|
3504
|
+
// src/styles/theme.ts
|
|
3505
|
+
var FIXED_RISK_CHIP_BG = "#FCE7B6";
|
|
3506
|
+
var FIXED_RISK_CHIP_TEXT = "#7A4F00";
|
|
3507
|
+
var lightTheme = {
|
|
3508
|
+
surfaceBg: "#F4F1EA",
|
|
3509
|
+
surfaceCard: "#FFFFFF",
|
|
3510
|
+
surfaceBorder: "rgba(15, 23, 42, 0.10)",
|
|
3511
|
+
surfaceInset: "#F1ECE2",
|
|
3512
|
+
textPrimary: "#0F172A",
|
|
3513
|
+
textSecondary: "#334155",
|
|
3514
|
+
textTertiary: "#64748B",
|
|
3515
|
+
surfaceAccent: "#0F172A",
|
|
3516
|
+
surfaceAccentText: "#FFFFFF",
|
|
3517
|
+
pillVerifiedBg: "#DCFCE7",
|
|
3518
|
+
pillVerifiedText: "#166534",
|
|
3519
|
+
pillUnverifiedBg: "#F1F5F9",
|
|
3520
|
+
pillUnverifiedText: "#475569",
|
|
3521
|
+
chipRiskBg: FIXED_RISK_CHIP_BG,
|
|
3522
|
+
chipRiskText: FIXED_RISK_CHIP_TEXT,
|
|
3523
|
+
focusRing: "rgba(15, 23, 42, 0.35)",
|
|
3524
|
+
cardShadow: "0 30px 80px -40px rgba(15, 23, 42, 0.40)"
|
|
3525
|
+
};
|
|
3526
|
+
var darkTheme = {
|
|
3527
|
+
surfaceBg: "#0B0808",
|
|
3528
|
+
surfaceCard: "rgba(20, 20, 22, 0.92)",
|
|
3529
|
+
surfaceBorder: "rgba(255, 255, 255, 0.08)",
|
|
3530
|
+
surfaceInset: "rgba(255, 255, 255, 0.04)",
|
|
3531
|
+
textPrimary: "#F8FAFC",
|
|
3532
|
+
textSecondary: "#CBD5E1",
|
|
3533
|
+
textTertiary: "#94A3B8",
|
|
3534
|
+
surfaceAccent: "#F8FAFC",
|
|
3535
|
+
surfaceAccentText: "#0F172A",
|
|
3536
|
+
pillVerifiedBg: "rgba(34, 197, 94, 0.16)",
|
|
3537
|
+
pillVerifiedText: "#86EFAC",
|
|
3538
|
+
pillUnverifiedBg: "rgba(148, 163, 184, 0.18)",
|
|
3539
|
+
pillUnverifiedText: "#CBD5E1",
|
|
3540
|
+
chipRiskBg: FIXED_RISK_CHIP_BG,
|
|
3541
|
+
chipRiskText: FIXED_RISK_CHIP_TEXT,
|
|
3542
|
+
focusRing: "rgba(248, 250, 252, 0.55)",
|
|
3543
|
+
cardShadow: "0 40px 90px -40px rgba(0, 0, 0, 0.85)"
|
|
3544
|
+
};
|
|
3545
|
+
function getConsentTheme(theme) {
|
|
3546
|
+
return theme === "dark" ? darkTheme : lightTheme;
|
|
3547
|
+
}
|
|
3548
|
+
function themeToCssVariables(tokens) {
|
|
3549
|
+
const declarations = [];
|
|
3550
|
+
for (const [key, value] of Object.entries(tokens)) {
|
|
3551
|
+
declarations.push(` --cs-${camelToKebab(key)}: ${value};`);
|
|
3552
|
+
}
|
|
3553
|
+
return declarations.join("\n");
|
|
3554
|
+
}
|
|
3555
|
+
function camelToKebab(value) {
|
|
3556
|
+
return value.replace(/[A-Z]/g, (c4) => `-${c4.toLowerCase()}`);
|
|
3557
|
+
}
|
|
3558
|
+
|
|
3559
|
+
// src/cedar/compile.ts
|
|
3560
|
+
var PLACEHOLDER_PATTERN = /\{\{\s*(agent_did|user_did|org|deployment)\s*\}\}/g;
|
|
3561
|
+
function compileSingleCapability(capability, context) {
|
|
3562
|
+
const compiled = capability.cedar.replace(PLACEHOLDER_PATTERN, (_2, key) => {
|
|
3563
|
+
const value = context[key];
|
|
3564
|
+
if (typeof value !== "string" || value.length === 0) {
|
|
3565
|
+
throw new Error(
|
|
3566
|
+
`Cedar template context missing required value for placeholder \`${key}\``
|
|
3567
|
+
);
|
|
3568
|
+
}
|
|
3569
|
+
return value;
|
|
3570
|
+
});
|
|
3571
|
+
if (compiled.trim().length === 0) {
|
|
3572
|
+
throw new Error(
|
|
3573
|
+
`Cedar fragment for capability \`${capability.id}\` is empty after compilation`
|
|
3574
|
+
);
|
|
3575
|
+
}
|
|
3576
|
+
return compiled;
|
|
3577
|
+
}
|
|
3578
|
+
|
|
3579
|
+
// src/components/consent-capabilities-screen.ts
|
|
3580
|
+
var ConsentCapabilitiesScreen = class extends i4 {
|
|
3581
|
+
constructor() {
|
|
3582
|
+
super(...arguments);
|
|
3583
|
+
this.capabilities = [];
|
|
3584
|
+
this.orgName = "";
|
|
3585
|
+
this.headlineVerb = "use";
|
|
3586
|
+
this.revocationPath = "Account \u2192 Connected Agents";
|
|
3587
|
+
this.inactivityDays = 90;
|
|
3588
|
+
this.theme = "light";
|
|
3589
|
+
this.howItWorksUrl = "";
|
|
3590
|
+
this.loading = false;
|
|
3591
|
+
this.selected = /* @__PURE__ */ new Set();
|
|
3592
|
+
this.onCapabilityToggle = (event) => {
|
|
3593
|
+
const detail = event.detail;
|
|
3594
|
+
const next = new Set(this.selected);
|
|
3595
|
+
if (detail.checked) next.add(detail.id);
|
|
3596
|
+
else next.delete(detail.id);
|
|
3597
|
+
this.selected = next;
|
|
3598
|
+
};
|
|
3599
|
+
this.onAllow = () => {
|
|
3600
|
+
if (this.loading) return;
|
|
3601
|
+
const selectedIds = Array.from(this.selected);
|
|
3602
|
+
const selectedScopes = this.capabilities.filter((c4) => this.selected.has(c4.id)).flatMap((c4) => c4.scopes);
|
|
3603
|
+
const detail = {
|
|
3604
|
+
selectedCapabilityIds: selectedIds,
|
|
3605
|
+
selectedScopes
|
|
3606
|
+
};
|
|
3607
|
+
this.dispatchEvent(
|
|
3608
|
+
new CustomEvent("capabilities-allow", {
|
|
3609
|
+
detail,
|
|
3610
|
+
bubbles: true,
|
|
3611
|
+
composed: true
|
|
3612
|
+
})
|
|
3613
|
+
);
|
|
3614
|
+
};
|
|
3615
|
+
this.onDeny = () => {
|
|
3616
|
+
this.dispatchEvent(
|
|
3617
|
+
new CustomEvent("capabilities-deny", { bubbles: true, composed: true })
|
|
3618
|
+
);
|
|
3619
|
+
};
|
|
3620
|
+
}
|
|
3621
|
+
connectedCallback() {
|
|
3622
|
+
super.connectedCallback();
|
|
3623
|
+
this.seedDefaults();
|
|
3624
|
+
}
|
|
3625
|
+
willUpdate(changed) {
|
|
3626
|
+
if (changed.has("capabilities")) {
|
|
3627
|
+
this.seedDefaults();
|
|
3628
|
+
}
|
|
3629
|
+
}
|
|
3630
|
+
seedDefaults() {
|
|
3631
|
+
const next = /* @__PURE__ */ new Set();
|
|
3632
|
+
for (const capability of this.capabilities) {
|
|
3633
|
+
if (capability.defaultOn) next.add(capability.id);
|
|
3634
|
+
}
|
|
3635
|
+
this.selected = next;
|
|
3636
|
+
}
|
|
3637
|
+
hostStyle() {
|
|
3638
|
+
return `:host { ${themeToCssVariables(getConsentTheme(this.theme))} }`;
|
|
3639
|
+
}
|
|
3640
|
+
compileCapabilityCedar(capability) {
|
|
3641
|
+
if (!this.cedarContext) {
|
|
3642
|
+
return capability.cedar;
|
|
3643
|
+
}
|
|
3644
|
+
try {
|
|
3645
|
+
return compileSingleCapability(capability, this.cedarContext);
|
|
3646
|
+
} catch {
|
|
3647
|
+
return capability.cedar;
|
|
3648
|
+
}
|
|
3649
|
+
}
|
|
3650
|
+
renderHeadline() {
|
|
3651
|
+
const agentName = this.agentMetadata?.name || "this agent";
|
|
3652
|
+
const tokens = CONSENT_COPY_TOKENS;
|
|
3653
|
+
const raw = formatToken(tokens.headline.template, {
|
|
3654
|
+
Agent: "@@AGENT@@",
|
|
3655
|
+
Verb: this.headlineVerb || "use",
|
|
3656
|
+
Org: "@@ORG@@"
|
|
3657
|
+
});
|
|
3658
|
+
const escaped = escapeHtml(raw);
|
|
3659
|
+
const withSerifEntities = escaped.replace("@@AGENT@@", `<em>${escapeHtml(agentName)}</em>`).replace("@@ORG@@", `<em>${escapeHtml(this.orgName || "this site")}</em>`);
|
|
3660
|
+
return b2`<h1
|
|
3661
|
+
class="headline"
|
|
3662
|
+
.innerHTML=${withSerifEntities}
|
|
3663
|
+
></h1>`;
|
|
3664
|
+
}
|
|
3665
|
+
render() {
|
|
3666
|
+
const tokens = CONSENT_COPY_TOKENS;
|
|
3667
|
+
const agentName = this.agentMetadata?.name || "this agent";
|
|
3668
|
+
const subhead = formatToken(tokens.subhead.template, { Agent: agentName });
|
|
3669
|
+
const sectionHeader = formatToken(tokens.section.capabilitiesHeader, {
|
|
3670
|
+
Agent: agentName.toUpperCase()
|
|
3671
|
+
});
|
|
3672
|
+
return b2`
|
|
3673
|
+
<style>
|
|
3674
|
+
${this.hostStyle()}
|
|
3675
|
+
</style>
|
|
3676
|
+
<div class="card" part="card">
|
|
3677
|
+
<span class="eyebrow">${tokens.eyebrow.permissionRequest}</span>
|
|
3678
|
+
${this.renderHeadline()}
|
|
3679
|
+
<p class="subhead">${subhead}</p>
|
|
3680
|
+
${this.agentMetadata ? b2`<consent-agent-header
|
|
3681
|
+
agentName="${this.agentMetadata.name}"
|
|
3682
|
+
vendor="${this.agentMetadata.vendor || ""}"
|
|
3683
|
+
surfaceLabel="${this.agentMetadata.surfaceLabel || ""}"
|
|
3684
|
+
?verified=${this.agentMetadata.verified}
|
|
3685
|
+
logoUrl="${this.agentMetadata.logoUrl || ""}"
|
|
3686
|
+
connectedAt="${this.agentMetadata.connectedAt || ""}"
|
|
3687
|
+
></consent-agent-header>` : A}
|
|
3688
|
+
<div>
|
|
3689
|
+
<div class="section-header">
|
|
3690
|
+
<span>${sectionHeader}</span>
|
|
3691
|
+
<span class="hint">${tokens.section.tapToToggle}</span>
|
|
3692
|
+
</div>
|
|
3693
|
+
<div class="rows" @capability-toggle=${this.onCapabilityToggle}>
|
|
3694
|
+
${this.capabilities.map(
|
|
3695
|
+
(capability) => b2`
|
|
3696
|
+
<consent-capability-card
|
|
3697
|
+
capabilityId="${capability.id}"
|
|
3698
|
+
label="${capability.label}"
|
|
3699
|
+
description="${capability.description}"
|
|
3700
|
+
icon="${capability.icon}"
|
|
3701
|
+
riskLevel="${capability.riskLevel}"
|
|
3702
|
+
?checked=${this.selected.has(capability.id)}
|
|
3703
|
+
compiled-cedar="${this.compileCapabilityCedar(capability)}"
|
|
3704
|
+
></consent-capability-card>
|
|
3705
|
+
`
|
|
3706
|
+
)}
|
|
3707
|
+
</div>
|
|
3708
|
+
</div>
|
|
3709
|
+
<consent-revocation-notice
|
|
3710
|
+
revocationPath="${this.revocationPath}"
|
|
3711
|
+
orgName="${this.orgName || "this site"}"
|
|
3712
|
+
inactivityDays=${this.inactivityDays}
|
|
3713
|
+
></consent-revocation-notice>
|
|
3714
|
+
<consent-action-bar
|
|
3715
|
+
agentName="${agentName}"
|
|
3716
|
+
theme="${this.theme}"
|
|
3717
|
+
?loading=${this.loading}
|
|
3718
|
+
?disabled=${this.selected.size === 0}
|
|
3719
|
+
@consent-allow=${this.onAllow}
|
|
3720
|
+
@consent-deny=${this.onDeny}
|
|
3721
|
+
></consent-action-bar>
|
|
3722
|
+
<consent-footer
|
|
3723
|
+
theme="${this.theme}"
|
|
3724
|
+
howItWorksUrl="${this.howItWorksUrl}"
|
|
3725
|
+
></consent-footer>
|
|
3726
|
+
</div>
|
|
3727
|
+
`;
|
|
3728
|
+
}
|
|
3729
|
+
};
|
|
3730
|
+
ConsentCapabilitiesScreen.styles = i`
|
|
3731
|
+
:host {
|
|
3732
|
+
display: block;
|
|
3733
|
+
box-sizing: border-box;
|
|
3734
|
+
width: 100%;
|
|
3735
|
+
max-width: 560px;
|
|
3736
|
+
margin: 0 auto;
|
|
3737
|
+
}
|
|
3738
|
+
|
|
3739
|
+
.card {
|
|
3740
|
+
background: var(--cs-surface-card);
|
|
3741
|
+
border: 1px solid var(--cs-surface-border);
|
|
3742
|
+
border-radius: 22px;
|
|
3743
|
+
box-shadow: var(--cs-card-shadow);
|
|
3744
|
+
padding: 28px 28px 22px;
|
|
3745
|
+
display: flex;
|
|
3746
|
+
flex-direction: column;
|
|
3747
|
+
gap: 22px;
|
|
3748
|
+
color: var(--cs-text-primary);
|
|
3749
|
+
}
|
|
3750
|
+
|
|
3751
|
+
.eyebrow {
|
|
3752
|
+
font-size: 11px;
|
|
3753
|
+
letter-spacing: 0.16em;
|
|
3754
|
+
font-weight: 600;
|
|
3755
|
+
color: var(--cs-text-tertiary);
|
|
3756
|
+
text-transform: uppercase;
|
|
3757
|
+
}
|
|
3758
|
+
|
|
3759
|
+
.headline {
|
|
3760
|
+
font-family: "Times New Roman", Georgia, serif;
|
|
3761
|
+
font-size: 30px;
|
|
3762
|
+
line-height: 1.18;
|
|
3763
|
+
letter-spacing: -0.01em;
|
|
3764
|
+
color: var(--cs-text-primary);
|
|
3765
|
+
margin: 0;
|
|
3766
|
+
}
|
|
3767
|
+
|
|
3768
|
+
.headline em {
|
|
3769
|
+
font-style: italic;
|
|
3770
|
+
}
|
|
3771
|
+
|
|
3772
|
+
.subhead {
|
|
3773
|
+
font-size: 14.5px;
|
|
3774
|
+
color: var(--cs-text-secondary);
|
|
3775
|
+
line-height: 1.55;
|
|
3776
|
+
margin: 0;
|
|
3777
|
+
}
|
|
3778
|
+
|
|
3779
|
+
.section-header {
|
|
3780
|
+
display: flex;
|
|
3781
|
+
align-items: center;
|
|
3782
|
+
justify-content: space-between;
|
|
3783
|
+
font-size: 11px;
|
|
3784
|
+
letter-spacing: 0.14em;
|
|
3785
|
+
font-weight: 600;
|
|
3786
|
+
color: var(--cs-text-tertiary);
|
|
3787
|
+
text-transform: uppercase;
|
|
3788
|
+
}
|
|
3789
|
+
|
|
3790
|
+
.section-header .hint {
|
|
3791
|
+
letter-spacing: 0;
|
|
3792
|
+
font-weight: 400;
|
|
3793
|
+
text-transform: none;
|
|
3794
|
+
font-size: 12px;
|
|
3795
|
+
}
|
|
3796
|
+
|
|
3797
|
+
.rows {
|
|
3798
|
+
display: flex;
|
|
3799
|
+
flex-direction: column;
|
|
3800
|
+
}
|
|
3801
|
+
`;
|
|
3802
|
+
__decorateClass([
|
|
3803
|
+
n4({ type: Array })
|
|
3804
|
+
], ConsentCapabilitiesScreen.prototype, "capabilities", 2);
|
|
3805
|
+
__decorateClass([
|
|
3806
|
+
n4({ type: Object })
|
|
3807
|
+
], ConsentCapabilitiesScreen.prototype, "agentMetadata", 2);
|
|
3808
|
+
__decorateClass([
|
|
3809
|
+
n4({ type: Object })
|
|
3810
|
+
], ConsentCapabilitiesScreen.prototype, "cedarContext", 2);
|
|
3811
|
+
__decorateClass([
|
|
3812
|
+
n4({ type: String })
|
|
3813
|
+
], ConsentCapabilitiesScreen.prototype, "orgName", 2);
|
|
3814
|
+
__decorateClass([
|
|
3815
|
+
n4({ type: String })
|
|
3816
|
+
], ConsentCapabilitiesScreen.prototype, "headlineVerb", 2);
|
|
3817
|
+
__decorateClass([
|
|
3818
|
+
n4({ type: String })
|
|
3819
|
+
], ConsentCapabilitiesScreen.prototype, "revocationPath", 2);
|
|
3820
|
+
__decorateClass([
|
|
3821
|
+
n4({ type: Number })
|
|
3822
|
+
], ConsentCapabilitiesScreen.prototype, "inactivityDays", 2);
|
|
3823
|
+
__decorateClass([
|
|
3824
|
+
n4({ type: String })
|
|
3825
|
+
], ConsentCapabilitiesScreen.prototype, "theme", 2);
|
|
3826
|
+
__decorateClass([
|
|
3827
|
+
n4({ type: String, attribute: "how-it-works-url" })
|
|
3828
|
+
], ConsentCapabilitiesScreen.prototype, "howItWorksUrl", 2);
|
|
3829
|
+
__decorateClass([
|
|
3830
|
+
n4({ type: Boolean })
|
|
3831
|
+
], ConsentCapabilitiesScreen.prototype, "loading", 2);
|
|
3832
|
+
__decorateClass([
|
|
3833
|
+
r5()
|
|
3834
|
+
], ConsentCapabilitiesScreen.prototype, "selected", 2);
|
|
3835
|
+
ConsentCapabilitiesScreen = __decorateClass([
|
|
3836
|
+
t3("consent-capabilities-screen")
|
|
3837
|
+
], ConsentCapabilitiesScreen);
|
|
3838
|
+
function escapeHtml(value) {
|
|
3839
|
+
return value.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
3840
|
+
}
|
|
3841
|
+
|
|
2618
3842
|
// src/types/modes.types.ts
|
|
2619
3843
|
var AUTH_MODES = {
|
|
2620
3844
|
/** Simple consent with no authentication - Consent → Success (2 screens) */
|
|
@@ -2949,6 +4173,13 @@ var McpConsent = class extends i4 {
|
|
|
2949
4173
|
this.credentialUserEmail = "";
|
|
2950
4174
|
this.credentialProviderUserId = "";
|
|
2951
4175
|
this.oauthUrl = "";
|
|
4176
|
+
this.capabilities = [];
|
|
4177
|
+
this.orgName = "";
|
|
4178
|
+
this.headlineVerb = "use";
|
|
4179
|
+
this.revocationPath = "Account \u2192 Connected Agents";
|
|
4180
|
+
this.inactivityDays = 90;
|
|
4181
|
+
this.consentTheme = "light";
|
|
4182
|
+
this.howItWorksUrl = "";
|
|
2952
4183
|
this.authorizationType = "password";
|
|
2953
4184
|
this.oauthProviderType = "";
|
|
2954
4185
|
this.currentMode = AUTH_MODES.CONSENT_ONLY;
|
|
@@ -2958,6 +4189,13 @@ var McpConsent = class extends i4 {
|
|
|
2958
4189
|
this.formData = {};
|
|
2959
4190
|
this.resendCooldown = 0;
|
|
2960
4191
|
this.selectedScopes = [];
|
|
4192
|
+
this.closeFailed = false;
|
|
4193
|
+
this.onCapabilitiesAllow = (event) => {
|
|
4194
|
+
const detail = event.detail;
|
|
4195
|
+
this.selectedScopes = Array.from(new Set(detail.selectedScopes));
|
|
4196
|
+
this.termsAccepted = true;
|
|
4197
|
+
void this.handleApprove();
|
|
4198
|
+
};
|
|
2961
4199
|
}
|
|
2962
4200
|
// === LIFECYCLE ===
|
|
2963
4201
|
connectedCallback() {
|
|
@@ -3152,6 +4390,12 @@ var McpConsent = class extends i4 {
|
|
|
3152
4390
|
);
|
|
3153
4391
|
window.close();
|
|
3154
4392
|
}
|
|
4393
|
+
handleClose() {
|
|
4394
|
+
window.close();
|
|
4395
|
+
setTimeout(() => {
|
|
4396
|
+
this.closeFailed = true;
|
|
4397
|
+
}, 300);
|
|
4398
|
+
}
|
|
3155
4399
|
handleTermsChange(e8) {
|
|
3156
4400
|
this.termsAccepted = e8.detail.checked;
|
|
3157
4401
|
}
|
|
@@ -3184,7 +4428,7 @@ var McpConsent = class extends i4 {
|
|
|
3184
4428
|
// === RENDER METHODS ===
|
|
3185
4429
|
renderAgentInfo() {
|
|
3186
4430
|
const agentDisplay = this.agentName || "this agent";
|
|
3187
|
-
return
|
|
4431
|
+
return b2`
|
|
3188
4432
|
<div class="agent-info">
|
|
3189
4433
|
<div class="agent-icon">
|
|
3190
4434
|
<svg
|
|
@@ -3201,7 +4445,7 @@ var McpConsent = class extends i4 {
|
|
|
3201
4445
|
<div class="agent-text">
|
|
3202
4446
|
<p>
|
|
3203
4447
|
<strong>${agentDisplay}</strong> is requesting permission to
|
|
3204
|
-
${this.tool ?
|
|
4448
|
+
${this.tool ? b2`use the <strong>${this.tool}</strong> tool` : "access your data"}
|
|
3205
4449
|
on your behalf.
|
|
3206
4450
|
</p>
|
|
3207
4451
|
</div>
|
|
@@ -3212,8 +4456,8 @@ var McpConsent = class extends i4 {
|
|
|
3212
4456
|
this.selectedScopes = e8.detail.selected;
|
|
3213
4457
|
}
|
|
3214
4458
|
renderPermissions() {
|
|
3215
|
-
if (this.scopes.length === 0) return
|
|
3216
|
-
return
|
|
4459
|
+
if (this.scopes.length === 0) return A;
|
|
4460
|
+
return b2`
|
|
3217
4461
|
<p class="permissions-header">
|
|
3218
4462
|
${this.resolved?.ui.permissionsHeader ?? "The agent is requesting the following permissions:"}
|
|
3219
4463
|
</p>
|
|
@@ -3229,7 +4473,7 @@ var McpConsent = class extends i4 {
|
|
|
3229
4473
|
}
|
|
3230
4474
|
renderExpiration() {
|
|
3231
4475
|
const days = this.resolved?.expirationDays ?? 7;
|
|
3232
|
-
return
|
|
4476
|
+
return b2`
|
|
3233
4477
|
<p class="expiration">
|
|
3234
4478
|
${this.resolved?.ui.expirationText ?? "This delegation will expire in"}
|
|
3235
4479
|
<strong>${days} ${days === 1 ? "day" : "days"}</strong>
|
|
@@ -3237,8 +4481,8 @@ var McpConsent = class extends i4 {
|
|
|
3237
4481
|
`;
|
|
3238
4482
|
}
|
|
3239
4483
|
renderTerms() {
|
|
3240
|
-
if (!this.resolved?.terms) return
|
|
3241
|
-
return
|
|
4484
|
+
if (!this.resolved?.terms) return A;
|
|
4485
|
+
return b2`
|
|
3242
4486
|
<div class="terms">
|
|
3243
4487
|
<consent-terms
|
|
3244
4488
|
name="termsAccepted"
|
|
@@ -3251,11 +4495,11 @@ var McpConsent = class extends i4 {
|
|
|
3251
4495
|
`;
|
|
3252
4496
|
}
|
|
3253
4497
|
renderError() {
|
|
3254
|
-
if (!this.error) return
|
|
3255
|
-
return
|
|
4498
|
+
if (!this.error) return A;
|
|
4499
|
+
return b2`<div class="error-message">${this.error}</div>`;
|
|
3256
4500
|
}
|
|
3257
4501
|
renderFooter() {
|
|
3258
|
-
return
|
|
4502
|
+
return b2`
|
|
3259
4503
|
<div slot="footer">
|
|
3260
4504
|
<consent-button variant="secondary" @click=${this.handleDeny}>
|
|
3261
4505
|
${this.resolved?.ui.cancelButtonText ?? "Cancel"}
|
|
@@ -3273,7 +4517,7 @@ var McpConsent = class extends i4 {
|
|
|
3273
4517
|
}
|
|
3274
4518
|
// === MODE-SPECIFIC RENDERS ===
|
|
3275
4519
|
renderConsentOnly() {
|
|
3276
|
-
return
|
|
4520
|
+
return b2`
|
|
3277
4521
|
<consent-shell
|
|
3278
4522
|
page-title=${this.resolved?.ui.title ?? "Permission Request"}
|
|
3279
4523
|
company-name=${this.resolved?.branding.companyName ?? ""}
|
|
@@ -3292,7 +4536,7 @@ var McpConsent = class extends i4 {
|
|
|
3292
4536
|
}
|
|
3293
4537
|
renderCredentials() {
|
|
3294
4538
|
const creds = this.resolved?.credentials;
|
|
3295
|
-
return
|
|
4539
|
+
return b2`
|
|
3296
4540
|
<consent-shell
|
|
3297
4541
|
page-title=${this.resolved?.ui.title ?? "Sign In"}
|
|
3298
4542
|
company-name=${this.resolved?.branding.companyName ?? ""}
|
|
@@ -3333,7 +4577,7 @@ var McpConsent = class extends i4 {
|
|
|
3333
4577
|
></consent-input>
|
|
3334
4578
|
</div>
|
|
3335
4579
|
|
|
3336
|
-
${creds?.showForgotPassword && creds.forgotPasswordUrl ?
|
|
4580
|
+
${creds?.showForgotPassword && creds.forgotPasswordUrl ? b2`
|
|
3337
4581
|
<p style="text-align: right; margin-bottom: 1rem;">
|
|
3338
4582
|
<a
|
|
3339
4583
|
href=${creds.forgotPasswordUrl}
|
|
@@ -3342,7 +4586,7 @@ var McpConsent = class extends i4 {
|
|
|
3342
4586
|
Forgot password?
|
|
3343
4587
|
</a>
|
|
3344
4588
|
</p>
|
|
3345
|
-
` :
|
|
4589
|
+
` : A}
|
|
3346
4590
|
</div>
|
|
3347
4591
|
${this.renderFooter()}
|
|
3348
4592
|
</consent-shell>
|
|
@@ -3353,7 +4597,7 @@ var McpConsent = class extends i4 {
|
|
|
3353
4597
|
const provider = oauth?.providerId ?? this.provider ?? "oauth";
|
|
3354
4598
|
const providerName = oauth?.providerName ?? this.provider ?? "OAuth Provider";
|
|
3355
4599
|
const oauthButtonUrl = this.oauthUrl ? this.oauthUrl : `${this.serverUrl}/oauth/${encodeURIComponent(provider)}?session_id=${encodeURIComponent(this.sessionId)}`;
|
|
3356
|
-
return
|
|
4600
|
+
return b2`
|
|
3357
4601
|
<consent-shell
|
|
3358
4602
|
page-title=${this.resolved?.ui.title ?? "Sign In"}
|
|
3359
4603
|
company-name=${this.resolved?.branding.companyName ?? ""}
|
|
@@ -3378,7 +4622,7 @@ var McpConsent = class extends i4 {
|
|
|
3378
4622
|
}
|
|
3379
4623
|
renderMagicLink() {
|
|
3380
4624
|
const ml = this.resolved?.magicLink;
|
|
3381
|
-
return
|
|
4625
|
+
return b2`
|
|
3382
4626
|
<consent-shell
|
|
3383
4627
|
page-title=${this.resolved?.ui.title ?? "Sign In"}
|
|
3384
4628
|
company-name=${this.resolved?.branding.companyName ?? ""}
|
|
@@ -3423,7 +4667,7 @@ var McpConsent = class extends i4 {
|
|
|
3423
4667
|
}
|
|
3424
4668
|
renderOTP() {
|
|
3425
4669
|
const otp = this.resolved?.otp;
|
|
3426
|
-
return
|
|
4670
|
+
return b2`
|
|
3427
4671
|
<consent-shell
|
|
3428
4672
|
page-title=${this.resolved?.ui.title ?? "Verify Code"}
|
|
3429
4673
|
company-name=${this.resolved?.branding.companyName ?? ""}
|
|
@@ -3496,7 +4740,7 @@ var McpConsent = class extends i4 {
|
|
|
3496
4740
|
const agentDisplay = this.getAgentDisplayName();
|
|
3497
4741
|
const expiryDate = this.formatExpiryDate();
|
|
3498
4742
|
const displayScopes = this.selectedScopes.length > 0 ? this.selectedScopes : this.scopes;
|
|
3499
|
-
return
|
|
4743
|
+
return b2`
|
|
3500
4744
|
<div class="success-container">
|
|
3501
4745
|
<!-- Success Header -->
|
|
3502
4746
|
<div class="success-header">
|
|
@@ -3529,18 +4773,18 @@ var McpConsent = class extends i4 {
|
|
|
3529
4773
|
<div class="credential-label">Delegation Credential</div>
|
|
3530
4774
|
<div class="credential-agent">${agentDisplay}</div>
|
|
3531
4775
|
|
|
3532
|
-
${displayScopes.length > 0 ?
|
|
4776
|
+
${displayScopes.length > 0 ? b2`
|
|
3533
4777
|
<div class="credential-permissions-label">
|
|
3534
4778
|
Permissions granted
|
|
3535
4779
|
</div>
|
|
3536
4780
|
<div class="credential-permissions">
|
|
3537
4781
|
${displayScopes.map(
|
|
3538
|
-
(scope) =>
|
|
4782
|
+
(scope) => b2`
|
|
3539
4783
|
<span class="permission-badge">${scope}</span>
|
|
3540
4784
|
`
|
|
3541
4785
|
)}
|
|
3542
4786
|
</div>
|
|
3543
|
-
` :
|
|
4787
|
+
` : A}
|
|
3544
4788
|
|
|
3545
4789
|
<div class="credential-expiry">Expires ${expiryDate}</div>
|
|
3546
4790
|
|
|
@@ -3567,13 +4811,15 @@ var McpConsent = class extends i4 {
|
|
|
3567
4811
|
|
|
3568
4812
|
<!-- Footer with Continue Button -->
|
|
3569
4813
|
<div class="success-footer">
|
|
3570
|
-
|
|
3571
|
-
|
|
3572
|
-
|
|
3573
|
-
|
|
3574
|
-
|
|
3575
|
-
|
|
3576
|
-
|
|
4814
|
+
${this.closeFailed ? b2`<p class="close-message">You can safely close this tab.</p>` : b2`
|
|
4815
|
+
<consent-button
|
|
4816
|
+
variant="primary"
|
|
4817
|
+
full-width
|
|
4818
|
+
@click=${this.handleClose}
|
|
4819
|
+
>
|
|
4820
|
+
${success?.continueButtonText ?? "Continue"}
|
|
4821
|
+
</consent-button>
|
|
4822
|
+
`}
|
|
3577
4823
|
</div>
|
|
3578
4824
|
</div>
|
|
3579
4825
|
`;
|
|
@@ -3584,6 +4830,9 @@ var McpConsent = class extends i4 {
|
|
|
3584
4830
|
if (displayStep === "success") {
|
|
3585
4831
|
return this.renderSuccess();
|
|
3586
4832
|
}
|
|
4833
|
+
if (this.capabilities.length > 0 && this.currentMode === AUTH_MODES.CONSENT_ONLY) {
|
|
4834
|
+
return this.renderCapabilitiesScreen();
|
|
4835
|
+
}
|
|
3587
4836
|
switch (this.currentMode) {
|
|
3588
4837
|
case AUTH_MODES.CREDENTIALS:
|
|
3589
4838
|
return this.renderCredentials();
|
|
@@ -3598,6 +4847,39 @@ var McpConsent = class extends i4 {
|
|
|
3598
4847
|
return this.renderConsentOnly();
|
|
3599
4848
|
}
|
|
3600
4849
|
}
|
|
4850
|
+
/**
|
|
4851
|
+
* Render the new humanized capability layout. Selection state is owned by
|
|
4852
|
+
* `<consent-capabilities-screen>`; on `capabilities-allow`, we hydrate the
|
|
4853
|
+
* legacy form-data path (selectedScopes, terms accepted) and reuse the
|
|
4854
|
+
* existing handleApprove submission logic.
|
|
4855
|
+
*/
|
|
4856
|
+
renderCapabilitiesScreen() {
|
|
4857
|
+
const flatCapabilities = this.capabilities.flatMap(
|
|
4858
|
+
(group) => group.capabilities
|
|
4859
|
+
);
|
|
4860
|
+
return b2`
|
|
4861
|
+
${this.error ? b2`<div role="alert" style="
|
|
4862
|
+
color: var(--cs-text-danger, #b91c1c);
|
|
4863
|
+
margin: 0 auto 12px;
|
|
4864
|
+
max-width: 560px;
|
|
4865
|
+
font-size: 13px;
|
|
4866
|
+
">${this.error}</div>` : A}
|
|
4867
|
+
<consent-capabilities-screen
|
|
4868
|
+
.capabilities=${flatCapabilities}
|
|
4869
|
+
.agentMetadata=${this.agentMetadata}
|
|
4870
|
+
.cedarContext=${this.cedarContext}
|
|
4871
|
+
orgName="${this.orgName}"
|
|
4872
|
+
headlineVerb="${this.headlineVerb}"
|
|
4873
|
+
revocationPath="${this.revocationPath}"
|
|
4874
|
+
inactivityDays=${this.inactivityDays}
|
|
4875
|
+
theme="${this.consentTheme}"
|
|
4876
|
+
how-it-works-url="${this.howItWorksUrl}"
|
|
4877
|
+
?loading=${this.loading}
|
|
4878
|
+
@capabilities-allow=${this.onCapabilitiesAllow}
|
|
4879
|
+
@capabilities-deny=${this.handleDeny}
|
|
4880
|
+
></consent-capabilities-screen>
|
|
4881
|
+
`;
|
|
4882
|
+
}
|
|
3601
4883
|
};
|
|
3602
4884
|
McpConsent.styles = i`
|
|
3603
4885
|
:host {
|
|
@@ -3919,6 +5201,14 @@ McpConsent.styles = i`
|
|
|
3919
5201
|
margin-top: 1.5rem;
|
|
3920
5202
|
}
|
|
3921
5203
|
|
|
5204
|
+
.close-message {
|
|
5205
|
+
text-align: center;
|
|
5206
|
+
color: #6b7280;
|
|
5207
|
+
font-size: 0.875rem;
|
|
5208
|
+
margin: 0;
|
|
5209
|
+
padding: 0.75rem 0;
|
|
5210
|
+
}
|
|
5211
|
+
|
|
3922
5212
|
/* OTP section */
|
|
3923
5213
|
.otp-section {
|
|
3924
5214
|
text-align: center;
|
|
@@ -4033,6 +5323,75 @@ __decorateClass([
|
|
|
4033
5323
|
__decorateClass([
|
|
4034
5324
|
n4({ type: String, attribute: "oauth-url" })
|
|
4035
5325
|
], McpConsent.prototype, "oauthUrl", 2);
|
|
5326
|
+
__decorateClass([
|
|
5327
|
+
n4({
|
|
5328
|
+
type: Array,
|
|
5329
|
+
converter: {
|
|
5330
|
+
fromAttribute: (value) => {
|
|
5331
|
+
if (!value) return [];
|
|
5332
|
+
try {
|
|
5333
|
+
const parsed = JSON.parse(value);
|
|
5334
|
+
return Array.isArray(parsed) ? parsed : [];
|
|
5335
|
+
} catch {
|
|
5336
|
+
return [];
|
|
5337
|
+
}
|
|
5338
|
+
},
|
|
5339
|
+
toAttribute: (value) => JSON.stringify(value)
|
|
5340
|
+
}
|
|
5341
|
+
})
|
|
5342
|
+
], McpConsent.prototype, "capabilities", 2);
|
|
5343
|
+
__decorateClass([
|
|
5344
|
+
n4({
|
|
5345
|
+
type: Object,
|
|
5346
|
+
attribute: "agent-metadata",
|
|
5347
|
+
converter: {
|
|
5348
|
+
fromAttribute: (value) => {
|
|
5349
|
+
if (!value) return void 0;
|
|
5350
|
+
try {
|
|
5351
|
+
return JSON.parse(value);
|
|
5352
|
+
} catch {
|
|
5353
|
+
return void 0;
|
|
5354
|
+
}
|
|
5355
|
+
},
|
|
5356
|
+
toAttribute: (value) => value ? JSON.stringify(value) : ""
|
|
5357
|
+
}
|
|
5358
|
+
})
|
|
5359
|
+
], McpConsent.prototype, "agentMetadata", 2);
|
|
5360
|
+
__decorateClass([
|
|
5361
|
+
n4({ type: String, attribute: "org-name" })
|
|
5362
|
+
], McpConsent.prototype, "orgName", 2);
|
|
5363
|
+
__decorateClass([
|
|
5364
|
+
n4({ type: String, attribute: "headline-verb" })
|
|
5365
|
+
], McpConsent.prototype, "headlineVerb", 2);
|
|
5366
|
+
__decorateClass([
|
|
5367
|
+
n4({ type: String, attribute: "revocation-path" })
|
|
5368
|
+
], McpConsent.prototype, "revocationPath", 2);
|
|
5369
|
+
__decorateClass([
|
|
5370
|
+
n4({ type: Number, attribute: "inactivity-days" })
|
|
5371
|
+
], McpConsent.prototype, "inactivityDays", 2);
|
|
5372
|
+
__decorateClass([
|
|
5373
|
+
n4({ type: String, attribute: "consent-theme" })
|
|
5374
|
+
], McpConsent.prototype, "consentTheme", 2);
|
|
5375
|
+
__decorateClass([
|
|
5376
|
+
n4({ type: String, attribute: "how-it-works-url" })
|
|
5377
|
+
], McpConsent.prototype, "howItWorksUrl", 2);
|
|
5378
|
+
__decorateClass([
|
|
5379
|
+
n4({
|
|
5380
|
+
type: Object,
|
|
5381
|
+
attribute: "cedar-context",
|
|
5382
|
+
converter: {
|
|
5383
|
+
fromAttribute: (value) => {
|
|
5384
|
+
if (!value) return void 0;
|
|
5385
|
+
try {
|
|
5386
|
+
return JSON.parse(value);
|
|
5387
|
+
} catch {
|
|
5388
|
+
return void 0;
|
|
5389
|
+
}
|
|
5390
|
+
},
|
|
5391
|
+
toAttribute: (value) => value ? JSON.stringify(value) : ""
|
|
5392
|
+
}
|
|
5393
|
+
})
|
|
5394
|
+
], McpConsent.prototype, "cedarContext", 2);
|
|
4036
5395
|
__decorateClass([
|
|
4037
5396
|
n4({ type: String, attribute: "authorization-type" })
|
|
4038
5397
|
], McpConsent.prototype, "authorizationType", 2);
|
|
@@ -4085,16 +5444,25 @@ __decorateClass([
|
|
|
4085
5444
|
__decorateClass([
|
|
4086
5445
|
r5()
|
|
4087
5446
|
], McpConsent.prototype, "selectedScopes", 2);
|
|
5447
|
+
__decorateClass([
|
|
5448
|
+
r5()
|
|
5449
|
+
], McpConsent.prototype, "closeFailed", 2);
|
|
4088
5450
|
McpConsent = __decorateClass([
|
|
4089
5451
|
t3("mcp-consent")
|
|
4090
5452
|
], McpConsent);
|
|
4091
5453
|
export {
|
|
5454
|
+
ConsentActionBar,
|
|
5455
|
+
ConsentAgentHeader,
|
|
4092
5456
|
ConsentButton,
|
|
5457
|
+
ConsentCapabilitiesScreen,
|
|
5458
|
+
ConsentCapabilityCard,
|
|
4093
5459
|
ConsentCheckbox,
|
|
5460
|
+
ConsentFooter,
|
|
4094
5461
|
ConsentInput,
|
|
4095
5462
|
ConsentOAuthButton,
|
|
4096
5463
|
ConsentOTPInput,
|
|
4097
5464
|
ConsentPermissions,
|
|
5465
|
+
ConsentRevocationNotice,
|
|
4098
5466
|
ConsentShell,
|
|
4099
5467
|
ConsentTerms,
|
|
4100
5468
|
McpConsent
|