@kya-os/consent 0.1.9 → 0.1.12
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/inline.d.ts.map +1 -1
- package/dist/bundle/inline.js +2 -2
- package/dist/bundle/inline.js.map +1 -1
- package/dist/bundle/shell.d.ts +6 -0
- package/dist/bundle/shell.d.ts.map +1 -1
- package/dist/bundle/shell.js +4 -1
- package/dist/bundle/shell.js.map +1 -1
- package/dist/components/mcp-consent.d.ts +37 -18
- package/dist/components/mcp-consent.d.ts.map +1 -1
- package/dist/components/mcp-consent.js +210 -135
- package/dist/components/mcp-consent.js.map +1 -1
- package/dist/consent.js +99 -27
- package/dist/consent.min.js +26 -25
- package/dist/schemas/api.schemas.d.ts +4 -4
- package/dist/templates/registry.d.ts +6 -0
- package/dist/templates/registry.d.ts.map +1 -1
- package/dist/templates/registry.js +11 -13
- package/dist/templates/registry.js.map +1 -1
- package/dist/types/modes.types.d.ts +53 -0
- package/dist/types/modes.types.d.ts.map +1 -1
- package/dist/types/modes.types.js +67 -0
- package/dist/types/modes.types.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +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,
|
|
1
|
+
{"version":3,"file":"inline.d.ts","sourceRoot":"","sources":["../../src/bundle/inline.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;;GAGG;AACH,eAAO,MAAM,cAAc,EAAE,MAA4irF,CAAC;AAE1krF;;GAEG;AACH,eAAO,MAAM,mBAAmB,EAAE,MAAc,CAAC"}
|
package/dist/bundle/inline.js
CHANGED
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
* The bundled consent.js content as a string.
|
|
12
12
|
* Use this to serve the bundle from a Worker.
|
|
13
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,Te=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,ke=/-->/g,Re=/>/g,O=RegExp(`>|${he}(?:([^\\\\s\"'>=/]+)(${he}*=${he}*(?:[^ \t\n\\f\\r\"'\\`<>=]|(\"|')|))|$)`,\"g\"),Ie=/'/g,Ue=/\"/g,Pe=/^(?:script|style|textarea|title)$/i,xe=i=>(t,...e)=>({_$litType$:i,strings:t,values:e}),d=xe(1),It=xe(2),Ut=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 Te!==void 0?Te.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,y,h=-1,k=0;for(;k<c.length&&(a.lastIndex=k,y=a.exec(c),y!==null);)k=a.lastIndex,a===Q?y[1]===\"!--\"?a=ke:y[1]!==void 0?a=Re:y[2]!==void 0?(Pe.test(y[2])&&(s=RegExp(\"</\"+y[2],\"g\")),a=O):y[3]!==void 0&&(a=O):a===O?y[0]===\">\"?(a=s??Q,h=-1):y[1]===void 0?h=-2:(h=a.lastIndex-y[2].length,f=y[1],a=y[3]===void 0?O:y[3]==='\"'?Ue:Ie):a===Ue||a===Ie?a=O:a===ke||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,y]=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 k=y[a++],R=s.getAttribute(h).split(M),q=/([.?@])?(.*)/.exec(k);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),k=h.length-1;if(k>0){s.textContent=le?le.emptyScript:\"\";for(let R=0;R<k;R++)s.append(h[R],Z()),B.nextNode(),c.push({type:2,index:++o});s.append(h[k],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 x=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 w(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([x(\"consent-button\")],_);var T=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 `}};T.formAssociated=!0,T.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})],T.prototype,\"name\",2),n([l({type:Boolean,reflect:!0})],T.prototype,\"checked\",2),n([l({type:Boolean})],T.prototype,\"required\",2),n([l({type:Boolean,reflect:!0})],T.prototype,\"disabled\",2),n([l({type:String})],T.prototype,\"value\",2),T=n([x(\"consent-checkbox\")],T);var C=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 `}};C.formAssociated=!0,C.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})],C.prototype,\"type\",2),n([l({type:String})],C.prototype,\"name\",2),n([l({type:String})],C.prototype,\"value\",2),n([l({type:String})],C.prototype,\"label\",2),n([l({type:String})],C.prototype,\"placeholder\",2),n([l({type:Boolean})],C.prototype,\"required\",2),n([l({type:Boolean,reflect:!0})],C.prototype,\"disabled\",2),n([l({type:String})],C.prototype,\"autocomplete\",2),n([l({type:String})],C.prototype,\"error\",2),n([w()],C.prototype,\"showPassword\",2),C=n([x(\"consent-input\")],C);var I=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 `}};I.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\"})],I.prototype,\"pageTitle\",2),n([l({type:String,attribute:\"logo-url\"})],I.prototype,\"logoUrl\",2),n([l({type:String,attribute:\"company-name\"})],I.prototype,\"companyName\",2),n([l({type:String,attribute:\"primary-color\"})],I.prototype,\"primaryColor\",2),n([l({type:String,attribute:\"secondary-color\"})],I.prototype,\"secondaryColor\",2),I=n([x(\"consent-shell\")],I);var U=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 `}};U.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)}})],U.prototype,\"scopes\",2),n([l({type:Boolean})],U.prototype,\"interactive\",2),n([l({type:Boolean,attribute:\"select-all\"})],U.prototype,\"selectAll\",2),n([l({type:String,attribute:\"icon-style\"})],U.prototype,\"iconStyle\",2),n([w()],U.prototype,\"selectedScopes\",2),U=n([x(\"consent-permissions\")],U);var $=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 `}};$.formAssociated=!0,$.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})],$.prototype,\"name\",2),n([l({type:String})],$.prototype,\"text\",2),n([l({type:String})],$.prototype,\"url\",2),n([l({type:String,attribute:\"privacy-text\"})],$.prototype,\"privacyText\",2),n([l({type:String,attribute:\"privacy-url\"})],$.prototype,\"privacyUrl\",2),n([l({type:String,attribute:\"label-prefix\"})],$.prototype,\"labelPrefix\",2),n([l({type:String})],$.prototype,\"conjunction\",2),n([l({type:Boolean,reflect:!0})],$.prototype,\"checked\",2),n([l({type:Boolean})],$.prototype,\"required\",2),n([l({type:Boolean,reflect:!0})],$.prototype,\"disabled\",2),n([l({type:String})],$.prototype,\"value\",2),$=n([x(\"consent-terms\")],$);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\"}},S=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 `}};S.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})],S.prototype,\"provider\",2),n([l({type:String,attribute:\"provider-name\"})],S.prototype,\"providerName\",2),n([l({type:String})],S.prototype,\"url\",2),n([l({type:String,attribute:\"button-text\"})],S.prototype,\"buttonText\",2),n([l({type:Boolean,reflect:!0})],S.prototype,\"loading\",2),n([l({type:Boolean,reflect:!0})],S.prototype,\"disabled\",2),n([l({type:Boolean,attribute:\"full-width\"})],S.prototype,\"fullWidth\",2),n([l({type:String,attribute:\"custom-icon\"})],S.prototype,\"customIcon\",2),n([w()],S.prototype,\"redirecting\",2),S=n([x(\"consent-oauth-button\")],S);var A=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 `}};A.formAssociated=!0,A.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})],A.prototype,\"length\",2),n([l({type:String})],A.prototype,\"name\",2),n([l({type:String})],A.prototype,\"value\",2),n([l({type:Boolean,reflect:!0})],A.prototype,\"disabled\",2),n([l({type:Boolean,reflect:!0})],A.prototype,\"error\",2),n([l({type:Boolean,attribute:\"auto-focus\"})],A.prototype,\"autoFocus\",2),n([l({type:String,attribute:\"input-type\"})],A.prototype,\"inputType\",2),n([w()],A.prototype,\"digits\",2),n([Be(\"input\")],A.prototype,\"inputs\",2),A=n([x(\"consent-otp-input\")],A);var b={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},E={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??E.title,a=e.description??E.description,p=e.expirationText??E.expirationText,c=e.cancelButtonText??E.cancelButtonText,f=e.submitButtonText??E.submitButtonText,y=e.permissionsHeader??E.permissionsHeader,h=r.text??Y.text,k=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:y,termsText:h,termsUrl:r.url,termsRequired:r.required??Y.required,resolvedDescription:q,successTitle:k,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?b.OAUTH:i?.credentials?.usernameLabel||i?.credentials?.passwordLabel?b.CREDENTIALS:i?.magicLink?.enabled?b.MAGIC_LINK:i?.otp?.enabled?b.OTP:b.CONSENT_ONLY}function Ct(i){return{title:i?.title??E.title,description:i?.description??E.description,expirationText:i?.expirationText??E.expirationText,cancelButtonText:i?.cancelButtonText??E.cancelButtonText,submitButtonText:i?.submitButtonText??E.submitButtonText,permissionsHeader:i?.permissionsHeader??E.permissionsHeader,autoClose:i?.autoClose??E.autoClose,popupEnabled:i?.popupEnabled??E.popupEnabled,theme:i?.theme??E.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.provider=\"\";this.currentMode=b.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)??b.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))}getProviderType(){switch(this.currentMode){case b.CREDENTIALS:return\"credential\";case b.OAUTH:return this.oauthIdentity?.provider??\"oauth2\";case b.MAGIC_LINK:return\"magic_link\";case b.OTP:return\"otp\";case b.CONSENT_ONLY:default:return\"none\"}}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.getProviderType()),this.provider&&r.append(\"provider\",this.provider),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 b.CREDENTIALS:return this.renderCredentials();case b.OAUTH:return this.renderOAuth();case b.MAGIC_LINK:return this.renderMagicLink();case b.OTP:return this.renderOTP();case b.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:String,attribute:\"provider\"})],m.prototype,\"provider\",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([w()],m.prototype,\"resolved\",2),n([w()],m.prototype,\"currentMode\",2),n([w()],m.prototype,\"loading\",2),n([w()],m.prototype,\"error\",2),n([w()],m.prototype,\"step\",2),n([w()],m.prototype,\"termsAccepted\",2),n([w()],m.prototype,\"formData\",2),n([w()],m.prototype,\"resendCooldown\",2),n([w()],m.prototype,\"selectedScopes\",2),m=n([x(\"mcp-consent\")],m);export{_ as ConsentButton,T as ConsentCheckbox,C as ConsentInput,S as ConsentOAuthButton,A as ConsentOTPInput,U as ConsentPermissions,I as ConsentShell,$ 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";
|
|
14
|
+
export const CONSENT_BUNDLE = "var Xe=Object.defineProperty;var Ze=Object.getOwnPropertyDescriptor;var n=(i,t,e,r)=>{for(var s=r>1?void 0:r?Ze(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&&Xe(t,e,s),s};var ne=globalThis,ae=ne.ShadowRoot&&(ne.ShadyCSS===void 0||ne.ShadyCSS.nativeShadow)&&\"adoptedStyleSheets\"in Document.prototype&&\"replace\"in CSSStyleSheet.prototype,ue=Symbol(),Ee=new WeakMap,W=class{constructor(t,e,r){if(this._$cssResult$=!0,r!==ue)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(ae&&t===void 0){let r=e!==void 0&&e.length===1;r&&(t=Ee.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),r&&Ee.set(e,t))}return t}toString(){return this.cssText}},Ae=i=>new W(typeof i==\"string\"?i:i+\"\",void 0,ue),b=(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 W(e,i,ue)},Se=(i,t)=>{if(ae)i.adoptedStyleSheets=t.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet));else for(let e of t){let r=document.createElement(\"style\"),s=ne.litNonce;s!==void 0&&r.setAttribute(\"nonce\",s),r.textContent=e.cssText,i.appendChild(r)}},he=ae?i=>i:i=>i instanceof CSSStyleSheet?(t=>{let e=\"\";for(let r of t.cssRules)e+=r.cssText;return Ae(e)})(i):i;var{is:et,defineProperty:tt,getOwnPropertyDescriptor:rt,getOwnPropertyNames:it,getOwnPropertySymbols:st,getPrototypeOf:ot}=Object,O=globalThis,_e=O.trustedTypes,nt=_e?_e.emptyScript:\"\",at=O.reactiveElementPolyfillSupport,J=(i,t)=>i,Q={toAttribute(i,t){switch(t){case Boolean:i=i?nt: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}},le=(i,t)=>!et(i,t),Te={attribute:!0,type:String,converter:Q,reflect:!1,useDefault:!1,hasChanged:le};Symbol.metadata??(Symbol.metadata=Symbol(\"metadata\")),O.litPropertyMetadata??(O.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=Te){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&&tt(this.prototype,t,s)}}static getPropertyDescriptor(t,e,r){let{get:s,set:o}=rt(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)??Te}static _$Ei(){if(this.hasOwnProperty(J(\"elementProperties\")))return;let t=ot(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(J(\"finalized\")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(J(\"properties\"))){let e=this.properties,r=[...it(e),...st(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(he(s))}else t!==void 0&&e.push(he(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 Se(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:Q).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:Q;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??le)(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[J(\"elementProperties\")]=new Map,N[J(\"finalized\")]=new Map,at?.({ReactiveElement:N}),(O.reactiveElementVersions??(O.reactiveElementVersions=[])).push(\"2.1.1\");var Z=globalThis,de=Z.trustedTypes,ke=de?de.createPolicy(\"lit-html\",{createHTML:i=>i}):void 0,Ue=\"$lit$\",M=`lit$${Math.random().toFixed(9).slice(2)}$`,Le=\"?\"+M,lt=`<${Le}>`,F=document,ee=()=>F.createComment(\"\"),te=i=>i===null||typeof i!=\"object\"&&typeof i!=\"function\",xe=Array.isArray,dt=i=>xe(i)||typeof i?.[Symbol.iterator]==\"function\",me=`[ \t\n\\f\\r]`,X=/<(?:(!--|\\/[^a-zA-Z])|(\\/?[a-zA-Z][^>\\s]*)|(\\/?$))/g,Re=/-->/g,Ie=/>/g,B=RegExp(`>|${me}(?:([^\\\\s\"'>=/]+)(${me}*=${me}*(?:[^ \t\n\\f\\r\"'\\`<>=]|(\"|')|))|$)`,\"g\"),Pe=/'/g,De=/\"/g,Oe=/^(?:script|style|textarea|title)$/i,we=i=>(t,...e)=>({_$litType$:i,strings:t,values:e}),d=we(1),Nt=we(2),Ut=we(3),U=Symbol.for(\"lit-noChange\"),u=Symbol.for(\"lit-nothing\"),Ne=new WeakMap,H=F.createTreeWalker(F,129);function Me(i,t){if(!xe(i)||!i.hasOwnProperty(\"raw\"))throw Error(\"invalid template strings array\");return ke!==void 0?ke.createHTML(t):t}var ct=(i,t)=>{let e=i.length-1,r=[],s,o=t===2?\"<svg>\":t===3?\"<math>\":\"\",a=X;for(let p=0;p<e;p++){let c=i[p],v,y,m=-1,k=0;for(;k<c.length&&(a.lastIndex=k,y=a.exec(c),y!==null);)k=a.lastIndex,a===X?y[1]===\"!--\"?a=Re:y[1]!==void 0?a=Ie:y[2]!==void 0?(Oe.test(y[2])&&(s=RegExp(\"</\"+y[2],\"g\")),a=B):y[3]!==void 0&&(a=B):a===B?y[0]===\">\"?(a=s??X,m=-1):y[1]===void 0?m=-2:(m=a.lastIndex-y[2].length,v=y[1],a=y[3]===void 0?B:y[3]==='\"'?De:Pe):a===De||a===Pe?a=B:a===Re||a===Ie?a=X:(a=B,s=void 0);let R=a===B&&i[p+1].startsWith(\"/>\")?\" \":\"\";o+=a===X?c+lt:m>=0?(r.push(v),c.slice(0,m)+Ue+c.slice(m)+M+R):c+M+(m===-2?p:R)}return[Me(i,o+(i[e]||\"<?>\")+(t===2?\"</svg>\":t===3?\"</math>\":\"\")),r]},re=class i{constructor({strings:t,_$litType$:e},r){let s;this.parts=[];let o=0,a=0,p=t.length-1,c=this.parts,[v,y]=ct(t,e);if(this.el=i.createElement(v,r),H.currentNode=this.el.content,e===2||e===3){let m=this.el.content.firstChild;m.replaceWith(...m.childNodes)}for(;(s=H.nextNode())!==null&&c.length<p;){if(s.nodeType===1){if(s.hasAttributes())for(let m of s.getAttributeNames())if(m.endsWith(Ue)){let k=y[a++],R=s.getAttribute(m).split(M),z=/([.?@])?(.*)/.exec(k);c.push({type:1,index:o,name:z[2],strings:R,ctor:z[1]===\".\"?fe:z[1]===\"?\"?ve:z[1]===\"@\"?be:j}),s.removeAttribute(m)}else m.startsWith(M)&&(c.push({type:6,index:o}),s.removeAttribute(m));if(Oe.test(s.tagName)){let m=s.textContent.split(M),k=m.length-1;if(k>0){s.textContent=de?de.emptyScript:\"\";for(let R=0;R<k;R++)s.append(m[R],ee()),H.nextNode(),c.push({type:2,index:++o});s.append(m[k],ee())}}}else if(s.nodeType===8)if(s.data===Le)c.push({type:2,index:o});else{let m=-1;for(;(m=s.data.indexOf(M,m+1))!==-1;)c.push({type:7,index:o}),m+=M.length-1}o++}}static createElement(t,e){let r=F.createElement(\"template\");return r.innerHTML=t,r}};function V(i,t,e=i,r){if(t===U)return t;let s=r!==void 0?e._$Co?.[r]:e._$Cl,o=te(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=V(i,s._$AS(i,t.values),s,r)),t}var ge=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);H.currentNode=s;let o=H.nextNode(),a=0,p=0,c=r[0];for(;c!==void 0;){if(a===c.index){let v;c.type===2?v=new ie(o,o.nextSibling,this,t):c.type===1?v=new c.ctor(o,c.name,c.strings,this,t):c.type===6&&(v=new ye(o,this,t)),this._$AV.push(v),c=r[++p]}a!==c?.index&&(o=H.nextNode(),a++)}return H.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++}},ie=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=V(this,t,e),te(t)?t===u||t==null||t===\"\"?(this._$AH!==u&&this._$AR(),this._$AH=u):t!==this._$AH&&t!==U&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):dt(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&&te(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=re.createElement(Me(r.h,r.h[0]),this.options)),r);if(this._$AH?._$AD===s)this._$AH.p(e);else{let o=new ge(s,this),a=o.u(this.options);o.p(e),this.T(a),this._$AH=o}}_$AC(t){let e=Ne.get(t.strings);return e===void 0&&Ne.set(t.strings,e=new re(t)),e}k(t){xe(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(ee()),this.O(ee()),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=V(this,t,e,0),a=!te(t)||t!==this._$AH&&t!==U,a&&(this._$AH=t);else{let p=t,c,v;for(t=o[0],c=0;c<o.length-1;c++)v=V(this,p[r+c],e,c),v===U&&(v=this._$AH[c]),a||(a=!te(v)||v!==this._$AH[c]),v===u?t=u:t!==u&&(t+=(v??\"\")+o[c+1]),this._$AH[c]=v}a&&!s&&this.j(t)}j(t){t===u?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??\"\")}},fe=class extends j{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===u?void 0:t}},ve=class extends j{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==u)}},be=class extends j{constructor(t,e,r,s,o){super(t,e,r,s,o),this.type=5}_$AI(t,e=this){if((t=V(this,t,e,0)??u)===U)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)}},ye=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){V(this,t)}};var pt=Z.litHtmlPolyfillSupport;pt?.(re,ie),(Z.litHtmlVersions??(Z.litHtmlVersions=[])).push(\"3.3.1\");var Be=(i,t,e)=>{let r=e?.renderBefore??t,s=r._$litPart$;if(s===void 0){let o=e?.renderBefore??null;r._$litPart$=s=new ie(t.insertBefore(ee(),o),o,void 0,e??{})}return s._$AI(i),s};var se=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=Be(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return U}};g._$litElement$=!0,g.finalized=!0,se.litElementHydrateSupport?.({LitElement:g});var ut=se.litElementPolyfillSupport;ut?.({LitElement:g});(se.litElementVersions??(se.litElementVersions=[])).push(\"4.2.1\");var x=i=>(t,e)=>{e!==void 0?e.addInitializer((()=>{customElements.define(i,t)})):customElements.define(i,t)};var ht={attribute:!0,type:String,converter:Q,reflect:!1,hasChanged:le},mt=(i=ht,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\"?mt(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 w(i){return l({...i,state:!0,attribute:!1})}var G=(i,t,e)=>(e.configurable=!0,e.enumerable=!0,Reflect.decorate&&typeof t!=\"object\"&&Object.defineProperty(i,t,e),e);var gt;function He(i){return(t,e)=>G(t,e,{get(){return(this.renderRoot??gt??(gt=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=b`\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([x(\"consent-button\")],_);var T=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 `}};T.formAssociated=!0,T.styles=b`\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})],T.prototype,\"name\",2),n([l({type:Boolean,reflect:!0})],T.prototype,\"checked\",2),n([l({type:Boolean})],T.prototype,\"required\",2),n([l({type:Boolean,reflect:!0})],T.prototype,\"disabled\",2),n([l({type:String})],T.prototype,\"value\",2),T=n([x(\"consent-checkbox\")],T);var C=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 `}};C.formAssociated=!0,C.styles=b`\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})],C.prototype,\"type\",2),n([l({type:String})],C.prototype,\"name\",2),n([l({type:String})],C.prototype,\"value\",2),n([l({type:String})],C.prototype,\"label\",2),n([l({type:String})],C.prototype,\"placeholder\",2),n([l({type:Boolean})],C.prototype,\"required\",2),n([l({type:Boolean,reflect:!0})],C.prototype,\"disabled\",2),n([l({type:String})],C.prototype,\"autocomplete\",2),n([l({type:String})],C.prototype,\"error\",2),n([w()],C.prototype,\"showPassword\",2),C=n([x(\"consent-input\")],C);var I=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 `}};I.styles=b`\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\"})],I.prototype,\"pageTitle\",2),n([l({type:String,attribute:\"logo-url\"})],I.prototype,\"logoUrl\",2),n([l({type:String,attribute:\"company-name\"})],I.prototype,\"companyName\",2),n([l({type:String,attribute:\"primary-color\"})],I.prototype,\"primaryColor\",2),n([l({type:String,attribute:\"secondary-color\"})],I.prototype,\"secondaryColor\",2),I=n([x(\"consent-shell\")],I);var P=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 `}};P.styles=b`\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)}})],P.prototype,\"scopes\",2),n([l({type:Boolean})],P.prototype,\"interactive\",2),n([l({type:Boolean,attribute:\"select-all\"})],P.prototype,\"selectAll\",2),n([l({type:String,attribute:\"icon-style\"})],P.prototype,\"iconStyle\",2),n([w()],P.prototype,\"selectedScopes\",2),P=n([x(\"consent-permissions\")],P);var $=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 `}};$.formAssociated=!0,$.styles=b`\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})],$.prototype,\"name\",2),n([l({type:String})],$.prototype,\"text\",2),n([l({type:String})],$.prototype,\"url\",2),n([l({type:String,attribute:\"privacy-text\"})],$.prototype,\"privacyText\",2),n([l({type:String,attribute:\"privacy-url\"})],$.prototype,\"privacyUrl\",2),n([l({type:String,attribute:\"label-prefix\"})],$.prototype,\"labelPrefix\",2),n([l({type:String})],$.prototype,\"conjunction\",2),n([l({type:Boolean,reflect:!0})],$.prototype,\"checked\",2),n([l({type:Boolean})],$.prototype,\"required\",2),n([l({type:Boolean,reflect:!0})],$.prototype,\"disabled\",2),n([l({type:String})],$.prototype,\"value\",2),$=n([x(\"consent-terms\")],$);var Fe={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},pe=i=>(...t)=>({_$litDirective$:i,values:t}),ce=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 q=class extends ce{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===U)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:[]}}};q.directiveName=\"unsafeHTML\",q.resultType=1;var Wr=pe(q);var oe=class extends q{};oe.directiveName=\"unsafeSVG\",oe.resultType=2;var qe=pe(oe);function ft(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 ze={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\"}},S=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 ze[this.provider]||ze.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=ft(this.customIcon);return d`<div class=\"icon\">${qe(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 `}};S.styles=b`\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})],S.prototype,\"provider\",2),n([l({type:String,attribute:\"provider-name\"})],S.prototype,\"providerName\",2),n([l({type:String})],S.prototype,\"url\",2),n([l({type:String,attribute:\"button-text\"})],S.prototype,\"buttonText\",2),n([l({type:Boolean,reflect:!0})],S.prototype,\"loading\",2),n([l({type:Boolean,reflect:!0})],S.prototype,\"disabled\",2),n([l({type:Boolean,attribute:\"full-width\"})],S.prototype,\"fullWidth\",2),n([l({type:String,attribute:\"custom-icon\"})],S.prototype,\"customIcon\",2),n([w()],S.prototype,\"redirecting\",2),S=n([x(\"consent-oauth-button\")],S);var A=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 `}};A.formAssociated=!0,A.styles=b`\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})],A.prototype,\"length\",2),n([l({type:String})],A.prototype,\"name\",2),n([l({type:String})],A.prototype,\"value\",2),n([l({type:Boolean,reflect:!0})],A.prototype,\"disabled\",2),n([l({type:Boolean,reflect:!0})],A.prototype,\"error\",2),n([l({type:Boolean,attribute:\"auto-focus\"})],A.prototype,\"autoFocus\",2),n([l({type:String,attribute:\"input-type\"})],A.prototype,\"inputType\",2),n([w()],A.prototype,\"digits\",2),n([He(\"input\")],A.prototype,\"inputs\",2),A=n([x(\"consent-otp-input\")],A);var f={CONSENT_ONLY:\"consent-only\",CREDENTIALS:\"credentials\",OAUTH:\"oauth\",MAGIC_LINK:\"magic-link\",OTP:\"otp\",QR_CODE:\"qr-code\",PASSKEY:\"passkey\",IDV:\"idv\"},L={NONE:\"none\",PASSWORD:\"password\",OAUTH2:\"oauth2\",MAGIC_LINK:\"magic_link\",OTP:\"otp\"},vt={[f.CONSENT_ONLY]:L.NONE,[f.CREDENTIALS]:L.PASSWORD,[f.OAUTH]:L.OAUTH2,[f.MAGIC_LINK]:L.MAGIC_LINK,[f.OTP]:L.OTP,[f.QR_CODE]:L.NONE,[f.PASSKEY]:L.NONE,[f.IDV]:L.NONE};function Ve(i){return vt[i]??L.NONE}var Y={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 fi={primaryColor:Y.PRIMARY,secondaryColor:Y.SECONDARY,logoUrl:void 0,companyName:void 0},E={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\"},K={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 je=30;function bt(i){return i?/^#[0-9A-Fa-f]{6}$/.test(i):!1}function Ge(i,t){return bt(i)?i:t}function yt(i){if(!i)return!1;try{let t=new URL(i);return t.protocol===\"http:\"||t.protocol===\"https:\"}catch{return!1}}function xt(i){if(yt(i))return i}function Ye(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 wt(i){return{\"--consent-primary\":i.primaryColor,\"--consent-secondary\":i.secondaryColor,\"--consent-primary-rgb\":Ye(i.primaryColor),\"--consent-secondary-rgb\":Ye(i.secondaryColor)}}function Ke(i){let t=Ge(i?.primaryColor,Y.PRIMARY),e=Ge(i?.secondaryColor,Y.SECONDARY),r=xt(i?.logoUrl),s=i?.companyName?.trim()||void 0,o=wt({primaryColor:t,secondaryColor:e});return{primaryColor:t,secondaryColor:e,logoUrl:r,companyName:s,cssVars:o}}var $t=\"[AI Agent]\";function We(i,t){return t?i.replace(new RegExp(Ct($t),\"g\"),t):i}function Ct(i){return i.replace(/[.*+?^${}()|[\\]\\\\]/g,\"\\\\$&\")}function Je(i,t){let e=i?.ui??{},r=i?.terms??{},s=i?.success??{},o=e.title??E.title,a=e.description??E.description,p=e.expirationText??E.expirationText,c=e.cancelButtonText??E.cancelButtonText,v=e.submitButtonText??E.submitButtonText,y=e.permissionsHeader??E.permissionsHeader,m=r.text??K.text,k=s.title??D.title,R=s.description??D.description,z=We(a,t),Qe=We(R,t);return{title:o,description:a,expirationText:p,cancelButtonText:c,submitButtonText:v,permissionsHeader:y,termsText:m,termsUrl:r.url,termsRequired:r.required??K.required,resolvedDescription:z,successTitle:k,successDescription:R,resolvedSuccessDescription:Qe,showCredential:s.showCredential??D.showCredential,continueButtonText:s.continueButtonText??D.continueButtonText}}function Et(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 At(i){return i==null?je:i<1?1:i>365?365:Math.floor(i)}function $e(i){return i?.oauth?.providerId?f.OAUTH:i?.credentials?.usernameLabel||i?.credentials?.passwordLabel?f.CREDENTIALS:i?.magicLink?.enabled?f.MAGIC_LINK:i?.otp?.enabled?f.OTP:f.CONSENT_ONLY}function St(i){return{title:i?.title??E.title,description:i?.description??E.description,expirationText:i?.expirationText??E.expirationText,cancelButtonText:i?.cancelButtonText??E.cancelButtonText,submitButtonText:i?.submitButtonText??E.submitButtonText,permissionsHeader:i?.permissionsHeader??E.permissionsHeader,autoClose:i?.autoClose??E.autoClose,popupEnabled:i?.popupEnabled??E.popupEnabled,theme:i?.theme??E.theme}}function _t(i){return{text:i?.text??K.text,url:i?.url,version:i?.version,required:i?.required??K.required}}function Tt(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 Ce(i,t){let e=Ke(i?.branding),r=Je(i,t),s=St(i?.ui),o=_t(i?.terms),a=Tt(i?.success),p=Et(i?.customFields),c=At(i?.expirationDays),v=$e(i);return{branding:e,copy:r,ui:s,terms:o,success:a,customFields:p,expirationDays:c,authMode:v,credentials:i?.credentials,oauth:i?.oauth,magicLink:i?.magicLink,otp:i?.otp,qrCode:i?.qrCode,passkey:i?.passkey,idv:i?.idv}}var h=class extends g{constructor(){super(...arguments);this.tool=\"\";this.scopes=[];this.agentDid=\"\";this.sessionId=\"\";this.projectId=\"\";this.serverUrl=\"\";this.agentName=\"\";this.provider=\"\";this.csrfToken=\"\";this.credentialProviderType=\"\";this.credentialProvider=\"\";this.currentMode=f.CONSENT_ONLY;this.loading=!1;this.step=\"consent\";this.termsAccepted=!1;this.formData={};this.resendCooldown=0;this.selectedScopes=[]}connectedCallback(){super.connectedCallback(),this.resolved=Ce(this.config,this.agentName),this.currentMode=this.mode??$e(this.config)??f.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=Ce(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))}getProviderType(){return this.currentMode===f.OAUTH&&this.oauthIdentity?.provider?this.oauthIdentity.provider:Ve(this.currentMode)}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.getProviderType()),this.provider&&r.append(\"provider\",this.provider),this.csrfToken&&r.append(\"csrf_token\",this.csrfToken),r.append(\"termsAccepted\",String(this.termsAccepted)),this.credentialProviderType&&r.append(\"credential_provider_type\",this.credentialProviderType),this.credentialProvider&&r.append(\"credential_provider\",this.credentialProvider),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();if(o.redirectUrl){this.dispatchEvent(new CustomEvent(\"mcp-consent:approve\",{detail:{success:!0,redirectUrl:o.redirectUrl},bubbles:!0,composed:!0})),window.location.href=o.redirectUrl;return}this.step=\"success\",this.dispatchEvent(new CustomEvent(\"mcp-consent:approve\",{detail:{success:!0,delegationId:o.delegation_id},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=>{let o=r.detail?.value??r.target?.value??\"\";this.handleInputChange(\"username\",o)}}\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=>{let o=r.detail?.value??r.target?.value??\"\";this.handleInputChange(\"password\",o)}}\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=>{let o=r.detail?.value??r.target?.value??\"\";this.handleInputChange(\"email\",o)}}\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=>{let o=r.detail?.value??\"\";this.handleInputChange(\"otp\",o),this.handleApprove()}}\n @input=${r=>{let o=r.detail?.value??\"\";this.handleInputChange(\"otp\",o)}}\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 f.CREDENTIALS:return this.renderCredentials();case f.OAUTH:return this.renderOAuth();case f.MAGIC_LINK:return this.renderMagicLink();case f.OTP:return this.renderOTP();case f.CONSENT_ONLY:default:return this.renderConsentOnly()}}};h.styles=b`\n :host {\n display: block;\n /* System font stack with font smoothing for crisp text */\n font-family:\n -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\",\n 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):\"\"}})],h.prototype,\"config\",2),n([l({type:String})],h.prototype,\"mode\",2),n([l({type:String})],h.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)}})],h.prototype,\"scopes\",2),n([l({type:String,attribute:\"agent-did\"})],h.prototype,\"agentDid\",2),n([l({type:String,attribute:\"session-id\"})],h.prototype,\"sessionId\",2),n([l({type:String,attribute:\"project-id\"})],h.prototype,\"projectId\",2),n([l({type:String,attribute:\"server-url\"})],h.prototype,\"serverUrl\",2),n([l({type:String,attribute:\"agent-name\"})],h.prototype,\"agentName\",2),n([l({type:String,attribute:\"provider\"})],h.prototype,\"provider\",2),n([l({type:String,attribute:\"csrf-token\"})],h.prototype,\"csrfToken\",2),n([l({type:String,attribute:\"credential-provider-type\"})],h.prototype,\"credentialProviderType\",2),n([l({type:String,attribute:\"credential-provider\"})],h.prototype,\"credentialProvider\",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):\"\"}})],h.prototype,\"oauthIdentity\",2),n([w()],h.prototype,\"resolved\",2),n([w()],h.prototype,\"currentMode\",2),n([w()],h.prototype,\"loading\",2),n([w()],h.prototype,\"error\",2),n([w()],h.prototype,\"step\",2),n([w()],h.prototype,\"termsAccepted\",2),n([w()],h.prototype,\"formData\",2),n([w()],h.prototype,\"resendCooldown\",2),n([w()],h.prototype,\"selectedScopes\",2),h=n([x(\"mcp-consent\")],h);export{_ as ConsentButton,T as ConsentCheckbox,C as ConsentInput,S as ConsentOAuthButton,A as ConsentOTPInput,P as ConsentPermissions,I as ConsentShell,$ as ConsentTerms,h 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
15
|
/**
|
|
16
16
|
* Size of the bundle in bytes (for logging/debugging)
|
|
17
17
|
*/
|
|
18
|
-
export const CONSENT_BUNDLE_SIZE =
|
|
18
|
+
export const CONSENT_BUNDLE_SIZE = 84522;
|
|
@@ -1 +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,
|
|
1
|
+
{"version":3,"file":"inline.js","sourceRoot":"","sources":["../../src/bundle/inline.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;;GAGG;AACH,MAAM,CAAC,MAAM,cAAc,GAAW,mirFAAmirF,CAAC;AAE1krF;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAW,KAAK,CAAC"}
|
package/dist/bundle/shell.d.ts
CHANGED
|
@@ -45,6 +45,12 @@ export interface ConsentShellOptions {
|
|
|
45
45
|
authMode?: string;
|
|
46
46
|
/** Provider name for credentials/oauth flows */
|
|
47
47
|
provider?: string;
|
|
48
|
+
/** CSRF token for form security (required for credential auth) */
|
|
49
|
+
csrfToken?: string;
|
|
50
|
+
/** Credential provider type from prior auth step (for 3-screen flow) */
|
|
51
|
+
credentialProviderType?: string;
|
|
52
|
+
/** Credential provider name from prior auth step (for 3-screen flow) */
|
|
53
|
+
credentialProvider?: string;
|
|
48
54
|
}
|
|
49
55
|
/**
|
|
50
56
|
* Generate the consent page HTML shell
|
|
@@ -1 +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;
|
|
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;IAClB,kEAAkE;IAClE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,wEAAwE;IACxE,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,wEAAwE;IACxE,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,mBAAmB,GAAG,MAAM,CA6MzE;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,IAAI,CAAC,mBAAmB,EAAE,YAAY,CAAC,EAChD,YAAY,EAAE,MAAM,GACnB,MAAM,CAsDR"}
|
package/dist/bundle/shell.js
CHANGED
|
@@ -41,7 +41,7 @@ import { escapeHtml, escapeAttr } from '../security/escape.js';
|
|
|
41
41
|
* ```
|
|
42
42
|
*/
|
|
43
43
|
export function generateConsentShell(options) {
|
|
44
|
-
const { config, tool, scopes, agentDid, sessionId, projectId, serverUrl, oauthIdentity, bundlePath = '/consent.js', pageTitle = 'Permission Request', nonce, authMode, provider, } = options;
|
|
44
|
+
const { config, tool, scopes, agentDid, sessionId, projectId, serverUrl, oauthIdentity, bundlePath = '/consent.js', pageTitle = 'Permission Request', nonce, authMode, provider, csrfToken, credentialProviderType, credentialProvider, } = options;
|
|
45
45
|
// Safely serialize config as JSON for attribute
|
|
46
46
|
const configJson = JSON.stringify(config);
|
|
47
47
|
const scopesJson = JSON.stringify(scopes);
|
|
@@ -186,6 +186,9 @@ export function generateConsentShell(options) {
|
|
|
186
186
|
${oauthJson ? `oauth-identity='${escapeAttr(oauthJson)}'` : ''}
|
|
187
187
|
${authMode ? `auth-mode="${escapeAttr(authMode)}"` : ''}
|
|
188
188
|
${provider ? `provider="${escapeAttr(provider)}"` : ''}
|
|
189
|
+
${csrfToken ? `csrf-token="${escapeAttr(csrfToken)}"` : ''}
|
|
190
|
+
${credentialProviderType ? `credential-provider-type="${escapeAttr(credentialProviderType)}"` : ''}
|
|
191
|
+
${credentialProvider ? `credential-provider="${escapeAttr(credentialProvider)}"` : ''}
|
|
189
192
|
></mcp-consent>
|
|
190
193
|
|
|
191
194
|
<!-- Loading skeleton (hidden once component is defined) -->
|
package/dist/bundle/shell.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shell.js","sourceRoot":"","sources":["../../src/bundle/shell.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"shell.js","sourceRoot":"","sources":["../../src/bundle/shell.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AA0C/D;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,UAAU,oBAAoB,CAAC,OAA4B;IAC/D,MAAM,EACJ,MAAM,EACN,IAAI,EACJ,MAAM,EACN,QAAQ,EACR,SAAS,EACT,SAAS,EACT,SAAS,EACT,aAAa,EACb,UAAU,GAAG,aAAa,EAC1B,SAAS,GAAG,oBAAoB,EAChC,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,SAAS,EACT,sBAAsB,EACtB,kBAAkB,GACnB,GAAG,OAAO,CAAC;IAEZ,gDAAgD;IAChD,MAAM,UAAU,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IAC1C,MAAM,UAAU,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IAC1C,MAAM,SAAS,GAAG,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IAEvE,oCAAoC;IACpC,MAAM,SAAS,GAAG,KAAK,CAAC,CAAC,CAAC,WAAW,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;IAE/D,OAAO;;;;;;WAME,UAAU,CAAC,SAAS,CAAC;;;8BAGF,UAAU,CAAC,UAAU,CAAC;;;+BAGrB,UAAU,CAAC,UAAU,CAAC,IAAI,SAAS;;UAExD,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAkHL,UAAU,CAAC,UAAU,CAAC;YACxB,UAAU,CAAC,IAAI,CAAC;cACd,UAAU,CAAC,UAAU,CAAC;iBACnB,UAAU,CAAC,QAAQ,CAAC;kBACnB,UAAU,CAAC,SAAS,CAAC;kBACrB,UAAU,CAAC,SAAS,CAAC;kBACrB,UAAU,CAAC,SAAS,CAAC;MACjC,SAAS,CAAC,CAAC,CAAC,mBAAmB,UAAU,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE;MAC5D,QAAQ,CAAC,CAAC,CAAC,cAAc,UAAU,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE;MACrD,QAAQ,CAAC,CAAC,CAAC,aAAa,UAAU,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE;MACpD,SAAS,CAAC,CAAC,CAAC,eAAe,UAAU,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE;MACxD,sBAAsB,CAAC,CAAC,CAAC,6BAA6B,UAAU,CAAC,sBAAsB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE;MAChG,kBAAkB,CAAC,CAAC,CAAC,wBAAwB,UAAU,CAAC,kBAAkB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE;;;;;;;;;;;;;;;;;;;;wDAoBjC,UAAU,CAAC,SAAS,CAAC;;;;gDAI7B,UAAU,CAAC,IAAI,CAAC;kDACd,UAAU,CAAC,UAAU,CAAC;qDACnB,UAAU,CAAC,QAAQ,CAAC;sDACnB,UAAU,CAAC,SAAS,CAAC;sDACrB,UAAU,CAAC,SAAS,CAAC;;;;;;;;QAQnE,CAAC;AACT,CAAC;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,0BAA0B,CACxC,OAAgD,EAChD,YAAoB;IAEpB,MAAM,EACJ,MAAM,EACN,IAAI,EACJ,MAAM,EACN,QAAQ,EACR,SAAS,EACT,SAAS,EACT,SAAS,EACT,aAAa,EACb,SAAS,GAAG,oBAAoB,EAChC,KAAK,GACN,GAAG,OAAO,CAAC;IAEZ,MAAM,UAAU,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IAC1C,MAAM,UAAU,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IAC1C,MAAM,SAAS,GAAG,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IACvE,MAAM,SAAS,GAAG,KAAK,CAAC,CAAC,CAAC,WAAW,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;IAE/D,OAAO;;;;;WAKE,UAAU,CAAC,SAAS,CAAC;yBACP,SAAS;EAChC,YAAY;;UAEJ,SAAS;;;;;;;;;;;;;;;cAeL,UAAU,CAAC,UAAU,CAAC;YACxB,UAAU,CAAC,IAAI,CAAC;cACd,UAAU,CAAC,UAAU,CAAC;iBACnB,UAAU,CAAC,QAAQ,CAAC;kBACnB,UAAU,CAAC,SAAS,CAAC;kBACrB,UAAU,CAAC,SAAS,CAAC;kBACrB,UAAU,CAAC,SAAS,CAAC;MACjC,SAAS,CAAC,CAAC,CAAC,mBAAmB,UAAU,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE;;;QAG1D,CAAC;AACT,CAAC"}
|