@kya-os/consent 0.1.0 → 0.1.2
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 +44 -0
- package/dist/bundle/index.d.ts.map +1 -0
- package/dist/bundle/index.js +45 -0
- package/dist/bundle/index.js.map +1 -0
- package/dist/bundle/inline.d.ts +18 -0
- package/dist/bundle/inline.d.ts.map +1 -0
- package/dist/bundle/inline.js +18 -0
- package/dist/bundle/inline.js.map +1 -0
- package/dist/bundle/shell.d.ts +91 -0
- package/dist/bundle/shell.d.ts.map +1 -0
- package/dist/bundle/shell.js +282 -0
- package/dist/bundle/shell.js.map +1 -0
- package/dist/components/consent-button.d.ts +61 -0
- package/dist/components/consent-button.d.ts.map +1 -0
- package/dist/components/consent-button.js +177 -0
- package/dist/components/consent-button.js.map +1 -0
- package/dist/components/consent-checkbox.d.ts +61 -0
- package/dist/components/consent-checkbox.d.ts.map +1 -0
- package/dist/components/consent-checkbox.js +220 -0
- package/dist/components/consent-checkbox.js.map +1 -0
- package/dist/components/consent-input.d.ts +91 -0
- package/dist/components/consent-input.d.ts.map +1 -0
- package/dist/components/consent-input.js +332 -0
- package/dist/components/consent-input.js.map +1 -0
- package/dist/components/consent-oauth-button.d.ts +87 -0
- package/dist/components/consent-oauth-button.d.ts.map +1 -0
- package/dist/components/consent-oauth-button.js +389 -0
- package/dist/components/consent-oauth-button.js.map +1 -0
- package/dist/components/consent-otp-input.d.ts +92 -0
- package/dist/components/consent-otp-input.d.ts.map +1 -0
- package/dist/components/consent-otp-input.js +385 -0
- package/dist/components/consent-otp-input.js.map +1 -0
- package/dist/components/consent-permissions.d.ts +104 -0
- package/dist/components/consent-permissions.d.ts.map +1 -0
- package/dist/components/consent-permissions.js +430 -0
- package/dist/components/consent-permissions.js.map +1 -0
- package/dist/components/consent-shell.d.ts +72 -0
- package/dist/components/consent-shell.d.ts.map +1 -0
- package/dist/components/consent-shell.js +231 -0
- package/dist/components/consent-shell.js.map +1 -0
- package/dist/components/consent-terms.d.ts +89 -0
- package/dist/components/consent-terms.d.ts.map +1 -0
- package/dist/components/consent-terms.js +284 -0
- package/dist/components/consent-terms.js.map +1 -0
- package/dist/components/index.d.ts +19 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.js +23 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/mcp-consent.d.ts +152 -0
- package/dist/components/mcp-consent.d.ts.map +1 -0
- package/dist/components/mcp-consent.js +874 -0
- package/dist/components/mcp-consent.js.map +1 -0
- package/dist/consent.js +3744 -0
- package/dist/consent.min.js +1564 -0
- package/dist/constants/auth-modes.d.ts +7 -2
- package/dist/constants/auth-modes.d.ts.map +1 -1
- package/dist/constants/auth-modes.js +28 -36
- package/dist/constants/auth-modes.js.map +1 -1
- package/dist/constants/colors.js +1 -4
- package/dist/constants/colors.js.map +1 -1
- package/dist/constants/defaults.d.ts +1 -1
- package/dist/constants/defaults.d.ts.map +1 -1
- package/dist/constants/defaults.js +16 -19
- package/dist/constants/defaults.js.map +1 -1
- package/dist/constants/index.d.ts +3 -3
- package/dist/constants/index.d.ts.map +1 -1
- package/dist/constants/index.js +3 -26
- package/dist/constants/index.js.map +1 -1
- package/dist/index.d.ts +10 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -23
- package/dist/index.js.map +1 -1
- package/dist/react/index.d.ts +123 -0
- package/dist/react/index.d.ts.map +1 -0
- package/dist/react/index.js +154 -0
- package/dist/react/index.js.map +1 -0
- package/dist/resolution/index.d.ts +3 -3
- package/dist/resolution/index.d.ts.map +1 -1
- package/dist/resolution/index.js +3 -19
- package/dist/resolution/index.js.map +1 -1
- package/dist/resolution/resolve-branding.d.ts +1 -1
- package/dist/resolution/resolve-branding.d.ts.map +1 -1
- package/dist/resolution/resolve-branding.js +14 -24
- package/dist/resolution/resolve-branding.js.map +1 -1
- package/dist/resolution/resolve-config.d.ts +2 -2
- package/dist/resolution/resolve-config.d.ts.map +1 -1
- package/dist/resolution/resolve-config.js +57 -53
- package/dist/resolution/resolve-config.js.map +1 -1
- package/dist/resolution/resolve-copy.d.ts +2 -2
- package/dist/resolution/resolve-copy.d.ts.map +1 -1
- package/dist/resolution/resolve-copy.js +35 -43
- package/dist/resolution/resolve-copy.js.map +1 -1
- package/dist/schemas/api.schemas.d.ts +7 -4
- package/dist/schemas/api.schemas.d.ts.map +1 -1
- package/dist/schemas/api.schemas.js +70 -74
- package/dist/schemas/api.schemas.js.map +1 -1
- package/dist/schemas/branding.schemas.js +17 -20
- package/dist/schemas/branding.schemas.js.map +1 -1
- package/dist/schemas/config.schemas.d.ts +1 -1
- package/dist/schemas/config.schemas.d.ts.map +1 -1
- package/dist/schemas/config.schemas.js +64 -70
- package/dist/schemas/config.schemas.js.map +1 -1
- package/dist/schemas/index.d.ts +4 -4
- package/dist/schemas/index.d.ts.map +1 -1
- package/dist/schemas/index.js +4 -20
- package/dist/schemas/index.js.map +1 -1
- package/dist/schemas/modes.schemas.js +60 -63
- package/dist/schemas/modes.schemas.js.map +1 -1
- package/dist/security/escape.d.ts.map +1 -1
- package/dist/security/escape.js +12 -17
- package/dist/security/escape.js.map +1 -1
- package/dist/security/index.d.ts +2 -2
- package/dist/security/index.d.ts.map +1 -1
- package/dist/security/index.js +2 -18
- package/dist/security/index.js.map +1 -1
- package/dist/security/validators.js +9 -20
- package/dist/security/validators.js.map +1 -1
- package/dist/styles/css-variables.d.ts +1 -1
- package/dist/styles/css-variables.d.ts.map +1 -1
- package/dist/styles/css-variables.js +18 -27
- package/dist/styles/css-variables.js.map +1 -1
- package/dist/styles/index.d.ts +3 -3
- package/dist/styles/index.d.ts.map +1 -1
- package/dist/styles/index.js +3 -19
- package/dist/styles/index.js.map +1 -1
- package/dist/styles/stylesheet.d.ts +1 -1
- package/dist/styles/stylesheet.d.ts.map +1 -1
- package/dist/styles/stylesheet.js +20 -27
- package/dist/styles/stylesheet.js.map +1 -1
- package/dist/styles/tokens.js +1 -4
- package/dist/styles/tokens.js.map +1 -1
- package/dist/templates/base/base-template.d.ts +3 -3
- package/dist/templates/base/base-template.d.ts.map +1 -1
- package/dist/templates/base/base-template.js +31 -35
- package/dist/templates/base/base-template.js.map +1 -1
- package/dist/templates/base/components.js +49 -65
- package/dist/templates/base/components.js.map +1 -1
- package/dist/templates/base/index.d.ts +2 -2
- package/dist/templates/base/index.d.ts.map +1 -1
- package/dist/templates/base/index.js +2 -20
- package/dist/templates/base/index.js.map +1 -1
- package/dist/templates/index.d.ts +9 -9
- package/dist/templates/index.d.ts.map +1 -1
- package/dist/templates/index.js +9 -25
- package/dist/templates/index.js.map +1 -1
- package/dist/templates/modes/consent-only.template.d.ts +2 -2
- package/dist/templates/modes/consent-only.template.d.ts.map +1 -1
- package/dist/templates/modes/consent-only.template.js +11 -15
- package/dist/templates/modes/consent-only.template.js.map +1 -1
- package/dist/templates/modes/credentials.template.d.ts +4 -4
- package/dist/templates/modes/credentials.template.d.ts.map +1 -1
- package/dist/templates/modes/credentials.template.js +20 -24
- package/dist/templates/modes/credentials.template.js.map +1 -1
- package/dist/templates/modes/index.d.ts +6 -6
- package/dist/templates/modes/index.d.ts.map +1 -1
- package/dist/templates/modes/index.js +6 -16
- package/dist/templates/modes/index.js.map +1 -1
- package/dist/templates/modes/magic-link.template.d.ts +2 -2
- package/dist/templates/modes/magic-link.template.d.ts.map +1 -1
- package/dist/templates/modes/magic-link.template.js +14 -18
- package/dist/templates/modes/magic-link.template.js.map +1 -1
- package/dist/templates/modes/oauth.template.d.ts +2 -2
- package/dist/templates/modes/oauth.template.d.ts.map +1 -1
- package/dist/templates/modes/oauth.template.js +21 -25
- package/dist/templates/modes/oauth.template.js.map +1 -1
- package/dist/templates/modes/otp.template.d.ts +2 -2
- package/dist/templates/modes/otp.template.d.ts.map +1 -1
- package/dist/templates/modes/otp.template.js +17 -21
- package/dist/templates/modes/otp.template.js.map +1 -1
- package/dist/templates/modes/success.template.d.ts +2 -2
- package/dist/templates/modes/success.template.d.ts.map +1 -1
- package/dist/templates/modes/success.template.js +24 -29
- package/dist/templates/modes/success.template.js.map +1 -1
- package/dist/templates/registry.d.ts +4 -4
- package/dist/templates/registry.d.ts.map +1 -1
- package/dist/templates/registry.js +30 -38
- package/dist/templates/registry.js.map +1 -1
- package/dist/types/api.types.d.ts +6 -5
- package/dist/types/api.types.d.ts.map +1 -1
- package/dist/types/api.types.js +1 -2
- package/dist/types/api.types.js.map +1 -1
- package/dist/types/branding.types.js +1 -2
- package/dist/types/branding.types.js.map +1 -1
- package/dist/types/config.types.d.ts +5 -5
- package/dist/types/config.types.d.ts.map +1 -1
- package/dist/types/config.types.js +1 -2
- package/dist/types/config.types.js.map +1 -1
- package/dist/types/copy.types.js +1 -2
- package/dist/types/copy.types.js.map +1 -1
- package/dist/types/index.d.ts +6 -6
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +6 -22
- package/dist/types/index.js.map +1 -1
- package/dist/types/modes.types.js +1 -4
- package/dist/types/modes.types.js.map +1 -1
- package/dist/types/page.types.d.ts +6 -6
- package/dist/types/page.types.d.ts.map +1 -1
- package/dist/types/page.types.js +1 -2
- package/dist/types/page.types.js.map +1 -1
- package/package.json +41 -4
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Consent Bundle Entry Point
|
|
3
|
+
*
|
|
4
|
+
* This file serves as the entry point for bundling all consent components
|
|
5
|
+
* into a single file (consent.js) that can be served by Workers.
|
|
6
|
+
*
|
|
7
|
+
* When bundled with esbuild, this creates a self-contained script that:
|
|
8
|
+
* 1. Imports Lit and all dependencies
|
|
9
|
+
* 2. Registers all custom elements
|
|
10
|
+
* 3. Makes <mcp-consent> and all sub-components available in the browser
|
|
11
|
+
*
|
|
12
|
+
* Usage in Worker:
|
|
13
|
+
* ```typescript
|
|
14
|
+
* // Serve consent.js at /consent.js
|
|
15
|
+
* import CONSENT_BUNDLE from './consent.bundle.js';
|
|
16
|
+
*
|
|
17
|
+
* app.get('/consent.js', () => new Response(CONSENT_BUNDLE, {
|
|
18
|
+
* headers: { 'Content-Type': 'application/javascript' }
|
|
19
|
+
* }));
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* @module @kya-os/consent/bundle
|
|
23
|
+
*/
|
|
24
|
+
import '../components/consent-button.js';
|
|
25
|
+
import '../components/consent-checkbox.js';
|
|
26
|
+
import '../components/consent-input.js';
|
|
27
|
+
import '../components/consent-shell.js';
|
|
28
|
+
import '../components/consent-permissions.js';
|
|
29
|
+
import '../components/consent-terms.js';
|
|
30
|
+
import '../components/consent-oauth-button.js';
|
|
31
|
+
import '../components/consent-otp-input.js';
|
|
32
|
+
import '../components/mcp-consent.js';
|
|
33
|
+
export { McpConsent } from '../components/mcp-consent.js';
|
|
34
|
+
export { ConsentButton } from '../components/consent-button.js';
|
|
35
|
+
export { ConsentCheckbox } from '../components/consent-checkbox.js';
|
|
36
|
+
export { ConsentInput } from '../components/consent-input.js';
|
|
37
|
+
export { ConsentShell } from '../components/consent-shell.js';
|
|
38
|
+
export { ConsentPermissions } from '../components/consent-permissions.js';
|
|
39
|
+
export { ConsentTerms } from '../components/consent-terms.js';
|
|
40
|
+
export { ConsentOAuthButton } from '../components/consent-oauth-button.js';
|
|
41
|
+
export { ConsentOTPInput } from '../components/consent-otp-input.js';
|
|
42
|
+
export type { ConsentConfig, ResolvedConsentConfig } from '../types/config.types.js';
|
|
43
|
+
export type { OAuthIdentity } from '../types/api.types.js';
|
|
44
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/bundle/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAGH,OAAO,iCAAiC,CAAC;AACzC,OAAO,mCAAmC,CAAC;AAC3C,OAAO,gCAAgC,CAAC;AACxC,OAAO,gCAAgC,CAAC;AACxC,OAAO,sCAAsC,CAAC;AAC9C,OAAO,gCAAgC,CAAC;AACxC,OAAO,uCAAuC,CAAC;AAC/C,OAAO,oCAAoC,CAAC;AAC5C,OAAO,8BAA8B,CAAC;AAGtC,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAG1D,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACpE,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAC1E,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAC3E,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AAGrE,YAAY,EAAE,aAAa,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACrF,YAAY,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Consent Bundle Entry Point
|
|
3
|
+
*
|
|
4
|
+
* This file serves as the entry point for bundling all consent components
|
|
5
|
+
* into a single file (consent.js) that can be served by Workers.
|
|
6
|
+
*
|
|
7
|
+
* When bundled with esbuild, this creates a self-contained script that:
|
|
8
|
+
* 1. Imports Lit and all dependencies
|
|
9
|
+
* 2. Registers all custom elements
|
|
10
|
+
* 3. Makes <mcp-consent> and all sub-components available in the browser
|
|
11
|
+
*
|
|
12
|
+
* Usage in Worker:
|
|
13
|
+
* ```typescript
|
|
14
|
+
* // Serve consent.js at /consent.js
|
|
15
|
+
* import CONSENT_BUNDLE from './consent.bundle.js';
|
|
16
|
+
*
|
|
17
|
+
* app.get('/consent.js', () => new Response(CONSENT_BUNDLE, {
|
|
18
|
+
* headers: { 'Content-Type': 'application/javascript' }
|
|
19
|
+
* }));
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* @module @kya-os/consent/bundle
|
|
23
|
+
*/
|
|
24
|
+
// Import all components - this registers them as custom elements
|
|
25
|
+
import '../components/consent-button.js';
|
|
26
|
+
import '../components/consent-checkbox.js';
|
|
27
|
+
import '../components/consent-input.js';
|
|
28
|
+
import '../components/consent-shell.js';
|
|
29
|
+
import '../components/consent-permissions.js';
|
|
30
|
+
import '../components/consent-terms.js';
|
|
31
|
+
import '../components/consent-oauth-button.js';
|
|
32
|
+
import '../components/consent-otp-input.js';
|
|
33
|
+
import '../components/mcp-consent.js';
|
|
34
|
+
// Re-export the main composite component for programmatic use
|
|
35
|
+
export { McpConsent } from '../components/mcp-consent.js';
|
|
36
|
+
// Re-export individual components for advanced usage
|
|
37
|
+
export { ConsentButton } from '../components/consent-button.js';
|
|
38
|
+
export { ConsentCheckbox } from '../components/consent-checkbox.js';
|
|
39
|
+
export { ConsentInput } from '../components/consent-input.js';
|
|
40
|
+
export { ConsentShell } from '../components/consent-shell.js';
|
|
41
|
+
export { ConsentPermissions } from '../components/consent-permissions.js';
|
|
42
|
+
export { ConsentTerms } from '../components/consent-terms.js';
|
|
43
|
+
export { ConsentOAuthButton } from '../components/consent-oauth-button.js';
|
|
44
|
+
export { ConsentOTPInput } from '../components/consent-otp-input.js';
|
|
45
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/bundle/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,iEAAiE;AACjE,OAAO,iCAAiC,CAAC;AACzC,OAAO,mCAAmC,CAAC;AAC3C,OAAO,gCAAgC,CAAC;AACxC,OAAO,gCAAgC,CAAC;AACxC,OAAO,sCAAsC,CAAC;AAC9C,OAAO,gCAAgC,CAAC;AACxC,OAAO,uCAAuC,CAAC;AAC/C,OAAO,oCAAoC,CAAC;AAC5C,OAAO,8BAA8B,CAAC;AAEtC,8DAA8D;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAE1D,qDAAqD;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACpE,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAC1E,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAC3E,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Inline Consent Bundle
|
|
3
|
+
*
|
|
4
|
+
* Auto-generated file containing the bundled consent components.
|
|
5
|
+
* DO NOT EDIT - regenerate with: pnpm build:bundle
|
|
6
|
+
*
|
|
7
|
+
* @module @kya-os/consent/bundle/inline
|
|
8
|
+
* @generated
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* The bundled consent.js content as a string.
|
|
12
|
+
* Use this to serve the bundle from a Worker.
|
|
13
|
+
*/
|
|
14
|
+
export declare const CONSENT_BUNDLE: string;
|
|
15
|
+
/**
|
|
16
|
+
* Size of the bundle in bytes (for logging/debugging)
|
|
17
|
+
*/
|
|
18
|
+
export declare const CONSENT_BUNDLE_SIZE: number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inline.d.ts","sourceRoot":"","sources":["../../src/bundle/inline.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;;GAGG;AACH,eAAO,MAAM,cAAc,EAAE,MAAmloF,CAAC;AAEjnoF;;GAEG;AACH,eAAO,MAAM,mBAAmB,EAAE,MAAc,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Inline Consent Bundle
|
|
3
|
+
*
|
|
4
|
+
* Auto-generated file containing the bundled consent components.
|
|
5
|
+
* DO NOT EDIT - regenerate with: pnpm build:bundle
|
|
6
|
+
*
|
|
7
|
+
* @module @kya-os/consent/bundle/inline
|
|
8
|
+
* @generated
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* The bundled consent.js content as a string.
|
|
12
|
+
* Use this to serve the bundle from a Worker.
|
|
13
|
+
*/
|
|
14
|
+
export const CONSENT_BUNDLE = "var Je=Object.defineProperty;var Qe=Object.getOwnPropertyDescriptor;var n=(i,t,e,r)=>{for(var s=r>1?void 0:r?Qe(t,e):t,o=i.length-1,a;o>=0;o--)(a=i[o])&&(s=(r?a(t,e,s):a(s))||s);return r&&s&&Je(t,e,s),s};var oe=globalThis,ne=oe.ShadowRoot&&(oe.ShadyCSS===void 0||oe.ShadyCSS.nativeShadow)&&\"adoptedStyleSheets\"in Document.prototype&&\"replace\"in CSSStyleSheet.prototype,pe=Symbol(),Ce=new WeakMap,K=class{constructor(t,e,r){if(this._$cssResult$=!0,r!==pe)throw Error(\"CSSResult is not constructable. Use `unsafeCSS` or `css` instead.\");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(ne&&t===void 0){let r=e!==void 0&&e.length===1;r&&(t=Ce.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),r&&Ce.set(e,t))}return t}toString(){return this.cssText}},Ee=i=>new K(typeof i==\"string\"?i:i+\"\",void 0,pe),v=(i,...t)=>{let e=i.length===1?i[0]:t.reduce(((r,s,o)=>r+(a=>{if(a._$cssResult$===!0)return a.cssText;if(typeof a==\"number\")return a;throw Error(\"Value passed to 'css' function must be a 'css' function result: \"+a+\". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.\")})(s)+i[o+1]),i[0]);return new K(e,i,pe)},Ae=(i,t)=>{if(ne)i.adoptedStyleSheets=t.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet));else for(let e of t){let r=document.createElement(\"style\"),s=oe.litNonce;s!==void 0&&r.setAttribute(\"nonce\",s),r.textContent=e.cssText,i.appendChild(r)}},ue=ne?i=>i:i=>i instanceof CSSStyleSheet?(t=>{let e=\"\";for(let r of t.cssRules)e+=r.cssText;return Ee(e)})(i):i;var{is:Xe,defineProperty:Ze,getOwnPropertyDescriptor:et,getOwnPropertyNames:tt,getOwnPropertySymbols:rt,getPrototypeOf:it}=Object,P=globalThis,Se=P.trustedTypes,st=Se?Se.emptyScript:\"\",ot=P.reactiveElementPolyfillSupport,W=(i,t)=>i,J={toAttribute(i,t){switch(t){case Boolean:i=i?st:null;break;case Object:case Array:i=i==null?i:JSON.stringify(i)}return i},fromAttribute(i,t){let e=i;switch(t){case Boolean:e=i!==null;break;case Number:e=i===null?null:Number(i);break;case Object:case Array:try{e=JSON.parse(i)}catch{e=null}}return e}},ae=(i,t)=>!Xe(i,t),_e={attribute:!0,type:String,converter:J,reflect:!1,useDefault:!1,hasChanged:ae};Symbol.metadata??(Symbol.metadata=Symbol(\"metadata\")),P.litPropertyMetadata??(P.litPropertyMetadata=new WeakMap);var N=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??(this.l=[])).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=_e){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){let r=Symbol(),s=this.getPropertyDescriptor(t,r,e);s!==void 0&&Ze(this.prototype,t,s)}}static getPropertyDescriptor(t,e,r){let{get:s,set:o}=et(this.prototype,t)??{get(){return this[e]},set(a){this[e]=a}};return{get:s,set(a){let p=s?.call(this);o?.call(this,a),this.requestUpdate(t,p,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??_e}static _$Ei(){if(this.hasOwnProperty(W(\"elementProperties\")))return;let t=it(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(W(\"finalized\")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(W(\"properties\"))){let e=this.properties,r=[...tt(e),...rt(e)];for(let s of r)this.createProperty(s,e[s])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[r,s]of e)this.elementProperties.set(r,s)}this._$Eh=new Map;for(let[e,r]of this.elementProperties){let s=this._$Eu(e,r);s!==void 0&&this._$Eh.set(s,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let r=new Set(t.flat(1/0).reverse());for(let s of r)e.unshift(ue(s))}else t!==void 0&&e.push(ue(t));return e}static _$Eu(t,e){let r=e.attribute;return r===!1?void 0:typeof r==\"string\"?r:typeof t==\"string\"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((t=>t(this)))}addController(t){(this._$EO??(this._$EO=new Set)).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let r of e.keys())this.hasOwnProperty(r)&&(t.set(r,this[r]),delete this[r]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Ae(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),this._$EO?.forEach((t=>t.hostConnected?.()))}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach((t=>t.hostDisconnected?.()))}attributeChangedCallback(t,e,r){this._$AK(t,r)}_$ET(t,e){let r=this.constructor.elementProperties.get(t),s=this.constructor._$Eu(t,r);if(s!==void 0&&r.reflect===!0){let o=(r.converter?.toAttribute!==void 0?r.converter:J).toAttribute(e,r.type);this._$Em=t,o==null?this.removeAttribute(s):this.setAttribute(s,o),this._$Em=null}}_$AK(t,e){let r=this.constructor,s=r._$Eh.get(t);if(s!==void 0&&this._$Em!==s){let o=r.getPropertyOptions(s),a=typeof o.converter==\"function\"?{fromAttribute:o.converter}:o.converter?.fromAttribute!==void 0?o.converter:J;this._$Em=s;let p=a.fromAttribute(e,o.type);this[s]=p??this._$Ej?.get(s)??p,this._$Em=null}}requestUpdate(t,e,r){if(t!==void 0){let s=this.constructor,o=this[t];if(r??(r=s.getPropertyOptions(t)),!((r.hasChanged??ae)(o,e)||r.useDefault&&r.reflect&&o===this._$Ej?.get(t)&&!this.hasAttribute(s._$Eu(t,r))))return;this.C(t,e,r)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(t,e,{useDefault:r,reflect:s,wrapped:o},a){r&&!(this._$Ej??(this._$Ej=new Map)).has(t)&&(this._$Ej.set(t,a??e??this[t]),o!==!0||a!==void 0)||(this._$AL.has(t)||(this.hasUpdated||r||(e=void 0),this._$AL.set(t,e)),s===!0&&this._$Em!==t&&(this._$Eq??(this._$Eq=new Set)).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(let[s,o]of this._$Ep)this[s]=o;this._$Ep=void 0}let r=this.constructor.elementProperties;if(r.size>0)for(let[s,o]of r){let{wrapped:a}=o,p=this[s];a!==!0||this._$AL.has(s)||p===void 0||this.C(s,void 0,o,p)}}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach((r=>r.hostUpdate?.())),this.update(e)):this._$EM()}catch(r){throw t=!1,this._$EM(),r}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach((e=>e.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&(this._$Eq=this._$Eq.forEach((e=>this._$ET(e,this[e])))),this._$EM()}updated(t){}firstUpdated(t){}};N.elementStyles=[],N.shadowRootOptions={mode:\"open\"},N[W(\"elementProperties\")]=new Map,N[W(\"finalized\")]=new Map,ot?.({ReactiveElement:N}),(P.reactiveElementVersions??(P.reactiveElementVersions=[])).push(\"2.1.1\");var X=globalThis,le=X.trustedTypes,ke=le?le.createPolicy(\"lit-html\",{createHTML:i=>i}):void 0,Ne=\"$lit$\",M=`lit$${Math.random().toFixed(9).slice(2)}$`,Le=\"?\"+M,nt=`<${Le}>`,F=document,Z=()=>F.createComment(\"\"),ee=i=>i===null||typeof i!=\"object\"&&typeof i!=\"function\",ye=Array.isArray,at=i=>ye(i)||typeof i?.[Symbol.iterator]==\"function\",he=`[ \t\n\\f\\r]`,Q=/<(?:(!--|\\/[^a-zA-Z])|(\\/?[a-zA-Z][^>\\s]*)|(\\/?$))/g,Te=/-->/g,Re=/>/g,O=RegExp(`>|${he}(?:([^\\\\s\"'>=/]+)(${he}*=${he}*(?:[^ \t\n\\f\\r\"'\\`<>=]|(\"|')|))|$)`,\"g\"),Ue=/'/g,Ie=/\"/g,Pe=/^(?:script|style|textarea|title)$/i,xe=i=>(t,...e)=>({_$litType$:i,strings:t,values:e}),d=xe(1),Ut=xe(2),It=xe(3),L=Symbol.for(\"lit-noChange\"),u=Symbol.for(\"lit-nothing\"),De=new WeakMap,B=F.createTreeWalker(F,129);function Me(i,t){if(!ye(i)||!i.hasOwnProperty(\"raw\"))throw Error(\"invalid template strings array\");return ke!==void 0?ke.createHTML(t):t}var lt=(i,t)=>{let e=i.length-1,r=[],s,o=t===2?\"<svg>\":t===3?\"<math>\":\"\",a=Q;for(let p=0;p<e;p++){let c=i[p],f,b,h=-1,T=0;for(;T<c.length&&(a.lastIndex=T,b=a.exec(c),b!==null);)T=a.lastIndex,a===Q?b[1]===\"!--\"?a=Te:b[1]!==void 0?a=Re:b[2]!==void 0?(Pe.test(b[2])&&(s=RegExp(\"</\"+b[2],\"g\")),a=O):b[3]!==void 0&&(a=O):a===O?b[0]===\">\"?(a=s??Q,h=-1):b[1]===void 0?h=-2:(h=a.lastIndex-b[2].length,f=b[1],a=b[3]===void 0?O:b[3]==='\"'?Ie:Ue):a===Ie||a===Ue?a=O:a===Te||a===Re?a=Q:(a=O,s=void 0);let R=a===O&&i[p+1].startsWith(\"/>\")?\" \":\"\";o+=a===Q?c+nt:h>=0?(r.push(f),c.slice(0,h)+Ne+c.slice(h)+M+R):c+M+(h===-2?p:R)}return[Me(i,o+(i[e]||\"<?>\")+(t===2?\"</svg>\":t===3?\"</math>\":\"\")),r]},te=class i{constructor({strings:t,_$litType$:e},r){let s;this.parts=[];let o=0,a=0,p=t.length-1,c=this.parts,[f,b]=lt(t,e);if(this.el=i.createElement(f,r),B.currentNode=this.el.content,e===2||e===3){let h=this.el.content.firstChild;h.replaceWith(...h.childNodes)}for(;(s=B.nextNode())!==null&&c.length<p;){if(s.nodeType===1){if(s.hasAttributes())for(let h of s.getAttributeNames())if(h.endsWith(Ne)){let T=b[a++],R=s.getAttribute(h).split(M),q=/([.?@])?(.*)/.exec(T);c.push({type:1,index:o,name:q[2],strings:R,ctor:q[1]===\".\"?ge:q[1]===\"?\"?fe:q[1]===\"@\"?ve:j}),s.removeAttribute(h)}else h.startsWith(M)&&(c.push({type:6,index:o}),s.removeAttribute(h));if(Pe.test(s.tagName)){let h=s.textContent.split(M),T=h.length-1;if(T>0){s.textContent=le?le.emptyScript:\"\";for(let R=0;R<T;R++)s.append(h[R],Z()),B.nextNode(),c.push({type:2,index:++o});s.append(h[T],Z())}}}else if(s.nodeType===8)if(s.data===Le)c.push({type:2,index:o});else{let h=-1;for(;(h=s.data.indexOf(M,h+1))!==-1;)c.push({type:7,index:o}),h+=M.length-1}o++}}static createElement(t,e){let r=F.createElement(\"template\");return r.innerHTML=t,r}};function z(i,t,e=i,r){if(t===L)return t;let s=r!==void 0?e._$Co?.[r]:e._$Cl,o=ee(t)?void 0:t._$litDirective$;return s?.constructor!==o&&(s?._$AO?.(!1),o===void 0?s=void 0:(s=new o(i),s._$AT(i,e,r)),r!==void 0?(e._$Co??(e._$Co=[]))[r]=s:e._$Cl=s),s!==void 0&&(t=z(i,s._$AS(i,t.values),s,r)),t}var me=class{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){let{el:{content:e},parts:r}=this._$AD,s=(t?.creationScope??F).importNode(e,!0);B.currentNode=s;let o=B.nextNode(),a=0,p=0,c=r[0];for(;c!==void 0;){if(a===c.index){let f;c.type===2?f=new re(o,o.nextSibling,this,t):c.type===1?f=new c.ctor(o,c.name,c.strings,this,t):c.type===6&&(f=new be(o,this,t)),this._$AV.push(f),c=r[++p]}a!==c?.index&&(o=B.nextNode(),a++)}return B.currentNode=F,s}p(t){let e=0;for(let r of this._$AV)r!==void 0&&(r.strings!==void 0?(r._$AI(t,r,e),e+=r.strings.length-2):r._$AI(t[e])),e++}},re=class i{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,r,s){this.type=2,this._$AH=u,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=r,this.options=s,this._$Cv=s?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode,e=this._$AM;return e!==void 0&&t?.nodeType===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=z(this,t,e),ee(t)?t===u||t==null||t===\"\"?(this._$AH!==u&&this._$AR(),this._$AH=u):t!==this._$AH&&t!==L&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):at(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==u&&ee(this._$AH)?this._$AA.nextSibling.data=t:this.T(F.createTextNode(t)),this._$AH=t}$(t){let{values:e,_$litType$:r}=t,s=typeof r==\"number\"?this._$AC(t):(r.el===void 0&&(r.el=te.createElement(Me(r.h,r.h[0]),this.options)),r);if(this._$AH?._$AD===s)this._$AH.p(e);else{let o=new me(s,this),a=o.u(this.options);o.p(e),this.T(a),this._$AH=o}}_$AC(t){let e=De.get(t.strings);return e===void 0&&De.set(t.strings,e=new te(t)),e}k(t){ye(this._$AH)||(this._$AH=[],this._$AR());let e=this._$AH,r,s=0;for(let o of t)s===e.length?e.push(r=new i(this.O(Z()),this.O(Z()),this,this.options)):r=e[s],r._$AI(o),s++;s<e.length&&(this._$AR(r&&r._$AB.nextSibling,s),e.length=s)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t!==this._$AB;){let r=t.nextSibling;t.remove(),t=r}}setConnected(t){this._$AM===void 0&&(this._$Cv=t,this._$AP?.(t))}},j=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,r,s,o){this.type=1,this._$AH=u,this._$AN=void 0,this.element=t,this.name=e,this._$AM=s,this.options=o,r.length>2||r[0]!==\"\"||r[1]!==\"\"?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=u}_$AI(t,e=this,r,s){let o=this.strings,a=!1;if(o===void 0)t=z(this,t,e,0),a=!ee(t)||t!==this._$AH&&t!==L,a&&(this._$AH=t);else{let p=t,c,f;for(t=o[0],c=0;c<o.length-1;c++)f=z(this,p[r+c],e,c),f===L&&(f=this._$AH[c]),a||(a=!ee(f)||f!==this._$AH[c]),f===u?t=u:t!==u&&(t+=(f??\"\")+o[c+1]),this._$AH[c]=f}a&&!s&&this.j(t)}j(t){t===u?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??\"\")}},ge=class extends j{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===u?void 0:t}},fe=class extends j{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==u)}},ve=class extends j{constructor(t,e,r,s,o){super(t,e,r,s,o),this.type=5}_$AI(t,e=this){if((t=z(this,t,e,0)??u)===L)return;let r=this._$AH,s=t===u&&r!==u||t.capture!==r.capture||t.once!==r.once||t.passive!==r.passive,o=t!==u&&(r===u||s);s&&this.element.removeEventListener(this.name,this,r),o&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){typeof this._$AH==\"function\"?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}},be=class{constructor(t,e,r){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(t){z(this,t)}};var dt=X.litHtmlPolyfillSupport;dt?.(te,re),(X.litHtmlVersions??(X.litHtmlVersions=[])).push(\"3.3.1\");var Oe=(i,t,e)=>{let r=e?.renderBefore??t,s=r._$litPart$;if(s===void 0){let o=e?.renderBefore??null;r._$litPart$=s=new re(t.insertBefore(Z(),o),o,void 0,e??{})}return s._$AI(i),s};var ie=globalThis,g=class extends N{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e;let t=super.createRenderRoot();return(e=this.renderOptions).renderBefore??(e.renderBefore=t.firstChild),t}update(t){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=Oe(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return L}};g._$litElement$=!0,g.finalized=!0,ie.litElementHydrateSupport?.({LitElement:g});var ct=ie.litElementPolyfillSupport;ct?.({LitElement:g});(ie.litElementVersions??(ie.litElementVersions=[])).push(\"4.2.1\");var y=i=>(t,e)=>{e!==void 0?e.addInitializer((()=>{customElements.define(i,t)})):customElements.define(i,t)};var pt={attribute:!0,type:String,converter:J,reflect:!1,hasChanged:ae},ut=(i=pt,t,e)=>{let{kind:r,metadata:s}=e,o=globalThis.litPropertyMetadata.get(s);if(o===void 0&&globalThis.litPropertyMetadata.set(s,o=new Map),r===\"setter\"&&((i=Object.create(i)).wrapped=!0),o.set(e.name,i),r===\"accessor\"){let{name:a}=e;return{set(p){let c=t.get.call(this);t.set.call(this,p),this.requestUpdate(a,c,i)},init(p){return p!==void 0&&this.C(a,void 0,i,p),p}}}if(r===\"setter\"){let{name:a}=e;return function(p){let c=this[a];t.call(this,p),this.requestUpdate(a,c,i)}}throw Error(\"Unsupported decorator location: \"+r)};function l(i){return(t,e)=>typeof e==\"object\"?ut(i,t,e):((r,s,o)=>{let a=s.hasOwnProperty(o);return s.constructor.createProperty(o,r),a?Object.getOwnPropertyDescriptor(s,o):void 0})(i,t,e)}function x(i){return l({...i,state:!0,attribute:!1})}var V=(i,t,e)=>(e.configurable=!0,e.enumerable=!0,Reflect.decorate&&typeof t!=\"object\"&&Object.defineProperty(i,t,e),e);var ht;function Be(i){return(t,e)=>V(t,e,{get(){return(this.renderRoot??ht??(ht=document.createDocumentFragment())).querySelectorAll(i)}})}var _=class extends g{constructor(){super();this.variant=\"primary\";this.type=\"button\";this.disabled=!1;this.fullWidth=!1;this.loading=!1;this.internals=this.attachInternals()}handleClick(){if(this.disabled||this.loading)return;let e=this.internals.form;e&&(this.type===\"submit\"?e.requestSubmit():this.type===\"reset\"&&e.reset())}render(){return d`\n <button\n part=\"button\"\n type=\"button\"\n ?disabled=${this.disabled||this.loading}\n aria-busy=${this.loading}\n @click=${this.handleClick}\n >\n ${this.loading?d`<span class=\"spinner\"></span>`:null}\n <slot></slot>\n </button>\n `}};_.formAssociated=!0,_.styles=v`\n :host {\n display: inline-block;\n }\n\n :host([full-width]) {\n display: block;\n width: 100%;\n }\n\n button {\n /* Base styles - matches AgentShield PreviewButton exactly */\n padding: 0.75rem 1rem;\n height: 2.75rem;\n border-radius: 0.5rem;\n font-size: 0.875rem;\n font-weight: 500;\n font-family: inherit;\n cursor: pointer;\n transition: opacity 0.15s ease, background-color 0.15s ease;\n border: none;\n width: 100%;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: 0.5rem;\n }\n\n /* Primary variant */\n :host([variant='primary']) button {\n background-color: var(--consent-primary, #2563eb);\n color: white;\n }\n\n :host([variant='primary']) button:hover:not(:disabled) {\n opacity: 0.9;\n }\n\n /* Secondary variant */\n :host([variant='secondary']) button {\n background-color: transparent;\n color: #374151;\n border: 1px solid #d1d5db;\n }\n\n :host([variant='secondary']) button:hover:not(:disabled) {\n background-color: #f9fafb;\n }\n\n /* Disabled state */\n button:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n\n /* Loading spinner */\n .spinner {\n width: 1rem;\n height: 1rem;\n border: 2px solid currentColor;\n border-top-color: transparent;\n border-radius: 50%;\n animation: spin 0.8s linear infinite;\n }\n\n @keyframes spin {\n to {\n transform: rotate(360deg);\n }\n }\n `,n([l({type:String,reflect:!0})],_.prototype,\"variant\",2),n([l({type:String})],_.prototype,\"type\",2),n([l({type:Boolean,reflect:!0})],_.prototype,\"disabled\",2),n([l({type:Boolean,attribute:\"full-width\"})],_.prototype,\"fullWidth\",2),n([l({type:Boolean,reflect:!0})],_.prototype,\"loading\",2),_=n([y(\"consent-button\")],_);var k=class extends g{constructor(){super();this.name=\"\";this.checked=!1;this.required=!1;this.disabled=!1;this.value=\"on\";this.internals=this.attachInternals()}updated(e){(e.has(\"checked\")||e.has(\"value\"))&&this.updateFormValue()}updateFormValue(){this.checked?this.internals.setFormValue(this.value):this.internals.setFormValue(null)}handleChange(e){let r=e.target;this.checked=r.checked,this.updateFormValue(),this.dispatchEvent(new CustomEvent(\"change\",{detail:{checked:this.checked,value:this.value},bubbles:!0,composed:!0}))}render(){return d`\n <label part=\"label\">\n <input\n part=\"checkbox\"\n type=\"checkbox\"\n name=${this.name}\n .value=${this.value}\n .checked=${this.checked}\n ?required=${this.required}\n ?disabled=${this.disabled}\n @change=${this.handleChange}\n />\n <span class=\"text\">\n <slot></slot>\n </span>\n </label>\n `}};k.formAssociated=!0,k.styles=v`\n :host {\n display: block;\n }\n\n label {\n display: flex;\n align-items: flex-start;\n gap: 0.75rem;\n cursor: pointer;\n font-size: 0.875rem;\n color: #374151;\n line-height: 1.5;\n }\n\n :host([disabled]) label {\n cursor: not-allowed;\n opacity: 0.6;\n }\n\n /* Custom checkbox styling - matches AgentShield exactly */\n input[type='checkbox'] {\n /* Reset */\n appearance: none;\n -webkit-appearance: none;\n margin: 0;\n\n /* Size - matches AgentShield w-4 h-4 */\n width: 1rem;\n height: 1rem;\n min-width: 1rem;\n margin-top: 0.125rem; /* Align with text baseline */\n\n /* Border */\n border: 1px solid #d1d5db;\n border-radius: 0.25rem;\n\n /* Background */\n background-color: white;\n\n /* Interaction */\n cursor: pointer;\n position: relative;\n transition: background-color 0.15s ease, border-color 0.15s ease;\n }\n\n input[type='checkbox']:hover:not(:disabled) {\n border-color: var(--consent-primary, #2563eb);\n }\n\n input[type='checkbox']:focus-visible {\n outline: 2px solid var(--consent-primary, #2563eb);\n outline-offset: 2px;\n }\n\n /* Checked state */\n input[type='checkbox']:checked {\n background-color: var(--consent-primary, #2563eb);\n border-color: var(--consent-primary, #2563eb);\n }\n\n /* Checkmark */\n input[type='checkbox']:checked::after {\n content: '';\n position: absolute;\n left: 4px;\n top: 1px;\n width: 5px;\n height: 9px;\n border: solid white;\n border-width: 0 2px 2px 0;\n transform: rotate(45deg);\n }\n\n /* Disabled */\n input[type='checkbox']:disabled {\n cursor: not-allowed;\n opacity: 0.5;\n }\n\n /* Text wrapper */\n .text {\n flex: 1;\n }\n\n /* Links in label */\n ::slotted(a) {\n color: var(--consent-primary, #2563eb);\n text-decoration: underline;\n }\n\n ::slotted(a:hover) {\n text-decoration: none;\n }\n `,n([l({type:String})],k.prototype,\"name\",2),n([l({type:Boolean,reflect:!0})],k.prototype,\"checked\",2),n([l({type:Boolean})],k.prototype,\"required\",2),n([l({type:Boolean,reflect:!0})],k.prototype,\"disabled\",2),n([l({type:String})],k.prototype,\"value\",2),k=n([y(\"consent-checkbox\")],k);var $=class extends g{constructor(){super();this.type=\"text\";this.name=\"\";this.value=\"\";this.label=\"\";this.placeholder=\"\";this.required=!1;this.disabled=!1;this.autocomplete=\"\";this.showPassword=!1;this.internals=this.attachInternals()}updated(e){e.has(\"value\")&&this.internals.setFormValue(this.value||null)}handleInput(e){let r=e.target;this.value=r.value,this.internals.setFormValue(this.value||null),this.dispatchEvent(new CustomEvent(\"input\",{detail:{value:this.value},bubbles:!0,composed:!0}))}handleChange(e){let r=e.target;this.value=r.value,this.dispatchEvent(new CustomEvent(\"change\",{detail:{value:this.value},bubbles:!0,composed:!0}))}togglePasswordVisibility(){this.showPassword=!this.showPassword}renderPasswordToggle(){if(this.type!==\"password\")return null;let e=this.showPassword?d`\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\">\n <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\"/>\n <line x1=\"1\" y1=\"1\" x2=\"23\" y2=\"23\"/>\n </svg>\n `:d`\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\">\n <path d=\"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z\"/>\n <circle cx=\"12\" cy=\"12\" r=\"3\"/>\n </svg>\n `;return d`\n <button\n type=\"button\"\n class=\"password-toggle\"\n @click=${this.togglePasswordVisibility}\n tabindex=\"-1\"\n aria-label=${this.showPassword?\"Hide password\":\"Show password\"}\n >\n ${e}\n </button>\n `}render(){let e=this.type===\"password\"&&this.showPassword?\"text\":this.type;return d`\n <div class=\"field\">\n ${this.label?d`\n <label part=\"label\" for=\"input\">\n ${this.label}${this.required?d`<span class=\"required\">*</span>`:null}\n </label>\n `:null}\n <div class=\"input-wrapper${this.error?\" has-error\":\"\"}\">\n <input\n part=\"input\"\n id=\"input\"\n type=${e}\n name=${this.name}\n .value=${this.value}\n placeholder=${this.placeholder}\n ?required=${this.required}\n ?disabled=${this.disabled}\n autocomplete=${this.autocomplete||\"off\"}\n @input=${this.handleInput}\n @change=${this.handleChange}\n />\n ${this.renderPasswordToggle()}\n </div>\n ${this.error?d`<div class=\"error-message\">${this.error}</div>`:null}\n </div>\n `}};$.formAssociated=!0,$.styles=v`\n :host {\n display: block;\n }\n\n .field {\n display: flex;\n flex-direction: column;\n gap: 0.375rem;\n }\n\n label {\n font-size: 0.875rem;\n font-weight: 500;\n color: #374151;\n }\n\n .input-wrapper {\n position: relative;\n display: flex;\n align-items: center;\n }\n\n /* Base input styles - use .input-wrapper for higher specificity */\n .input-wrapper input {\n width: 100%;\n padding: 0.625rem 0.75rem;\n font-size: 0.875rem;\n font-family: inherit;\n color: #111827;\n background-color: white;\n border: 1px solid #d1d5db;\n border-radius: 0.5rem;\n outline: none;\n box-shadow: none;\n transition: border-color 0.15s ease, box-shadow 0.15s ease;\n }\n\n .input-wrapper input:focus {\n border-color: var(--consent-primary, #2563eb);\n box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);\n }\n\n .input-wrapper input:disabled {\n background-color: #f9fafb;\n cursor: not-allowed;\n opacity: 0.6;\n }\n\n .input-wrapper input::placeholder {\n color: #9ca3af;\n }\n\n /* Prevent browser validation styling before user interaction */\n .input-wrapper input:invalid {\n border-color: #d1d5db;\n box-shadow: none;\n outline: none;\n background-color: white;\n }\n\n /* Override browser autofill styling */\n .input-wrapper input:-webkit-autofill,\n .input-wrapper input:-webkit-autofill:hover,\n .input-wrapper input:-webkit-autofill:focus {\n -webkit-box-shadow: 0 0 0 1000px white inset;\n -webkit-text-fill-color: #111827;\n border-color: #d1d5db;\n transition: background-color 5000s ease-in-out 0s;\n }\n\n /* Only show validation styling after user interaction */\n .input-wrapper input:user-invalid {\n border-color: #ef4444;\n }\n\n .input-wrapper input:user-invalid:focus {\n border-color: #ef4444;\n box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);\n }\n\n /* Password toggle */\n .input-wrapper input[type='password'] {\n padding-right: 2.5rem;\n }\n\n .password-toggle {\n position: absolute;\n right: 0.5rem;\n padding: 0.375rem;\n background: none;\n border: none;\n cursor: pointer;\n color: #6b7280;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n .password-toggle:hover {\n color: #374151;\n }\n\n .password-toggle svg {\n width: 1.25rem;\n height: 1.25rem;\n }\n\n /* Error state - use class instead of attribute for proper specificity */\n .input-wrapper.has-error input {\n border-color: #ef4444;\n }\n\n .input-wrapper.has-error input:focus {\n border-color: #ef4444;\n box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);\n }\n\n .error-message {\n font-size: 0.75rem;\n color: #ef4444;\n margin-top: 0.25rem;\n }\n\n /* Required indicator */\n .required {\n color: #ef4444;\n margin-left: 0.125rem;\n }\n `,n([l({type:String})],$.prototype,\"type\",2),n([l({type:String})],$.prototype,\"name\",2),n([l({type:String})],$.prototype,\"value\",2),n([l({type:String})],$.prototype,\"label\",2),n([l({type:String})],$.prototype,\"placeholder\",2),n([l({type:Boolean})],$.prototype,\"required\",2),n([l({type:Boolean,reflect:!0})],$.prototype,\"disabled\",2),n([l({type:String})],$.prototype,\"autocomplete\",2),n([l({type:String})],$.prototype,\"error\",2),n([x()],$.prototype,\"showPassword\",2),$=n([y(\"consent-input\")],$);var U=class extends g{constructor(){super(...arguments);this.pageTitle=\"Permission Request\";this.primaryColor=\"#2563EB\";this.secondaryColor=\"#DBEAFE\"}renderLogo(){return this.logoUrl?d`\n <img\n class=\"logo\"\n src=${this.logoUrl}\n alt=${this.companyName||\"Company logo\"}\n />\n `:d`\n <div class=\"default-icon\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n >\n <path\n d=\"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z\"\n fill=\"currentColor\"\n opacity=\"0.2\"\n />\n <path d=\"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z\" />\n </svg>\n </div>\n `}updated(e){(e.has(\"primaryColor\")||e.has(\"secondaryColor\"))&&(this.style.setProperty(\"--consent-primary\",this.primaryColor),this.style.setProperty(\"--consent-secondary\",this.secondaryColor))}render(){return d`\n <div class=\"container\" part=\"container\">\n <header class=\"header\" part=\"header\">\n ${this.renderLogo()}\n ${this.companyName?d`<div class=\"company-name\">${this.companyName}</div>`:null}\n <h1 class=\"title\">${this.pageTitle}</h1>\n </header>\n\n <div class=\"content\" part=\"content\">\n <slot name=\"content\"></slot>\n </div>\n\n <footer class=\"footer\" part=\"footer\">\n <slot name=\"footer\"></slot>\n </footer>\n </div>\n `}};U.styles=v`\n :host {\n display: block;\n /* System font stack with font smoothing for crisp text */\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,\n 'Helvetica Neue', Arial, sans-serif;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n /* Allow customization via CSS variables */\n --_primary: var(--consent-primary, #2563eb);\n --_secondary: var(--consent-secondary, #dbeafe);\n }\n\n /* Container - matches AgentShield PreviewShell exactly */\n .container {\n background: white;\n border-radius: 20px;\n border: 1px solid rgba(0, 0, 0, 0.1);\n box-shadow:\n 0 20px 25px -5px rgba(0, 0, 0, 0.1),\n 0 8px 10px -6px rgba(0, 0, 0, 0.1);\n overflow: hidden;\n max-width: 512px;\n width: 100%;\n margin: 0 auto;\n }\n\n /* Header */\n .header {\n padding: 1.25rem 2rem 0;\n text-align: center;\n }\n\n .logo {\n max-height: 48px;\n max-width: 200px;\n margin-bottom: 0.5rem;\n }\n\n .company-name {\n font-size: 0.875rem;\n color: #6b7280;\n margin-bottom: 0.5rem;\n }\n\n .title {\n font-size: 1.5rem;\n font-weight: 700;\n color: #333333;\n margin: 0;\n }\n\n /* Content */\n .content {\n padding: 1rem 2rem 2rem;\n }\n\n /* Footer */\n .footer {\n padding: 0 2rem 2rem;\n display: flex;\n gap: 0.75rem;\n }\n\n .footer ::slotted(*) {\n flex: 1;\n }\n\n /* Default icon when no logo */\n .default-icon {\n width: 48px;\n height: 48px;\n margin: 0 auto 0.5rem;\n background: var(--_secondary);\n border-radius: 12px;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n .default-icon svg {\n width: 24px;\n height: 24px;\n color: var(--_primary);\n }\n `,n([l({type:String,attribute:\"page-title\"})],U.prototype,\"pageTitle\",2),n([l({type:String,attribute:\"logo-url\"})],U.prototype,\"logoUrl\",2),n([l({type:String,attribute:\"company-name\"})],U.prototype,\"companyName\",2),n([l({type:String,attribute:\"primary-color\"})],U.prototype,\"primaryColor\",2),n([l({type:String,attribute:\"secondary-color\"})],U.prototype,\"secondaryColor\",2),U=n([y(\"consent-shell\")],U);var I=class extends g{constructor(){super(...arguments);this.scopes=[];this.interactive=!1;this.selectAll=!1;this.iconStyle=\"check\";this.selectedScopes=new Set;this.previousScopeIds=new Set}connectedCallback(){super.connectedCallback(),this.interactive&&this.initializeSelectedScopes()}updated(e){e.has(\"scopes\")&&this.interactive&&this.reinitializeSelectedScopes()}reinitializeSelectedScopes(){let e=new Set(this.normalizedScopes.map(o=>o.id)),r=new Set(Array.from(this.selectedScopes).filter(o=>e.has(o))),s=Array.from(e).filter(o=>!this.previousScopeIds.has(o));if(this.selectAll)this.selectedScopes=new Set([...r,...s]);else{let o=this.normalizedScopes.filter(a=>a.required).map(a=>a.id);this.selectedScopes=new Set([...r,...o])}this.previousScopeIds=e,this.dispatchEvent(new CustomEvent(\"change\",{detail:{selected:this.getSelectedScopes()},bubbles:!0,composed:!0}))}initializeSelectedScopes(){this.previousScopeIds=new Set(this.normalizedScopes.map(e=>e.id)),this.selectAll?this.selectedScopes=new Set(this.normalizedScopes.map(e=>e.id)):this.selectedScopes=new Set(this.normalizedScopes.filter(e=>e.required).map(e=>e.id))}get normalizedScopes(){return this.scopes.map(e=>typeof e==\"string\"?{id:e,label:this.formatScopeLabel(e)}:e)}formatScopeLabel(e){return e.replace(/[_:-]/g,\" \").replace(/\\b\\w/g,r=>r.toUpperCase())}getSelectedScopes(){return Array.from(this.selectedScopes)}handleCheckboxChange(e,r){r?this.selectedScopes.add(e):this.selectedScopes.delete(e),this.requestUpdate(),this.dispatchEvent(new CustomEvent(\"change\",{detail:{selected:this.getSelectedScopes()},bubbles:!0,composed:!0}))}renderIcon(){switch(this.iconStyle){case\"bullet\":return d`<div class=\"icon icon-bullet\"></div>`;case\"shield\":return d`\n <div class=\"icon icon-shield\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n >\n <path d=\"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z\" />\n </svg>\n </div>\n `;default:return d`\n <div class=\"icon icon-check\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n >\n <polyline points=\"20 6 9 17 4 12\" />\n </svg>\n </div>\n `}}renderPermissionItem(e){let r=this.selectedScopes.has(e.id);return d`\n <li class=\"permission-item\" part=\"item\">\n ${this.interactive?d`\n <input\n type=\"checkbox\"\n class=\"checkbox\"\n .checked=${r}\n ?disabled=${e.required}\n @change=${s=>this.handleCheckboxChange(e.id,s.target.checked)}\n aria-label=${e.label}\n />\n `:this.renderIcon()}\n <div class=\"content\">\n <span class=\"label\">\n ${e.label}\n ${e.required?d`<span class=\"required-badge\">Required</span>`:null}\n </span>\n ${e.description?d`<div class=\"description\">${e.description}</div>`:null}\n </div>\n </li>\n `}render(){let e=this.normalizedScopes;return e.length===0?d`<div class=\"empty\">No permissions requested</div>`:d`\n <ul class=\"permission-list\" part=\"list\" role=\"list\">\n ${e.map(r=>this.renderPermissionItem(r))}\n </ul>\n `}};I.styles=v`\n :host {\n display: block;\n --_primary: var(--consent-primary, #2563eb);\n }\n\n .permission-list {\n list-style: none;\n padding: 0;\n margin: 0;\n }\n\n .permission-item {\n display: flex;\n align-items: flex-start;\n gap: 0.75rem;\n padding: 0.625rem 0;\n font-size: 0.875rem;\n color: #374151;\n border-bottom: 1px solid #f3f4f6;\n }\n\n .permission-item:last-child {\n border-bottom: none;\n }\n\n /* Icon styles */\n .icon {\n flex-shrink: 0;\n width: 1.25rem;\n height: 1.25rem;\n margin-top: 0.0625rem;\n }\n\n .icon-check {\n background: var(--_primary);\n border-radius: 0.25rem;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n .icon-check svg {\n width: 0.75rem;\n height: 0.75rem;\n color: white;\n }\n\n .icon-bullet {\n background: var(--_primary);\n border-radius: 50%;\n width: 0.5rem;\n height: 0.5rem;\n margin: 0.375rem;\n }\n\n .icon-shield {\n color: var(--_primary);\n }\n\n .icon-shield svg {\n width: 1.25rem;\n height: 1.25rem;\n }\n\n /* Content */\n .content {\n flex: 1;\n }\n\n .label {\n font-weight: 500;\n color: #111827;\n }\n\n .description {\n font-size: 0.75rem;\n color: #6b7280;\n margin-top: 0.125rem;\n }\n\n .required-badge {\n font-size: 0.625rem;\n text-transform: uppercase;\n letter-spacing: 0.05em;\n color: #6b7280;\n background: #f3f4f6;\n padding: 0.125rem 0.375rem;\n border-radius: 0.25rem;\n margin-left: 0.5rem;\n }\n\n /* Interactive mode checkbox */\n .checkbox {\n appearance: none;\n -webkit-appearance: none;\n width: 1rem;\n height: 1rem;\n border: 1px solid #d1d5db;\n border-radius: 0.25rem;\n background: white;\n cursor: pointer;\n position: relative;\n flex-shrink: 0;\n margin-top: 0.125rem;\n }\n\n .checkbox:checked {\n background: var(--_primary);\n border-color: var(--_primary);\n }\n\n .checkbox:checked::after {\n content: '';\n position: absolute;\n left: 4px;\n top: 1px;\n width: 5px;\n height: 9px;\n border: solid white;\n border-width: 0 2px 2px 0;\n transform: rotate(45deg);\n }\n\n .checkbox:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n\n .checkbox:focus-visible {\n outline: 2px solid var(--_primary);\n outline-offset: 2px;\n }\n\n /* Empty state */\n .empty {\n text-align: center;\n color: #6b7280;\n font-size: 0.875rem;\n padding: 1rem 0;\n }\n `,n([l({type:Array,converter:{fromAttribute:e=>{if(!e)return[];try{let r=JSON.parse(e);return Array.isArray(r)?r:(console.warn(\"[consent-permissions] Expected array, got:\",typeof r),[])}catch{return[]}},toAttribute:e=>JSON.stringify(e)}})],I.prototype,\"scopes\",2),n([l({type:Boolean})],I.prototype,\"interactive\",2),n([l({type:Boolean,attribute:\"select-all\"})],I.prototype,\"selectAll\",2),n([l({type:String,attribute:\"icon-style\"})],I.prototype,\"iconStyle\",2),n([x()],I.prototype,\"selectedScopes\",2),I=n([y(\"consent-permissions\")],I);var w=class extends g{constructor(){super();this.name=\"termsAccepted\";this.text=\"Terms and Conditions\";this.labelPrefix=\"I agree to the\";this.conjunction=\"and\";this.checked=!1;this.required=!0;this.disabled=!1;this.value=\"accepted\";this.internals=this.attachInternals()}updated(e){(e.has(\"checked\")||e.has(\"value\"))&&this.updateFormValue()}updateFormValue(){this.checked?this.internals.setFormValue(this.value):this.internals.setFormValue(null)}handleChange(e){let r=e.target;this.checked=r.checked,this.updateFormValue(),this.dispatchEvent(new CustomEvent(\"change\",{detail:{checked:this.checked,value:this.value},bubbles:!0,composed:!0}))}renderLink(e,r){return r?d`<a\n href=${r}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n part=\"link\"\n @click=${s=>s.stopPropagation()}\n >${e}</a\n >`:d`<span>${e}</span>`}render(){let e=this.privacyText&&this.privacyUrl;return d`\n <label part=\"label\">\n <input\n part=\"checkbox\"\n type=\"checkbox\"\n name=${this.name}\n .value=${this.value}\n .checked=${this.checked}\n ?required=${this.required}\n ?disabled=${this.disabled}\n @change=${this.handleChange}\n />\n <span class=\"text\">\n ${this.labelPrefix} ${this.renderLink(this.text,this.url)}\n ${e?d`\n ${this.conjunction}\n ${this.renderLink(this.privacyText,this.privacyUrl)}\n `:u}\n ${this.required?d`<span class=\"required\">*</span>`:u}\n </span>\n </label>\n `}};w.formAssociated=!0,w.styles=v`\n :host {\n display: block;\n --_primary: var(--consent-primary, #2563eb);\n }\n\n label {\n display: flex;\n align-items: flex-start;\n gap: 0.75rem;\n cursor: pointer;\n font-size: 0.875rem;\n color: #374151;\n line-height: 1.5;\n }\n\n :host([disabled]) label {\n cursor: not-allowed;\n opacity: 0.6;\n }\n\n /* Custom checkbox styling - matches AgentShield exactly */\n input[type='checkbox'] {\n appearance: none;\n -webkit-appearance: none;\n margin: 0;\n\n /* Size - matches AgentShield w-4 h-4 */\n width: 1rem;\n height: 1rem;\n min-width: 1rem;\n margin-top: 0.125rem;\n\n /* Border */\n border: 1px solid #d1d5db;\n border-radius: 0.25rem;\n\n /* Background */\n background-color: white;\n\n /* Interaction */\n cursor: pointer;\n position: relative;\n transition: background-color 0.15s ease, border-color 0.15s ease;\n }\n\n input[type='checkbox']:hover:not(:disabled) {\n border-color: var(--_primary);\n }\n\n input[type='checkbox']:focus-visible {\n outline: 2px solid var(--_primary);\n outline-offset: 2px;\n }\n\n /* Checked state */\n input[type='checkbox']:checked {\n background-color: var(--_primary);\n border-color: var(--_primary);\n }\n\n /* Checkmark */\n input[type='checkbox']:checked::after {\n content: '';\n position: absolute;\n left: 4px;\n top: 1px;\n width: 5px;\n height: 9px;\n border: solid white;\n border-width: 0 2px 2px 0;\n transform: rotate(45deg);\n }\n\n /* Disabled */\n input[type='checkbox']:disabled {\n cursor: not-allowed;\n opacity: 0.5;\n }\n\n /* Text wrapper */\n .text {\n flex: 1;\n }\n\n /* Links */\n a {\n color: var(--_primary);\n text-decoration: underline;\n text-underline-offset: 2px;\n }\n\n a:hover {\n text-decoration: none;\n }\n\n a:focus-visible {\n outline: 2px solid var(--_primary);\n outline-offset: 2px;\n border-radius: 2px;\n }\n\n /* Required indicator */\n .required {\n color: #ef4444;\n margin-left: 0.125rem;\n }\n `,n([l({type:String})],w.prototype,\"name\",2),n([l({type:String})],w.prototype,\"text\",2),n([l({type:String})],w.prototype,\"url\",2),n([l({type:String,attribute:\"privacy-text\"})],w.prototype,\"privacyText\",2),n([l({type:String,attribute:\"privacy-url\"})],w.prototype,\"privacyUrl\",2),n([l({type:String,attribute:\"label-prefix\"})],w.prototype,\"labelPrefix\",2),n([l({type:String})],w.prototype,\"conjunction\",2),n([l({type:Boolean,reflect:!0})],w.prototype,\"checked\",2),n([l({type:Boolean})],w.prototype,\"required\",2),n([l({type:Boolean,reflect:!0})],w.prototype,\"disabled\",2),n([l({type:String})],w.prototype,\"value\",2),w=n([y(\"consent-terms\")],w);var Fe={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},ce=i=>(...t)=>({_$litDirective$:i,values:t}),de=class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,r){this._$Ct=t,this._$AM=e,this._$Ci=r}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}};var H=class extends de{constructor(t){if(super(t),this.it=u,t.type!==Fe.CHILD)throw Error(this.constructor.directiveName+\"() can only be used in child bindings\")}render(t){if(t===u||t==null)return this._t=void 0,this.it=t;if(t===L)return t;if(typeof t!=\"string\")throw Error(this.constructor.directiveName+\"() called with a non-string value\");if(t===this.it)return this._t;this.it=t;let e=[t];return e.raw=e,this._t={_$litType$:this.constructor.resultType,strings:e,values:[]}}};H.directiveName=\"unsafeHTML\",H.resultType=1;var Gr=ce(H);var se=class extends H{};se.directiveName=\"unsafeSVG\",se.resultType=2;var He=ce(se);function mt(i){if(!i||typeof i!=\"string\")return\"\";let t=i.replace(/<script\\b[^<]*(?:(?!<\\/script>)<[^<]*)*<\\/script>/gi,\"\");return t=t.replace(/\\s*on\\w+\\s*=\\s*[\"'][^\"']*[\"']/gi,\"\"),t=t.replace(/\\s*on\\w+\\s*=\\s*[^\\s>]*/gi,\"\"),t=t.replace(/(href|src|xlink:href)\\s*=\\s*[\"']?\\s*javascript:[^\"'>\\s]*/gi,'$1=\"\"'),t=t.replace(/(href|src|xlink:href)\\s*=\\s*[\"']?\\s*data:[^\"'>\\s]*/gi,'$1=\"\"'),t=t.replace(/data:text\\/html[^\"'>\\s]*/gi,\"\"),t}var qe={google:{name:\"Google\",bgColor:\"#ffffff\",textColor:\"#374151\",borderColor:\"#d1d5db\",hoverBgColor:\"#f9fafb\"},microsoft:{name:\"Microsoft\",bgColor:\"#2f2f2f\",textColor:\"#ffffff\",borderColor:\"#2f2f2f\",hoverBgColor:\"#1f1f1f\"},apple:{name:\"Apple\",bgColor:\"#000000\",textColor:\"#ffffff\",borderColor:\"#000000\",hoverBgColor:\"#1a1a1a\"},github:{name:\"GitHub\",bgColor:\"#24292f\",textColor:\"#ffffff\",borderColor:\"#24292f\",hoverBgColor:\"#1b1f23\"},twitter:{name:\"Twitter\",bgColor:\"#1da1f2\",textColor:\"#ffffff\",borderColor:\"#1da1f2\",hoverBgColor:\"#0c8de4\"},facebook:{name:\"Facebook\",bgColor:\"#1877f2\",textColor:\"#ffffff\",borderColor:\"#1877f2\",hoverBgColor:\"#0b5ed7\"},custom:{name:\"Sign in\",bgColor:\"#ffffff\",textColor:\"#374151\",borderColor:\"#d1d5db\",hoverBgColor:\"#f9fafb\"}},A=class extends g{constructor(){super(...arguments);this.provider=\"custom\";this.url=\"\";this.loading=!1;this.disabled=!1;this.fullWidth=!1;this.redirecting=!1}get config(){return qe[this.provider]||qe.custom}get displayName(){return this.providerName?this.providerName:this.config.name}get displayText(){return this.buttonText?this.buttonText:`Continue with ${this.displayName}`}handleClick(){this.disabled||this.loading||this.redirecting||(this.url&&(this.redirecting=!0,window.location.href=this.url),this.dispatchEvent(new CustomEvent(\"oauth-click\",{detail:{provider:this.provider,url:this.url},bubbles:!0,composed:!0})))}renderProviderIcon(){if(this.customIcon){let e=mt(this.customIcon);return d`<div class=\"icon\">${He(e)}</div>`}switch(this.provider){case\"google\":return d`\n <div class=\"icon\">\n <svg viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fill=\"#4285F4\"\n d=\"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z\"\n />\n <path\n fill=\"#34A853\"\n d=\"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z\"\n />\n <path\n fill=\"#FBBC05\"\n d=\"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z\"\n />\n <path\n fill=\"#EA4335\"\n d=\"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z\"\n />\n </svg>\n </div>\n `;case\"microsoft\":return d`\n <div class=\"icon\">\n <svg viewBox=\"0 0 21 21\" xmlns=\"http://www.w3.org/2000/svg\">\n <rect x=\"1\" y=\"1\" width=\"9\" height=\"9\" fill=\"#f25022\" />\n <rect x=\"1\" y=\"11\" width=\"9\" height=\"9\" fill=\"#00a4ef\" />\n <rect x=\"11\" y=\"1\" width=\"9\" height=\"9\" fill=\"#7fba00\" />\n <rect x=\"11\" y=\"11\" width=\"9\" height=\"9\" fill=\"#ffb900\" />\n </svg>\n </div>\n `;case\"apple\":return d`\n <div class=\"icon\">\n <svg viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fill=\"currentColor\"\n d=\"M17.05 20.28c-.98.95-2.05.8-3.08.35-1.09-.46-2.09-.48-3.24 0-1.44.62-2.2.44-3.06-.35C2.79 15.25 3.51 7.59 9.05 7.31c1.35.07 2.29.74 3.08.8 1.18-.24 2.31-.93 3.57-.84 1.51.12 2.65.72 3.4 1.8-3.12 1.87-2.38 5.98.48 7.13-.57 1.5-1.31 2.99-2.54 4.09l.01-.01zM12.03 7.25c-.15-2.23 1.66-4.07 3.74-4.25.29 2.58-2.34 4.5-3.74 4.25z\"\n />\n </svg>\n </div>\n `;case\"github\":return d`\n <div class=\"icon\">\n <svg viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fill=\"currentColor\"\n d=\"M12 2C6.477 2 2 6.477 2 12c0 4.42 2.865 8.17 6.839 9.49.5.092.682-.217.682-.482 0-.237-.008-.866-.013-1.7-2.782.604-3.369-1.34-3.369-1.34-.454-1.156-1.11-1.464-1.11-1.464-.908-.62.069-.608.069-.608 1.003.07 1.531 1.03 1.531 1.03.892 1.529 2.341 1.087 2.91.831.092-.646.35-1.086.636-1.336-2.22-.253-4.555-1.11-4.555-4.943 0-1.091.39-1.984 1.029-2.683-.103-.253-.446-1.27.098-2.647 0 0 .84-.269 2.75 1.025A9.578 9.578 0 0112 6.836c.85.004 1.705.114 2.504.336 1.909-1.294 2.747-1.025 2.747-1.025.546 1.377.203 2.394.1 2.647.64.699 1.028 1.592 1.028 2.683 0 3.842-2.339 4.687-4.566 4.935.359.309.678.919.678 1.852 0 1.336-.012 2.415-.012 2.743 0 .267.18.578.688.48C19.138 20.167 22 16.418 22 12c0-5.523-4.477-10-10-10z\"\n />\n </svg>\n </div>\n `;case\"twitter\":return d`\n <div class=\"icon\">\n <svg viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fill=\"currentColor\"\n d=\"M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z\"\n />\n </svg>\n </div>\n `;case\"facebook\":return d`\n <div class=\"icon\">\n <svg viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n fill=\"currentColor\"\n d=\"M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z\"\n />\n </svg>\n </div>\n `;default:return u}}updated(e){if(e.has(\"provider\")){let r=this.config;this.style.setProperty(\"--button-bg\",r.bgColor),this.style.setProperty(\"--button-text\",r.textColor),this.style.setProperty(\"--button-border\",r.borderColor),this.style.setProperty(\"--button-hover-bg\",r.hoverBgColor)}}render(){let e=this.loading||this.redirecting;return d`\n <button\n part=\"button\"\n type=\"button\"\n ?disabled=${this.disabled||e}\n @click=${this.handleClick}\n style=\"\n background-color: var(--button-bg, ${this.config.bgColor});\n color: var(--button-text, ${this.config.textColor});\n border: 1px solid var(--button-border, ${this.config.borderColor});\n \"\n aria-busy=${e}\n >\n ${e?d`<span class=\"spinner\"></span>`:this.renderProviderIcon()}\n <span class=\"text\" part=\"text\">${this.displayText}</span>\n </button>\n `}};A.styles=v`\n :host {\n display: inline-block;\n }\n\n :host([full-width]) {\n display: block;\n width: 100%;\n }\n\n button {\n width: 100%;\n padding: 0.75rem 1rem;\n height: 2.75rem;\n border-radius: 0.5rem;\n font-size: 0.875rem;\n font-weight: 500;\n font-family: inherit;\n cursor: pointer;\n transition: background-color 0.15s ease, opacity 0.15s ease;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: 0.75rem;\n }\n\n button:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n\n button:focus-visible {\n outline: 2px solid #2563eb;\n outline-offset: 2px;\n }\n\n .icon {\n width: 1.125rem;\n height: 1.125rem;\n flex-shrink: 0;\n }\n\n .icon svg {\n width: 100%;\n height: 100%;\n }\n\n /* Loading spinner */\n .spinner {\n width: 1rem;\n height: 1rem;\n border: 2px solid currentColor;\n border-top-color: transparent;\n border-radius: 50%;\n animation: spin 0.8s linear infinite;\n }\n\n @keyframes spin {\n to {\n transform: rotate(360deg);\n }\n }\n\n .text {\n flex: 1;\n text-align: center;\n }\n `,n([l({type:String})],A.prototype,\"provider\",2),n([l({type:String,attribute:\"provider-name\"})],A.prototype,\"providerName\",2),n([l({type:String})],A.prototype,\"url\",2),n([l({type:String,attribute:\"button-text\"})],A.prototype,\"buttonText\",2),n([l({type:Boolean,reflect:!0})],A.prototype,\"loading\",2),n([l({type:Boolean,reflect:!0})],A.prototype,\"disabled\",2),n([l({type:Boolean,attribute:\"full-width\"})],A.prototype,\"fullWidth\",2),n([l({type:String,attribute:\"custom-icon\"})],A.prototype,\"customIcon\",2),n([x()],A.prototype,\"redirecting\",2),A=n([y(\"consent-oauth-button\")],A);var E=class extends g{constructor(){super();this.length=6;this.name=\"otp\";this.value=\"\";this.disabled=!1;this.error=!1;this.autoFocus=!1;this.inputType=\"text\";this.digits=[];this.internals=this.attachInternals()}connectedCallback(){super.connectedCallback(),this.initializeDigits()}initializeDigits(){this.digits=Array.from({length:this.length},()=>\"\"),this.value&&this.value.replace(/\\D/g,\"\").slice(0,this.length).split(\"\").forEach((s,o)=>{this.digits[o]=s})}firstUpdated(){this.autoFocus&&this.inputs.length>0&&this.inputs[0]?.focus()}updated(e){e.has(\"value\")&&!e.has(\"digits\")&&this.initializeDigits(),e.has(\"length\")&&this.initializeDigits();let r=this.digits.join(\"\");this.internals.setFormValue(r||null)}getFullValue(){return this.digits.join(\"\")}handleInput(e,r){let s=r.target,o=s.value;if(o.length>1&&(o=o.slice(-1)),o&&!/^\\d$/.test(o)){s.value=this.digits[e]??\"\";return}this.digits[e]=o,this.digits=[...this.digits],s.value=o;let a=this.getFullValue();this.value=a,this.dispatchEvent(new CustomEvent(\"input\",{detail:{value:a,index:e,digit:o},bubbles:!0,composed:!0})),o&&e<this.length-1&&this.inputs[e+1]?.focus(),a.length===this.length&&this.dispatchEvent(new CustomEvent(\"complete\",{detail:{value:a},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(\"change\",{detail:{value:a},bubbles:!0,composed:!0}))}handleKeyDown(e,r){switch(r.key){case\"Backspace\":!this.digits[e]&&e>0?(r.preventDefault(),this.inputs[e-1]?.focus(),this.digits[e-1]=\"\",this.digits=[...this.digits]):(this.digits[e]=\"\",this.digits=[...this.digits]),this.value=this.getFullValue();break;case\"ArrowLeft\":r.preventDefault(),e>0&&this.inputs[e-1]?.focus();break;case\"ArrowRight\":r.preventDefault(),e<this.length-1&&this.inputs[e+1]?.focus();break;case\"Delete\":this.digits[e]=\"\",this.digits=[...this.digits],this.value=this.getFullValue();break}}handlePaste(e){e.preventDefault();let s=(e.clipboardData?.getData(\"text\")||\"\").replace(/\\D/g,\"\").slice(0,this.length);if(s){this.digits=Array.from({length:this.length},(a,p)=>s[p]||\"\"),this.value=this.getFullValue(),this.requestUpdate();let o=Math.min(s.length,this.length-1);setTimeout(()=>{this.inputs[o]?.focus()},0),this.dispatchEvent(new CustomEvent(\"input\",{detail:{value:this.value,index:0,digit:s[0]||\"\"},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(\"change\",{detail:{value:this.value},bubbles:!0,composed:!0})),s.length===this.length&&this.dispatchEvent(new CustomEvent(\"complete\",{detail:{value:this.value},bubbles:!0,composed:!0}))}}handleFocus(e){e.target.select()}focus(){let e=this.digits.findIndex(s=>!s),r=e>=0?e:this.length-1;this.inputs[r]?.focus()}clear(){this.digits=Array.from({length:this.length},()=>\"\"),this.value=\"\",this.inputs[0]?.focus()}renderDigitInput(e){let r=this.digits[e]||\"\",s=r!==\"\";return d`\n <input\n part=\"input\"\n type=${this.inputType}\n inputmode=\"numeric\"\n pattern=\"[0-9]*\"\n maxlength=\"1\"\n .value=${r}\n ?disabled=${this.disabled}\n placeholder=\"○\"\n class=${s?\"filled\":\"\"}\n @input=${o=>this.handleInput(e,o)}\n @keydown=${o=>this.handleKeyDown(e,o)}\n @paste=${this.handlePaste}\n @focus=${this.handleFocus}\n aria-label=${`Digit ${e+1} of ${this.length}`}\n />\n `}render(){return d`\n <div class=\"container\" part=\"container\" role=\"group\" aria-label=\"One-time password input\">\n ${Array.from({length:this.length},(e,r)=>this.renderDigitInput(r))}\n </div>\n `}};E.formAssociated=!0,E.styles=v`\n :host {\n display: block;\n --_primary: var(--consent-primary, #2563eb);\n }\n\n .container {\n display: flex;\n gap: 0.5rem;\n justify-content: center;\n }\n\n input {\n width: 2.75rem;\n height: 3.5rem;\n text-align: center;\n font-size: 1.5rem;\n font-weight: 600;\n font-family: inherit;\n color: #111827;\n background: white;\n border: 1px solid #d1d5db;\n border-radius: 0.5rem;\n outline: none;\n transition: border-color 0.15s ease, box-shadow 0.15s ease;\n\n /* Hide spinner for number inputs */\n -moz-appearance: textfield;\n }\n\n input::-webkit-outer-spin-button,\n input::-webkit-inner-spin-button {\n -webkit-appearance: none;\n margin: 0;\n }\n\n input:focus {\n border-color: var(--_primary);\n box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);\n }\n\n input:disabled {\n background: #f9fafb;\n cursor: not-allowed;\n opacity: 0.6;\n }\n\n input::placeholder {\n color: #d1d5db;\n }\n\n /* Error state */\n :host([error]) input {\n border-color: #ef4444;\n }\n\n :host([error]) input:focus {\n border-color: #ef4444;\n box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);\n }\n\n /* Filled state */\n input.filled {\n border-color: var(--_primary);\n background: #f0f9ff;\n }\n\n /* Responsive: smaller on mobile */\n @media (max-width: 400px) {\n input {\n width: 2.25rem;\n height: 3rem;\n font-size: 1.25rem;\n }\n\n .container {\n gap: 0.375rem;\n }\n }\n `,n([l({type:Number})],E.prototype,\"length\",2),n([l({type:String})],E.prototype,\"name\",2),n([l({type:String})],E.prototype,\"value\",2),n([l({type:Boolean,reflect:!0})],E.prototype,\"disabled\",2),n([l({type:Boolean,reflect:!0})],E.prototype,\"error\",2),n([l({type:Boolean,attribute:\"auto-focus\"})],E.prototype,\"autoFocus\",2),n([l({type:String,attribute:\"input-type\"})],E.prototype,\"inputType\",2),n([x()],E.prototype,\"digits\",2),n([Be(\"input\")],E.prototype,\"inputs\",2),E=n([y(\"consent-otp-input\")],E);var S={CONSENT_ONLY:\"consent-only\",CREDENTIALS:\"credentials\",OAUTH:\"oauth\",MAGIC_LINK:\"magic-link\",OTP:\"otp\",QR_CODE:\"qr-code\",PASSKEY:\"passkey\",IDV:\"idv\"};var G={PRIMARY:\"#2563EB\",SECONDARY:\"#DBEAFE\",BACKGROUND:\"#F9FAFB\",TEXT_PRIMARY:\"#111827\",TEXT_SECONDARY:\"#6B7280\",TEXT_MUTED:\"#9CA3AF\",BORDER:\"#E5E7EB\",BORDER_DARK:\"#D1D5DB\",SUCCESS:\"#16A34A\",ERROR:\"#DC2626\",WARNING:\"#F59E0B\"};var hi={primaryColor:G.PRIMARY,secondaryColor:G.SECONDARY,logoUrl:void 0,companyName:void 0},C={title:\"Permission request\",description:\"It looks like you would like to use [AI Agent] to access resources on your behalf.\",expirationText:\"This delegation will expire in\",cancelButtonText:\"Cancel\",submitButtonText:\"Allow access\",permissionsHeader:\"The agent is requesting the following permissions:\",autoClose:!1,popupEnabled:!1,theme:\"auto\"},Y={text:\"Terms and Conditions\",url:void 0,version:void 0,required:!0},D={title:\"Access Granted\",description:\"The agent now has permission to act on your behalf.\",showCredential:!0,redirectUrl:void 0,redirectDelay:void 0,continueButtonText:\"Close\"};var ze=30;function gt(i){return i?/^#[0-9A-Fa-f]{6}$/.test(i):!1}function je(i,t){return gt(i)?i:t}function ft(i){if(!i)return!1;try{let t=new URL(i);return t.protocol===\"http:\"||t.protocol===\"https:\"}catch{return!1}}function vt(i){if(ft(i))return i}function Ve(i){let t=i.replace(/^#/,\"\"),e=parseInt(t.slice(0,2),16),r=parseInt(t.slice(2,4),16),s=parseInt(t.slice(4,6),16);return`${e}, ${r}, ${s}`}function bt(i){return{\"--consent-primary\":i.primaryColor,\"--consent-secondary\":i.secondaryColor,\"--consent-primary-rgb\":Ve(i.primaryColor),\"--consent-secondary-rgb\":Ve(i.secondaryColor)}}function Ge(i){let t=je(i?.primaryColor,G.PRIMARY),e=je(i?.secondaryColor,G.SECONDARY),r=vt(i?.logoUrl),s=i?.companyName?.trim()||void 0,o=bt({primaryColor:t,secondaryColor:e});return{primaryColor:t,secondaryColor:e,logoUrl:r,companyName:s,cssVars:o}}var yt=\"[AI Agent]\";function Ye(i,t){return t?i.replace(new RegExp(xt(yt),\"g\"),t):i}function xt(i){return i.replace(/[.*+?^${}()|[\\]\\\\]/g,\"\\\\$&\")}function Ke(i,t){let e=i?.ui??{},r=i?.terms??{},s=i?.success??{},o=e.title??C.title,a=e.description??C.description,p=e.expirationText??C.expirationText,c=e.cancelButtonText??C.cancelButtonText,f=e.submitButtonText??C.submitButtonText,b=e.permissionsHeader??C.permissionsHeader,h=r.text??Y.text,T=s.title??D.title,R=s.description??D.description,q=Ye(a,t),We=Ye(R,t);return{title:o,description:a,expirationText:p,cancelButtonText:c,submitButtonText:f,permissionsHeader:b,termsText:h,termsUrl:r.url,termsRequired:r.required??Y.required,resolvedDescription:q,successTitle:T,successDescription:R,resolvedSuccessDescription:We,showCredential:s.showCredential??D.showCredential,continueButtonText:s.continueButtonText??D.continueButtonText}}function wt(i){return!i||i.length===0?[]:i.slice(0,10).filter(e=>!(!e.name||!e.label||!/^[a-zA-Z0-9_]+$/.test(e.name)||e.type===\"select\"&&(!e.options||e.options.length===0)))}function $t(i){return i==null?ze:i<1?1:i>365?365:Math.floor(i)}function we(i){return i?.oauth?.providerId?S.OAUTH:i?.credentials?.usernameLabel||i?.credentials?.passwordLabel?S.CREDENTIALS:i?.magicLink?.enabled?S.MAGIC_LINK:i?.otp?.enabled?S.OTP:S.CONSENT_ONLY}function Ct(i){return{title:i?.title??C.title,description:i?.description??C.description,expirationText:i?.expirationText??C.expirationText,cancelButtonText:i?.cancelButtonText??C.cancelButtonText,submitButtonText:i?.submitButtonText??C.submitButtonText,permissionsHeader:i?.permissionsHeader??C.permissionsHeader,autoClose:i?.autoClose??C.autoClose,popupEnabled:i?.popupEnabled??C.popupEnabled,theme:i?.theme??C.theme}}function Et(i){return{text:i?.text??Y.text,url:i?.url,version:i?.version,required:i?.required??Y.required}}function At(i){return{title:i?.title??D.title,description:i?.description??D.description,showCredential:i?.showCredential??D.showCredential,redirectUrl:i?.redirectUrl,redirectDelay:i?.redirectDelay,continueButtonText:i?.continueButtonText??D.continueButtonText}}function $e(i,t){let e=Ge(i?.branding),r=Ke(i,t),s=Ct(i?.ui),o=Et(i?.terms),a=At(i?.success),p=wt(i?.customFields),c=$t(i?.expirationDays),f=we(i);return{branding:e,copy:r,ui:s,terms:o,success:a,customFields:p,expirationDays:c,authMode:f,credentials:i?.credentials,oauth:i?.oauth,magicLink:i?.magicLink,otp:i?.otp,qrCode:i?.qrCode,passkey:i?.passkey,idv:i?.idv}}var m=class extends g{constructor(){super(...arguments);this.tool=\"\";this.scopes=[];this.agentDid=\"\";this.sessionId=\"\";this.projectId=\"\";this.serverUrl=\"\";this.agentName=\"\";this.currentMode=S.CONSENT_ONLY;this.loading=!1;this.step=\"consent\";this.termsAccepted=!1;this.formData={};this.resendCooldown=0;this.selectedScopes=[]}connectedCallback(){super.connectedCallback(),this.resolved=$e(this.config,this.agentName),this.currentMode=this.mode??we(this.config)??S.CONSENT_ONLY,this.selectedScopes=[...this.scopes]}disconnectedCallback(){super.disconnectedCallback(),this.resendCooldownInterval!==void 0&&(clearInterval(this.resendCooldownInterval),this.resendCooldownInterval=void 0)}updated(e){(e.has(\"config\")||e.has(\"agentName\"))&&(this.resolved=$e(this.config,this.agentName)),e.has(\"mode\")&&this.mode&&(this.currentMode=this.mode),e.has(\"scopes\")&&(this.selectedScopes=[...this.scopes]),this.resolved&&(this.style.setProperty(\"--consent-primary\",this.resolved.branding.primaryColor),this.style.setProperty(\"--consent-secondary\",this.resolved.branding.secondaryColor))}async handleApprove(e){if(e?.preventDefault(),!this.loading){if(!this.termsAccepted&&this.resolved?.terms.required){this.error=\"Please accept the terms to continue\";return}if(this.scopes.length>0&&this.selectedScopes.length===0){this.error=\"Please select at least one permission\";return}this.loading=!0,this.error=void 0;try{let r=new FormData;r.append(\"tool\",this.tool),r.append(\"scopes\",JSON.stringify(this.selectedScopes)),r.append(\"agent_did\",this.agentDid),r.append(\"session_id\",this.sessionId),r.append(\"project_id\",this.projectId),r.append(\"auth_mode\",this.currentMode),r.append(\"provider_type\",this.oauthIdentity?.provider??\"none\"),r.append(\"termsAccepted\",String(this.termsAccepted)),Object.entries(this.formData).forEach(([a,p])=>{r.append(a,p)});let s=await fetch(`${this.serverUrl}/consent/approve`,{method:\"POST\",body:r});if(!s.ok){let a=await s.json().catch(()=>({}));throw new Error(a.message||\"Approval failed\")}let o=await s.json();this.step=\"success\",this.dispatchEvent(new CustomEvent(\"mcp-consent:approve\",{detail:{success:!0,redirectUrl:o.redirectUrl},bubbles:!0,composed:!0}))}catch(r){this.error=r instanceof Error?r.message:\"Unknown error\",this.dispatchEvent(new CustomEvent(\"mcp-consent:error\",{detail:{error:this.error},bubbles:!0,composed:!0}))}finally{this.loading=!1}}}handleDeny(){this.dispatchEvent(new CustomEvent(\"mcp-consent:deny\",{bubbles:!0,composed:!0})),window.close()}handleTermsChange(e){this.termsAccepted=e.detail.checked}handleInputChange(e,r){this.formData={...this.formData,[e]:r}}handleResendOtp(){if(this.resendCooldown>0)return;let e=this.resolved?.otp?.resendCooldown??60;this.resendCooldown=e,this.resendCooldownInterval!==void 0&&clearInterval(this.resendCooldownInterval),this.resendCooldownInterval=setInterval(()=>{this.resendCooldown--,this.resendCooldown<=0&&(clearInterval(this.resendCooldownInterval),this.resendCooldownInterval=void 0)},1e3),this.dispatchEvent(new CustomEvent(\"mcp-consent:resend-otp\",{bubbles:!0,composed:!0}))}renderAgentInfo(){let e=this.agentName||\"this agent\";return d`\n <div class=\"agent-info\">\n <div class=\"agent-icon\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d=\"M12 16v-4M12 8h.01\" />\n </svg>\n </div>\n <div class=\"agent-text\">\n <p>\n <strong>${e}</strong> is requesting permission to\n ${this.tool?d`use the <strong>${this.tool}</strong> tool`:\"access your data\"}\n on your behalf.\n </p>\n </div>\n </div>\n `}handlePermissionsChange(e){this.selectedScopes=e.detail.selected}renderPermissions(){return this.scopes.length===0?u:d`\n <p class=\"permissions-header\">\n ${this.resolved?.ui.permissionsHeader??\"The agent is requesting the following permissions:\"}\n </p>\n <div class=\"permissions\">\n <consent-permissions\n .scopes=${this.scopes}\n interactive\n select-all\n @change=${this.handlePermissionsChange}\n ></consent-permissions>\n </div>\n `}renderExpiration(){let e=this.resolved?.expirationDays??7;return d`\n <p class=\"expiration\">\n ${this.resolved?.ui.expirationText??\"This delegation will expire in\"}\n <strong>${e} ${e===1?\"day\":\"days\"}</strong>\n </p>\n `}renderTerms(){return this.resolved?.terms?d`\n <div class=\"terms\">\n <consent-terms\n name=\"termsAccepted\"\n text=${this.resolved.terms.text}\n url=${this.resolved.terms.url??\"\"}\n ?required=${this.resolved.terms.required}\n @change=${this.handleTermsChange}\n ></consent-terms>\n </div>\n `:u}renderError(){return this.error?d`<div class=\"error-message\">${this.error}</div>`:u}renderFooter(){return d`\n <div slot=\"footer\">\n <consent-button variant=\"secondary\" @click=${this.handleDeny}>\n ${this.resolved?.ui.cancelButtonText??\"Cancel\"}\n </consent-button>\n <consent-button\n variant=\"primary\"\n ?loading=${this.loading}\n ?disabled=${this.resolved?.terms.required&&!this.termsAccepted}\n @click=${this.handleApprove}\n >\n ${this.resolved?.ui.submitButtonText??\"Allow access\"}\n </consent-button>\n </div>\n `}renderConsentOnly(){return d`\n <consent-shell\n page-title=${this.resolved?.ui.title??\"Permission Request\"}\n company-name=${this.resolved?.branding.companyName??\"\"}\n logo-url=${this.resolved?.branding.logoUrl??\"\"}\n primary-color=${this.resolved?.branding.primaryColor??\"#2563eb\"}\n secondary-color=${this.resolved?.branding.secondaryColor??\"#dbeafe\"}\n >\n <div slot=\"content\">\n ${this.renderError()} ${this.renderAgentInfo()}\n ${this.renderPermissions()} ${this.renderExpiration()}\n ${this.renderTerms()}\n </div>\n ${this.renderFooter()}\n </consent-shell>\n `}renderCredentials(){let e=this.resolved?.credentials;return d`\n <consent-shell\n page-title=${this.resolved?.ui.title??\"Sign In\"}\n company-name=${this.resolved?.branding.companyName??\"\"}\n logo-url=${this.resolved?.branding.logoUrl??\"\"}\n primary-color=${this.resolved?.branding.primaryColor??\"#2563eb\"}\n secondary-color=${this.resolved?.branding.secondaryColor??\"#dbeafe\"}\n >\n <div slot=\"content\">\n ${this.renderError()} ${this.renderAgentInfo()}\n\n <div class=\"form-fields\">\n <consent-input\n type=\"text\"\n name=\"username\"\n label=${e?.usernameLabel??\"Username\"}\n placeholder=${e?.usernamePlaceholder??\"Enter your username\"}\n autocomplete=\"username\"\n required\n @input=${r=>this.handleInputChange(\"username\",r.detail.value)}\n ></consent-input>\n\n <consent-input\n type=\"password\"\n name=\"password\"\n label=${e?.passwordLabel??\"Password\"}\n placeholder=${e?.passwordPlaceholder??\"Enter your password\"}\n autocomplete=\"current-password\"\n required\n @input=${r=>this.handleInputChange(\"password\",r.detail.value)}\n ></consent-input>\n </div>\n\n ${e?.showForgotPassword&&e.forgotPasswordUrl?d`\n <p style=\"text-align: right; margin-bottom: 1rem;\">\n <a\n href=${e.forgotPasswordUrl}\n style=\"font-size: 0.75rem; color: var(--_primary);\"\n >\n Forgot password?\n </a>\n </p>\n `:u}\n ${this.renderPermissions()} ${this.renderExpiration()}\n ${this.renderTerms()}\n </div>\n ${this.renderFooter()}\n </consent-shell>\n `}renderOAuth(){let e=this.resolved?.oauth,r=e?.providerId??\"oauth\",s=e?.providerName??\"OAuth Provider\";return d`\n <consent-shell\n page-title=${this.resolved?.ui.title??\"Sign In\"}\n company-name=${this.resolved?.branding.companyName??\"\"}\n logo-url=${this.resolved?.branding.logoUrl??\"\"}\n primary-color=${this.resolved?.branding.primaryColor??\"#2563eb\"}\n secondary-color=${this.resolved?.branding.secondaryColor??\"#dbeafe\"}\n >\n <div slot=\"content\">\n ${this.renderError()} ${this.renderAgentInfo()}\n\n <consent-oauth-button\n provider=${r}\n provider-name=${s}\n url=${`${this.serverUrl}/oauth/${encodeURIComponent(r)}?session_id=${encodeURIComponent(this.sessionId)}`}\n button-text=${e?.buttonText??`Continue with ${s}`}\n full-width\n ></consent-oauth-button>\n\n ${this.renderPermissions()}\n\n <div class=\"divider\">or</div>\n\n ${this.renderExpiration()} ${this.renderTerms()}\n </div>\n ${this.renderFooter()}\n </consent-shell>\n `}renderMagicLink(){let e=this.resolved?.magicLink;return d`\n <consent-shell\n page-title=${this.resolved?.ui.title??\"Sign In\"}\n company-name=${this.resolved?.branding.companyName??\"\"}\n logo-url=${this.resolved?.branding.logoUrl??\"\"}\n primary-color=${this.resolved?.branding.primaryColor??\"#2563eb\"}\n secondary-color=${this.resolved?.branding.secondaryColor??\"#dbeafe\"}\n >\n <div slot=\"content\">\n ${this.renderError()} ${this.renderAgentInfo()}\n\n <div class=\"form-fields\">\n <consent-input\n type=\"email\"\n name=\"email\"\n label=${e?.emailLabel??\"Email\"}\n placeholder=${e?.emailPlaceholder??\"Enter your email address\"}\n autocomplete=\"email\"\n required\n @input=${r=>this.handleInputChange(\"email\",r.detail.value)}\n ></consent-input>\n </div>\n\n ${this.renderPermissions()} ${this.renderExpiration()}\n ${this.renderTerms()}\n </div>\n\n <div slot=\"footer\">\n <consent-button variant=\"secondary\" @click=${this.handleDeny}>\n Cancel\n </consent-button>\n <consent-button\n variant=\"primary\"\n ?loading=${this.loading}\n ?disabled=${this.resolved?.terms.required&&!this.termsAccepted}\n @click=${this.handleApprove}\n >\n ${e?.buttonText??\"Send magic link\"}\n </consent-button>\n </div>\n </consent-shell>\n `}renderOTP(){let e=this.resolved?.otp;return d`\n <consent-shell\n page-title=${this.resolved?.ui.title??\"Verify Code\"}\n company-name=${this.resolved?.branding.companyName??\"\"}\n logo-url=${this.resolved?.branding.logoUrl??\"\"}\n primary-color=${this.resolved?.branding.primaryColor??\"#2563eb\"}\n secondary-color=${this.resolved?.branding.secondaryColor??\"#dbeafe\"}\n >\n <div slot=\"content\">\n ${this.renderError()} ${this.renderAgentInfo()}\n\n <div class=\"otp-section\">\n <p class=\"otp-instructions\">\n ${e?.instructions??\"Enter the verification code sent to your device\"}\n </p>\n <consent-otp-input\n length=${e?.digits??6}\n name=\"otp\"\n auto-focus\n @complete=${r=>{this.handleInputChange(\"otp\",r.detail.value),this.handleApprove()}}\n @input=${r=>this.handleInputChange(\"otp\",r.detail.value)}\n ></consent-otp-input>\n <div class=\"otp-resend\">\n Didn't receive the code?\n <button\n type=\"button\"\n ?disabled=${this.resendCooldown>0}\n @click=${this.handleResendOtp}\n >\n ${this.resendCooldown>0?`Resend in ${this.resendCooldown}s`:\"Resend\"}\n </button>\n </div>\n </div>\n\n ${this.renderPermissions()} ${this.renderTerms()}\n </div>\n ${this.renderFooter()}\n </consent-shell>\n `}renderSuccess(){let e=this.resolved?.success;return d`\n <consent-shell\n page-title=${e?.title??\"Access Granted\"}\n company-name=${this.resolved?.branding.companyName??\"\"}\n logo-url=${this.resolved?.branding.logoUrl??\"\"}\n primary-color=${this.resolved?.branding.primaryColor??\"#2563eb\"}\n secondary-color=${this.resolved?.branding.secondaryColor??\"#dbeafe\"}\n >\n <div slot=\"content\">\n <div class=\"success-view\">\n <div class=\"success-icon\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n >\n <polyline points=\"20 6 9 17 4 12\" />\n </svg>\n </div>\n <h2 class=\"success-title\">${e?.title??\"Access Granted\"}</h2>\n <p class=\"success-description\">\n ${e?.description??\"You have successfully granted access. You can now close this window.\"}\n </p>\n </div>\n </div>\n\n <div slot=\"footer\">\n <consent-button\n variant=\"primary\"\n full-width\n @click=${()=>window.close()}\n >\n ${e?.continueButtonText??\"Close\"}\n </consent-button>\n </div>\n </consent-shell>\n `}render(){if(this.step===\"success\")return this.renderSuccess();switch(this.currentMode){case S.CREDENTIALS:return this.renderCredentials();case S.OAUTH:return this.renderOAuth();case S.MAGIC_LINK:return this.renderMagicLink();case S.OTP:return this.renderOTP();case S.CONSENT_ONLY:default:return this.renderConsentOnly()}}};m.styles=v`\n :host {\n display: block;\n /* System font stack with font smoothing for crisp text */\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,\n 'Helvetica Neue', Arial, sans-serif;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n --_primary: var(--consent-primary, #2563eb);\n --_secondary: var(--consent-secondary, #dbeafe);\n }\n\n /* Agent info box */\n .agent-info {\n display: flex;\n gap: 1rem;\n padding: 1rem;\n background: #f9fafb;\n border-radius: 0.5rem;\n margin-bottom: 1rem;\n }\n\n .agent-icon {\n width: 40px;\n height: 40px;\n background: var(--_secondary);\n border-radius: 0.5rem;\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n }\n\n .agent-icon svg {\n width: 20px;\n height: 20px;\n color: var(--_primary);\n }\n\n .agent-text {\n flex: 1;\n }\n\n .agent-text p {\n margin: 0;\n font-size: 0.875rem;\n color: #374151;\n line-height: 1.5;\n }\n\n .agent-text strong {\n color: #111827;\n }\n\n /* Permissions section */\n .permissions-header {\n font-size: 0.875rem;\n color: #6b7280;\n margin-bottom: 0.5rem;\n }\n\n .permissions {\n margin-bottom: 1rem;\n }\n\n /* Expiration */\n .expiration {\n font-size: 0.75rem;\n color: #6b7280;\n margin-top: 1rem;\n }\n\n .expiration strong {\n color: #374151;\n }\n\n /* Terms */\n .terms {\n margin-top: 1.5rem;\n }\n\n /* Error message */\n .error-message {\n background: #fef2f2;\n border: 1px solid #fecaca;\n border-radius: 0.5rem;\n padding: 0.75rem 1rem;\n margin-bottom: 1rem;\n color: #dc2626;\n font-size: 0.875rem;\n }\n\n /* Form fields */\n .form-fields {\n display: flex;\n flex-direction: column;\n gap: 1rem;\n margin-bottom: 1rem;\n }\n\n /* Divider */\n .divider {\n display: flex;\n align-items: center;\n gap: 1rem;\n margin: 1.5rem 0;\n color: #6b7280;\n font-size: 0.75rem;\n }\n\n .divider::before,\n .divider::after {\n content: '';\n flex: 1;\n height: 1px;\n background: #e5e7eb;\n }\n\n /* Success view */\n .success-view {\n text-align: center;\n padding: 2rem 0;\n }\n\n .success-icon {\n width: 64px;\n height: 64px;\n background: #d1fae5;\n border-radius: 50%;\n display: flex;\n align-items: center;\n justify-content: center;\n margin: 0 auto 1.5rem;\n }\n\n .success-icon svg {\n width: 32px;\n height: 32px;\n color: #059669;\n }\n\n .success-title {\n font-size: 1.25rem;\n font-weight: 600;\n color: #111827;\n margin: 0 0 0.5rem;\n }\n\n .success-description {\n font-size: 0.875rem;\n color: #6b7280;\n margin: 0 0 1.5rem;\n }\n\n /* OTP section */\n .otp-section {\n text-align: center;\n margin-bottom: 1.5rem;\n }\n\n .otp-instructions {\n font-size: 0.875rem;\n color: #6b7280;\n margin-bottom: 1rem;\n }\n\n .otp-resend {\n margin-top: 1rem;\n font-size: 0.75rem;\n }\n\n .otp-resend button {\n background: none;\n border: none;\n color: var(--_primary);\n cursor: pointer;\n text-decoration: underline;\n }\n\n .otp-resend button:disabled {\n color: #9ca3af;\n cursor: not-allowed;\n }\n `,n([l({type:Object,converter:{fromAttribute:e=>{if(e)try{return JSON.parse(e)}catch{return}},toAttribute:e=>e?JSON.stringify(e):\"\"}})],m.prototype,\"config\",2),n([l({type:String})],m.prototype,\"mode\",2),n([l({type:String})],m.prototype,\"tool\",2),n([l({type:Array,converter:{fromAttribute:e=>{if(!e)return[];try{return JSON.parse(e)}catch{return[]}},toAttribute:e=>JSON.stringify(e)}})],m.prototype,\"scopes\",2),n([l({type:String,attribute:\"agent-did\"})],m.prototype,\"agentDid\",2),n([l({type:String,attribute:\"session-id\"})],m.prototype,\"sessionId\",2),n([l({type:String,attribute:\"project-id\"})],m.prototype,\"projectId\",2),n([l({type:String,attribute:\"server-url\"})],m.prototype,\"serverUrl\",2),n([l({type:String,attribute:\"agent-name\"})],m.prototype,\"agentName\",2),n([l({type:Object,attribute:\"oauth-identity\",converter:{fromAttribute:e=>{if(e)try{return JSON.parse(e)}catch{return}},toAttribute:e=>e?JSON.stringify(e):\"\"}})],m.prototype,\"oauthIdentity\",2),n([x()],m.prototype,\"resolved\",2),n([x()],m.prototype,\"currentMode\",2),n([x()],m.prototype,\"loading\",2),n([x()],m.prototype,\"error\",2),n([x()],m.prototype,\"step\",2),n([x()],m.prototype,\"termsAccepted\",2),n([x()],m.prototype,\"formData\",2),n([x()],m.prototype,\"resendCooldown\",2),n([x()],m.prototype,\"selectedScopes\",2),m=n([y(\"mcp-consent\")],m);export{_ as ConsentButton,k as ConsentCheckbox,$ as ConsentInput,A as ConsentOAuthButton,E as ConsentOTPInput,I as ConsentPermissions,U as ConsentShell,w as ConsentTerms,m as McpConsent};\n/*! Bundled license information:\n\n@lit/reactive-element/css-tag.js:\n (**\n * @license\n * Copyright 2019 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n *)\n\n@lit/reactive-element/reactive-element.js:\nlit-html/lit-html.js:\nlit-element/lit-element.js:\n@lit/reactive-element/decorators/custom-element.js:\n@lit/reactive-element/decorators/property.js:\n@lit/reactive-element/decorators/state.js:\n@lit/reactive-element/decorators/event-options.js:\n@lit/reactive-element/decorators/base.js:\n@lit/reactive-element/decorators/query.js:\n@lit/reactive-element/decorators/query-all.js:\n@lit/reactive-element/decorators/query-async.js:\n@lit/reactive-element/decorators/query-assigned-nodes.js:\nlit-html/directive.js:\nlit-html/directives/unsafe-html.js:\nlit-html/directives/unsafe-svg.js:\n (**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n *)\n\nlit-html/is-server.js:\n (**\n * @license\n * Copyright 2022 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n *)\n\n@lit/reactive-element/decorators/query-assigned-elements.js:\n (**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n *)\n*/\n";
|
|
15
|
+
/**
|
|
16
|
+
* Size of the bundle in bytes (for logging/debugging)
|
|
17
|
+
*/
|
|
18
|
+
export const CONSENT_BUNDLE_SIZE = 83084;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inline.js","sourceRoot":"","sources":["../../src/bundle/inline.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;;GAGG;AACH,MAAM,CAAC,MAAM,cAAc,GAAW,0koFAA0koF,CAAC;AAEjnoF;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAW,KAAK,CAAC"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Consent HTML Shell Generator
|
|
3
|
+
*
|
|
4
|
+
* Generates the minimal HTML shell that Workers serve for consent pages.
|
|
5
|
+
* The shell loads the bundled consent.js and renders <mcp-consent>.
|
|
6
|
+
*
|
|
7
|
+
* Architecture:
|
|
8
|
+
* 1. Worker receives consent page request
|
|
9
|
+
* 2. Worker calls generateConsentShell() with config
|
|
10
|
+
* 3. Browser loads HTML, fetches consent.js
|
|
11
|
+
* 4. Lit components render the consent UI
|
|
12
|
+
* 5. Form submission posts back to Worker
|
|
13
|
+
*
|
|
14
|
+
* @module @kya-os/consent/bundle/shell
|
|
15
|
+
*/
|
|
16
|
+
import type { ConsentConfig } from '../types/config.types.js';
|
|
17
|
+
import type { OAuthIdentity } from '../types/api.types.js';
|
|
18
|
+
/**
|
|
19
|
+
* Options for generating the consent HTML shell
|
|
20
|
+
*/
|
|
21
|
+
export interface ConsentShellOptions {
|
|
22
|
+
/** Consent page configuration (from AgentShield remote config) */
|
|
23
|
+
config: ConsentConfig;
|
|
24
|
+
/** Tool being requested */
|
|
25
|
+
tool: string;
|
|
26
|
+
/** Permission scopes requested */
|
|
27
|
+
scopes: string[];
|
|
28
|
+
/** Agent's DID */
|
|
29
|
+
agentDid: string;
|
|
30
|
+
/** Session identifier */
|
|
31
|
+
sessionId: string;
|
|
32
|
+
/** Project identifier */
|
|
33
|
+
projectId: string;
|
|
34
|
+
/** Server URL for form submission */
|
|
35
|
+
serverUrl: string;
|
|
36
|
+
/** OAuth identity if already authenticated */
|
|
37
|
+
oauthIdentity?: OAuthIdentity;
|
|
38
|
+
/** Path to consent.js bundle (defaults to '/consent.js') */
|
|
39
|
+
bundlePath?: string;
|
|
40
|
+
/** Custom page title */
|
|
41
|
+
pageTitle?: string;
|
|
42
|
+
/** CSP nonce for inline scripts/styles */
|
|
43
|
+
nonce?: string;
|
|
44
|
+
/** Authentication mode (consent-only, credentials, oauth, magic-link, otp) */
|
|
45
|
+
authMode?: string;
|
|
46
|
+
/** Provider name for credentials/oauth flows */
|
|
47
|
+
provider?: string;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Generate the consent page HTML shell
|
|
51
|
+
*
|
|
52
|
+
* This produces a minimal HTML document that:
|
|
53
|
+
* - Loads the bundled consent.js
|
|
54
|
+
* - Renders the <mcp-consent> web component
|
|
55
|
+
* - Includes a loading skeleton for perceived performance
|
|
56
|
+
* - Has a no-JS fallback form
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```typescript
|
|
60
|
+
* const html = generateConsentShell({
|
|
61
|
+
* config: remoteConfig,
|
|
62
|
+
* tool: 'purchase',
|
|
63
|
+
* scopes: ['billing:read', 'orders:write'],
|
|
64
|
+
* agentDid: 'did:key:z6Mk...',
|
|
65
|
+
* sessionId: 'sess_abc123',
|
|
66
|
+
* projectId: 'proj_xyz',
|
|
67
|
+
* serverUrl: 'https://api.example.com',
|
|
68
|
+
* });
|
|
69
|
+
*
|
|
70
|
+
* return new Response(html, {
|
|
71
|
+
* headers: { 'Content-Type': 'text/html' }
|
|
72
|
+
* });
|
|
73
|
+
* ```
|
|
74
|
+
*/
|
|
75
|
+
export declare function generateConsentShell(options: ConsentShellOptions): string;
|
|
76
|
+
/**
|
|
77
|
+
* Generate inline consent component (no external bundle)
|
|
78
|
+
*
|
|
79
|
+
* For scenarios where you want to inline everything into a single HTML response.
|
|
80
|
+
* This is useful for:
|
|
81
|
+
* - Offline/embedded scenarios
|
|
82
|
+
* - Single-request consent pages
|
|
83
|
+
* - Testing/debugging
|
|
84
|
+
*
|
|
85
|
+
* Note: This requires the consent bundle to be inlined as a string.
|
|
86
|
+
*
|
|
87
|
+
* @param options - Shell options
|
|
88
|
+
* @param bundleSource - The bundled consent.js source code
|
|
89
|
+
*/
|
|
90
|
+
export declare function generateInlineConsentShell(options: Omit<ConsentShellOptions, 'bundlePath'>, bundleSource: string): string;
|
|
91
|
+
//# sourceMappingURL=shell.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shell.d.ts","sourceRoot":"","sources":["../../src/bundle/shell.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAE3D;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,kEAAkE;IAClE,MAAM,EAAE,aAAa,CAAC;IACtB,2BAA2B;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,kCAAkC;IAClC,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,kBAAkB;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,yBAAyB;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,yBAAyB;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,qCAAqC;IACrC,SAAS,EAAE,MAAM,CAAC;IAClB,8CAA8C;IAC9C,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,4DAA4D;IAC5D,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,wBAAwB;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,0CAA0C;IAC1C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,8EAA8E;IAC9E,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gDAAgD;IAChD,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,mBAAmB,GAAG,MAAM,CAuMzE;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,IAAI,CAAC,mBAAmB,EAAE,YAAY,CAAC,EAChD,YAAY,EAAE,MAAM,GACnB,MAAM,CAsDR"}
|