kenobi-js 0.1.42 → 0.1.44

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.
@@ -1,8 +1,145 @@
1
1
  /*!
2
- * Kenobi SDK v0.1.42
2
+ * Kenobi SDK v0.1.44
3
3
  * (c) 2026 Kenobi.ai
4
4
  */
5
- "use strict";var KenobiLib=(()=>{var Te=Object.defineProperty;var ir=Object.getOwnPropertyDescriptor;var or=Object.getOwnPropertyNames;var ar=Object.prototype.hasOwnProperty;var sr=(e,t,r)=>t in e?Te(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var lr=(e,t)=>{for(var r in t)Te(e,r,{get:t[r],enumerable:!0})},cr=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of or(t))!ar.call(e,i)&&i!==r&&Te(e,i,{get:()=>t[i],enumerable:!(n=ir(t,i))||n.enumerable});return e};var ur=e=>cr(Te({},"__esModule",{value:!0}),e);var h=(e,t,r)=>sr(e,typeof t!="symbol"?t+"":t,r);var Zr={};lr(Zr,{CueCard:()=>ke,Kenobi:()=>rt,TRANSFORMATION_ACTIONS:()=>Xt});var at=11;function dr(e,t){var r=t.attributes,n,i,o,a,l;if(!(t.nodeType===at||e.nodeType===at)){for(var d=r.length-1;d>=0;d--)n=r[d],i=n.name,o=n.namespaceURI,a=n.value,o?(i=n.localName||i,l=e.getAttributeNS(o,i),l!==a&&(n.prefix==="xmlns"&&(i=n.name),e.setAttributeNS(o,i,a))):(l=e.getAttribute(i),l!==a&&e.setAttribute(i,a));for(var c=e.attributes,u=c.length-1;u>=0;u--)n=c[u],i=n.name,o=n.namespaceURI,o?(i=n.localName||i,t.hasAttributeNS(o,i)||e.removeAttributeNS(o,i)):t.hasAttribute(i)||e.removeAttribute(i)}}var Se,pr="http://www.w3.org/1999/xhtml",j=typeof document>"u"?void 0:document,fr=!!j&&"content"in j.createElement("template"),hr=!!j&&j.createRange&&"createContextualFragment"in j.createRange();function mr(e){var t=j.createElement("template");return t.innerHTML=e,t.content.childNodes[0]}function br(e){Se||(Se=j.createRange(),Se.selectNode(j.body));var t=Se.createContextualFragment(e);return t.childNodes[0]}function gr(e){var t=j.createElement("body");return t.innerHTML=e,t.childNodes[0]}function _r(e){return e=e.trim(),fr?mr(e):hr?br(e):gr(e)}function Ee(e,t){var r=e.nodeName,n=t.nodeName,i,o;return r===n?!0:(i=r.charCodeAt(0),o=n.charCodeAt(0),i<=90&&o>=97?r===n.toUpperCase():o<=90&&i>=97?n===r.toUpperCase():!1)}function vr(e,t){return!t||t===pr?j.createElement(e):j.createElementNS(t,e)}function yr(e,t){for(var r=e.firstChild;r;){var n=r.nextSibling;t.appendChild(r),r=n}return t}function $e(e,t,r){e[r]!==t[r]&&(e[r]=t[r],e[r]?e.setAttribute(r,""):e.removeAttribute(r))}var st={OPTION:function(e,t){var r=e.parentNode;if(r){var n=r.nodeName.toUpperCase();n==="OPTGROUP"&&(r=r.parentNode,n=r&&r.nodeName.toUpperCase()),n==="SELECT"&&!r.hasAttribute("multiple")&&(e.hasAttribute("selected")&&!t.selected&&(e.setAttribute("selected","selected"),e.removeAttribute("selected")),r.selectedIndex=-1)}$e(e,t,"selected")},INPUT:function(e,t){$e(e,t,"checked"),$e(e,t,"disabled"),e.value!==t.value&&(e.value=t.value),t.hasAttribute("value")||e.removeAttribute("value")},TEXTAREA:function(e,t){var r=t.value;e.value!==r&&(e.value=r);var n=e.firstChild;if(n){var i=n.nodeValue;if(i==r||!r&&i==e.placeholder)return;n.nodeValue=r}},SELECT:function(e,t){if(!t.hasAttribute("multiple")){for(var r=-1,n=0,i=e.firstChild,o,a;i;)if(a=i.nodeName&&i.nodeName.toUpperCase(),a==="OPTGROUP")o=i,i=o.firstChild,i||(i=o.nextSibling,o=null);else{if(a==="OPTION"){if(i.hasAttribute("selected")){r=n;break}n++}i=i.nextSibling,!i&&o&&(i=o.nextSibling,o=null)}e.selectedIndex=r}}},ge=1,lt=11,ct=3,ut=8;function ae(){}function kr(e){if(e)return e.getAttribute&&e.getAttribute("id")||e.id}function wr(e){return function(r,n,i){if(i||(i={}),typeof n=="string")if(r.nodeName==="#document"||r.nodeName==="HTML"||r.nodeName==="BODY"){var o=n;n=j.createElement("html"),n.innerHTML=o}else n=_r(n);else n.nodeType===lt&&(n=n.firstElementChild);var a=i.getNodeKey||kr,l=i.onBeforeNodeAdded||ae,d=i.onNodeAdded||ae,c=i.onBeforeElUpdated||ae,u=i.onElUpdated||ae,s=i.onBeforeNodeDiscarded||ae,f=i.onNodeDiscarded||ae,m=i.onBeforeElChildrenUpdated||ae,S=i.skipFromChildren||ae,L=i.addChild||function(y,k){return y.appendChild(k)},E=i.childrenOnly===!0,b=Object.create(null),v=[];function C(y){v.push(y)}function F(y,k){if(y.nodeType===ge)for(var D=y.firstChild;D;){var w=void 0;k&&(w=a(D))?C(w):(f(D),D.firstChild&&F(D,k)),D=D.nextSibling}}function z(y,k,D){s(y)!==!1&&(k&&k.removeChild(y),f(y),F(y,D))}function _(y){if(y.nodeType===ge||y.nodeType===lt)for(var k=y.firstChild;k;){var D=a(k);D&&(b[D]=k),_(k),k=k.nextSibling}}_(r);function U(y){d(y);for(var k=y.firstChild;k;){var D=k.nextSibling,w=a(k);if(w){var A=b[w];A&&Ee(k,A)?(k.parentNode.replaceChild(A,k),R(A,k)):U(k)}else U(k);k=D}}function O(y,k,D){for(;k;){var w=k.nextSibling;(D=a(k))?C(D):z(k,y,!0),k=w}}function R(y,k,D){var w=a(k);if(w&&delete b[w],!D){var A=c(y,k);if(A===!1||(A instanceof HTMLElement&&(y=A,_(y)),e(y,k),u(y),m(y,k)===!1))return}y.nodeName!=="TEXTAREA"?K(y,k):st.TEXTAREA(y,k)}function K(y,k){var D=S(y,k),w=k.firstChild,A=y.firstChild,W,q,re,pe,J;e:for(;w;){for(pe=w.nextSibling,W=a(w);!D&&A;){if(re=A.nextSibling,w.isSameNode&&w.isSameNode(A)){w=pe,A=re;continue e}q=a(A);var fe=A.nodeType,Y=void 0;if(fe===w.nodeType&&(fe===ge?(W?W!==q&&((J=b[W])?re===J?Y=!1:(y.insertBefore(J,A),q?C(q):z(A,y,!0),A=J,q=a(A)):Y=!1):q&&(Y=!1),Y=Y!==!1&&Ee(A,w),Y&&R(A,w)):(fe===ct||fe==ut)&&(Y=!0,A.nodeValue!==w.nodeValue&&(A.nodeValue=w.nodeValue))),Y){w=pe,A=re;continue e}q?C(q):z(A,y,!0),A=re}if(W&&(J=b[W])&&Ee(J,w))D||L(y,J),R(J,w);else{var be=l(w);be!==!1&&(be&&(w=be),w.actualize&&(w=w.actualize(y.ownerDocument||j)),L(y,w),U(w))}w=pe,A=re}O(y,A,q);var B=st[y.nodeName];B&&B(y,k)}var M=r,V=M.nodeType,xe=n.nodeType;if(!E){if(V===ge)xe===ge?Ee(r,n)||(f(r),M=yr(r,vr(n.nodeName,n.namespaceURI))):M=n;else if(V===ct||V===ut){if(xe===V)return M.nodeValue!==n.nodeValue&&(M.nodeValue=n.nodeValue),M;M=n}}if(M===n)f(r);else{if(n.isSameNode&&n.isSameNode(M))return;if(R(M,n,E),v)for(var de=0,se=v.length;de<se;de++){var le=b[v[de]];le&&z(le,le.parentNode,!1)}}return!E&&M!==r&&r.parentNode&&(M.actualize&&(M=M.actualize(r.ownerDocument||j)),r.parentNode.replaceChild(M,r)),M}}var xr=wr(dr),Ae=xr;var De,P,mt,Cr,ue,dt,bt,gt,_t,We,Ve,Be,Tr,_e={},vt=[],Sr=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,ze=Array.isArray;function ne(e,t){for(var r in t)e[r]=t[r];return e}function qe(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function Er(e,t,r){var n,i,o,a={};for(o in t)o=="key"?n=t[o]:o=="ref"?i=t[o]:a[o]=t[o];if(arguments.length>2&&(a.children=arguments.length>3?De.call(arguments,2):r),typeof e=="function"&&e.defaultProps!=null)for(o in e.defaultProps)a[o]===void 0&&(a[o]=e.defaultProps[o]);return Pe(e,a,n,i,null)}function Pe(e,t,r,n,i){var o={type:e,props:t,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i??++mt,__i:-1,__u:0};return i==null&&P.vnode!=null&&P.vnode(o),o}function ie(e){return e.children}function Le(e,t){this.props=e,this.context=t}function he(e,t){if(t==null)return e.__?he(e.__,e.__i+1):null;for(var r;t<e.__k.length;t++)if((r=e.__k[t])!=null&&r.__e!=null)return r.__e;return typeof e.type=="function"?he(e):null}function yt(e){var t,r;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((r=e.__k[t])!=null&&r.__e!=null){e.__e=e.__c.base=r.__e;break}return yt(e)}}function pt(e){(!e.__d&&(e.__d=!0)&&ue.push(e)&&!Re.__r++||dt!=P.debounceRendering)&&((dt=P.debounceRendering)||bt)(Re)}function Re(){for(var e,t,r,n,i,o,a,l=1;ue.length;)ue.length>l&&ue.sort(gt),e=ue.shift(),l=ue.length,e.__d&&(r=void 0,n=void 0,i=(n=(t=e).__v).__e,o=[],a=[],t.__P&&((r=ne({},n)).__v=n.__v+1,P.vnode&&P.vnode(r),Xe(t.__P,r,n,t.__n,t.__P.namespaceURI,32&n.__u?[i]:null,o,i??he(n),!!(32&n.__u),a),r.__v=n.__v,r.__.__k[r.__i]=r,xt(o,r,a),n.__e=n.__=null,r.__e!=i&&yt(r)));Re.__r=0}function kt(e,t,r,n,i,o,a,l,d,c,u){var s,f,m,S,L,E,b,v=n&&n.__k||vt,C=t.length;for(d=Ar(r,t,v,d,C),s=0;s<C;s++)(m=r.__k[s])!=null&&(f=m.__i==-1?_e:v[m.__i]||_e,m.__i=s,E=Xe(e,m,f,i,o,a,l,d,c,u),S=m.__e,m.ref&&f.ref!=m.ref&&(f.ref&&Ge(f.ref,null,m),u.push(m.ref,m.__c||S,m)),L==null&&S!=null&&(L=S),(b=!!(4&m.__u))||f.__k===m.__k?d=wt(m,d,e,b):typeof m.type=="function"&&E!==void 0?d=E:S&&(d=S.nextSibling),m.__u&=-7);return r.__e=L,d}function Ar(e,t,r,n,i){var o,a,l,d,c,u=r.length,s=u,f=0;for(e.__k=new Array(i),o=0;o<i;o++)(a=t[o])!=null&&typeof a!="boolean"&&typeof a!="function"?(d=o+f,(a=e.__k[o]=typeof a=="string"||typeof a=="number"||typeof a=="bigint"||a.constructor==String?Pe(null,a,null,null,null):ze(a)?Pe(ie,{children:a},null,null,null):a.constructor==null&&a.__b>0?Pe(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):a).__=e,a.__b=e.__b+1,l=null,(c=a.__i=Mr(a,r,d,s))!=-1&&(s--,(l=r[c])&&(l.__u|=2)),l==null||l.__v==null?(c==-1&&(i>u?f--:i<u&&f++),typeof a.type!="function"&&(a.__u|=4)):c!=d&&(c==d-1?f--:c==d+1?f++:(c>d?f--:f++,a.__u|=4))):e.__k[o]=null;if(s)for(o=0;o<u;o++)(l=r[o])!=null&&(2&l.__u)==0&&(l.__e==n&&(n=he(l)),Tt(l,l));return n}function wt(e,t,r,n){var i,o;if(typeof e.type=="function"){for(i=e.__k,o=0;i&&o<i.length;o++)i[o]&&(i[o].__=e,t=wt(i[o],t,r,n));return t}e.__e!=t&&(n&&(t&&e.type&&!t.parentNode&&(t=he(e)),r.insertBefore(e.__e,t||null)),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function Mr(e,t,r,n){var i,o,a,l=e.key,d=e.type,c=t[r],u=c!=null&&(2&c.__u)==0;if(c===null&&e.key==null||u&&l==c.key&&d==c.type)return r;if(n>(u?1:0)){for(i=r-1,o=r+1;i>=0||o<t.length;)if((c=t[a=i>=0?i--:o++])!=null&&(2&c.__u)==0&&l==c.key&&d==c.type)return a}return-1}function ft(e,t,r){t[0]=="-"?e.setProperty(t,r??""):e[t]=r==null?"":typeof r!="number"||Sr.test(t)?r:r+"px"}function Me(e,t,r,n,i){var o,a;e:if(t=="style")if(typeof r=="string")e.style.cssText=r;else{if(typeof n=="string"&&(e.style.cssText=n=""),n)for(t in n)r&&t in r||ft(e.style,t,"");if(r)for(t in r)n&&r[t]==n[t]||ft(e.style,t,r[t])}else if(t[0]=="o"&&t[1]=="n")o=t!=(t=t.replace(_t,"$1")),a=t.toLowerCase(),t=a in e||t=="onFocusOut"||t=="onFocusIn"?a.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=r,r?n?r.u=n.u:(r.u=We,e.addEventListener(t,o?Be:Ve,o)):e.removeEventListener(t,o?Be:Ve,o);else{if(i=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=r??"";break e}catch{}typeof r=="function"||(r==null||r===!1&&t[4]!="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&r==1?"":r))}}function ht(e){return function(t){if(this.l){var r=this.l[t.type+e];if(t.t==null)t.t=We++;else if(t.t<r.u)return;return r(P.event?P.event(t):t)}}}function Xe(e,t,r,n,i,o,a,l,d,c){var u,s,f,m,S,L,E,b,v,C,F,z,_,U,O,R,K,M=t.type;if(t.constructor!=null)return null;128&r.__u&&(d=!!(32&r.__u),o=[l=t.__e=r.__e]),(u=P.__b)&&u(t);e:if(typeof M=="function")try{if(b=t.props,v="prototype"in M&&M.prototype.render,C=(u=M.contextType)&&n[u.__c],F=u?C?C.props.value:u.__:n,r.__c?E=(s=t.__c=r.__c).__=s.__E:(v?t.__c=s=new M(b,F):(t.__c=s=new Le(b,F),s.constructor=M,s.render=Lr),C&&C.sub(s),s.props=b,s.state||(s.state={}),s.context=F,s.__n=n,f=s.__d=!0,s.__h=[],s._sb=[]),v&&s.__s==null&&(s.__s=s.state),v&&M.getDerivedStateFromProps!=null&&(s.__s==s.state&&(s.__s=ne({},s.__s)),ne(s.__s,M.getDerivedStateFromProps(b,s.__s))),m=s.props,S=s.state,s.__v=t,f)v&&M.getDerivedStateFromProps==null&&s.componentWillMount!=null&&s.componentWillMount(),v&&s.componentDidMount!=null&&s.__h.push(s.componentDidMount);else{if(v&&M.getDerivedStateFromProps==null&&b!==m&&s.componentWillReceiveProps!=null&&s.componentWillReceiveProps(b,F),!s.__e&&s.shouldComponentUpdate!=null&&s.shouldComponentUpdate(b,s.__s,F)===!1||t.__v==r.__v){for(t.__v!=r.__v&&(s.props=b,s.state=s.__s,s.__d=!1),t.__e=r.__e,t.__k=r.__k,t.__k.some(function(V){V&&(V.__=t)}),z=0;z<s._sb.length;z++)s.__h.push(s._sb[z]);s._sb=[],s.__h.length&&a.push(s);break e}s.componentWillUpdate!=null&&s.componentWillUpdate(b,s.__s,F),v&&s.componentDidUpdate!=null&&s.__h.push(function(){s.componentDidUpdate(m,S,L)})}if(s.context=F,s.props=b,s.__P=e,s.__e=!1,_=P.__r,U=0,v){for(s.state=s.__s,s.__d=!1,_&&_(t),u=s.render(s.props,s.state,s.context),O=0;O<s._sb.length;O++)s.__h.push(s._sb[O]);s._sb=[]}else do s.__d=!1,_&&_(t),u=s.render(s.props,s.state,s.context),s.state=s.__s;while(s.__d&&++U<25);s.state=s.__s,s.getChildContext!=null&&(n=ne(ne({},n),s.getChildContext())),v&&!f&&s.getSnapshotBeforeUpdate!=null&&(L=s.getSnapshotBeforeUpdate(m,S)),R=u,u!=null&&u.type===ie&&u.key==null&&(R=Ct(u.props.children)),l=kt(e,ze(R)?R:[R],t,r,n,i,o,a,l,d,c),s.base=t.__e,t.__u&=-161,s.__h.length&&a.push(s),E&&(s.__E=s.__=null)}catch(V){if(t.__v=null,d||o!=null)if(V.then){for(t.__u|=d?160:128;l&&l.nodeType==8&&l.nextSibling;)l=l.nextSibling;o[o.indexOf(l)]=null,t.__e=l}else{for(K=o.length;K--;)qe(o[K]);je(t)}else t.__e=r.__e,t.__k=r.__k,V.then||je(t);P.__e(V,t,r)}else o==null&&t.__v==r.__v?(t.__k=r.__k,t.__e=r.__e):l=t.__e=Pr(r.__e,t,r,n,i,o,a,d,c);return(u=P.diffed)&&u(t),128&t.__u?void 0:l}function je(e){e&&e.__c&&(e.__c.__e=!0),e&&e.__k&&e.__k.forEach(je)}function xt(e,t,r){for(var n=0;n<r.length;n++)Ge(r[n],r[++n],r[++n]);P.__c&&P.__c(t,e),e.some(function(i){try{e=i.__h,i.__h=[],e.some(function(o){o.call(i)})}catch(o){P.__e(o,i.__v)}})}function Ct(e){return typeof e!="object"||e==null||e.__b&&e.__b>0?e:ze(e)?e.map(Ct):ne({},e)}function Pr(e,t,r,n,i,o,a,l,d){var c,u,s,f,m,S,L,E=r.props,b=t.props,v=t.type;if(v=="svg"?i="http://www.w3.org/2000/svg":v=="math"?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),o!=null){for(c=0;c<o.length;c++)if((m=o[c])&&"setAttribute"in m==!!v&&(v?m.localName==v:m.nodeType==3)){e=m,o[c]=null;break}}if(e==null){if(v==null)return document.createTextNode(b);e=document.createElementNS(i,v,b.is&&b),l&&(P.__m&&P.__m(t,o),l=!1),o=null}if(v==null)E===b||l&&e.data==b||(e.data=b);else{if(o=o&&De.call(e.childNodes),E=r.props||_e,!l&&o!=null)for(E={},c=0;c<e.attributes.length;c++)E[(m=e.attributes[c]).name]=m.value;for(c in E)if(m=E[c],c!="children"){if(c=="dangerouslySetInnerHTML")s=m;else if(!(c in b)){if(c=="value"&&"defaultValue"in b||c=="checked"&&"defaultChecked"in b)continue;Me(e,c,null,m,i)}}for(c in b)m=b[c],c=="children"?f=m:c=="dangerouslySetInnerHTML"?u=m:c=="value"?S=m:c=="checked"?L=m:l&&typeof m!="function"||E[c]===m||Me(e,c,m,E[c],i);if(u)l||s&&(u.__html==s.__html||u.__html==e.innerHTML)||(e.innerHTML=u.__html),t.__k=[];else if(s&&(e.innerHTML=""),kt(t.type=="template"?e.content:e,ze(f)?f:[f],t,r,n,v=="foreignObject"?"http://www.w3.org/1999/xhtml":i,o,a,o?o[0]:r.__k&&he(r,0),l,d),o!=null)for(c=o.length;c--;)qe(o[c]);l||(c="value",v=="progress"&&S==null?e.removeAttribute("value"):S!=null&&(S!==e[c]||v=="progress"&&!S||v=="option"&&S!=E[c])&&Me(e,c,S,E[c],i),c="checked",L!=null&&L!=e[c]&&Me(e,c,L,E[c],i))}return e}function Ge(e,t,r){try{if(typeof e=="function"){var n=typeof e.__u=="function";n&&e.__u(),n&&t==null||(e.__u=e(t))}else e.current=t}catch(i){P.__e(i,r)}}function Tt(e,t,r){var n,i;if(P.unmount&&P.unmount(e),(n=e.ref)&&(n.current&&n.current!=e.__e||Ge(n,null,t)),(n=e.__c)!=null){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(o){P.__e(o,t)}n.base=n.__P=null}if(n=e.__k)for(i=0;i<n.length;i++)n[i]&&Tt(n[i],t,r||typeof e.type!="function");r||qe(e.__e),e.__c=e.__=e.__e=void 0}function Lr(e,t,r){return this.constructor(e,r)}function Ye(e,t,r){var n,i,o,a;t==document&&(t=document.documentElement),P.__&&P.__(e,t),i=(n=typeof r=="function")?null:r&&r.__k||t.__k,o=[],a=[],Xe(t,e=(!n&&r||t).__k=Er(ie,null,[e]),i||_e,_e,t.namespaceURI,!n&&r?[r]:i?null:t.firstChild?De.call(t.childNodes):null,o,!n&&r?r:i?i.__e:t.firstChild,n,a),xt(o,e,a)}De=vt.slice,P={__e:function(e,t,r,n){for(var i,o,a;t=t.__;)if((i=t.__c)&&!i.__)try{if((o=i.constructor)&&o.getDerivedStateFromError!=null&&(i.setState(o.getDerivedStateFromError(e)),a=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(e,n||{}),a=i.__d),a)return i.__E=i}catch(l){e=l}throw e}},mt=0,Cr=function(e){return e!=null&&e.constructor==null},Le.prototype.setState=function(e,t){var r;r=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=ne({},this.state),typeof e=="function"&&(e=e(ne({},r),this.props)),e&&ne(r,e),e!=null&&this.__v&&(t&&this._sb.push(t),pt(this))},Le.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),pt(this))},Le.prototype.render=ie,ue=[],bt=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,gt=function(e,t){return e.__v.__b-t.__v.__b},Re.__r=0,_t=/(PointerCapture)$|Capture$/i,We=0,Ve=ht(!1),Be=ht(!0),Tr=0;var ve,N,Qe,St,ye=0,zt=[],I=P,Et=I.__b,At=I.__r,Mt=I.diffed,Pt=I.__c,Lt=I.unmount,Rt=I.__;function Ze(e,t){I.__h&&I.__h(N,e,ye||t),ye=0;var r=N.__H||(N.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function oe(e){return ye=1,Rr(Ft,e)}function Rr(e,t,r){var n=Ze(ve++,2);if(n.t=e,!n.__c&&(n.__=[r?r(t):Ft(void 0,t),function(l){var d=n.__N?n.__N[0]:n.__[0],c=n.t(d,l);d!==c&&(n.__N=[c,n.__[1]],n.__c.setState({}))}],n.__c=N,!N.__f)){var i=function(l,d,c){if(!n.__c.__H)return!0;var u=n.__c.__H.__.filter(function(f){return!!f.__c});if(u.every(function(f){return!f.__N}))return!o||o.call(this,l,d,c);var s=n.__c.props!==l;return u.forEach(function(f){if(f.__N){var m=f.__[0];f.__=f.__N,f.__N=void 0,m!==f.__[0]&&(s=!0)}}),o&&o.call(this,l,d,c)||s};N.__f=!0;var o=N.shouldComponentUpdate,a=N.componentWillUpdate;N.componentWillUpdate=function(l,d,c){if(this.__e){var u=o;o=void 0,i(l,d,c),o=u}a&&a.call(this,l,d,c)},N.shouldComponentUpdate=i}return n.__N||n.__}function G(e,t){var r=Ze(ve++,3);!I.__s&&Ht(r.__H,t)&&(r.__=e,r.u=t,N.__H.__h.push(r))}function H(e){return ye=5,Nt(function(){return{current:e}},[])}function Nt(e,t){var r=Ze(ve++,7);return Ht(r.__H,t)&&(r.__=e(),r.__H=t,r.__h=e),r.__}function It(e,t){return ye=8,Nt(function(){return e},t)}function Dr(){for(var e;e=zt.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Ne),e.__H.__h.forEach(Je),e.__H.__h=[]}catch(t){e.__H.__h=[],I.__e(t,e.__v)}}I.__b=function(e){N=null,Et&&Et(e)},I.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Rt&&Rt(e,t)},I.__r=function(e){At&&At(e),ve=0;var t=(N=e.__c).__H;t&&(Qe===N?(t.__h=[],N.__h=[],t.__.forEach(function(r){r.__N&&(r.__=r.__N),r.u=r.__N=void 0})):(t.__h.forEach(Ne),t.__h.forEach(Je),t.__h=[],ve=0)),Qe=N},I.diffed=function(e){Mt&&Mt(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(zt.push(t)!==1&&St===I.requestAnimationFrame||((St=I.requestAnimationFrame)||zr)(Dr)),t.__H.__.forEach(function(r){r.u&&(r.__H=r.u),r.u=void 0})),Qe=N=null},I.__c=function(e,t){t.some(function(r){try{r.__h.forEach(Ne),r.__h=r.__h.filter(function(n){return!n.__||Je(n)})}catch(n){t.some(function(i){i.__h&&(i.__h=[])}),t=[],I.__e(n,r.__v)}}),Pt&&Pt(e,t)},I.unmount=function(e){Lt&&Lt(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{Ne(n)}catch(i){t=i}}),r.__H=void 0,t&&I.__e(t,r.__v))};var Dt=typeof requestAnimationFrame=="function";function zr(e){var t,r=function(){clearTimeout(n),Dt&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,35);Dt&&(t=requestAnimationFrame(r))}function Ne(e){var t=N,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),N=t}function Je(e){var t=N;e.__c=e.__(),N=t}function Ht(e,t){return!e||e.length!==t.length||t.some(function(r,n){return r!==e[n]})}function Ft(e,t){return typeof t=="function"?t(e):t}var Nr=0;function p(e,t,r,n,i,o){t||(t={});var a,l,d=t;if("ref"in d)for(l in d={},t)l=="ref"?a=t[l]:d[l]=t[l];var c={type:e,props:d,key:r,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Nr,__i:-1,__u:0,__source:i,__self:o};if(typeof e=="function"&&(a=e.defaultProps))for(l in a)d[l]===void 0&&(d[l]=a[l]);return P.vnode&&P.vnode(c),c}var Ot=()=>p("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"3","stroke-linecap":"round","stroke-linejoin":"round",width:"16",height:"16",children:p("path",{d:"M5 12h14M12 5l7 7-7 7"})}),Ir=()=>p("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",width:"16",height:"16",children:p("path",{fillRule:"evenodd",d:"M19.916 4.626a.75.75 0 0 1 .208 1.04l-9 13.5a.75.75 0 0 1-1.154.114l-6-6a.75.75 0 0 1 1.06-1.06l5.353 5.353 8.493-12.739a.75.75 0 0 1 1.04-.208Z",clipRule:"evenodd"})}),Kt=()=>p("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",width:"16",height:"16",children:p("path",{fillRule:"evenodd",d:"M5.47 5.47a.75.75 0 0 1 1.06 0L12 10.94l5.47-5.47a.75.75 0 1 1 1.06 1.06L13.06 12l5.47 5.47a.75.75 0 1 1-1.06 1.06L12 13.06l-5.47 5.47a.75.75 0 0 1-1.06-1.06L10.94 12 5.47 6.53a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"})}),et=()=>p("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"animate-spin",children:p("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})}),Hr=()=>p("svg",{width:"32",height:"32",viewBox:"0 0 900 900",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[p("circle",{cx:"446",cy:"450",r:"424",fill:"black"}),p("circle",{cx:"450",cy:"450",r:"357",fill:"#E8E8E8"}),p("ellipse",{cx:"579.85",cy:"294.451",rx:"79.778",ry:"108.483",transform:"rotate(-46.2324 579.85 294.451)",fill:"black"})]}),Fr=()=>p("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",width:"16",height:"16",children:p("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0 3.181 3.183a8.25 8.25 0 0 0 13.803-3.7M4.031 9.865a8.25 8.25 0 0 1 13.803-3.7l3.181 3.182m0-4.991v4.99"})}),Or=`
5
+ "use strict";var KenobiLib=(()=>{var Se=Object.defineProperty;var Rn=Object.getOwnPropertyDescriptor;var In=Object.getOwnPropertyNames;var Nn=Object.prototype.hasOwnProperty;var On=(t,e,n)=>e in t?Se(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var Hn=(t,e)=>{for(var n in e)Se(t,n,{get:e[n],enumerable:!0})},Fn=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of In(e))!Nn.call(t,i)&&i!==n&&Se(t,i,{get:()=>e[i],enumerable:!(r=Rn(e,i))||r.enumerable});return t};var Un=t=>Fn(Se({},"__esModule",{value:!0}),t);var m=(t,e,n)=>On(t,typeof e!="symbol"?e+"":e,n);var Dr={};Hn(Dr,{CueCard:()=>we,Kenobi:()=>lt,TRANSFORMATION_ACTIONS:()=>dn});var vt=11;function $n(t,e){var n=e.attributes,r,i,o,a,s;if(!(e.nodeType===vt||t.nodeType===vt)){for(var u=n.length-1;u>=0;u--)r=n[u],i=r.name,o=r.namespaceURI,a=r.value,o?(i=r.localName||i,s=t.getAttributeNS(o,i),s!==a&&(r.prefix==="xmlns"&&(i=r.name),t.setAttributeNS(o,i,a))):(s=t.getAttribute(i),s!==a&&t.setAttribute(i,a));for(var c=t.attributes,h=c.length-1;h>=0;h--)r=c[h],i=r.name,o=r.namespaceURI,o?(i=r.localName||i,e.hasAttributeNS(o,i)||t.removeAttributeNS(o,i)):e.hasAttribute(i)||t.removeAttribute(i)}}var Ee,Kn="http://www.w3.org/1999/xhtml",Q=typeof document>"u"?void 0:document,Vn=!!Q&&"content"in Q.createElement("template"),jn=!!Q&&Q.createRange&&"createContextualFragment"in Q.createRange();function Bn(t){var e=Q.createElement("template");return e.innerHTML=t,e.content.childNodes[0]}function qn(t){Ee||(Ee=Q.createRange(),Ee.selectNode(Q.body));var e=Ee.createContextualFragment(t);return e.childNodes[0]}function Wn(t){var e=Q.createElement("body");return e.innerHTML=t,e.childNodes[0]}function Xn(t){return t=t.trim(),Vn?Bn(t):jn?qn(t):Wn(t)}function ze(t,e){var n=t.nodeName,r=e.nodeName,i,o;return n===r?!0:(i=n.charCodeAt(0),o=r.charCodeAt(0),i<=90&&o>=97?n===r.toUpperCase():o<=90&&i>=97?r===n.toUpperCase():!1)}function Yn(t,e){return!e||e===Kn?Q.createElement(t):Q.createElementNS(e,t)}function Gn(t,e){for(var n=t.firstChild;n;){var r=n.nextSibling;e.appendChild(n),n=r}return e}function We(t,e,n){t[n]!==e[n]&&(t[n]=e[n],t[n]?t.setAttribute(n,""):t.removeAttribute(n))}var kt={OPTION:function(t,e){var n=t.parentNode;if(n){var r=n.nodeName.toUpperCase();r==="OPTGROUP"&&(n=n.parentNode,r=n&&n.nodeName.toUpperCase()),r==="SELECT"&&!n.hasAttribute("multiple")&&(t.hasAttribute("selected")&&!e.selected&&(t.setAttribute("selected","selected"),t.removeAttribute("selected")),n.selectedIndex=-1)}We(t,e,"selected")},INPUT:function(t,e){We(t,e,"checked"),We(t,e,"disabled"),t.value!==e.value&&(t.value=e.value),e.hasAttribute("value")||t.removeAttribute("value")},TEXTAREA:function(t,e){var n=e.value;t.value!==n&&(t.value=n);var r=t.firstChild;if(r){var i=r.nodeValue;if(i==n||!n&&i==t.placeholder)return;r.nodeValue=n}},SELECT:function(t,e){if(!e.hasAttribute("multiple")){for(var n=-1,r=0,i=t.firstChild,o,a;i;)if(a=i.nodeName&&i.nodeName.toUpperCase(),a==="OPTGROUP")o=i,i=o.firstChild,i||(i=o.nextSibling,o=null);else{if(a==="OPTION"){if(i.hasAttribute("selected")){n=r;break}r++}i=i.nextSibling,!i&&o&&(i=o.nextSibling,o=null)}t.selectedIndex=n}}},ye=1,wt=11,xt=3,Ct=8;function ce(){}function Qn(t){if(t)return t.getAttribute&&t.getAttribute("id")||t.id}function Jn(t){return function(n,r,i){if(i||(i={}),typeof r=="string")if(n.nodeName==="#document"||n.nodeName==="HTML"||n.nodeName==="BODY"){var o=r;r=Q.createElement("html"),r.innerHTML=o}else r=Xn(r);else r.nodeType===wt&&(r=r.firstElementChild);var a=i.getNodeKey||Qn,s=i.onBeforeNodeAdded||ce,u=i.onNodeAdded||ce,c=i.onBeforeElUpdated||ce,h=i.onElUpdated||ce,l=i.onBeforeNodeDiscarded||ce,p=i.onNodeDiscarded||ce,b=i.onBeforeElChildrenUpdated||ce,E=i.skipFromChildren||ce,M=i.addChild||function(_,k){return _.appendChild(k)},T=i.childrenOnly===!0,g=Object.create(null),x=[];function P(_){x.push(_)}function O(_,k){if(_.nodeType===ye)for(var D=_.firstChild;D;){var S=void 0;k&&(S=a(D))?P(S):(p(D),D.firstChild&&O(D,k)),D=D.nextSibling}}function L(_,k,D){l(_)!==!1&&(k&&k.removeChild(_),p(_),O(_,D))}function v(_){if(_.nodeType===ye||_.nodeType===wt)for(var k=_.firstChild;k;){var D=a(k);D&&(g[D]=k),v(k),k=k.nextSibling}}v(n);function V(_){u(_);for(var k=_.firstChild;k;){var D=k.nextSibling,S=a(k);if(S){var z=g[S];z&&ze(k,z)?(k.parentNode.replaceChild(z,k),j(z,k)):V(k)}else V(k);k=D}}function J(_,k,D){for(;k;){var S=k.nextSibling;(D=a(k))?P(D):L(k,_,!0),k=S}}function j(_,k,D){var S=a(k);if(S&&delete g[S],!D){var z=c(_,k);if(z===!1||(z instanceof HTMLElement&&(_=z,v(_)),t(_,k),h(_),b(_,k)===!1))return}_.nodeName!=="TEXTAREA"?H(_,k):kt.TEXTAREA(_,k)}function H(_,k){var D=E(_,k),S=k.firstChild,z=_.firstChild,G,Z,F,te,ne;e:for(;S;){for(te=S.nextSibling,G=a(S);!D&&z;){if(F=z.nextSibling,S.isSameNode&&S.isSameNode(z)){S=te,z=F;continue e}Z=a(z);var ee=z.nodeType,q=void 0;if(ee===S.nodeType&&(ee===ye?(G?G!==Z&&((ne=g[G])?F===ne?q=!1:(_.insertBefore(ne,z),Z?P(Z):L(z,_,!0),z=ne,Z=a(z)):q=!1):Z&&(q=!1),q=q!==!1&&ze(z,S),q&&j(z,S)):(ee===xt||ee==Ct)&&(q=!0,z.nodeValue!==S.nodeValue&&(z.nodeValue=S.nodeValue))),q){S=te,z=F;continue e}Z?P(Z):L(z,_,!0),z=F}if(G&&(ne=g[G])&&ze(ne,S))D||M(_,ne),j(ne,S);else{var K=s(S);K!==!1&&(K&&(S=K),S.actualize&&(S=S.actualize(_.ownerDocument||Q)),M(_,S),V(S))}S=te,z=F}J(_,z,Z);var se=kt[_.nodeName];se&&se(_,k)}var C=n,B=C.nodeType,ge=r.nodeType;if(!T){if(B===ye)ge===ye?ze(n,r)||(p(n),C=Gn(n,Yn(r.nodeName,r.namespaceURI))):C=r;else if(B===xt||B===Ct){if(ge===B)return C.nodeValue!==r.nodeValue&&(C.nodeValue=r.nodeValue),C;C=r}}if(C===r)p(n);else{if(r.isSameNode&&r.isSameNode(C))return;if(j(C,r,T),x)for(var ue=0,Fe=x.length;ue<Fe;ue++){var pe=g[x[ue]];pe&&L(pe,pe.parentNode,!1)}}return!T&&C!==n&&n.parentNode&&(C.actualize&&(C=C.actualize(n.ownerDocument||Q)),n.parentNode.replaceChild(C,n)),C}}var Zn=Jn($n),Pe=Zn;var Re,A,Pt,er,de,Tt,At,Mt,Lt,Qe,Xe,Ye,tr,_e={},Dt=[],nr=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Ie=Array.isArray;function le(t,e){for(var n in e)t[n]=e[n];return t}function Je(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function rr(t,e,n){var r,i,o,a={};for(o in e)o=="key"?r=e[o]:o=="ref"?i=e[o]:a[o]=e[o];if(arguments.length>2&&(a.children=arguments.length>3?Re.call(arguments,2):n),typeof t=="function"&&t.defaultProps!=null)for(o in t.defaultProps)a[o]===void 0&&(a[o]=t.defaultProps[o]);return Me(t,a,r,i,null)}function Me(t,e,n,r,i){var o={type:t,props:e,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i??++Pt,__i:-1,__u:0};return i==null&&A.vnode!=null&&A.vnode(o),o}function oe(t){return t.children}function Le(t,e){this.props=t,this.context=e}function he(t,e){if(e==null)return t.__?he(t.__,t.__i+1):null;for(var n;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null)return n.__e;return typeof t.type=="function"?he(t):null}function Rt(t){var e,n;if((t=t.__)!=null&&t.__c!=null){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null){t.__e=t.__c.base=n.__e;break}return Rt(t)}}function St(t){(!t.__d&&(t.__d=!0)&&de.push(t)&&!De.__r++||Tt!=A.debounceRendering)&&((Tt=A.debounceRendering)||At)(De)}function De(){for(var t,e,n,r,i,o,a,s=1;de.length;)de.length>s&&de.sort(Mt),t=de.shift(),s=de.length,t.__d&&(n=void 0,r=void 0,i=(r=(e=t).__v).__e,o=[],a=[],e.__P&&((n=le({},r)).__v=r.__v+1,A.vnode&&A.vnode(n),Ze(e.__P,n,r,e.__n,e.__P.namespaceURI,32&r.__u?[i]:null,o,i??he(r),!!(32&r.__u),a),n.__v=r.__v,n.__.__k[n.__i]=n,Ot(o,n,a),r.__e=r.__=null,n.__e!=i&&Rt(n)));De.__r=0}function It(t,e,n,r,i,o,a,s,u,c,h){var l,p,b,E,M,T,g,x=r&&r.__k||Dt,P=e.length;for(u=ir(n,e,x,u,P),l=0;l<P;l++)(b=n.__k[l])!=null&&(p=b.__i==-1?_e:x[b.__i]||_e,b.__i=l,T=Ze(t,b,p,i,o,a,s,u,c,h),E=b.__e,b.ref&&p.ref!=b.ref&&(p.ref&&et(p.ref,null,b),h.push(b.ref,b.__c||E,b)),M==null&&E!=null&&(M=E),(g=!!(4&b.__u))||p.__k===b.__k?u=Nt(b,u,t,g):typeof b.type=="function"&&T!==void 0?u=T:E&&(u=E.nextSibling),b.__u&=-7);return n.__e=M,u}function ir(t,e,n,r,i){var o,a,s,u,c,h=n.length,l=h,p=0;for(t.__k=new Array(i),o=0;o<i;o++)(a=e[o])!=null&&typeof a!="boolean"&&typeof a!="function"?(u=o+p,(a=t.__k[o]=typeof a=="string"||typeof a=="number"||typeof a=="bigint"||a.constructor==String?Me(null,a,null,null,null):Ie(a)?Me(oe,{children:a},null,null,null):a.constructor==null&&a.__b>0?Me(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):a).__=t,a.__b=t.__b+1,s=null,(c=a.__i=or(a,n,u,l))!=-1&&(l--,(s=n[c])&&(s.__u|=2)),s==null||s.__v==null?(c==-1&&(i>h?p--:i<h&&p++),typeof a.type!="function"&&(a.__u|=4)):c!=u&&(c==u-1?p--:c==u+1?p++:(c>u?p--:p++,a.__u|=4))):t.__k[o]=null;if(l)for(o=0;o<h;o++)(s=n[o])!=null&&(2&s.__u)==0&&(s.__e==r&&(r=he(s)),Ft(s,s));return r}function Nt(t,e,n,r){var i,o;if(typeof t.type=="function"){for(i=t.__k,o=0;i&&o<i.length;o++)i[o]&&(i[o].__=t,e=Nt(i[o],e,n,r));return e}t.__e!=e&&(r&&(e&&t.type&&!e.parentNode&&(e=he(t)),n.insertBefore(t.__e,e||null)),e=t.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function or(t,e,n,r){var i,o,a,s=t.key,u=t.type,c=e[n],h=c!=null&&(2&c.__u)==0;if(c===null&&t.key==null||h&&s==c.key&&u==c.type)return n;if(r>(h?1:0)){for(i=n-1,o=n+1;i>=0||o<e.length;)if((c=e[a=i>=0?i--:o++])!=null&&(2&c.__u)==0&&s==c.key&&u==c.type)return a}return-1}function Et(t,e,n){e[0]=="-"?t.setProperty(e,n??""):t[e]=n==null?"":typeof n!="number"||nr.test(e)?n:n+"px"}function Ae(t,e,n,r,i){var o,a;e:if(e=="style")if(typeof n=="string")t.style.cssText=n;else{if(typeof r=="string"&&(t.style.cssText=r=""),r)for(e in r)n&&e in n||Et(t.style,e,"");if(n)for(e in n)r&&n[e]==r[e]||Et(t.style,e,n[e])}else if(e[0]=="o"&&e[1]=="n")o=e!=(e=e.replace(Lt,"$1")),a=e.toLowerCase(),e=a in t||e=="onFocusOut"||e=="onFocusIn"?a.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+o]=n,n?r?n.u=r.u:(n.u=Qe,t.addEventListener(e,o?Ye:Xe,o)):t.removeEventListener(e,o?Ye:Xe,o);else{if(i=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in t)try{t[e]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&e[4]!="-"?t.removeAttribute(e):t.setAttribute(e,e=="popover"&&n==1?"":n))}}function zt(t){return function(e){if(this.l){var n=this.l[e.type+t];if(e.t==null)e.t=Qe++;else if(e.t<n.u)return;return n(A.event?A.event(e):e)}}}function Ze(t,e,n,r,i,o,a,s,u,c){var h,l,p,b,E,M,T,g,x,P,O,L,v,V,J,j,H,C=e.type;if(e.constructor!=null)return null;128&n.__u&&(u=!!(32&n.__u),o=[s=e.__e=n.__e]),(h=A.__b)&&h(e);e:if(typeof C=="function")try{if(g=e.props,x="prototype"in C&&C.prototype.render,P=(h=C.contextType)&&r[h.__c],O=h?P?P.props.value:h.__:r,n.__c?T=(l=e.__c=n.__c).__=l.__E:(x?e.__c=l=new C(g,O):(e.__c=l=new Le(g,O),l.constructor=C,l.render=sr),P&&P.sub(l),l.props=g,l.state||(l.state={}),l.context=O,l.__n=r,p=l.__d=!0,l.__h=[],l._sb=[]),x&&l.__s==null&&(l.__s=l.state),x&&C.getDerivedStateFromProps!=null&&(l.__s==l.state&&(l.__s=le({},l.__s)),le(l.__s,C.getDerivedStateFromProps(g,l.__s))),b=l.props,E=l.state,l.__v=e,p)x&&C.getDerivedStateFromProps==null&&l.componentWillMount!=null&&l.componentWillMount(),x&&l.componentDidMount!=null&&l.__h.push(l.componentDidMount);else{if(x&&C.getDerivedStateFromProps==null&&g!==b&&l.componentWillReceiveProps!=null&&l.componentWillReceiveProps(g,O),!l.__e&&l.shouldComponentUpdate!=null&&l.shouldComponentUpdate(g,l.__s,O)===!1||e.__v==n.__v){for(e.__v!=n.__v&&(l.props=g,l.state=l.__s,l.__d=!1),e.__e=n.__e,e.__k=n.__k,e.__k.some(function(B){B&&(B.__=e)}),L=0;L<l._sb.length;L++)l.__h.push(l._sb[L]);l._sb=[],l.__h.length&&a.push(l);break e}l.componentWillUpdate!=null&&l.componentWillUpdate(g,l.__s,O),x&&l.componentDidUpdate!=null&&l.__h.push(function(){l.componentDidUpdate(b,E,M)})}if(l.context=O,l.props=g,l.__P=t,l.__e=!1,v=A.__r,V=0,x){for(l.state=l.__s,l.__d=!1,v&&v(e),h=l.render(l.props,l.state,l.context),J=0;J<l._sb.length;J++)l.__h.push(l._sb[J]);l._sb=[]}else do l.__d=!1,v&&v(e),h=l.render(l.props,l.state,l.context),l.state=l.__s;while(l.__d&&++V<25);l.state=l.__s,l.getChildContext!=null&&(r=le(le({},r),l.getChildContext())),x&&!p&&l.getSnapshotBeforeUpdate!=null&&(M=l.getSnapshotBeforeUpdate(b,E)),j=h,h!=null&&h.type===oe&&h.key==null&&(j=Ht(h.props.children)),s=It(t,Ie(j)?j:[j],e,n,r,i,o,a,s,u,c),l.base=e.__e,e.__u&=-161,l.__h.length&&a.push(l),T&&(l.__E=l.__=null)}catch(B){if(e.__v=null,u||o!=null)if(B.then){for(e.__u|=u?160:128;s&&s.nodeType==8&&s.nextSibling;)s=s.nextSibling;o[o.indexOf(s)]=null,e.__e=s}else{for(H=o.length;H--;)Je(o[H]);Ge(e)}else e.__e=n.__e,e.__k=n.__k,B.then||Ge(e);A.__e(B,e,n)}else o==null&&e.__v==n.__v?(e.__k=n.__k,e.__e=n.__e):s=e.__e=ar(n.__e,e,n,r,i,o,a,u,c);return(h=A.diffed)&&h(e),128&e.__u?void 0:s}function Ge(t){t&&t.__c&&(t.__c.__e=!0),t&&t.__k&&t.__k.forEach(Ge)}function Ot(t,e,n){for(var r=0;r<n.length;r++)et(n[r],n[++r],n[++r]);A.__c&&A.__c(e,t),t.some(function(i){try{t=i.__h,i.__h=[],t.some(function(o){o.call(i)})}catch(o){A.__e(o,i.__v)}})}function Ht(t){return typeof t!="object"||t==null||t.__b&&t.__b>0?t:Ie(t)?t.map(Ht):le({},t)}function ar(t,e,n,r,i,o,a,s,u){var c,h,l,p,b,E,M,T=n.props,g=e.props,x=e.type;if(x=="svg"?i="http://www.w3.org/2000/svg":x=="math"?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),o!=null){for(c=0;c<o.length;c++)if((b=o[c])&&"setAttribute"in b==!!x&&(x?b.localName==x:b.nodeType==3)){t=b,o[c]=null;break}}if(t==null){if(x==null)return document.createTextNode(g);t=document.createElementNS(i,x,g.is&&g),s&&(A.__m&&A.__m(e,o),s=!1),o=null}if(x==null)T===g||s&&t.data==g||(t.data=g);else{if(o=o&&Re.call(t.childNodes),T=n.props||_e,!s&&o!=null)for(T={},c=0;c<t.attributes.length;c++)T[(b=t.attributes[c]).name]=b.value;for(c in T)if(b=T[c],c!="children"){if(c=="dangerouslySetInnerHTML")l=b;else if(!(c in g)){if(c=="value"&&"defaultValue"in g||c=="checked"&&"defaultChecked"in g)continue;Ae(t,c,null,b,i)}}for(c in g)b=g[c],c=="children"?p=b:c=="dangerouslySetInnerHTML"?h=b:c=="value"?E=b:c=="checked"?M=b:s&&typeof b!="function"||T[c]===b||Ae(t,c,b,T[c],i);if(h)s||l&&(h.__html==l.__html||h.__html==t.innerHTML)||(t.innerHTML=h.__html),e.__k=[];else if(l&&(t.innerHTML=""),It(e.type=="template"?t.content:t,Ie(p)?p:[p],e,n,r,x=="foreignObject"?"http://www.w3.org/1999/xhtml":i,o,a,o?o[0]:n.__k&&he(n,0),s,u),o!=null)for(c=o.length;c--;)Je(o[c]);s||(c="value",x=="progress"&&E==null?t.removeAttribute("value"):E!=null&&(E!==t[c]||x=="progress"&&!E||x=="option"&&E!=T[c])&&Ae(t,c,E,T[c],i),c="checked",M!=null&&M!=t[c]&&Ae(t,c,M,T[c],i))}return t}function et(t,e,n){try{if(typeof t=="function"){var r=typeof t.__u=="function";r&&t.__u(),r&&e==null||(t.__u=t(e))}else t.current=e}catch(i){A.__e(i,n)}}function Ft(t,e,n){var r,i;if(A.unmount&&A.unmount(t),(r=t.ref)&&(r.current&&r.current!=t.__e||et(r,null,e)),(r=t.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(o){A.__e(o,e)}r.base=r.__P=null}if(r=t.__k)for(i=0;i<r.length;i++)r[i]&&Ft(r[i],e,n||typeof t.type!="function");n||Je(t.__e),t.__c=t.__=t.__e=void 0}function sr(t,e,n){return this.constructor(t,n)}function tt(t,e,n){var r,i,o,a;e==document&&(e=document.documentElement),A.__&&A.__(t,e),i=(r=typeof n=="function")?null:n&&n.__k||e.__k,o=[],a=[],Ze(e,t=(!r&&n||e).__k=rr(oe,null,[t]),i||_e,_e,e.namespaceURI,!r&&n?[n]:i?null:e.firstChild?Re.call(e.childNodes):null,o,!r&&n?n:i?i.__e:e.firstChild,r,a),Ot(o,t,a)}Re=Dt.slice,A={__e:function(t,e,n,r){for(var i,o,a;e=e.__;)if((i=e.__c)&&!i.__)try{if((o=i.constructor)&&o.getDerivedStateFromError!=null&&(i.setState(o.getDerivedStateFromError(t)),a=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(t,r||{}),a=i.__d),a)return i.__E=i}catch(s){t=s}throw t}},Pt=0,er=function(t){return t!=null&&t.constructor==null},Le.prototype.setState=function(t,e){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=le({},this.state),typeof t=="function"&&(t=t(le({},n),this.props)),t&&le(n,t),t!=null&&this.__v&&(e&&this._sb.push(e),St(this))},Le.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),St(this))},Le.prototype.render=oe,de=[],At=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Mt=function(t,e){return t.__v.__b-e.__v.__b},De.__r=0,Lt=/(PointerCapture)$|Capture$/i,Qe=0,Xe=zt(!1),Ye=zt(!0),tr=0;var ve,N,nt,Ut,ke=0,Xt=[],U=A,$t=U.__b,Kt=U.__r,Vt=U.diffed,jt=U.__c,Bt=U.unmount,qt=U.__;function it(t,e){U.__h&&U.__h(N,t,ke||e),ke=0;var n=N.__H||(N.__H={__:[],__h:[]});return t>=n.__.length&&n.__.push({}),n.__[t]}function re(t){return ke=1,lr(Jt,t)}function lr(t,e,n){var r=it(ve++,2);if(r.t=t,!r.__c&&(r.__=[n?n(e):Jt(void 0,e),function(s){var u=r.__N?r.__N[0]:r.__[0],c=r.t(u,s);u!==c&&(r.__N=[c,r.__[1]],r.__c.setState({}))}],r.__c=N,!N.__f)){var i=function(s,u,c){if(!r.__c.__H)return!0;var h=r.__c.__H.__.filter(function(p){return!!p.__c});if(h.every(function(p){return!p.__N}))return!o||o.call(this,s,u,c);var l=r.__c.props!==s;return h.forEach(function(p){if(p.__N){var b=p.__[0];p.__=p.__N,p.__N=void 0,b!==p.__[0]&&(l=!0)}}),o&&o.call(this,s,u,c)||l};N.__f=!0;var o=N.shouldComponentUpdate,a=N.componentWillUpdate;N.componentWillUpdate=function(s,u,c){if(this.__e){var h=o;o=void 0,i(s,u,c),o=h}a&&a.call(this,s,u,c)},N.shouldComponentUpdate=i}return r.__N||r.__}function X(t,e){var n=it(ve++,3);!U.__s&&Qt(n.__H,e)&&(n.__=t,n.u=e,N.__H.__h.push(n))}function $(t){return ke=5,Yt(function(){return{current:t}},[])}function Yt(t,e){var n=it(ve++,7);return Qt(n.__H,e)&&(n.__=t(),n.__H=e,n.__h=t),n.__}function Gt(t,e){return ke=8,Yt(function(){return t},e)}function cr(){for(var t;t=Xt.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(Ne),t.__H.__h.forEach(rt),t.__H.__h=[]}catch(e){t.__H.__h=[],U.__e(e,t.__v)}}U.__b=function(t){N=null,$t&&$t(t)},U.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),qt&&qt(t,e)},U.__r=function(t){Kt&&Kt(t),ve=0;var e=(N=t.__c).__H;e&&(nt===N?(e.__h=[],N.__h=[],e.__.forEach(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(e.__h.forEach(Ne),e.__h.forEach(rt),e.__h=[],ve=0)),nt=N},U.diffed=function(t){Vt&&Vt(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(Xt.push(e)!==1&&Ut===U.requestAnimationFrame||((Ut=U.requestAnimationFrame)||ur)(cr)),e.__H.__.forEach(function(n){n.u&&(n.__H=n.u),n.u=void 0})),nt=N=null},U.__c=function(t,e){e.some(function(n){try{n.__h.forEach(Ne),n.__h=n.__h.filter(function(r){return!r.__||rt(r)})}catch(r){e.some(function(i){i.__h&&(i.__h=[])}),e=[],U.__e(r,n.__v)}}),jt&&jt(t,e)},U.unmount=function(t){Bt&&Bt(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.forEach(function(r){try{Ne(r)}catch(i){e=i}}),n.__H=void 0,e&&U.__e(e,n.__v))};var Wt=typeof requestAnimationFrame=="function";function ur(t){var e,n=function(){clearTimeout(r),Wt&&cancelAnimationFrame(e),setTimeout(t)},r=setTimeout(n,35);Wt&&(e=requestAnimationFrame(n))}function Ne(t){var e=N,n=t.__c;typeof n=="function"&&(t.__c=void 0,n()),N=e}function rt(t){var e=N;t.__c=t.__(),N=e}function Qt(t,e){return!t||t.length!==e.length||e.some(function(n,r){return n!==t[r]})}function Jt(t,e){return typeof e=="function"?e(t):e}var dr=0;function d(t,e,n,r,i,o){e||(e={});var a,s,u=e;if("ref"in u)for(s in u={},e)s=="ref"?a=e[s]:u[s]=e[s];var c={type:t,props:u,key:n,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--dr,__i:-1,__u:0,__source:i,__self:o};if(typeof t=="function"&&(a=t.defaultProps))for(s in a)u[s]===void 0&&(u[s]=a[s]);return A.vnode&&A.vnode(c),c}var ot=()=>d("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"3","stroke-linecap":"round","stroke-linejoin":"round",width:"16",height:"16",children:d("path",{d:"M5 12h14M12 5l7 7-7 7"})}),pr=()=>d("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",width:"16",height:"16",children:d("path",{fillRule:"evenodd",d:"M19.916 4.626a.75.75 0 0 1 .208 1.04l-9 13.5a.75.75 0 0 1-1.154.114l-6-6a.75.75 0 0 1 1.06-1.06l5.353 5.353 8.493-12.739a.75.75 0 0 1 1.04-.208Z",clipRule:"evenodd"})}),Zt=()=>d("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",width:"16",height:"16",children:d("path",{fillRule:"evenodd",d:"M5.47 5.47a.75.75 0 0 1 1.06 0L12 10.94l5.47-5.47a.75.75 0 1 1 1.06 1.06L13.06 12l5.47 5.47a.75.75 0 1 1-1.06 1.06L12 13.06l-5.47 5.47a.75.75 0 0 1-1.06-1.06L10.94 12 5.47 6.53a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"})}),Oe=()=>d("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"animate-spin",children:d("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})}),fr=()=>d("svg",{width:"32",height:"32",viewBox:"0 0 900 900",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[d("circle",{cx:"446",cy:"450",r:"424",fill:"black"}),d("circle",{cx:"450",cy:"450",r:"357",fill:"#E8E8E8"}),d("ellipse",{cx:"579.85",cy:"294.451",rx:"79.778",ry:"108.483",transform:"rotate(-46.2324 579.85 294.451)",fill:"black"})]});var mr=()=>d("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",width:"16",height:"16",children:d("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0 3.181 3.183a8.25 8.25 0 0 0 13.803-3.7M4.031 9.865a8.25 8.25 0 0 1 13.803-3.7l3.181 3.182m0-4.991v4.99"})}),He="kenobi:identity-resolved",en="kenobi-snitcher",hr=1600,at=(t,e)=>{typeof window>"u"||window.dispatchEvent(new CustomEvent(`kenobi:${t}`,{detail:e,bubbles:!0}))},br=t=>{if(!t||t.type!=="business")return null;let e=t.company,n=e?.name||t.domain||void 0,r=e?.domain||t.domain||void 0;return n?{name:n,domain:r,logoUrl:e?.logoUrl||(r?`https://logo.clearbit.com/${r}`:void 0)}:null},tn=t=>t?t.replace(/^https?:\/\//i,"").replace(/\/.*$/,"").replace(/:\d+$/,"").replace(/^www\./i,"").trim().toLowerCase():"",gr=t=>{if(typeof window>"u"||typeof document>"u"||window.__kenobiSnitcherLoaded||window.__kenobiSnitcherLoading)return;if(window.Snitcher||window.SpotterSettings){window.__kenobiSnitcherLoaded=!0;return}if(document.getElementById(en)){window.__kenobiSnitcherLoaded=!0;return}let e=t?.snitcher;if(!e?.spotterToken||!e.profileId)return;window.__kenobiSnitcherLoading=!0;let n=t?.logoUrlTemplate||"https://logo.clearbit.com/{domain}",r=e.apiEndpoint||`${window.location.origin}/api/snitcher-proxy/radar`,i=e.cdn||`${window.location.origin}/api/snitcher-proxy/cdn`,o=e.namespace||"Snitcher",a=`
6
+ (function () {
7
+ function spotterCb(response) {
8
+ var rawDomain = (response.company && response.company.domain) || response.domain || "";
9
+ var normalizedDomain = rawDomain
10
+ .replace(/^https?:\\/\\//i, "")
11
+ .replace(/\\/.*$/, "")
12
+ .replace(/:\\d+$/, "")
13
+ .replace(/^www\\./i, "");
14
+ var identity = {
15
+ provider: "snitcher",
16
+ type: response.type === "business" ? "business" : "unknown",
17
+ domain: response.domain || null,
18
+ ip: response.ip,
19
+ company: response.company
20
+ ? {
21
+ id: response.company.id,
22
+ name: response.company.name || response.domain,
23
+ domain: response.company.domain || response.domain,
24
+ logoUrl: "${n}".replace("{domain}", normalizedDomain),
25
+ industry: response.company.industry,
26
+ location: response.company.location,
27
+ employeeRange: response.company.employee_range,
28
+ foundedYear: response.company.founded_year,
29
+ description: response.company.description,
30
+ geo: response.company.geo
31
+ ? {
32
+ city: response.company.geo.city,
33
+ country: response.company.geo.country,
34
+ countryCode: response.company.geo.country_code,
35
+ region: response.company.geo.region,
36
+ postalCode: response.company.geo.postal_code,
37
+ address:
38
+ response.company.geo.full_address ||
39
+ response.company.geo.address,
40
+ }
41
+ : undefined,
42
+ profiles: response.company.profiles
43
+ ? {
44
+ linkedin: response.company.profiles.linkedin?.url,
45
+ twitter: response.company.profiles.twitter?.url,
46
+ facebook: response.company.profiles.facebook?.url,
47
+ crunchbase: response.company.profiles.crunchbase?.url,
48
+ }
49
+ : undefined,
50
+ }
51
+ : undefined,
52
+ raw: response,
53
+ };
54
+
55
+ window.__kenobiIdentityResolution = identity;
56
+ window.dispatchEvent(
57
+ new CustomEvent("${He}", {
58
+ detail: identity,
59
+ bubbles: true,
60
+ })
61
+ );
62
+ }
63
+
64
+ window.SpotterSettings = {
65
+ token: "${e.spotterToken}",
66
+ callback: spotterCb,
67
+ };
68
+
69
+ !(function (e) {
70
+ "use strict";
71
+ var t = e && e.namespace;
72
+ if (t && e.profileId && e.cdn) {
73
+ var i = window[t];
74
+ if (((i && Array.isArray(i)) || (i = window[t] = []), !i.initialized && !i._loaded))
75
+ if (i._loaded) console && console.warn("[Radar] Duplicate initialization attempted");
76
+ else {
77
+ i._loaded = !0;
78
+ [
79
+ "track",
80
+ "page",
81
+ "identify",
82
+ "group",
83
+ "alias",
84
+ "ready",
85
+ "debug",
86
+ "on",
87
+ "off",
88
+ "once",
89
+ "trackClick",
90
+ "trackSubmit",
91
+ "trackLink",
92
+ "trackForm",
93
+ "pageview",
94
+ "screen",
95
+ "reset",
96
+ "register",
97
+ "setAnonymousId",
98
+ "addSourceMiddleware",
99
+ "addIntegrationMiddleware",
100
+ "addDestinationMiddleware",
101
+ "giveCookieConsent",
102
+ ].forEach(function (e) {
103
+ var a;
104
+ i[e] =
105
+ ((a = e),
106
+ function () {
107
+ var e = window[t];
108
+ if (e.initialized) return e[a].apply(e, arguments);
109
+ var i = [].slice.call(arguments);
110
+ return i.unshift(a), e.push(i), e;
111
+ });
112
+ }),
113
+ -1 === e.apiEndpoint.indexOf("http") &&
114
+ (e.apiEndpoint = "https://" + e.apiEndpoint),
115
+ (i.bootstrap = function () {
116
+ var t,
117
+ i = document.createElement("script");
118
+ (i.async = !0),
119
+ (i.type = "text/javascript"),
120
+ (i.id = "__radar__"),
121
+ i.setAttribute("data-settings", JSON.stringify(e)),
122
+ (i.src = [
123
+ -1 !== (t = e.cdn).indexOf("http") ? "" : "https://",
124
+ t,
125
+ "/releases/latest/radar.min.js",
126
+ ].join(""));
127
+ var a = document.scripts[0];
128
+ a.parentNode.insertBefore(i, a);
129
+ }),
130
+ i.bootstrap();
131
+ }
132
+ } else
133
+ "undefined" != typeof console &&
134
+ console.error("[Radar] Configuration incomplete");
135
+ })({
136
+ apiEndpoint: "${r}",
137
+ cdn: "${i}",
138
+ namespace: "${o}",
139
+ profileId: "${e.profileId}",
140
+ });
141
+ })();
142
+ `,s=document.createElement("script");s.id=en,s.type="text/javascript",s.text=a,document.head?.appendChild(s),window.__kenobiSnitcherLoaded=!0,window.__kenobiSnitcherLoading=!1},yr=`
6
143
  :host { --kb-font-family: system-ui, -apple-system, sans-serif; --kb-bg-container: rgba(255, 255, 255, 0.05); --kb-border-container: rgba(255, 255, 255, 0.2); --kb-shadow-container: 0 25px 50px -12px rgba(0, 0, 0, 0.25); --kb-backdrop-blur: 16px; --kb-text-title: #ffffff; --kb-text-subtitle: rgba(255, 255, 255, 0.7); --kb-btn-dismiss-bg: rgba(0, 0, 0, 0.7); --kb-btn-dismiss-border: rgba(255, 255, 255, 0.2); --kb-btn-dismiss-text: rgba(255, 255, 255, 0.8); --kb-btn-dismiss-hover-bg: rgba(0, 0, 0, 0.9); --kb-btn-dismiss-hover-text: #ffffff; --kb-btn-trigger-bg: #ffffff; --kb-btn-trigger-text: #000000; --kb-btn-trigger-hover-bg: rgba(255, 255, 255, 0.9); --kb-progress-track: rgba(255, 255, 255, 0.2); --kb-progress-indicator: #ffffff; --kb-popover-bg: rgba(255, 255, 255, 0.05); --kb-popover-border: rgba(255, 255, 255, 0.2); --kb-popover-text: #ffffff; --kb-input-bg: transparent; --kb-input-border: rgba(255, 255, 255, 0.3); --kb-input-text: #ffffff; --kb-input-placeholder: rgba(255, 255, 255, 0.6); --kb-form-label: #ffffff; --kb-success-color: #6ee7b7; --kb-error-text: #ef4444; --kb-focus-blur: 10px; --kb-kbd-bg: rgba(255, 255, 255, 0.15); --kb-kbd-border: rgba(255, 255, 255, 0.4); --kb-kbd-text: #ffffff; --kb-watermark-text: rgba(255, 255, 255, 0.4); font-family: var(--kb-font-family); }
7
144
  .theme-light { --kb-bg-container: #ffffff; --kb-border-container: #e2e8f0; --kb-shadow-container: 0 20px 25px -5px rgba(0, 0, 0, 0.1); --kb-backdrop-blur: 0px; --kb-text-title: #0f172a; --kb-text-subtitle: #475569; --kb-btn-dismiss-bg: #ffffff; --kb-btn-dismiss-border: #e2e8f0; --kb-btn-dismiss-text: #64748b; --kb-btn-dismiss-hover-bg: #f1f5f9; --kb-btn-dismiss-hover-text: #0f172a; --kb-btn-trigger-bg: #0f172a; --kb-btn-trigger-text: #ffffff; --kb-btn-trigger-hover-bg: #1e293b; --kb-progress-track: #e2e8f0; --kb-progress-indicator: #0f172a; --kb-popover-bg: #ffffff; --kb-popover-border: #e2e8f0; --kb-popover-text: #0f172a; --kb-input-bg: #ffffff; --kb-input-border: #cbd5e1; --kb-input-text: #0f172a; --kb-input-placeholder: #94a3b8; --kb-form-label: #334155; --kb-success-color: #059669; --kb-error-text: #ef4444; --kb-kbd-bg: #f1f5f9; --kb-kbd-border: #e2e8f0; --kb-kbd-text: #64748b; --kb-watermark-text: #94a3b8; }
8
145
  .theme-dark { --kb-bg-container: #0f172a; --kb-border-container: #334155; --kb-shadow-container: 0 25px 50px -12px rgba(0, 0, 0, 0.25); --kb-backdrop-blur: 0px; --kb-text-title: #f1f5f9; --kb-text-subtitle: #94a3b8; --kb-btn-dismiss-bg: #1e293b; --kb-btn-dismiss-border: #334155; --kb-btn-dismiss-text: #cbd5e1; --kb-btn-dismiss-hover-bg: #334155; --kb-btn-dismiss-hover-text: #ffffff; --kb-btn-trigger-bg: #ffffff; --kb-btn-trigger-text: #0f172a; --kb-btn-trigger-hover-bg: #f1f5f9; --kb-progress-track: #1e293b; --kb-progress-indicator: #ffffff; --kb-popover-bg: #0f172a; --kb-popover-border: #334155; --kb-popover-text: #f1f5f9; --kb-input-bg: #0f172a; --kb-input-border: #475569; --kb-input-text: #f1f5f9; --kb-input-placeholder: #94a3b8; --kb-form-label: #e2e8f0; --kb-success-color: #6ee7b7; --kb-error-text: #ef4444; --kb-kbd-bg: #1e293b; --kb-kbd-border: #334155; --kb-kbd-text: #94a3b8; --kb-watermark-text: #64748b; }
@@ -12,9 +149,18 @@
12
149
  .backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0); backdrop-filter: blur(0); -webkit-backdrop-filter: blur(0); transition: all 0.5s ease; z-index: 0; pointer-events: none; }
13
150
  .backdrop.active { background: rgba(0,0,0,0.1); backdrop-filter: blur(var(--kb-focus-blur)); -webkit-backdrop-filter: blur(var(--kb-focus-blur)); }
14
151
  .launcher { position: absolute; pointer-events: auto; background-color: var(--kb-bg-container); border: 1px solid var(--kb-border-container); box-shadow: var(--kb-shadow-container); backdrop-filter: blur(var(--kb-backdrop-blur)); -webkit-backdrop-filter: blur(var(--kb-backdrop-blur)); border-radius: 9999px; padding: 0.5rem 1rem; display: flex; align-items: center; gap: 0.75rem; cursor: pointer; transition: transform 0.2s, opacity 0.3s; opacity: 0; z-index: 1; color: var(--kb-text-title); font-weight: 500; font-size: 0.875rem; font-family: var(--kb-font-family); }
15
- .launcher .kbd-hint .kbd { background: var(--kb-kbd-bg); border: 1px solid var(--kb-kbd-border); color: var(--kb-kbd-text); }
16
- .launcher .kbd-hint .kbd-text { color: var(--kb-kbd-text); }
17
152
  .launcher:hover { transform: scale(1.02); background-color: var(--kb-bg-container); }
153
+ .kb-chip-row { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; }
154
+ .kb-chip { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.35rem 0.8rem; border-radius: 9999px; border: 1px solid rgba(255,255,255,0.85); background: linear-gradient(135deg, rgba(255,255,255,0.28), rgba(255,255,255,0.08)); color: var(--kb-text-title); font-size: 0.8rem; font-weight: 600; backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: 0 8px 18px rgba(0,0,0,0.4), inset 0 0 0 1px rgba(255,255,255,0.45); }
155
+ .kb-chip-logo { width: 18px; height: 18px; border-radius: 9999px; overflow: hidden; background: rgba(255,255,255,0.2); display: flex; align-items: center; justify-content: center; }
156
+ .kb-chip-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
157
+ .kb-chip-fallback { width: 18px; height: 18px; border-radius: 9999px; display: flex; align-items: center; justify-content: center; font-size: 0.7rem; font-weight: 700; color: var(--kb-text-title); background: rgba(255,255,255,0.25); }
158
+ .kb-chip-action { margin-left: 0.35rem; font-size: 0.7rem; color: var(--kb-text-subtitle); text-decoration: underline; background: none; border: none; padding: 0; cursor: pointer; }
159
+ .kb-chip-action:hover { color: var(--kb-text-title); }
160
+ .kb-chip--launcher { padding: 0.25rem 0.65rem; font-size: 0.7rem; }
161
+ .kb-chip-row.launcher-row { margin-bottom: 0; }
162
+ .launcher-label { display: inline-flex; align-items: center; gap: 0.5rem; }
163
+ .subtitle-chip { margin-top: 0.35rem; }
18
164
  .pos-top-center { left: 50%; translate: -50% 0; top: 1rem; }
19
165
  .pos-top-right { right: 1rem; top: 1rem; left: auto; }
20
166
  @media (max-width: 768px) { .pos-top-center, .pos-top-right { left: 0.5rem; right: 0.5rem; top: 0.5rem; translate: none; width: auto; max-width: none; } }
@@ -29,7 +175,7 @@
29
175
  .text-content { flex: 1; user-select: none; }
30
176
  .text-row { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; }
31
177
  .title { color: var(--kb-text-title); font-size: 1rem; font-weight: 600; line-height: 1.5; }
32
- .subtitle { color: var(--kb-text-title); font-size: 0.875rem; line-height: 1.25; opacity: 0.8; }
178
+ .subtitle-text { color: var(--kb-text-title); font-size: 0.875rem; line-height: 1.25; opacity: 0.8; }
33
179
  .btn { display: inline-flex; align-items: center; justify-content: center; border-radius: 0.375rem; font-weight: 500; font-size: 0.875rem; line-height: 1.25rem; padding: 0.5rem 1rem; transition: all 0.2s; cursor: pointer; border: none; outline: none; }
34
180
  .btn-trigger { background-color: var(--kb-btn-trigger-bg); color: var(--kb-btn-trigger-text); min-width: 8rem; gap: 0.5rem; transition: opacity 0.2s ease-out, background-color 0.2s ease-out; }
35
181
  .btn-trigger.hidden { opacity: 0; pointer-events: none; }
@@ -77,19 +223,17 @@
77
223
  .popover-watermark { position: absolute; top: 100%; left: 0; right: 0; text-align: center; font-size: 0.625rem; color: var(--kb-watermark-text); opacity: 0.6; font-weight: 500; letter-spacing: 0.025em; padding-top: 0.5rem; }
78
224
  .popover-watermark a { color: inherit; text-decoration: none; cursor: pointer; }
79
225
  .popover-watermark a:hover { text-decoration: underline; opacity: 1; }
80
- /* Launcher hint positioning */
81
- .launcher .kbd-hint { position: static; transform: none; opacity: 0.6; transition: opacity 0.2s; }
82
- .launcher:hover .kbd-hint { opacity: 1; }
83
- .pos-top-right.launcher .kbd-hint { left: auto; right: auto; }
226
+ /* Launcher helper hint (below launcher) */
227
+ .launcher-hint { position: absolute; top: calc(100% + 0.4rem); left: 50%; transform: translateX(-50%); pointer-events: none; white-space: nowrap; }
228
+ .launcher-hint.visible { opacity: 0.65; }
84
229
  /* Launcher dismiss button */
85
230
  .launcher .btn-dismiss.launcher-dismiss { top: -0.375rem; left: -0.375rem; width: 1.25rem; height: 1.25rem; opacity: 0; transition: opacity 0.2s ease-out, background-color 0.3s ease-out, color 0.3s ease-out; }
86
231
  .launcher:hover .btn-dismiss.launcher-dismiss { opacity: 1; }
87
232
  /* Launcher logo */
88
233
  .launcher-logo { width: 20px; height: 20px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
89
234
  .launcher-logo svg { width: 20px; height: 20px; }
90
- /* Mobile: hide keyboard hints, show dismiss button */
235
+ /* Mobile: show dismiss button */
91
236
  @media (max-width: 768px) {
92
- .launcher .kbd-hint { display: none; }
93
237
  .launcher .btn-dismiss.launcher-dismiss { opacity: 1; }
94
238
  }
95
239
  /* Toggle personalization button */
@@ -99,7 +243,12 @@
99
243
  /* Custom tooltip for toggle button */
100
244
  .btn-toggle-personalization .toggle-tooltip { position: absolute; top: calc(100% + 6px); left: 50%; transform: translateX(-50%); white-space: nowrap; background-color: var(--kb-bg-container); border: 1px solid var(--kb-border-container); color: var(--kb-text-title); font-size: 0.7rem; font-weight: 500; padding: 0.25rem 0.5rem; border-radius: 4px; opacity: 0; visibility: hidden; transition: opacity 0.15s ease-out, visibility 0.15s ease-out; pointer-events: none; z-index: 100; box-shadow: 0 2px 8px rgba(0,0,0,0.15); }
101
245
  .btn-toggle-personalization:hover .toggle-tooltip { opacity: 1; visibility: visible; }
102
- `,Ut=(e,t,r)=>{let n=H(!1),i=H(null);G(()=>{let o=e.current;if(!o)return;i.current&&(i.current.cancel(),i.current=null);let a=r.direction==="top-to-bottom",l=a?"translateY(-60px)":"translateX(60px)",d=a?"translateY(-20px)":"translateX(20px)",c="translate(0, 0)";if(t){o.style.visibility="visible",n.current=!0;let u=o.animate([{opacity:0,transform:l},{opacity:1,transform:c}],{duration:500,delay:r.entranceDelayMs,easing:"cubic-bezier(0.175, 0.885, 0.32, 1.275)",fill:"forwards"});i.current=u,u.onfinish=()=>{i.current=null,r.onEntranceComplete?.()}}else if(n.current){let u=o.animate([{opacity:1,transform:c},{opacity:0,transform:d}],{duration:350,delay:r.exitDelayMs,easing:"ease-in-out",fill:"forwards"});i.current=u,u.onfinish=()=>{o.style.visibility="hidden",i.current=null,r.onExitComplete?.()}}else o.style.opacity="0",o.style.transform=d,o.style.visibility="hidden"},[t,r.direction])},$t=e=>{if(!e)return{};let t={};return e.fontFamily&&(t["--kb-font-family"]=e.fontFamily),e.backgroundColor&&(t["--kb-bg-container"]=e.backgroundColor,t["--kb-popover-bg"]=e.backgroundColor),e.borderColor&&(t["--kb-border-container"]=e.borderColor,t["--kb-popover-border"]=e.borderColor),e.textColor&&(t["--kb-text-title"]=e.textColor,t["--kb-popover-text"]=e.textColor),e.subtitleColor&&(t["--kb-text-subtitle"]=e.subtitleColor),e.borderRadius&&(t["border-radius"]=e.borderRadius,t["border-bottom-left-radius"]=e.borderRadius,t["border-bottom-right-radius"]=e.borderRadius),e.primaryColor&&(t["--kb-btn-trigger-bg"]=e.primaryColor,t["--kb-progress-indicator"]=e.primaryColor,t["--kb-success-color"]=e.primaryColor),e.primaryTextColor&&(t["--kb-btn-trigger-text"]=e.primaryTextColor),t},Kr=({config:e,isOpen:t,skipFocus:r,setIsOpen:n})=>{let i=e.mountMode==="inline",o=H(null),a=H(null),l=H(null),d=H(null),c=H(null),[u,s]=oe("card"),[f,m]=oe(!1),[S,L]=oe(!1),[E,b]=oe(!1),v=H(!1),C=H(!1),F=H(!1),z=H("card"),_=H(e.status),U=H(!!e.isVisible),O=H(null),R=H(null),K=H(!1),[M,V]=oe(!1),[xe,de]=oe(!1),[se,le]=oe({}),[y,k]=oe(0),D=H(0),w=e.enableTimer!==!1,A=Math.max(500,e.timerDurationMs??2e4),W=It(g=>{D.current=g,k(g)},[]);G(()=>{e.isVisible&&(s("card"),v.current=!1,m(!1))},[e.isVisible]),u==="card"&&z.current==="launcher"&&(C.current=!1),e.status==="success"&&_.current!=="success"?u==="card"&&(C.current=!0):e.status!=="success"&&(C.current=!1),_.current=e.status,G(()=>{let g=z.current==="launcher",x=u==="card";g&&x&&S&&(F.current=!0,setTimeout(()=>{F.current=!1},100)),u==="launcher"&&V(!1),g&&x&&w&&(W(0),O.current=null,K.current=!1)},[u,W,w]),G(()=>{if(e.status==="success"&&(L(!0),e.enableLauncher&&u==="card"&&C.current)){let g=setTimeout(()=>{s("launcher")},2e3);return()=>clearTimeout(g)}},[e.status,e.enableLauncher,u]),G(()=>{e.isVisible&&!U.current&&w&&(W(0),O.current=null,K.current=!1),U.current=!!e.isVisible},[e.isVisible,W,w]),G(()=>{z.current=u},[u]);let q=H(!1);r&&(q.current=!0),G(()=>{if(t){S&&c.current&&c.current.reset();let g=q.current;if(q.current=!1,!g){let x=setTimeout(()=>{d.current&&d.current.focus()},100);return()=>clearTimeout(x)}}},[t]);let re=H(t);G(()=>{let g=re.current;re.current=t,!g&&t&&u==="launcher"&&s("card")},[t,u]);let pe=!v.current,J=z.current==="launcher",fe=pe?e.entranceDelayMs||0:J&&u==="card"?400:0;i||(Ut(o,!!e.isVisible&&u==="card"&&!f,{direction:e.direction||"top-to-bottom",position:e.position||"top-center",entranceDelayMs:fe,exitDelayMs:75,onEntranceComplete:()=>{e.onEntranceComplete?.(),v.current=!0},onExitComplete:()=>{(!e.isVisible||f)&&e.onExitComplete?.()}}),Ut(a,!!e.isVisible&&u==="launcher"&&!f,{direction:e.direction||"top-to-bottom",position:e.position||"top-center",entranceDelayMs:400,exitDelayMs:75})),G(()=>{let g=l.current;if(!g)return;let x=e.status==="success"&&C.current;if(e.enableFocusMode&&u==="card"&&e.isVisible&&!x){let T=setTimeout(()=>{g.classList.add("active")},e.focusDelayMs||500);return()=>clearTimeout(T)}else g.classList.remove("active")},[e.enableFocusMode,u,e.isVisible,e.focusDelayMs,e.status]),G(()=>{if(!e.isVisible)return;let g=x=>{if(x.key==="Escape"){u==="card"&&(e.enableLauncher?(b(!0),s("launcher"),setTimeout(()=>{n(!1),b(!1)},500)):(n(!1),e.onDismiss?.()));return}(($,Q)=>{let ee=Q||{key:"p",modifiers:["meta","ctrl"]};if($.key.toLowerCase()!==ee.key.toLowerCase())return!1;let X=ee.modifiers||[];if(Q){let Ke=X.includes("meta")===$.metaKey,Ce=X.includes("ctrl")===$.ctrlKey,Ue=X.includes("alt")===$.altKey,nr=X.includes("shift")===$.shiftKey;return Ke&&Ce&&Ue&&nr}return $.metaKey||$.ctrlKey})(x,e.keyboardShortcut)&&(x.preventDefault(),u==="launcher"?(s("card"),n(!0)):u==="card"&&(e.enableLauncher?s("launcher"):e.onDismiss?.()))};return window.addEventListener("keydown",g),()=>window.removeEventListener("keydown",g)},[e.isVisible,t,u,e.enableLauncher,n,e.onDismiss]);let Y=typeof navigator<"u"&&/Mac/.test(navigator.userAgent),be=(()=>{if(e.keyboardShortcut){let g=e.keyboardShortcut.modifiers||[],x=[];return g.includes("meta")&&x.push(Y?"\u2318":"Win"),g.includes("ctrl")&&x.push("Ctrl"),g.includes("alt")&&x.push(Y?"Opt":"Alt"),g.includes("shift")&&x.push("Shift"),x.push(e.keyboardShortcut.key.toUpperCase()),x}return[Y?"\u2318":"Ctrl","P"]})(),B=e.status==="starting",ce=e.status==="success",Ie=e.status==="error",He=ce&&C.current,Z=e.textOverrides||{},Yt=ce?Z.titleSuccess||"Personalization complete":B?"Starting personalization":Ie?Z.titleError||"Let's try that again":e.hasPersonalization?"Personalization ready":Z.titleResting||"Personalization available",Qt=ce?Z.subtitleSuccess||"Take a look":B?"Hang tight...":Ie?Z.subtitleError||"Something went wrong. Tap to retry.":Z.subtitleResting||"This page can adapt to you",Fe=B?Z.btnLoading||"Starting...":Ie?Z.btnError||"Try again":ce&&C.current?Z.btnSuccess||"Personalised":S?"Show me again":Z.btnResting||"Show me",nt=(g,x,T)=>{if(!T)return null;if(T.required&&!x.trim())return T.errorMessage||`${T.label} is required`;if(!x)return null;if(T.type==="email"&&!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(x))return T.errorMessage||"Please enter a valid email address";if(T.type==="url")try{new URL(x)}catch{return T.errorMessage||"Please enter a valid URL (e.g., https://example.com)"}return T.minLength&&x.length<T.minLength?T.errorMessage||`Must be at least ${T.minLength} characters`:T.maxLength&&x.length>T.maxLength?T.errorMessage||`Must be at most ${T.maxLength} characters`:T.pattern&&!new RegExp(T.pattern).test(x)?T.errorMessage||"Invalid format":null},Jt=g=>{if(g.preventDefault(),B)return;let x=new FormData(g.target),T={},$={},Q=!1;if(x.forEach((ee,X)=>{let Oe=ee.toString();T[X]=Oe;let Ke=e.fields.find(Ue=>Ue.name===X),Ce=nt(X,Oe,Ke);Ce&&($[X]=Ce,Q=!0)}),Q){le($);return}le({}),n(!1),e.onSubmitPersonalization?.(T)},Zt=g=>{let x=g.target,T=x.name;if(se[T]){let $=e.fields.find(ee=>ee.name===T),Q=nt(T,x.value,$);le(ee=>{let X={...ee};return Q?X[T]=Q:delete X[T],X})}},er=g=>{if(g.stopPropagation(),B||ce)return;let x=!t;n(x),x&&e.enableClickSheen&&(de(!0),setTimeout(()=>de(!1),600))};G(()=>{if(!w||K.current)return;if(!(e.isVisible&&u==="card"&&e.status==="resting"&&!t&&!M)){R.current!==null&&(cancelAnimationFrame(R.current),R.current=null),O.current=null;return}let x=T=>{O.current===null&&(O.current=T-D.current/100*A);let $=T-O.current,Q=Math.min(1,$/A),ee=Q*100;if(W(ee),Q>=1){K.current=!0,O.current=null,R.current=null,e.enableLauncher?(s("launcher"),n(!1)):e.onDismiss?.();return}R.current=requestAnimationFrame(x)};return R.current=requestAnimationFrame(x),()=>{R.current!==null&&(cancelAnimationFrame(R.current),R.current=null)}},[e.enableLauncher,e.isVisible,e.onDismiss,e.status,M,t,u,n,A,w,W]),G(()=>()=>{R.current!==null&&cancelAnimationFrame(R.current)},[]);let tr=Math.max(0,Math.min(100,e.progressPct??0)),rr=w?y:tr,it=!!e.isVisible&&u==="card"&&!f,ot=!!e.isVisible&&u==="launcher"&&!f;return p(ie,{children:[p("div",{ref:l,class:"backdrop",style:{display:it||ot?"block":"none"}}),p("div",{ref:o,class:`container theme-${e.theme||"glass"} pos-${e.position||"top-center"}${t?" popover-open":""}`,style:{...$t(e.customTheme),pointerEvents:it?"auto":"none"},onClick:()=>!t&&!B&&!ce&&n(!0),onMouseEnter:()=>V(!0),onMouseLeave:()=>V(!1),children:[e.enableClickSheen&&p("div",{class:`container-sheen${xe?" active":""}`}),p("button",{class:"btn-dismiss","aria-label":"Dismiss",onClick:g=>{g.stopPropagation(),K.current=!0,e.enableLauncher?s("launcher"):e.onDismiss?.()},children:p(Kt,{})}),p("div",{class:"content-wrapper",children:p("div",{class:"text-content",children:p("div",{class:"text-row",children:[p("div",{children:[p("div",{class:"title",children:Yt}),p("div",{class:"subtitle",children:Qt})]}),B?p("span",{class:"status-text",children:[p(et,{})," ",Fe]}):p("button",{class:`btn btn-trigger ${He?"success":""}${t||E?" hidden":""}`,disabled:He,onClick:er,children:He?p(ie,{children:[p(Ir,{})," ",Fe]}):Fe})]})})}),p("div",{class:"progress-clip",children:p("div",{class:"progress-container",children:p("div",{class:"progress-bar",style:{width:`${rr}%`}})})}),p("div",{class:`popover ${t?"open":""}`,onClick:g=>g.stopPropagation(),children:[p("form",{onSubmit:Jt,ref:c,children:[e.fields.map((g,x)=>p("div",{class:"form-group",children:[p("label",{class:`form-label ${se[g.name]?"error":""}`,children:g.label}),p("div",{class:"input-row",children:[p("input",{ref:x===0?d:void 0,class:`form-input ${se[g.name]?"error":""}`,name:g.name,type:g.type||"text",placeholder:g.placeholder,required:g.required,onInput:Zt}),e.fields.length===1&&p("button",{type:"submit",class:"btn btn-submit",disabled:B,children:B?p(et,{}):p(Ot,{})})]}),se[g.name]&&p("div",{class:"form-message",children:se[g.name]})]},g.name)),e.fields.length>1&&p("button",{type:"submit",class:"btn btn-submit",style:{width:"100%"},disabled:B,children:B?p(et,{}):p(Ot,{})})]}),e.showWatermark&&p("div",{class:"popover-watermark",children:["Powered by"," ",p("a",{href:"https://kenobi.ai",target:"_blank",rel:"noopener noreferrer",children:"Kenobi"})]})]}),e.showKeyboardHints&&e.enableFocusMode&&p("div",{class:`kbd-hint ${!t&&!B&&!ce?"visible":""}`,children:[p("div",{class:"kbd-group",children:p("div",{class:"kbd",children:"Esc"})}),p("span",{class:"kbd-text",children:"to dismiss"})]})]}),p("div",{ref:a,class:`launcher theme-${e.theme||"glass"} pos-${e.position||"top-center"}`,style:{...$t(e.customTheme),...e.launcherStyles,pointerEvents:ot?"auto":"none"},onClick:g=>{g.stopPropagation(),m(!1),s("card"),n(!0)},role:"button",tabIndex:0,children:[e.launcherShineBorder?.enabled&&p("div",{class:"launcher-shine-border",style:{"--shine-duration":`${e.launcherShineBorder.duration||14}s`,"--shine-border-width":`${e.launcherShineBorder.borderWidth||1}px`,backgroundImage:`radial-gradient(transparent, transparent, ${Array.isArray(e.launcherShineBorder.color)?e.launcherShineBorder.color.join(","):e.launcherShineBorder.color||"rgba(255,255,255,0.5)"}, transparent, transparent)`}}),p("button",{class:"btn-dismiss launcher-dismiss","aria-label":"Dismiss",onClick:g=>{g.stopPropagation(),m(!0),e.onDismiss?.()},children:p(Kt,{})}),e.showLauncherLogo!==!1&&p("div",{class:"launcher-logo",children:p(Hr,{})}),S?e.textOverrides?.launcherLabelSuccess||e.textOverrides?.launcherLabel||"Personalize again":e.textOverrides?.launcherLabel||"Personalize",e.enableUndoToggle&&S&&p("button",{class:"btn-toggle-personalization","aria-label":e.isPersonalized?"Show original":"Show personalized",onClick:g=>{g.stopPropagation(),e.onTogglePersonalization?.()},children:[p(Fr,{}),p("span",{class:"toggle-tooltip",children:e.isPersonalized?"Show original":"Show personalized"})]}),e.showKeyboardHints&&p("div",{class:"kbd-hint visible",children:p("div",{class:"kbd-group",children:be.map((g,x)=>p("div",{class:"kbd",children:g},x))})})]})]})},ke=class{constructor(t){h(this,"host");h(this,"shadow");h(this,"config");h(this,"isOpen",!1);h(this,"skipFocus",!1);h(this,"mountTarget",null);this.config={position:"top-center",direction:"top-to-bottom",theme:"glass",entranceDelayMs:0,exitDelayMs:75,hasPersonalization:!1,isVisible:!1,progressPct:0,status:"resting",enableTimer:!0,timerDurationMs:2e4,enableLauncher:!0,enableFocusMode:!1,focusBlurIntensity:"10px",focusDelayMs:500,showKeyboardHints:!1,showWatermark:!0,mountMode:"overlay",...t},this.mountTarget=t.mountNode??null,this.host=document.createElement("div"),this.host.id="kenobi-cue-card-root",this.applyHostStyles(),this.shadow=this.host.attachShadow({mode:"open"});let r=document.createElement("style");r.textContent=Or,this.shadow.appendChild(r);let n=document.createElement("div");this.shadow.appendChild(n)}applyHostStyles(){let t=this.config.mountMode==="inline";this.host.classList.toggle("kb-inline",t);let r=this.config.focusBlurIntensity??"10px";if(t){this.host.style.cssText=`
246
+ .btn-toggle-personalization.loading { cursor: default; opacity: 0.7; }
247
+ .btn-toggle-personalization.loading:hover { transform: none; }
248
+ .btn-toggle-personalization:disabled { cursor: default; }
249
+ .launcher-domain { text-decoration: underline; text-underline-offset: 2px; }
250
+ .launcher-actions { display: flex; align-items: center; gap: 0.25rem; }
251
+ `,nn=(t,e,n)=>{let r=$(!1),i=$(null);X(()=>{let o=t.current;if(!o)return;i.current&&(i.current.cancel(),i.current=null);let a=n.direction==="top-to-bottom",s=a?"translateY(-60px)":"translateX(60px)",u=a?"translateY(-20px)":"translateX(20px)",c="translate(0, 0)";if(e){o.style.visibility="visible",r.current=!0;let h=o.animate([{opacity:0,transform:s},{opacity:1,transform:c}],{duration:500,delay:n.entranceDelayMs,easing:"cubic-bezier(0.175, 0.885, 0.32, 1.275)",fill:"forwards"});i.current=h,h.onfinish=()=>{i.current=null,n.onEntranceComplete?.()}}else if(r.current){let h=o.animate([{opacity:1,transform:c},{opacity:0,transform:u}],{duration:350,delay:n.exitDelayMs,easing:"ease-in-out",fill:"forwards"});i.current=h,h.onfinish=()=>{o.style.visibility="hidden",i.current=null,n.onExitComplete?.()}}else o.style.opacity="0",o.style.transform=u,o.style.visibility="hidden"},[e,n.direction])},rn=t=>{if(!t)return{};let e={};return t.fontFamily&&(e["--kb-font-family"]=t.fontFamily),t.backgroundColor&&(e["--kb-bg-container"]=t.backgroundColor,e["--kb-popover-bg"]=t.backgroundColor),t.borderColor&&(e["--kb-border-container"]=t.borderColor,e["--kb-popover-border"]=t.borderColor),t.textColor&&(e["--kb-text-title"]=t.textColor,e["--kb-popover-text"]=t.textColor),t.subtitleColor&&(e["--kb-text-subtitle"]=t.subtitleColor),t.borderRadius&&(e["border-radius"]=t.borderRadius,e["border-bottom-left-radius"]=t.borderRadius,e["border-bottom-right-radius"]=t.borderRadius),t.primaryColor&&(e["--kb-btn-trigger-bg"]=t.primaryColor,e["--kb-progress-indicator"]=t.primaryColor,e["--kb-success-color"]=t.primaryColor),t.primaryTextColor&&(e["--kb-btn-trigger-text"]=t.primaryTextColor),e},_r=({config:t,isOpen:e,skipFocus:n,setIsOpen:r,deanonymizedCompany:i,onClearDeanonymizedCompany:o})=>{let a=t.mountMode==="inline",s=$(null),u=$(null),c=$(null),h=$(null),l=$(null),[p,b]=re("card"),[E,M]=re(!1),[T,g]=re(!1),[x,P]=re(!1),O=$(!1),L=$(!1),v=$(!1),V=$("card"),J=$(t.status),j=$(!!t.isVisible),H=$(null),C=$(null),B=$(!1),[ge,ue]=re(!1),[Fe,pe]=re(!1),[_,k]=re({}),[D,S]=re(0),z=$(0),G=t.enableTimer!==!1,Z=Math.max(500,t.timerDurationMs??2e4),F=t.status==="starting",te=t.status==="success",ne=t.status==="error",ee=!!i,q=!ee,K=q?e:!1,se=i?.name||i?.domain||"",Ce=i?.domain,fe=Gt(f=>{z.current=f,S(f)},[]);X(()=>{t.isVisible&&(b("card"),O.current=!1,M(!1))},[t.isVisible]),p==="card"&&V.current==="launcher"&&(L.current=!1),t.status==="success"&&J.current!=="success"?p==="card"&&(L.current=!0):t.status!=="success"&&(L.current=!1),J.current=t.status,X(()=>{let f=V.current==="launcher",y=p==="card";f&&y&&T&&(v.current=!0,setTimeout(()=>{v.current=!1},100)),p==="launcher"&&ue(!1),f&&y&&G&&(fe(0),H.current=null,B.current=!1)},[p,fe,G]),X(()=>{if(t.status==="success"&&(g(!0),t.enableLauncher&&p==="card"&&L.current)){let f=setTimeout(()=>{b("launcher")},2e3);return()=>clearTimeout(f)}},[t.status,t.enableLauncher,p]),X(()=>{t.isVisible&&!j.current&&G&&(fe(0),H.current=null,B.current=!1),j.current=!!t.isVisible},[t.isVisible,fe,G]),X(()=>{V.current=p},[p]);let Ue=$(!1);n&&(Ue.current=!0),X(()=>{if(K){T&&l.current&&l.current.reset();let f=Ue.current;if(Ue.current=!1,!f){let y=setTimeout(()=>{h.current&&h.current.focus()},100);return()=>clearTimeout(y)}}},[K]);let ct=$(K);X(()=>{let f=ct.current;ct.current=K,!f&&K&&p==="launcher"&&b("card")},[K,p]);let fn=!O.current,mn=V.current==="launcher",hn=fn?t.entranceDelayMs||0:mn&&p==="card"?400:0;a||(nn(s,!!t.isVisible&&p==="card"&&!E,{direction:t.direction||"top-to-bottom",position:t.position||"top-center",entranceDelayMs:hn,exitDelayMs:75,onEntranceComplete:()=>{t.onEntranceComplete?.(),O.current=!0},onExitComplete:()=>{(!t.isVisible||E)&&t.onExitComplete?.()}}),nn(u,!!t.isVisible&&p==="launcher"&&!E,{direction:t.direction||"top-to-bottom",position:t.position||"top-center",entranceDelayMs:400,exitDelayMs:75})),X(()=>{let f=c.current;if(!f)return;let y=t.status==="success"&&L.current;if(t.enableFocusMode&&p==="card"&&t.isVisible&&!y){let w=setTimeout(()=>{f.classList.add("active")},t.focusDelayMs||500);return()=>clearTimeout(w)}else f.classList.remove("active")},[t.enableFocusMode,p,t.isVisible,t.focusDelayMs,t.status]),X(()=>{if(!t.isVisible)return;let f=y=>{if(y.key==="Escape"){p==="card"&&(t.enableLauncher?(P(!0),b("launcher"),setTimeout(()=>{r(!1),P(!1)},500)):(r(!1),t.onDismiss?.()));return}((R,I)=>{let Y=I||{key:"p",modifiers:["meta","ctrl"]};if(R.key.toLowerCase()!==Y.key.toLowerCase())return!1;let ie=Y.modifiers||[];if(I){let An=ie.includes("meta")===R.metaKey,Mn=ie.includes("ctrl")===R.ctrlKey,Ln=ie.includes("alt")===R.altKey,Dn=ie.includes("shift")===R.shiftKey;return An&&Mn&&Ln&&Dn}return R.metaKey||R.ctrlKey})(y,t.keyboardShortcut)&&(y.preventDefault(),p==="launcher"?(b("card"),r(q)):p==="card"&&(t.enableLauncher?b("launcher"):t.onDismiss?.()))};return window.addEventListener("keydown",f),()=>window.removeEventListener("keydown",f)},[t.isVisible,K,p,t.enableLauncher,r,t.onDismiss,q]);let[bn,gn]=re(!1),$e=typeof navigator<"u"&&/Mac/.test(navigator.userAgent);X(()=>{if(typeof window>"u")return;let f=window.matchMedia("(max-width: 768px)"),y=()=>gn(f.matches);return y(),"addEventListener"in f?(f.addEventListener("change",y),()=>f.removeEventListener("change",y)):(window.addEventListener("resize",y),()=>window.removeEventListener("resize",y))},[]);let Ke=(()=>{if(bn)return{keys:[],label:"tap to launch"};if(t.keyboardShortcut){let f=t.keyboardShortcut.modifiers||[],y=[];return f.includes("meta")&&y.push($e?"\u2318":"Ctrl"),f.includes("ctrl")&&y.push("Ctrl"),f.includes("alt")&&y.push($e?"Opt":"Alt"),f.includes("shift")&&y.push("Shift"),y.push(t.keyboardShortcut.key.toUpperCase()),{keys:y,label:"to launch"}}return{keys:[$e?"\u2318":"Ctrl","P"],label:"to launch"}})(),[yn,ut]=re(!1),[dt,pt]=re("primary");X(()=>{ut(!1),pt("primary")},[i?.logoUrl,se,Ce]),X(()=>{!q&&e&&r(!1)},[q,e,r]);let ft=t.deanonymization?.logoUrlTemplate,Te=tn(Ce),me=Te?`https://logo.clearbit.com/${Te}`:void 0,Ve=Te&&ft?ft.replace("{domain}",Te):i?.logoUrl||me,mt=dt==="fallback"&&me&&me!==Ve?me:Ve,je=te&&L.current,W=t.textOverrides||{},_n=te?W.titleSuccess||"Personalization complete":F?"Starting personalization":ne?W.titleError||"Let's try that again":t.hasPersonalization?"Personalization ready":W.titleResting||"Personalization available",vn=te?W.subtitleSuccess||"Take a look":F?"Hang tight...":ne?W.subtitleError||"Something went wrong. Tap to retry.":W.subtitleResting||"This page can adapt to you",Be=F?W.btnLoading||"Starting...":ne?W.btnError||"Try again":te&&L.current?W.btnSuccess||"Personalised":T?"Show me again":W.btnResting||"Show me",ht=ee?T?W.launcherLabelDeanonymizedSuccess||W.launcherLabelDeanonymized||"See it again for":W.launcherLabelDeanonymized||"See it in action for":T?W.launcherLabelSuccess||W.launcherLabel||"Personalize again":W.launcherLabel||"Personalize",bt=f=>{if(!i||!se)return null;let y=f==="launcher",w=se.trim().slice(0,1).toUpperCase();return d("div",{class:`kb-chip ${y?"kb-chip--launcher":""}`,children:[!!mt&&!yn?d("span",{class:"kb-chip-logo",children:d("img",{src:mt,alt:"",referrerPolicy:"no-referrer",onError:()=>{if(dt==="primary"&&me&&me!==Ve){pt("fallback");return}ut(!0)}})}):d("span",{class:"kb-chip-fallback",children:w}),d("span",{children:se}),o&&d("button",{class:"kb-chip-action",type:"button",onClick:I=>{I.stopPropagation(),o(),r(!0)},children:"Not you?"})]})},kn=()=>{let f=tn(Ce),y=(f||Ce||se||"").toString(),w={};return t.fields.forEach(R=>{let I=R.name,Y=I.toLowerCase();if(Y.includes("domain")){w[I]=f||y;return}if(Y.includes("company")){w[I]=se;return}w[I]=y}),w},gt=f=>{let y={},w=!1;if(t.fields.forEach(R=>{let I=f[R.name]??"",Y=typeof I=="string"?I:String(I),ie=yt(R.name,Y,R);ie&&(y[R.name]=ie,w=!0)}),w){k(y);return}k({}),r(!1),t.onSubmitPersonalization?.(f)},yt=(f,y,w)=>{if(!w)return null;if(w.required&&!y.trim())return w.errorMessage||`${w.label} is required`;if(!y)return null;if(w.type==="email"&&!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(y))return w.errorMessage||"Please enter a valid email address";if(w.type==="url")try{new URL(y)}catch{return w.errorMessage||"Please enter a valid URL (e.g., https://example.com)"}return w.minLength&&y.length<w.minLength?w.errorMessage||`Must be at least ${w.minLength} characters`:w.maxLength&&y.length>w.maxLength?w.errorMessage||`Must be at most ${w.maxLength} characters`:w.pattern&&!new RegExp(w.pattern).test(y)?w.errorMessage||"Invalid format":null},wn=f=>{if(f.preventDefault(),F)return;let y=new FormData(f.target),w={};y.forEach((R,I)=>{let Y=R.toString();w[I]=Y}),gt(w)},xn=f=>{let y=f.target,w=y.name;if(_[w]){let R=t.fields.find(Y=>Y.name===w),I=yt(w,y.value,R);k(Y=>{let ie={...Y};return I?ie[w]=I:delete ie[w],ie})}},Cn=()=>{F||!ee||gt(kn())},Tn=f=>{if(f.stopPropagation(),ee||F||te)return;let y=!K;r(y),y&&t.enableClickSheen&&(pe(!0),setTimeout(()=>pe(!1),600))};X(()=>{if(!G||B.current)return;if(!(t.isVisible&&p==="card"&&t.status==="resting"&&!K&&!ge)){C.current!==null&&(cancelAnimationFrame(C.current),C.current=null),H.current=null;return}let y=w=>{H.current===null&&(H.current=w-z.current/100*Z);let R=w-H.current,I=Math.min(1,R/Z),Y=I*100;if(fe(Y),I>=1){B.current=!0,H.current=null,C.current=null,t.enableLauncher?(b("launcher"),r(!1)):t.onDismiss?.();return}C.current=requestAnimationFrame(y)};return C.current=requestAnimationFrame(y),()=>{C.current!==null&&(cancelAnimationFrame(C.current),C.current=null)}},[t.enableLauncher,t.isVisible,t.onDismiss,t.status,ge,K,p,r,Z,G,fe]),X(()=>()=>{C.current!==null&&cancelAnimationFrame(C.current)},[]);let Sn=Math.max(0,Math.min(100,t.progressPct??0)),En=G?D:Sn,_t=!!t.isVisible&&p==="card"&&!E,qe=!!t.isVisible&&p==="launcher"&&!E,zn=_t||qe,Pn=!!t.showKeyboardHints&&qe;return d(oe,{children:[d("div",{ref:c,class:"backdrop",style:{display:zn?"block":"none"}}),d("div",{ref:s,class:`container theme-${t.theme||"glass"} pos-${t.position||"top-center"}${K?" popover-open":""}`,style:{...rn(t.customTheme),pointerEvents:_t?"auto":"none"},onClick:()=>!K&&!F&&!te&&q&&r(!0),onMouseEnter:()=>ue(!0),onMouseLeave:()=>ue(!1),children:[t.enableClickSheen&&d("div",{class:`container-sheen${Fe?" active":""}`}),d("button",{class:"btn-dismiss","aria-label":"Dismiss",onClick:f=>{f.stopPropagation(),B.current=!0,t.enableLauncher?b("launcher"):t.onDismiss?.()},children:d(Zt,{})}),d("div",{class:"content-wrapper",children:d("div",{class:"text-content",children:d("div",{class:"text-row",children:[d("div",{children:[d("div",{class:"title",children:_n}),ee?d("div",{class:"subtitle-chip",children:bt("card")}):d("div",{class:"subtitle-text",children:vn})]}),F?d("span",{class:"status-text",children:[d(Oe,{})," ",Be]}):d("button",{class:`btn btn-trigger ${je?"success":""}${K||x?" hidden":""}`,disabled:je,onClick:ee?Cn:Tn,children:je?d(oe,{children:[d(pr,{})," ",Be]}):Be})]})})}),d("div",{class:"progress-clip",children:d("div",{class:"progress-container",children:d("div",{class:"progress-bar",style:{width:`${En}%`}})})}),!ee&&d("div",{class:`popover ${K?"open":""}`,onClick:f=>f.stopPropagation(),children:[d("form",{onSubmit:wn,ref:l,children:[t.fields.map((f,y)=>d("div",{class:"form-group",children:[d("label",{class:`form-label ${_[f.name]?"error":""}`,children:f.label}),d("div",{class:"input-row",children:[d("input",{ref:y===0?h:void 0,class:`form-input ${_[f.name]?"error":""}`,name:f.name,type:f.type||"text",placeholder:f.placeholder,required:f.required,onInput:xn}),t.fields.length===1&&d("button",{type:"submit",class:"btn btn-submit",disabled:F,children:F?d(Oe,{}):d(ot,{})})]}),_[f.name]&&d("div",{class:"form-message",children:_[f.name]})]},f.name)),t.fields.length>1&&d("button",{type:"submit",class:"btn btn-submit",style:{width:"100%"},disabled:F,children:F?d(Oe,{}):d(ot,{})})]}),t.showWatermark&&d("div",{class:"popover-watermark",children:["Powered by"," ",d("a",{href:"https://kenobi.ai",target:"_blank",rel:"noopener noreferrer",children:"Kenobi"})]})]}),t.showKeyboardHints&&t.enableFocusMode&&d("div",{class:`kbd-hint ${!K&&!F&&!te?"visible":""}`,children:[d("div",{class:"kbd-group",children:d("div",{class:"kbd",children:"Esc"})}),d("span",{class:"kbd-text",children:"to dismiss"})]})]}),d("div",{ref:u,class:`launcher theme-${t.theme||"glass"} pos-${t.position||"top-center"}`,style:{...rn(t.customTheme),...t.launcherStyles,pointerEvents:qe?"auto":"none"},onClick:f=>{f.stopPropagation(),M(!1),b("card"),r(q)},role:"button",tabIndex:0,children:[t.launcherShineBorder?.enabled&&d("div",{class:"launcher-shine-border",style:{"--shine-duration":`${t.launcherShineBorder.duration||14}s`,"--shine-border-width":`${t.launcherShineBorder.borderWidth||1}px`,backgroundImage:`radial-gradient(transparent, transparent, ${Array.isArray(t.launcherShineBorder.color)?t.launcherShineBorder.color.join(","):t.launcherShineBorder.color||"rgba(255,255,255,0.5)"}, transparent, transparent)`}}),d("button",{class:"btn-dismiss launcher-dismiss","aria-label":"Dismiss",onClick:f=>{f.stopPropagation(),M(!0),t.onDismiss?.()},children:d(Zt,{})}),t.showLauncherLogo!==!1&&d("div",{class:"launcher-logo",children:d(fr,{})}),d("div",{class:"launcher-label",children:[d("span",{children:(()=>{let f=ht.match(/^(For\s+)(.+)$/i);return f?d(oe,{children:[f[1],d("span",{class:"launcher-domain",children:f[2]})]}):ht})()}),ee&&bt("launcher")]}),d("div",{class:"launcher-actions",children:[t.enableUndoToggle&&T&&d("button",{class:"btn-toggle-personalization","aria-label":t.isPersonalized?"Show original":"Show personalized",onClick:f=>{f.stopPropagation(),t.onTogglePersonalization?.()},children:[d(mr,{}),d("span",{class:"toggle-tooltip",children:t.isPersonalized?"Show original":"Show personalized"})]}),t.launcherAction&&t.launcherAction.status!=="idle"&&T&&d("button",{class:`btn-toggle-personalization${t.launcherAction.status==="loading"?" loading":""}`,"aria-label":t.launcherAction.tooltip||"Action",onClick:f=>{f.stopPropagation(),t.launcherAction?.onClick?.()},disabled:t.launcherAction.status==="loading",children:[t.launcherAction.status==="loading"?d(Oe,{}):d(ot,{}),t.launcherAction.tooltip&&d("span",{class:"toggle-tooltip",children:t.launcherAction.tooltip})]})]}),Pn&&d("div",{class:"kbd-hint visible launcher-hint","aria-hidden":"true",children:[Ke.keys.length>0&&d("div",{class:"kbd-group",children:Ke.keys.map((f,y)=>d("div",{class:"kbd",children:f},y))}),d("span",{class:"kbd-text",children:Ke.label})]})]})]})},we=class{constructor(e){m(this,"host");m(this,"shadow");m(this,"config");m(this,"isOpen",!1);m(this,"skipFocus",!1);m(this,"mountTarget",null);m(this,"deanonymizedCompany",null);m(this,"deanonymizationStatus","idle");m(this,"deanonymizationCleanup",null);m(this,"hasStartedDeanonymization",!1);m(this,"clearDeanonymizedCompany",()=>{let e=this.deanonymizedCompany,n=this.config.status==="success"||this.config.isPersonalized;this.config.isPersonalized&&this.config.onTogglePersonalization?.(),this.deanonymizedCompany=null,this.deanonymizationStatus="failed",e&&at("deanonymization:not-you",{company:e}),n&&(this.config={...this.config,status:"resting",progressPct:0,isPersonalized:!1}),this.render()});this.config={position:"top-center",direction:"top-to-bottom",theme:"glass",entranceDelayMs:0,exitDelayMs:75,hasPersonalization:!1,isVisible:!1,progressPct:0,status:"resting",enableTimer:!0,timerDurationMs:2e4,enableLauncher:!0,enableFocusMode:!1,focusBlurIntensity:"10px",focusDelayMs:500,showKeyboardHints:!1,showWatermark:!0,mountMode:"overlay",...e},this.mountTarget=e.mountNode??null,this.isDeanonymizationEnabled()&&(this.deanonymizationStatus="pending"),this.host=document.createElement("div"),this.host.id="kenobi-cue-card-root",this.applyHostStyles(),this.shadow=this.host.attachShadow({mode:"open"});let n=document.createElement("style");n.textContent=yr,this.shadow.appendChild(n);let r=document.createElement("div");this.shadow.appendChild(r)}applyHostStyles(){let e=this.config.mountMode==="inline";this.host.classList.toggle("kb-inline",e);let n=this.config.focusBlurIntensity??"10px";if(e){this.host.style.cssText=`
103
252
  position: relative !important;
104
253
  z-index: auto !important;
105
254
  top: auto !important;
@@ -109,7 +258,7 @@
109
258
  pointer-events: auto !important;
110
259
  isolation: auto !important;
111
260
  display: block !important;
112
- --kb-focus-blur: ${r};
261
+ --kb-focus-blur: ${n};
113
262
  `;return}this.host.style.cssText=`
114
263
  position: fixed !important;
115
264
  z-index: 2147483647 !important;
@@ -119,6 +268,6 @@
119
268
  height: 0 !important;
120
269
  pointer-events: none !important;
121
270
  isolation: isolate !important;
122
- --kb-focus-blur: ${r};
123
- `}mount(t){let r=t||this.config.mountNode||this.mountTarget||document.body;this.mountTarget=r,r.contains(this.host)||r.appendChild(this.host),this.applyHostStyles(),this.render()}unmount(){Ye(null,this.shadow.lastElementChild),this.host.remove()}update(t){t.status==="starting"&&this.config.status!=="starting"&&(this.isOpen=!1),this.config={...this.config,...t},this.applyHostStyles(),this.render()}setTheme(t){this.update({theme:t})}openForm(t){this.isOpen=!0,this.skipFocus=t??!1,this.render()}render(){let t=this.shadow.lastElementChild,r=this.skipFocus;this.skipFocus=!1,Ye(p(Kr,{config:this.config,isOpen:this.isOpen,skipFocus:r,setIsOpen:n=>{this.isOpen=n,this.config.onOpenChange?.(n),this.render()}}),t)}};var Vt="kfor",Bt="kenobi_visitor_key",te="data-kenobi-transformation-identifier",me={enabled:!1,durationMs:300,delayMs:0,easing:"ease",animateSize:!0,overflow:"hidden"},Ur=e=>({enabled:e?.enabled??me.enabled,durationMs:e?.durationMs??me.durationMs,delayMs:e?.delayMs??me.delayMs,easing:e?.easing??me.easing,animateSize:e?.animateSize??me.animateSize,overflow:e?.overflow??me.overflow,textAnimation:e?.textAnimation,enter:e?.enter,exit:e?.exit}),$r=(e,t)=>({enabled:t?.enabled??e.enabled,durationMs:t?.durationMs??e.durationMs,delayMs:t?.delayMs??e.delayMs,easing:t?.easing??e.easing,animateSize:t?.animateSize??e.animateSize,overflow:t?.overflow??e.overflow,textAnimation:t?.textAnimation??e.textAnimation,enter:t?.enter??e.enter,exit:t?.exit??e.exit}),Wt=e=>typeof e=="string",we=e=>e instanceof HTMLElement||typeof SVGElement<"u"&&e instanceof SVGElement,Vr=e=>typeof e=="string",Br=e=>e==="hidden"||e==="visible"||e==="clip",jr=e=>e==="line"||e==="word"||e==="character",qt=e=>typeof e!="object"||e===null?!1:Array.isArray(e)?e.every(t=>typeof t=="object"&&t!==null):!0,jt=e=>{if(typeof e!="object"||e===null)return!1;let t=e,{animationName:r,keyframes:n,durationMs:i,delayMs:o}=t;return(r===void 0||Wt(r))&&(n===void 0||qt(n))&&(i===void 0||typeof i=="number")&&(o===void 0||typeof o=="number")},Wr=e=>{if(typeof e!="object"||e===null)return!1;let t=e,{by:r,staggerMs:n,animationName:i,keyframes:o,delayMs:a,durationMs:l}=t;return jr(r)&&(a===void 0||typeof a=="number")&&(n===void 0||typeof n=="number")&&(l===void 0||typeof l=="number")&&(Wt(i)||o!==void 0)&&(o===void 0||qt(o))},qr=e=>{if(typeof e!="object"||e===null)return!1;let t=e,{enabled:r,durationMs:n,delayMs:i,easing:o,animateSize:a,overflow:l,textAnimation:d,enter:c,exit:u}=t;return(r===void 0||typeof r=="boolean")&&(n===void 0||typeof n=="number")&&(i===void 0||typeof i=="number")&&(o===void 0||Vr(o))&&(a===void 0||typeof a=="boolean")&&(l===void 0||Br(l))&&(d===void 0||Wr(d))&&(c===void 0||jt(c))&&(u===void 0||jt(u))},tt=class{constructor(){h(this,"replaceWithTransition",async(t,r,n)=>{let i=document.createElement("div");i.style.position="relative",i.style.overflow=n.overflow;let o=t.getBoundingClientRect(),a=window.getComputedStyle(t);i.style.display=a.display,i.style.verticalAlign=a.verticalAlign,i.style.width=`${o.width}px`,i.style.height=`${o.height}px`,i.style.margin=a.margin;let l=t.cloneNode(!0);if(!(l instanceof Element)||!we(l))throw new Error("oldElClone is not an AnimatableElement");l.style.position="absolute",l.style.top="0",l.style.left="0",l.style.width="100%",l.style.height="100%",l.style.margin="0",l.style.pointerEvents="none",i.appendChild(l);let d=document.createElement("div");d.innerHTML=r;let c=d.firstElementChild;if(!c||!(c instanceof HTMLElement||c instanceof SVGElement))return await this.exit(t,n).finished,t;let u=c.style.cssText,s=t.parentNode,f;if(s instanceof HTMLElement){let _=s.cloneNode(!1),U=window.getComputedStyle(s),O=U.cssText?U.cssText:Array.from(U).reduce((R,K)=>`${R}${K}:${U.getPropertyValue(K)};`,"");_.style.cssText=O,_.style.position="absolute",_.style.top="-9999px",_.style.left="-9999px",_.style.visibility="hidden",_.style.pointerEvents="none",_.appendChild(c),document.body.appendChild(_),n.textAnimation&&this.applyTextAnimationToNode(c,n.textAnimation,n),f=c.getBoundingClientRect(),document.body.removeChild(_)}else{let _=document.createElement("div");_.style.position="absolute",_.style.top="-9999px",_.style.left="-9999px",_.style.visibility="hidden",_.appendChild(c),document.body.appendChild(_),n.textAnimation&&this.applyTextAnimationToNode(c,n.textAnimation,n),f=c.getBoundingClientRect(),document.body.removeChild(_)}c.style.cssText=u,c.style.visibility="",c.style.position="absolute",c.style.top="0",c.style.left="0",c.style.width=`${f.width}px`,c.style.height=`${f.height}px`,c.style.margin="0",c.style.opacity="0",i.appendChild(c),t.replaceWith(i);let m=n.exit?.delayMs??n.delayMs,S=n.exit?.durationMs??n.durationMs,L=n.enter?.delayMs??n.delayMs,E=n.enter?.durationMs??n.durationMs,b=[],v=this.resolveKeyframes(n.exit?.keyframes),C=l.animate(v,{duration:S,delay:m,easing:n.easing,fill:"forwards"});b.push(C);let F=this.resolveKeyframes(n.enter?.keyframes),z=c.animate(F,{duration:E,delay:L,easing:n.easing,fill:"forwards"});if(b.push(z),n.animateSize){let _=i.animate([{width:`${o.width}px`,height:`${o.height}px`},{width:`${f.width}px`,height:`${f.height}px`}],{duration:E,delay:L,easing:n.easing,fill:"forwards"});b.push(_)}return await Promise.all(b.map(_=>_.finished)),i.parentNode&&i.replaceWith(c),c.style.cssText=u,l.remove(),c});h(this,"enter",(t,r)=>{let n=r.enter?.delayMs??r.delayMs,i=r.enter?.durationMs??r.durationMs,o=this.resolveKeyframes(r.enter?.keyframes);return t.animate(o,{duration:i,delay:n,easing:r.easing,fill:"forwards"})});h(this,"exit",(t,r)=>{let n=r.exit?.delayMs??r.delayMs,i=r.exit?.durationMs??r.durationMs,o=this.resolveKeyframes(r.exit?.keyframes);return t.animate(o,{duration:i,delay:n,easing:r.easing,fill:"forwards"})});h(this,"resolveKeyframes",t=>t?Array.isArray(t)?t:[t]:[]);h(this,"applyTextAnimationToNode",(t,r,n)=>{let i=r.delayMs??0,o=window.getComputedStyle(t),a=o.getPropertyValue("background-clip")==="text"||o.getPropertyValue("-webkit-background-clip")==="text",l=(d,c,u)=>{if(d.nodeType===Node.TEXT_NODE){let s=d.textContent??"";if(s.trim().length===0)return c;if(r.by==="character"){let L=s.split(/(\s+)/),E=document.createDocumentFragment(),b=c;return L.forEach(v=>{if(v.length===0)return;if(v.trim().length===0){E.appendChild(document.createTextNode(v));return}let C=document.createElement("span");C.style.display="inline-block",C.style.whiteSpace="nowrap",u&&(C.style.setProperty("background","inherit"),C.style.setProperty("-webkit-background-clip","text"),C.style.setProperty("background-clip","text"),C.style.setProperty("color","transparent")),v.split("").forEach(z=>{let _=document.createElement("span");_.textContent=z,_.style.display="inline-block",_.style.opacity="0",u&&(_.style.setProperty("background","inherit"),_.style.setProperty("-webkit-background-clip","text"),_.style.setProperty("background-clip","text"),_.style.setProperty("color","transparent"),_.style.paddingBottom="0.1em",_.style.marginBottom="-0.1em");let U=this.resolveKeyframes(r.keyframes),O=r.durationMs??n.durationMs??300,R=n.easing??"ease",K=_.animate(U,{duration:O,easing:R,delay:b,fill:"forwards"});K.addEventListener("finish",()=>{K.commitStyles(),K.cancel()}),C.appendChild(_),b+=r.staggerMs??50}),E.appendChild(C)}),d.parentNode?.replaceChild(E,d),b}let f;switch(r.by){case"word":f=s.split(/(\s+)/);break;case"line":f=s.split(`
124
- `);break;default:f=s.split("")}let m=document.createDocumentFragment(),S=c;return f.forEach(L=>{if(L.length===0)return;if(L.trim().length===0){m.appendChild(document.createTextNode(L));return}let b=document.createElement("span");b.textContent=L,b.style.display="inline-block",b.style.opacity="0",u&&(b.style.setProperty("background","inherit"),b.style.setProperty("-webkit-background-clip","text"),b.style.setProperty("background-clip","text"),b.style.setProperty("color","transparent"),b.style.setProperty("will-change","opacity, transform"));let v=this.resolveKeyframes(r.keyframes),C=r.durationMs??n.durationMs??300,F=n.easing??"ease",z=b.animate(v,{duration:C,easing:F,delay:S,fill:"forwards"});z.addEventListener("finish",()=>{z.commitStyles(),z.cancel()}),m.appendChild(b),S+=r.staggerMs??50}),d.parentNode?.replaceChild(m,d),S}if(d.nodeType===Node.ELEMENT_NODE){let s=c,f=Array.from(d.childNodes);for(let m of f)s=l(m,s,u);return s}return c};l(t,i,a)})}},Xr=e=>typeof e!="object"||e===null?!1:typeof e.enabled=="boolean",Xt=new Set(["Replace","InsertBefore","InsertAfter","Delete","SetFormField"]),Gt=e=>typeof e=="string",Gr=e=>Array.isArray(e)&&e.every(t=>Gt(t)),Yr=e=>typeof e=="string"&&Xt.has(e),Qr=e=>{if(typeof e!="object"||e===null)return!1;let t=e;return Gt(t.identifier)&&typeof t.markup=="string"&&Gr(t.selectorGuesses)&&Yr(t.action)&&(t.transition===void 0||qr(t.transition))},Jr=e=>{if(typeof e!="object"||e===null)throw new Error("Invalid response: expected object with data array");let t=e.data;if(!Array.isArray(t))throw new Error("Invalid response: data must be an array");return t.forEach((r,n)=>{if(!Qr(r))throw new Error(`Invalid transformation at index ${n}`)}),t},rt=class{constructor(t){h(this,"config");h(this,"changeStack",new Map);h(this,"visitorKey",null);h(this,"orchestrator");h(this,"cueCardInstance",null);h(this,"currentPath");h(this,"currentUrl");h(this,"navTicking",!1);h(this,"transitionDefaults");h(this,"lastAppliedTransformations",[]);h(this,"isPersonalized",!1);h(this,"startAutoTransform",async()=>{try{this.syncChangeStack(),await this.waitForLoaded(),this.isFramer()&&(await this.waitForFrames(),await this.waitForIdle(),await this.waitForQuietDom(100,1e3)),await this.transform()}catch(t){this.log("error","Auto-transformation flow failed with error:",t)}});h(this,"transform",async()=>{try{let t=new Date;if(this.log("debug","Starting transform"),this.visitorKey===null){this.log("debug",`Couldn't find a visitor copy external ID with query param key "${Vt}"`,"Exiting...");return}let r=[];try{r=await this.getTransformations(this.currentPath,this.visitorKey)}catch(o){this.log("error_detailed","An error occurred _getting_ transformations",o)}try{await this.applyTransformations(r)}catch(o){this.log("error_detailed","An error occurred _applying_ transformations",o)}let n=new Date,i=this.getDurationInMilliseconds(t,n);this.log("debug",`Transformation complete, took ${this.formatThousands(i)} ms`)}catch(t){this.log("error","An unexpected, top-level error occurred during transformation",t)}});h(this,"log",(t,r,...n)=>{let a=`${`[Kenobi \u25D4] (v${typeof window.__KENOBI_VERSION__<"u"?window.__KENOBI_VERSION__:"dev"})`} [${t.toLocaleUpperCase()}] :: ${r}`;switch(t){case"debug":this.config.debug&&console.log(a,...n);break;case"info":console.log(a,...n);break;case"warn":console.warn(a,...n);break;case"error_detailed":console.trace(...n);case"error":console.error(a,...n);break}});h(this,"resolveTransitionConfig",t=>$r(this.transitionDefaults,t));h(this,"retrieveElement",t=>{if(!Array.isArray(t)||t.some(r=>typeof r!="string"))throw new Error(`Invalid selectorGuesses payload received: expected array of strings but got ${JSON.stringify(t)}`);for(let r of t){let n=document.querySelectorAll(r);if(n.length===0)continue;if(n.length===1)return n[0];let i=Array.from(n).filter(a=>{let l=a.getBoundingClientRect(),d=getComputedStyle(a);return d.display!=="none"&&d.visibility!=="hidden"&&l.width>0&&l.height>0});if(i.length===0)continue;let o=i.sort((a,l)=>a.getBoundingClientRect().top-l.getBoundingClientRect().top);return this.log("debug",`Selector "${r}" matched ${n.length} elements, selected topmost visible one at y=${o[0].getBoundingClientRect().top}`),o[0]}throw new Error(`Could not find an element in the document with any of these selector patterns: ${t.join(", ")}`)});h(this,"getQueryParam",t=>new URLSearchParams(window.location.search).get(t));h(this,"getCurrentPath",()=>window.location.pathname);h(this,"getCurrentUrl",()=>window.location.pathname+window.location.search+window.location.hash);h(this,"getDurationInMilliseconds",(t,r)=>+r-+t);h(this,"formatThousands",t=>new Intl.NumberFormat("en-US").format(t));h(this,"setDebug",t=>this.config.debug=t);h(this,"isInputElement",t=>!(!(t instanceof HTMLInputElement)&&!(t instanceof HTMLTextAreaElement)&&!(t instanceof HTMLSelectElement)));h(this,"waitForFrames",()=>new Promise(t=>requestAnimationFrame(()=>requestAnimationFrame(t))));h(this,"waitForIdle",(t=1e3)=>new Promise(r=>"requestIdleCallback"in window?window.requestIdleCallback(()=>r(),{timeout:t}):setTimeout(r,50)));h(this,"waitForLoaded",()=>document.readyState==="complete"?Promise.resolve():new Promise(t=>window.addEventListener("load",()=>t(),{once:!0})));h(this,"waitForQuietDom",(t,r)=>new Promise(n=>{let i=performance.now(),o=new MutationObserver(()=>{i=performance.now()});o.observe(document.documentElement,{subtree:!0,childList:!0,attributes:!0,characterData:!0});let a=performance.now()+t;(function l(){let d=performance.now();if(d-i>=r){o.disconnect(),n();return}if(d>=a){o.disconnect(),n();return}requestAnimationFrame(l)})()}));h(this,"isFramer",()=>{let t=Array.from(document.scripts).map(n=>n.src||"");return["__framer_events"in window,document.querySelector("[data-framer-root],[data-framer-component],[data-framer-page]"),t.some(n=>/framerusercontent\.com\/sites/i.test(n))].some(n=>!!n)});h(this,"syncVisitorKey",()=>{try{let t=this.getQueryParam(Vt);t?(this.log("debug",`Query param value found (${t}), pushing into session storage`),sessionStorage.setItem(Bt,t),this.visitorKey=t):this.visitorKey=sessionStorage.getItem(Bt)}catch(t){this.log("error","Failed to sync visitor key with error:",t)}});h(this,"initNavigationListener",()=>{if("__KENOBI_NAV_HOOKED__"in window)return;window.__KENOBI_NAV_HOOKED__=!0;let t=i=>{this.navTicking||(this.navTicking=!0,queueMicrotask(()=>{this.navTicking=!1;let o=this.getCurrentUrl();o!==this.currentUrl&&(this.currentUrl=o,this.currentPath=this.getCurrentPath(),this.log("debug",`URL changed (${i}) \u2192 ${location.href}`),this.config.autoTransform&&(this.undoAll(),this.startAutoTransform()),this.syncCueCardVisibility())}))};if("navigation"in window){let i=window.navigation;i&&"addEventListener"in i&&typeof i.addEventListener=="function"&&(i.addEventListener("navigate",()=>t("navigation:navigate")),i.addEventListener("currententrychange",()=>t("navigation:entrychange")),i.addEventListener?.("navigatesuccess",()=>t("navigation:success")))}let r=history.pushState.bind(history),n=history.replaceState.bind(history);history.pushState=((...i)=>{let o=r(...i);return t("pushState"),o}),history.replaceState=((...i)=>{let o=n(...i);return t("replaceState"),o}),window.addEventListener("popstate",()=>t("popstate")),window.addEventListener("hashchange",()=>t("hashchange")),document.addEventListener("click",i=>{let o=i.target,a=o&&o.closest?.("a[href]");!a||a.target&&a.target!=="_self"||new URL(a.href,location.href).origin!==location.origin||setTimeout(()=>t("click"),0)},!0),setInterval(()=>{this.getCurrentUrl()!==this.currentUrl&&t("poll")},1e3)});h(this,"getTransformations",async(t,r)=>{let n=new URLSearchParams({path:t}),i=await fetch(`${this.config.apiHost}/v1/visitor-copy-transformations/${r}?${n.toString()}`),o=await i.json();if(!i.ok)throw new Error(`Network error (status ${i.status}) with json body: ${JSON.stringify(o,null,2)}`);return Jr(o)});h(this,"validateTransitionPreconditions",(t,r,n)=>{if(n.enabled){let i=document.createElement("div");i.innerHTML=r;let o=i.firstElementChild;if(!o||!we(o))return this.log("warn",`Transformation "${t}" was skipped: A transition was requested, but the element is not animatable.`),!1}return!0});h(this,"applyTransformations",async(t,r)=>{this.log("debug",`Starting ${t.length} transformations`),r?.shouldConsolidate&&this.changeStack.forEach((n,i)=>{t.find(a=>a.identifier===i)&&this.undo(i)});for(let{identifier:n,...i}of t)try{if(this.changeStack.get(n))throw new Error("Transformation already exists in stack");let o=this.retrieveElement(i.selectorGuesses);switch(i.action){case"Replace":{let a=o.outerHTML,l=this.resolveTransitionConfig(i.transition);if(l.enabled&&we(o)&&"animate"in o){let d=await this.orchestrator.replaceWithTransition(o,i.markup,l);this.setOrUpdateReplaceChangeRef(n,a,d)}else Ae(o,i.markup,{}),this.setOrUpdateReplaceChangeRef(n,a,o);o.nodeName==="VIDEO"&&o.play();break}case"InsertBefore":{let a=this.resolveTransitionConfig(i.transition);if(!this.validateTransitionPreconditions(n,i.markup,a))break;o.insertAdjacentHTML("beforebegin",i.markup);let l=o.previousElementSibling;if(l===null)throw new Error("Element wasn't created");if(l.setAttribute(te,n),a.enabled&&we(l)){let d=l.style.cssText;l.style.opacity="0",this.orchestrator.enter(l,{...a,delayMs:a.enter?.delayMs??a.delayMs}).addEventListener("finish",()=>{l.style.cssText=d},{once:!0})}this.changeStack.set(n,{undoOpts:{type:"Remove",ref:l}});break}case"InsertAfter":{let a=this.resolveTransitionConfig(i.transition);if(!this.validateTransitionPreconditions(n,i.markup,a))break;o.insertAdjacentHTML("afterend",i.markup);let l=o.nextElementSibling;if(l===null)throw new Error("Element wasn't created");if(l.setAttribute(te,n),a.enabled&&we(l)){let d=l.style.cssText;l.style.opacity="0",this.orchestrator.enter(l,{...a,delayMs:a.enter?.delayMs??a.delayMs}).addEventListener("finish",()=>{l.style.cssText=d},{once:!0})}this.changeStack.set(n,{undoOpts:{type:"Remove",ref:l}});break}case"Delete":{let a=o.outerHTML;Ae(o,'<div style="display: none;" data-kenobi-delete-marker="true"></div>',{}),o.setAttribute(te,n),this.changeStack.set(n,{undoOpts:{type:"Replace",ref:o,content:a}});break}case"SetFormField":{if(!this.isInputElement(o))throw new Error("Element targeted is not of a supported type");let a=o.value;this.setInputValue(o,i.markup),o.setAttribute(te,n),this.changeStack.set(n,{undoOpts:{type:"SetInput",ref:o,content:a}})}}}catch(o){this.log("warn",`Unable to apply transformation with identifier "${n}"`,o)}this.lastAppliedTransformations=t,this.isPersonalized=!0,this.updateCueCardPersonalizationState()});h(this,"setOrUpdateReplaceChangeRef",(t,r,n)=>{let i=this.changeStack.get(t);if(!i){n.setAttribute(te,t),this.changeStack.set(t,{undoOpts:{type:"Replace",ref:n,content:r}});return}let o=i.undoOpts.ref;o&&o!==n&&o.isConnected&&o.removeAttribute(te),n.setAttribute(te,t),i.undoOpts.ref=n});h(this,"syncChangeStack",()=>{let t=0;for(let[r,n]of this.changeStack){let i=n.undoOpts.ref;if(!(!!i&&(i.isConnected||document.contains(i)))){this.changeStack.delete(r),t++;continue}i.getAttribute(te)!==r&&(this.changeStack.delete(r),t++)}this.log("debug",`syncChangeStack pruned ${this.formatThousands(t)} stale entries`)});h(this,"undo",t=>{let r=this.changeStack.get(t);if(r===void 0)throw new Error(`Cannot undo stack item with identifier ${t} as it does not exist.`);let{undoOpts:n}=r;switch(n.type){case"Remove":{n.ref.remove();break}case"Replace":{Ae(n.ref,n.content),n.ref.removeAttribute(te);break}case"SetInput":{if(!this.isInputElement(n.ref))throw new Error("Element targeted is not of a supported type");this.setInputValue(n.ref,n.content),n.ref.removeAttribute(te);break}}this.changeStack.delete(t)});h(this,"undoAll",()=>{this.changeStack.forEach((t,r)=>this.undo(r))});h(this,"toggleTransformations",async()=>{this.isPersonalized?(this.undoAll(),this.isPersonalized=!1,this.log("debug","Toggled to original content")):(this.lastAppliedTransformations.length>0&&await this.applyTransformations(this.lastAppliedTransformations,{shouldConsolidate:!0}),this.isPersonalized=!0,this.log("debug","Toggled to personalized content")),this.updateCueCardPersonalizationState()});h(this,"updateCueCardPersonalizationState",()=>{this.cueCardInstance&&this.cueCardInstance.update({isPersonalized:this.isPersonalized})});h(this,"setInputValue",(t,r)=>{let n=t instanceof HTMLTextAreaElement?HTMLTextAreaElement.prototype:t instanceof HTMLInputElement?HTMLInputElement.prototype:HTMLSelectElement.prototype,i=Object.getOwnPropertyDescriptor(n,"value");if(!i?.set)throw new Error("No value setter found");i.set.call(t,r),t.dispatchEvent(new Event("input",{bubbles:!0})),t.dispatchEvent(new Event("change",{bubbles:!0}))});h(this,"fetchCueCardConfig",async t=>{if(!this.config.publicKey)return null;try{let r=new URLSearchParams({publicKey:this.config.publicKey,pagePath:t}),n=await fetch(`${this.config.apiHost}/v1/cue-card-config?${r.toString()}`);if(!n.ok)return this.log("warn",`CueCard config request failed with status ${n.status}`),null;let i=await n.json();return Xr(i)?i:(this.log("warn","Invalid CueCard config response format"),null)}catch(r){return this.log("error","Failed to fetch CueCard config:",r),null}});h(this,"initCueCard",async()=>{if(this.cueCardInstance){this.log("warn","CueCard already initialized, skipping...");return}let t=await this.fetchCueCardConfig(this.currentPath);if(!t||!t.enabled){this.log("debug",`CueCard not mounted: no active template for path "${this.currentPath}"`);return}this.log("debug","Active template found, mounting CueCard...");let r=t.config;this.cueCardInstance=new ke({theme:r?.theme??"light",position:r?.position??"top-center",direction:r?.direction??"top-to-bottom",fields:r?.fields??[{name:"companyDomain",label:"Company Name or Domain",placeholder:"example.com",required:!0,minLength:3,errorMessage:"Company name or domain is required"}],isVisible:!0,enableFocusMode:r?.enableFocusMode??!1,showWatermark:r?.showWatermark??!1,showKeyboardHints:r?.showKeyboardHints??!0,enableLauncher:r?.enableLauncher??!0,customTheme:r?.customTheme,textOverrides:r?.textOverrides,enableUndoToggle:r?.enableUndoToggle??!1,isPersonalized:this.isPersonalized,onDismiss:()=>{this.log("debug","CueCard dismissed by user"),this.dispatchKenobiEvent("cuecard:dismiss",{pagePath:this.currentPath})},onSubmitPersonalization:n=>{this.log("debug","CueCard submitted:",n),this.personalize(n)},onOpenChange:n=>{this.log("debug","CueCard open state changed:",n),this.dispatchKenobiEvent("cuecard:openchange",{isOpen:n,pagePath:this.currentPath})},onTogglePersonalization:()=>{this.log("debug","CueCard toggle personalization"),this.toggleTransformations(),this.dispatchKenobiEvent("cuecard:toggle",{isPersonalized:this.isPersonalized,pagePath:this.currentPath})}}),this.cueCardInstance.mount(),this.log("debug","CueCard mounted successfully")});h(this,"syncCueCardVisibility",async()=>{this.config.publicKey&&(this.cueCardInstance&&(this.log("debug","Navigation detected, unmounting CueCard"),this.cueCardInstance.unmount(),this.cueCardInstance=null),this.initCueCard())});h(this,"dispatchKenobiEvent",(t,r)=>{let n=new CustomEvent(`kenobi:${t}`,{detail:r,bubbles:!0});window.dispatchEvent(n),this.log("debug",`Dispatched event: kenobi:${t}`,r)});h(this,"personalize",async t=>{if(!this.config.publicKey){this.log("error","Cannot personalize: publicKey not configured");return}let r=new Date;this.log("debug","Starting personalization with input:",t),this.dispatchKenobiEvent("personalization:start",{input:t,pagePath:this.currentPath}),this.cueCardInstance&&this.cueCardInstance.update({status:"starting",progressPct:10});try{let n=await fetch(`${this.config.apiHost}/v1/personalize`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({publicKey:this.config.publicKey,input:t,pagePath:this.currentPath})});if(this.cueCardInstance&&this.cueCardInstance.update({progressPct:50}),!n.ok){let l=await n.json().catch(()=>({}));throw new Error(l.error||`API error: ${n.status}`)}let i=await n.json();this.log("debug","Personalization API response:",i),this.cueCardInstance&&this.cueCardInstance.update({progressPct:80}),i.transformations&&Array.isArray(i.transformations)&&await this.applyTransformations(i.transformations,{shouldConsolidate:!0}),this.cueCardInstance&&this.cueCardInstance.update({status:"success",progressPct:100});let o=new Date,a=this.getDurationInMilliseconds(r,o);this.log("debug",`Personalization complete, took ${this.formatThousands(a)} ms`),this.dispatchKenobiEvent("personalization:complete",{input:t,pagePath:this.currentPath,durationMs:a,transformationsCount:i.transformations?.length??0,metadata:i.metadata})}catch(n){this.log("error","Personalization failed:",n),this.cueCardInstance&&this.cueCardInstance.update({status:"error",progressPct:0}),this.dispatchKenobiEvent("personalization:error",{input:t,pagePath:this.currentPath,error:n instanceof Error?n.message:String(n)})}});h(this,"getCueCard",()=>this.cueCardInstance);this.config={apiHost:"https://kenobi.ai/api",debug:!1,autoTransform:!0,...t},this.transitionDefaults=Ur(this.config.transitionDefaults),this.orchestrator=new tt,this.syncVisitorKey(),this.currentPath=this.getCurrentPath(),this.currentUrl=this.getCurrentUrl();try{this.initNavigationListener()}catch(r){this.log("error","Failed to initialize navigation listener with error:",r)}this.log("debug","Kenobi initialized"),this.config.autoTransform&&(this.log("debug","Auto-transform is requested... Starting..."),this.startAutoTransform()),this.config.publicKey&&!this.config.skipCueCardAutoMount&&(this.log("debug","Public key provided, checking for active template..."),this.initCueCard())}};return ur(Zr);})();
271
+ --kb-focus-blur: ${n};
272
+ `}mount(e){let n=e||this.config.mountNode||this.mountTarget||document.body;this.mountTarget=n,n.contains(this.host)||n.appendChild(this.host),this.applyHostStyles(),this.startDeanonymization(),this.render()}unmount(){tt(null,this.shadow.lastElementChild),this.host.remove(),this.deanonymizationCleanup?.(),this.deanonymizationCleanup=null}update(e){e.status==="starting"&&this.config.status!=="starting"&&(this.isOpen=!1);let n=this.isDeanonymizationEnabled();this.config={...this.config,...e};let r=this.isDeanonymizationEnabled();r&&!n&&(this.deanonymizationStatus="pending",this.startDeanonymization()),!r&&n&&(this.deanonymizedCompany=null,this.deanonymizationStatus="idle",this.deanonymizationCleanup?.(),this.deanonymizationCleanup=null,this.hasStartedDeanonymization=!1),this.applyHostStyles(),this.render()}isDeanonymizationEnabled(){return this.config.deanonymization?.provider==="Kenobi"}startDeanonymization(){if(!this.isDeanonymizationEnabled()||this.hasStartedDeanonymization||this.deanonymizationStatus!=="pending")return;if(this.hasStartedDeanonymization=!0,typeof window>"u"){this.deanonymizationStatus="failed",this.render();return}let e=window.__kenobiIdentityResolution;if(e){this.handleDeanonymizationResult(e);return}let n=o=>{let a=o.detail;this.handleDeanonymizationResult(a)};window.addEventListener(He,n),gr(this.config.deanonymization);let r=this.config.deanonymization?.timeoutMs??hr,i=window.setTimeout(()=>{window.removeEventListener(He,n),this.handleDeanonymizationResult(null)},r);this.deanonymizationCleanup=()=>{window.removeEventListener(He,n),window.clearTimeout(i)}}handleDeanonymizationResult(e){if(this.deanonymizationStatus!=="pending")return;this.deanonymizationCleanup?.(),this.deanonymizationCleanup=null;let n=br(e);this.deanonymizedCompany=n,this.deanonymizationStatus=n?"resolved":"failed",n?at("deanonymization:success",{company:n,detail:e}):at("deanonymization:fail",{detail:e}),this.render()}getRenderConfig(){return this.deanonymizationStatus==="pending"?{...this.config,isVisible:!1}:this.config}setTheme(e){this.update({theme:e})}openForm(e){this.isOpen=!0,this.skipFocus=e??!1,this.render()}render(){let e=this.shadow.lastElementChild,n=this.skipFocus;this.skipFocus=!1,tt(d(_r,{config:this.getRenderConfig(),isOpen:this.isOpen,skipFocus:n,deanonymizedCompany:this.deanonymizedCompany,onClearDeanonymizedCompany:this.clearDeanonymizedCompany,setIsOpen:r=>{this.isOpen=r,this.config.onOpenChange?.(r),this.render()}}),e)}};var on="kfor",an="kenobi_visitor_key",ae="data-kenobi-transformation-identifier",be={enabled:!1,durationMs:300,delayMs:0,easing:"ease",animateSize:!0,overflow:"hidden"},vr=t=>({enabled:t?.enabled??be.enabled,durationMs:t?.durationMs??be.durationMs,delayMs:t?.delayMs??be.delayMs,easing:t?.easing??be.easing,animateSize:t?.animateSize??be.animateSize,overflow:t?.overflow??be.overflow,textAnimation:t?.textAnimation,enter:t?.enter,exit:t?.exit}),kr=(t,e)=>({enabled:e?.enabled??t.enabled,durationMs:e?.durationMs??t.durationMs,delayMs:e?.delayMs??t.delayMs,easing:e?.easing??t.easing,animateSize:e?.animateSize??t.animateSize,overflow:e?.overflow??t.overflow,textAnimation:e?.textAnimation??t.textAnimation,enter:e?.enter??t.enter,exit:e?.exit??t.exit}),cn=t=>typeof t=="string",xe=t=>t instanceof HTMLElement||typeof SVGElement<"u"&&t instanceof SVGElement,wr=t=>typeof t=="string",xr=t=>t==="hidden"||t==="visible"||t==="clip",Cr=t=>t==="line"||t==="word"||t==="character",un=t=>typeof t!="object"||t===null?!1:Array.isArray(t)?t.every(e=>typeof e=="object"&&e!==null):!0,sn=t=>{if(typeof t!="object"||t===null)return!1;let e=t,{animationName:n,keyframes:r,durationMs:i,delayMs:o}=e;return(n===void 0||cn(n))&&(r===void 0||un(r))&&(i===void 0||typeof i=="number")&&(o===void 0||typeof o=="number")},Tr=t=>{if(typeof t!="object"||t===null)return!1;let e=t,{by:n,staggerMs:r,animationName:i,keyframes:o,delayMs:a,durationMs:s}=e;return Cr(n)&&(a===void 0||typeof a=="number")&&(r===void 0||typeof r=="number")&&(s===void 0||typeof s=="number")&&(cn(i)||o!==void 0)&&(o===void 0||un(o))},Sr=t=>{if(typeof t!="object"||t===null)return!1;let e=t,{enabled:n,durationMs:r,delayMs:i,easing:o,animateSize:a,overflow:s,textAnimation:u,enter:c,exit:h}=e;return(n===void 0||typeof n=="boolean")&&(r===void 0||typeof r=="number")&&(i===void 0||typeof i=="number")&&(o===void 0||wr(o))&&(a===void 0||typeof a=="boolean")&&(s===void 0||xr(s))&&(u===void 0||Tr(u))&&(c===void 0||sn(c))&&(h===void 0||sn(h))},st=class{constructor(){m(this,"replaceWithTransition",async(e,n,r)=>{let i=document.createElement("div");i.style.position="relative",i.style.overflow=r.overflow;let o=e.getBoundingClientRect(),a=window.getComputedStyle(e);i.style.display=a.display,i.style.verticalAlign=a.verticalAlign,i.style.width=`${o.width}px`,i.style.height=`${o.height}px`,i.style.margin=a.margin;let s=e.cloneNode(!0);if(!(s instanceof Element)||!xe(s))throw new Error("oldElClone is not an AnimatableElement");s.style.position="absolute",s.style.top="0",s.style.left="0",s.style.width="100%",s.style.height="100%",s.style.margin="0",s.style.pointerEvents="none",i.appendChild(s);let u=document.createElement("div");u.innerHTML=n;let c=u.firstElementChild;if(!c||!(c instanceof HTMLElement||c instanceof SVGElement))return await this.exit(e,r).finished,e;let h=c.style.cssText,l=e.parentNode,p;if(l instanceof HTMLElement){let v=l.cloneNode(!1),V=window.getComputedStyle(l),J=V.cssText?V.cssText:Array.from(V).reduce((j,H)=>`${j}${H}:${V.getPropertyValue(H)};`,"");v.style.cssText=J,v.style.position="absolute",v.style.top="-9999px",v.style.left="-9999px",v.style.visibility="hidden",v.style.pointerEvents="none",v.appendChild(c),document.body.appendChild(v),r.textAnimation&&this.applyTextAnimationToNode(c,r.textAnimation,r),p=c.getBoundingClientRect(),document.body.removeChild(v)}else{let v=document.createElement("div");v.style.position="absolute",v.style.top="-9999px",v.style.left="-9999px",v.style.visibility="hidden",v.appendChild(c),document.body.appendChild(v),r.textAnimation&&this.applyTextAnimationToNode(c,r.textAnimation,r),p=c.getBoundingClientRect(),document.body.removeChild(v)}c.style.cssText=h,c.style.visibility="",c.style.position="absolute",c.style.top="0",c.style.left="0",c.style.width=`${p.width}px`,c.style.height=`${p.height}px`,c.style.margin="0",c.style.opacity="0",i.appendChild(c),e.replaceWith(i);let b=r.exit?.delayMs??r.delayMs,E=r.exit?.durationMs??r.durationMs,M=r.enter?.delayMs??r.delayMs,T=r.enter?.durationMs??r.durationMs,g=[],x=this.resolveKeyframes(r.exit?.keyframes),P=s.animate(x,{duration:E,delay:b,easing:r.easing,fill:"forwards"});g.push(P);let O=this.resolveKeyframes(r.enter?.keyframes),L=c.animate(O,{duration:T,delay:M,easing:r.easing,fill:"forwards"});if(g.push(L),r.animateSize){let v=i.animate([{width:`${o.width}px`,height:`${o.height}px`},{width:`${p.width}px`,height:`${p.height}px`}],{duration:T,delay:M,easing:r.easing,fill:"forwards"});g.push(v)}return await Promise.all(g.map(v=>v.finished)),i.parentNode&&i.replaceWith(c),c.style.cssText=h,s.remove(),c});m(this,"enter",(e,n)=>{let r=n.enter?.delayMs??n.delayMs,i=n.enter?.durationMs??n.durationMs,o=this.resolveKeyframes(n.enter?.keyframes);return e.animate(o,{duration:i,delay:r,easing:n.easing,fill:"forwards"})});m(this,"exit",(e,n)=>{let r=n.exit?.delayMs??n.delayMs,i=n.exit?.durationMs??n.durationMs,o=this.resolveKeyframes(n.exit?.keyframes);return e.animate(o,{duration:i,delay:r,easing:n.easing,fill:"forwards"})});m(this,"resolveKeyframes",e=>e?Array.isArray(e)?e:[e]:[]);m(this,"applyTextAnimationToNode",(e,n,r)=>{let i=n.delayMs??0,o=window.getComputedStyle(e),a=o.getPropertyValue("background-clip")==="text"||o.getPropertyValue("-webkit-background-clip")==="text",s=(u,c,h)=>{if(u.nodeType===Node.TEXT_NODE){let l=u.textContent??"";if(l.trim().length===0)return c;if(n.by==="character"){let M=l.split(/(\s+)/),T=document.createDocumentFragment(),g=c;return M.forEach(x=>{if(x.length===0)return;if(x.trim().length===0){T.appendChild(document.createTextNode(x));return}let P=document.createElement("span");P.style.display="inline-block",P.style.whiteSpace="nowrap",h&&(P.style.setProperty("background","inherit"),P.style.setProperty("-webkit-background-clip","text"),P.style.setProperty("background-clip","text"),P.style.setProperty("color","transparent")),x.split("").forEach(L=>{let v=document.createElement("span");v.textContent=L,v.style.display="inline-block",v.style.opacity="0",h&&(v.style.setProperty("background","inherit"),v.style.setProperty("-webkit-background-clip","text"),v.style.setProperty("background-clip","text"),v.style.setProperty("color","transparent"),v.style.paddingBottom="0.1em",v.style.marginBottom="-0.1em");let V=this.resolveKeyframes(n.keyframes),J=n.durationMs??r.durationMs??300,j=r.easing??"ease",H=v.animate(V,{duration:J,easing:j,delay:g,fill:"forwards"});H.addEventListener("finish",()=>{H.commitStyles(),H.cancel()}),P.appendChild(v),g+=n.staggerMs??50}),T.appendChild(P)}),u.parentNode?.replaceChild(T,u),g}let p;switch(n.by){case"word":p=l.split(/(\s+)/);break;case"line":p=l.split(`
273
+ `);break;default:p=l.split("")}let b=document.createDocumentFragment(),E=c;return p.forEach(M=>{if(M.length===0)return;if(M.trim().length===0){b.appendChild(document.createTextNode(M));return}let g=document.createElement("span");g.textContent=M,g.style.display="inline-block",g.style.opacity="0",h&&(g.style.setProperty("background","inherit"),g.style.setProperty("-webkit-background-clip","text"),g.style.setProperty("background-clip","text"),g.style.setProperty("color","transparent"),g.style.setProperty("will-change","opacity, transform"));let x=this.resolveKeyframes(n.keyframes),P=n.durationMs??r.durationMs??300,O=r.easing??"ease",L=g.animate(x,{duration:P,easing:O,delay:E,fill:"forwards"});L.addEventListener("finish",()=>{L.commitStyles(),L.cancel()}),b.appendChild(g),E+=n.staggerMs??50}),u.parentNode?.replaceChild(b,u),E}if(u.nodeType===Node.ELEMENT_NODE){let l=c,p=Array.from(u.childNodes);for(let b of p)l=s(b,l,h);return l}return c};s(e,i,a)})}},ln="kenobi:identity-resolved",Er=1600,zr=t=>typeof t!="object"||t===null?!1:typeof t.enabled=="boolean",dn=new Set(["Replace","InsertBefore","InsertAfter","Delete","SetFormField"]),pn=t=>typeof t=="string",Pr=t=>Array.isArray(t)&&t.every(e=>pn(e)),Ar=t=>typeof t=="string"&&dn.has(t),Mr=t=>{if(typeof t!="object"||t===null)return!1;let e=t;return pn(e.identifier)&&typeof e.markup=="string"&&Pr(e.selectorGuesses)&&Ar(e.action)&&(e.transition===void 0||Sr(e.transition))},Lr=t=>{if(typeof t!="object"||t===null)throw new Error("Invalid response: expected object with data array");let e=t.data;if(!Array.isArray(e))throw new Error("Invalid response: data must be an array");return e.forEach((n,r)=>{if(!Mr(n))throw new Error(`Invalid transformation at index ${r}`)}),e},lt=class{constructor(e){m(this,"config");m(this,"changeStack",new Map);m(this,"visitorKey",null);m(this,"orchestrator");m(this,"cueCardInstance",null);m(this,"preparedPersonalization",null);m(this,"isPreparingPersonalization",!1);m(this,"preparePersonalizationPromise",null);m(this,"deanonymizationPrefetchCleanup",null);m(this,"currentPath");m(this,"currentUrl");m(this,"navTicking",!1);m(this,"transitionDefaults");m(this,"lastAppliedTransformations",[]);m(this,"isPersonalized",!1);m(this,"startAutoTransform",async()=>{try{this.syncChangeStack(),await this.waitForLoaded(),this.isFramer()&&(await this.waitForFrames(),await this.waitForIdle(),await this.waitForQuietDom(100,1e3)),await this.transform()}catch(e){this.log("error","Auto-transformation flow failed with error:",e)}});m(this,"transform",async()=>{try{let e=new Date;if(this.log("debug","Starting transform"),this.visitorKey===null){this.log("debug",`Couldn't find a visitor copy external ID with query param key "${on}"`,"Exiting...");return}let n=[];try{n=await this.getTransformations(this.currentPath,this.visitorKey)}catch(o){this.log("error_detailed","An error occurred _getting_ transformations",o)}try{await this.applyTransformations(n)}catch(o){this.log("error_detailed","An error occurred _applying_ transformations",o)}let r=new Date,i=this.getDurationInMilliseconds(e,r);this.log("debug",`Transformation complete, took ${this.formatThousands(i)} ms`)}catch(e){this.log("error","An unexpected, top-level error occurred during transformation",e)}});m(this,"log",(e,n,...r)=>{let a=`${`[Kenobi \u25D4] (v${typeof window.__KENOBI_VERSION__<"u"?window.__KENOBI_VERSION__:"dev"})`} [${e.toLocaleUpperCase()}] :: ${n}`;switch(e){case"debug":this.config.debug&&console.log(a,...r);break;case"info":console.log(a,...r);break;case"warn":console.warn(a,...r);break;case"error_detailed":console.trace(...r);case"error":console.error(a,...r);break}});m(this,"resolveTransitionConfig",e=>kr(this.transitionDefaults,e));m(this,"retrieveElement",e=>{if(!Array.isArray(e)||e.some(n=>typeof n!="string"))throw new Error(`Invalid selectorGuesses payload received: expected array of strings but got ${JSON.stringify(e)}`);for(let n of e){let r=document.querySelectorAll(n);if(r.length===0)continue;if(r.length===1)return r[0];let i=Array.from(r).filter(a=>{let s=a.getBoundingClientRect(),u=getComputedStyle(a);return u.display!=="none"&&u.visibility!=="hidden"&&s.width>0&&s.height>0});if(i.length===0)continue;let o=i.sort((a,s)=>a.getBoundingClientRect().top-s.getBoundingClientRect().top);return this.log("debug",`Selector "${n}" matched ${r.length} elements, selected topmost visible one at y=${o[0].getBoundingClientRect().top}`),o[0]}throw new Error(`Could not find an element in the document with any of these selector patterns: ${e.join(", ")}`)});m(this,"getQueryParam",e=>new URLSearchParams(window.location.search).get(e));m(this,"getCurrentPath",()=>window.location.pathname);m(this,"getCurrentUrl",()=>window.location.pathname+window.location.search+window.location.hash);m(this,"getDurationInMilliseconds",(e,n)=>+n-+e);m(this,"formatThousands",e=>new Intl.NumberFormat("en-US").format(e));m(this,"setDebug",e=>this.config.debug=e);m(this,"isInputElement",e=>!(!(e instanceof HTMLInputElement)&&!(e instanceof HTMLTextAreaElement)&&!(e instanceof HTMLSelectElement)));m(this,"waitForFrames",()=>new Promise(e=>requestAnimationFrame(()=>requestAnimationFrame(e))));m(this,"waitForIdle",(e=1e3)=>new Promise(n=>"requestIdleCallback"in window?window.requestIdleCallback(()=>n(),{timeout:e}):setTimeout(n,50)));m(this,"waitForLoaded",()=>document.readyState==="complete"?Promise.resolve():new Promise(e=>window.addEventListener("load",()=>e(),{once:!0})));m(this,"waitForQuietDom",(e,n)=>new Promise(r=>{let i=performance.now(),o=new MutationObserver(()=>{i=performance.now()});o.observe(document.documentElement,{subtree:!0,childList:!0,attributes:!0,characterData:!0});let a=performance.now()+e;(function s(){let u=performance.now();if(u-i>=n){o.disconnect(),r();return}if(u>=a){o.disconnect(),r();return}requestAnimationFrame(s)})()}));m(this,"isFramer",()=>{let e=Array.from(document.scripts).map(r=>r.src||"");return["__framer_events"in window,document.querySelector("[data-framer-root],[data-framer-component],[data-framer-page]"),e.some(r=>/framerusercontent\.com\/sites/i.test(r))].some(r=>!!r)});m(this,"syncVisitorKey",()=>{try{let e=this.getQueryParam(on);e?(this.log("debug",`Query param value found (${e}), pushing into session storage`),sessionStorage.setItem(an,e),this.visitorKey=e):this.visitorKey=sessionStorage.getItem(an)}catch(e){this.log("error","Failed to sync visitor key with error:",e)}});m(this,"initNavigationListener",()=>{if("__KENOBI_NAV_HOOKED__"in window)return;window.__KENOBI_NAV_HOOKED__=!0;let e=i=>{this.navTicking||(this.navTicking=!0,queueMicrotask(()=>{this.navTicking=!1;let o=this.getCurrentUrl();o!==this.currentUrl&&(this.currentUrl=o,this.currentPath=this.getCurrentPath(),this.log("debug",`URL changed (${i}) \u2192 ${location.href}`),this.config.autoTransform&&(this.undoAll(),this.startAutoTransform()),this.syncCueCardVisibility())}))};if("navigation"in window){let i=window.navigation;i&&"addEventListener"in i&&typeof i.addEventListener=="function"&&(i.addEventListener("navigate",()=>e("navigation:navigate")),i.addEventListener("currententrychange",()=>e("navigation:entrychange")),i.addEventListener?.("navigatesuccess",()=>e("navigation:success")))}let n=history.pushState.bind(history),r=history.replaceState.bind(history);history.pushState=((...i)=>{let o=n(...i);return e("pushState"),o}),history.replaceState=((...i)=>{let o=r(...i);return e("replaceState"),o}),window.addEventListener("popstate",()=>e("popstate")),window.addEventListener("hashchange",()=>e("hashchange")),document.addEventListener("click",i=>{let o=i.target,a=o&&o.closest?.("a[href]");!a||a.target&&a.target!=="_self"||new URL(a.href,location.href).origin!==location.origin||setTimeout(()=>e("click"),0)},!0),setInterval(()=>{this.getCurrentUrl()!==this.currentUrl&&e("poll")},1e3)});m(this,"getTransformations",async(e,n)=>{let r=new URLSearchParams({path:e}),i=await fetch(`${this.config.apiHost}/v1/visitor-copy-transformations/${n}?${r.toString()}`),o=await i.json();if(!i.ok)throw new Error(`Network error (status ${i.status}) with json body: ${JSON.stringify(o,null,2)}`);return Lr(o)});m(this,"validateTransitionPreconditions",(e,n,r)=>{if(r.enabled){let i=document.createElement("div");i.innerHTML=n;let o=i.firstElementChild;if(!o||!xe(o))return this.log("warn",`Transformation "${e}" was skipped: A transition was requested, but the element is not animatable.`),!1}return!0});m(this,"applyTransformations",async(e,n)=>{this.log("debug",`Starting ${e.length} transformations`),n?.shouldConsolidate&&this.changeStack.forEach((r,i)=>{e.find(a=>a.identifier===i)&&this.undo(i)});for(let{identifier:r,...i}of e)try{if(this.changeStack.get(r))throw new Error("Transformation already exists in stack");let o=this.retrieveElement(i.selectorGuesses);switch(i.action){case"Replace":{let a=o.outerHTML,s=this.resolveTransitionConfig(i.transition);if(s.enabled&&xe(o)&&"animate"in o){let u=await this.orchestrator.replaceWithTransition(o,i.markup,s);this.setOrUpdateReplaceChangeRef(r,a,u)}else Pe(o,i.markup,{}),this.setOrUpdateReplaceChangeRef(r,a,o);o.nodeName==="VIDEO"&&o.play();break}case"InsertBefore":{let a=this.resolveTransitionConfig(i.transition);if(!this.validateTransitionPreconditions(r,i.markup,a))break;o.insertAdjacentHTML("beforebegin",i.markup);let s=o.previousElementSibling;if(s===null)throw new Error("Element wasn't created");if(s.setAttribute(ae,r),a.enabled&&xe(s)){let u=s.style.cssText;s.style.opacity="0",this.orchestrator.enter(s,{...a,delayMs:a.enter?.delayMs??a.delayMs}).addEventListener("finish",()=>{s.style.cssText=u},{once:!0})}this.changeStack.set(r,{undoOpts:{type:"Remove",ref:s}});break}case"InsertAfter":{let a=this.resolveTransitionConfig(i.transition);if(!this.validateTransitionPreconditions(r,i.markup,a))break;o.insertAdjacentHTML("afterend",i.markup);let s=o.nextElementSibling;if(s===null)throw new Error("Element wasn't created");if(s.setAttribute(ae,r),a.enabled&&xe(s)){let u=s.style.cssText;s.style.opacity="0",this.orchestrator.enter(s,{...a,delayMs:a.enter?.delayMs??a.delayMs}).addEventListener("finish",()=>{s.style.cssText=u},{once:!0})}this.changeStack.set(r,{undoOpts:{type:"Remove",ref:s}});break}case"Delete":{let a=o.outerHTML;Pe(o,'<div style="display: none;" data-kenobi-delete-marker="true"></div>',{}),o.setAttribute(ae,r),this.changeStack.set(r,{undoOpts:{type:"Replace",ref:o,content:a}});break}case"SetFormField":{if(!this.isInputElement(o))throw new Error("Element targeted is not of a supported type");let a=o.value;this.setInputValue(o,i.markup),o.setAttribute(ae,r),this.changeStack.set(r,{undoOpts:{type:"SetInput",ref:o,content:a}})}}}catch(o){this.log("warn",`Unable to apply transformation with identifier "${r}"`,o)}this.lastAppliedTransformations=e,this.isPersonalized=!0,this.updateCueCardPersonalizationState()});m(this,"setOrUpdateReplaceChangeRef",(e,n,r)=>{let i=this.changeStack.get(e);if(!i){r.setAttribute(ae,e),this.changeStack.set(e,{undoOpts:{type:"Replace",ref:r,content:n}});return}let o=i.undoOpts.ref;o&&o!==r&&o.isConnected&&o.removeAttribute(ae),r.setAttribute(ae,e),i.undoOpts.ref=r});m(this,"syncChangeStack",()=>{let e=0;for(let[n,r]of this.changeStack){let i=r.undoOpts.ref;if(!(!!i&&(i.isConnected||document.contains(i)))){this.changeStack.delete(n),e++;continue}i.getAttribute(ae)!==n&&(this.changeStack.delete(n),e++)}this.log("debug",`syncChangeStack pruned ${this.formatThousands(e)} stale entries`)});m(this,"undo",e=>{let n=this.changeStack.get(e);if(n===void 0)throw new Error(`Cannot undo stack item with identifier ${e} as it does not exist.`);let{undoOpts:r}=n;switch(r.type){case"Remove":{r.ref.remove();break}case"Replace":{Pe(r.ref,r.content),r.ref.removeAttribute(ae);break}case"SetInput":{if(!this.isInputElement(r.ref))throw new Error("Element targeted is not of a supported type");this.setInputValue(r.ref,r.content),r.ref.removeAttribute(ae);break}}this.changeStack.delete(e)});m(this,"undoAll",()=>{this.changeStack.forEach((e,n)=>this.undo(n))});m(this,"toggleTransformations",async()=>{this.isPersonalized?(this.undoAll(),this.isPersonalized=!1,this.log("debug","Toggled to original content")):(this.lastAppliedTransformations.length>0&&await this.applyTransformations(this.lastAppliedTransformations,{shouldConsolidate:!0}),this.isPersonalized=!0,this.log("debug","Toggled to personalized content")),this.updateCueCardPersonalizationState()});m(this,"updateCueCardPersonalizationState",()=>{this.cueCardInstance&&this.cueCardInstance.update({isPersonalized:this.isPersonalized})});m(this,"setInputValue",(e,n)=>{let r=e instanceof HTMLTextAreaElement?HTMLTextAreaElement.prototype:e instanceof HTMLInputElement?HTMLInputElement.prototype:HTMLSelectElement.prototype,i=Object.getOwnPropertyDescriptor(r,"value");if(!i?.set)throw new Error("No value setter found");i.set.call(e,n),e.dispatchEvent(new Event("input",{bubbles:!0})),e.dispatchEvent(new Event("change",{bubbles:!0}))});m(this,"fetchCueCardConfig",async e=>{if(!this.config.publicKey)return null;try{let n=new URLSearchParams({publicKey:this.config.publicKey,pagePath:e}),r=await fetch(`${this.config.apiHost}/v1/cue-card-config?${n.toString()}`);if(!r.ok)return this.log("warn",`CueCard config request failed with status ${r.status}`),null;let i=await r.json();return zr(i)?i:(this.log("warn","Invalid CueCard config response format"),null)}catch(n){return this.log("error","Failed to fetch CueCard config:",n),null}});m(this,"initCueCard",async()=>{if(this.cueCardInstance){this.log("warn","CueCard already initialized, skipping...");return}let e=await this.fetchCueCardConfig(this.currentPath);if(!e||!e.enabled){this.log("debug",`CueCard not mounted: no active template for path "${this.currentPath}"`);return}this.log("debug","Active template found, mounting CueCard...");let n=e.config,r=n?.deanonymization,i=!!r?.provider;this.cueCardInstance=new we({theme:n?.theme??"light",position:n?.position??"top-center",direction:n?.direction??"top-to-bottom",fields:n?.fields??[{name:"companyDomain",label:"Company Name or Domain",placeholder:"example.com",required:!0,minLength:3,errorMessage:"Company name or domain is required"}],isVisible:!i,enableFocusMode:n?.enableFocusMode??!1,showWatermark:n?.showWatermark??!1,showKeyboardHints:n?.showKeyboardHints??!0,enableLauncher:n?.enableLauncher??!0,customTheme:n?.customTheme,textOverrides:n?.textOverrides,enableUndoToggle:n?.enableUndoToggle??!1,deanonymization:r,isPersonalized:this.isPersonalized,onDismiss:()=>{this.log("debug","CueCard dismissed by user"),this.dispatchKenobiEvent("cuecard:dismiss",{pagePath:this.currentPath})},onSubmitPersonalization:o=>{this.log("debug","CueCard submitted:",o),this.personalize(o)},onOpenChange:o=>{this.log("debug","CueCard open state changed:",o),this.dispatchKenobiEvent("cuecard:openchange",{isOpen:o,pagePath:this.currentPath})},onTogglePersonalization:()=>{this.log("debug","CueCard toggle personalization"),this.toggleTransformations(),this.dispatchKenobiEvent("cuecard:toggle",{isPersonalized:this.isPersonalized,pagePath:this.currentPath})}}),this.cueCardInstance.mount(),i&&this.setupDeanonymizationPrefetch(r,n?.fields),this.log("debug","CueCard mounted successfully")});m(this,"isSameInput",(e,n)=>{let r=Object.keys(e).sort(),i=Object.keys(n).sort();if(r.length!==i.length)return!1;for(let o=0;o<r.length;o+=1){let a=r[o];if(a!==i[o]||(e[a]??"")!==(n[a]??""))return!1}return!0});m(this,"buildInputFromFields",(e,n,r)=>{let i=r||n;if(!i)return null;let o={};return e.forEach(a=>{let s=a.name,u=s.toLowerCase();if(u.includes("domain")){o[s]=r||i;return}if(u.includes("company")){o[s]=n||i;return}o[s]=i}),o});m(this,"buildDeanonymizedInput",(e,n)=>{let r=e.company?.name||e.domain||"",i=e.company?.domain||e.domain||"";return!n||n.length===0?!r&&!i?null:{companyName:r||i,companyDomain:i||r}:this.buildInputFromFields(n,r,i)});m(this,"requestPersonalization",async(e,n)=>{let r={publicKey:this.config.publicKey,input:e,pagePath:this.currentPath};n?.notifySlack===!1&&(r.notifySlack=!1),n?.notifyOnly&&(r.notifyOnly=!0),n?.predictionSource&&(r.predictionSource=n.predictionSource),n?.prefetchedTransformations&&(r.prefetchedTransformations=n.prefetchedTransformations),n?.prefetchedMetadata&&(r.prefetchedMetadata=n.prefetchedMetadata);let i=await fetch(`${this.config.apiHost}/v1/personalize`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)});if(!i.ok){let a=await i.json().catch(()=>({}));throw new Error(a.error||`API error: ${i.status}`)}let o=await i.json();return this.log("debug","Personalization API response:",o),o});m(this,"preparePersonalization",async(e,n)=>this.config.publicKey?this.preparedPersonalization?.input&&this.isSameInput(this.preparedPersonalization.input,e)?(n?.source&&!this.preparedPersonalization.source&&(this.preparedPersonalization={...this.preparedPersonalization,source:n.source}),this.preparedPersonalization.result):this.preparePersonalizationPromise?this.preparePersonalizationPromise:(this.isPreparingPersonalization=!0,this.preparePersonalizationPromise=(async()=>{try{let r=await this.requestPersonalization(e,{notifySlack:!1,predictionSource:n?.source});return this.preparedPersonalization={input:e,result:r,source:n?.source},this.dispatchKenobiEvent("personalization:ready",{input:e,pagePath:this.currentPath,transformationsCount:r.transformations?.length??0,metadata:r.metadata,source:n?.source}),r}catch(r){return this.log("error","Personalization prefetch failed:",r),null}finally{this.isPreparingPersonalization=!1,this.preparePersonalizationPromise=null}})(),this.preparePersonalizationPromise):(this.log("error","Cannot prepare personalization: publicKey not configured"),null));m(this,"notifyPreparedPersonalization",async e=>{if(!e.result.transformations||!e.result.metadata){this.log("warn","Prepared personalization missing transformations or metadata for notify");return}try{await this.requestPersonalization(e.input,{notifySlack:!0,notifyOnly:!0,predictionSource:e.source,prefetchedTransformations:e.result.transformations,prefetchedMetadata:e.result.metadata})}catch(n){this.log("warn","Failed to send Slack notification for prepared personalization:",n)}});m(this,"setupDeanonymizationPrefetch",(e,n)=>{if(!this.cueCardInstance)return;if(typeof window>"u"){this.cueCardInstance.update({isVisible:!0});return}if(this.deanonymizationPrefetchCleanup)return;let r=!1,i=!1,o=!1,a=()=>{r||(r=!0,o?this.cueCardInstance?.update({deanonymization:void 0,isVisible:!0}):this.cueCardInstance?.update({isVisible:!0}),this.deanonymizationPrefetchCleanup?.(),this.deanonymizationPrefetchCleanup=null)},s=async l=>{if(r)return;let p=l.detail;if(i=!0,p?.type!=="business"){a();return}let b=this.buildDeanonymizedInput(p,n);if(!b){a();return}await this.preparePersonalization(b,{source:"deanonymized"})||(o=!0),a()},u=window.__kenobiIdentityResolution;u&&s({detail:u}),window.addEventListener(ln,s);let c=e?.timeoutMs??Er,h=window.setTimeout(()=>{i||a()},c+50);this.deanonymizationPrefetchCleanup=()=>{window.removeEventListener(ln,s),window.clearTimeout(h)}});m(this,"syncCueCardVisibility",async()=>{this.config.publicKey&&(this.cueCardInstance&&(this.log("debug","Navigation detected, unmounting CueCard"),this.cueCardInstance.unmount(),this.cueCardInstance=null),this.initCueCard())});m(this,"dispatchKenobiEvent",(e,n)=>{let r=new CustomEvent(`kenobi:${e}`,{detail:n,bubbles:!0});window.dispatchEvent(r),this.log("debug",`Dispatched event: kenobi:${e}`,n)});m(this,"personalize",async e=>{if(!this.config.publicKey)return this.log("error","Cannot personalize: publicKey not configured"),null;let n=new Date;this.log("debug","Starting personalization with input:",e);let r=this.preparedPersonalization?.input&&this.isSameInput(this.preparedPersonalization.input,e)?this.preparedPersonalization:null,i=r?.source==="deanonymized";this.dispatchKenobiEvent("personalization:start",{input:e,pagePath:this.currentPath,deanonymized:i});try{this.cueCardInstance&&this.cueCardInstance.update({status:"starting",progressPct:r?80:10}),r&&this.notifyPreparedPersonalization(r);let o=r?r.result:await this.requestPersonalization(e);o.transformations&&Array.isArray(o.transformations)&&await this.applyTransformations(o.transformations,{shouldConsolidate:!0}),r&&(this.preparedPersonalization=null),this.cueCardInstance&&this.cueCardInstance.update({status:"success",progressPct:100});let a=new Date,s=this.getDurationInMilliseconds(n,a);return this.log("debug",`Personalization complete, took ${this.formatThousands(s)} ms`),this.dispatchKenobiEvent("personalization:complete",{input:e,pagePath:this.currentPath,durationMs:s,transformationsCount:o.transformations?.length??0,metadata:o.metadata,source:r?"prefetch":"api",deanonymized:i}),o}catch(o){this.log("error","Personalization failed:",o),this.cueCardInstance&&this.cueCardInstance.update({status:"error",progressPct:0}),this.dispatchKenobiEvent("personalization:error",{input:e,pagePath:this.currentPath,error:o instanceof Error?o.message:String(o),deanonymized:i})}return null});m(this,"getCueCard",()=>this.cueCardInstance);this.config={apiHost:"https://kenobi.ai/api",debug:!1,autoTransform:!0,...e},this.transitionDefaults=vr(this.config.transitionDefaults),this.orchestrator=new st,this.syncVisitorKey(),this.currentPath=this.getCurrentPath(),this.currentUrl=this.getCurrentUrl();try{this.initNavigationListener()}catch(n){this.log("error","Failed to initialize navigation listener with error:",n)}this.log("debug","Kenobi initialized"),this.config.autoTransform&&(this.log("debug","Auto-transform is requested... Starting..."),this.startAutoTransform()),this.config.publicKey&&!this.config.skipCueCardAutoMount&&(this.log("debug","Public key provided, checking for active template..."),this.initCueCard())}};return Un(Dr);})();