@frak-labs/components 0.0.23-beta.de6e0d34 → 0.0.23-beta.ebc9d3a3

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.
@@ -0,0 +1 @@
1
+ export const __webpack_id__="767";export const __webpack_ids__=["767"];export const __webpack_modules__={"../../node_modules/.bun/preact-custom-element@4.5.1+e9f4a629fd396517/node_modules/preact-custom-element/dist/preact-custom-element.esm.js":function(e,t,n){n.d(t,{A:()=>i});var _=n("../../node_modules/.bun/preact@10.27.2/node_modules/preact/dist/preact.module.js");function o(){return(o=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var _ in n)Object.prototype.hasOwnProperty.call(n,_)&&(e[_]=n[_])}return e}).apply(this,arguments)}function r(e,t){if(null==e)return{};var n,_,o={},r=Object.keys(e);for(_=0;_<r.length;_++)t.indexOf(n=r[_])>=0||(o[n]=e[n]);return o}var u=["context","children"],l=["useFragment"];function i(e,t,n,_){function o(){var t=Reflect.construct(HTMLElement,[],o);return t._vdomComponent=e,t._root=_&&_.shadow?t.attachShadow({mode:_.mode||"open"}):t,_&&_.adoptedStyleSheets&&(t._root.adoptedStyleSheets=_.adoptedStyleSheets),t}return(o.prototype=Object.create(HTMLElement.prototype)).constructor=o,o.prototype.connectedCallback=function(){s.call(this,_)},o.prototype.attributeChangedCallback=a,o.prototype.disconnectedCallback=p,o.observedAttributes=n=n||e.observedAttributes||Object.keys(e.propTypes||{}),e.formAssociated&&(o.formAssociated=!0),n.forEach(function(e){Object.defineProperty(o.prototype,e,{get:function(){return this._vdom?this._vdom.props[e]:this._props[e]},set:function(t){this._vdom?this.attributeChangedCallback(e,null,t):(this._props||(this._props={}),this._props[e]=t);var n=typeof t;null!=t&&"string"!==n&&"boolean"!==n&&"number"!==n||this.setAttribute(e,t)}})}),customElements.define(t||e.tagName||e.displayName||e.name,o),o}function c(e){this.getChildContext=function(){return e.context};var t=e.children,n=r(e,u);return(0,_.Ob)(t,n)}function s(e){var t=new CustomEvent("_preact",{detail:{},bubbles:!0,cancelable:!0});this.dispatchEvent(t),this._vdom=(0,_.h)(c,o({},this._props,{context:t.detail.context}),function e(t,n,o){if(3===t.nodeType)return t.data;if(1!==t.nodeType)return null;var r=[],u={},l=0,i=t.attributes,c=t.childNodes;for(l=i.length;l--;)"slot"!==i[l].name&&(u[i[l].name]=i[l].value,u[f(i[l].name)]=i[l].value);for(l=c.length;l--;){var s=e(c[l],null,o),a=c[l].slot;a?u[a]=(0,_.h)(d,{name:a},s):r[l]=s}var p=!(!o||!o.shadow),h=n?(0,_.h)(d,{useFragment:!p},r):r;return!p&&n&&(t.innerHTML=""),(0,_.h)(n||t.nodeName.toLowerCase(),u,h)}(this,this._vdomComponent,e)),(this.hasAttribute("hydrate")?_.Qv:_.XX)(this._vdom,this._root)}function f(e){return e.replace(/-(\w)/g,function(e,t){return t?t.toUpperCase():""})}function a(e,t,n){if(this._vdom){var o={};o[e]=n=null==n?void 0:n,o[f(e)]=n,this._vdom=(0,_.Ob)(this._vdom,o),(0,_.XX)(this._vdom,this._root)}}function p(){(0,_.XX)(this._vdom=null,this._root)}function d(e,t){var n=this,u=e.useFragment,i=r(e,l);return(0,_.h)(u?_.FK:"slot",o({},i,{ref:function(e){e?(n.ref=e,n._listener||(n._listener=function(e){e.stopPropagation(),e.detail.context=t},e.addEventListener("_preact",n._listener))):n.ref.removeEventListener("_preact",n._listener)}}))}},"../../node_modules/.bun/preact@10.27.2/node_modules/preact/dist/preact.module.js":function(e,t,n){n.d(t,{FK:()=>w,Ob:()=>D,Qv:()=>O,XX:()=>M,fF:()=>o,h:()=>g,n:()=>g,uA:()=>x,v2:()=>function e(t,n){return n=n||[],null==t||"boolean"==typeof t||(m(t)?t.some(function(t){e(t,n)}):n.push(t)),n}});var _,o,r,u,l,i,c,s,f,a,p,d={},h=[],v=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,m=Array.isArray;function y(e,t){for(var n in t)e[n]=t[n];return e}function b(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function g(e,t,n){var o,r,u,l={};for(u in t)"key"==u?o=t[u]:"ref"==u?r=t[u]:l[u]=t[u];if(arguments.length>2&&(l.children=arguments.length>3?_.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(u in e.defaultProps)void 0===l[u]&&(l[u]=e.defaultProps[u]);return k(e,l,o,r,null)}function k(e,t,n,_,u){var l={type:e,props:t,key:n,ref:_,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==u?++r:u,__i:-1,__u:0};return null==u&&null!=o.vnode&&o.vnode(l),l}function w(e){return e.children}function x(e,t){this.props=e,this.context=t}function C(e,t){if(null==t)return e.__?C(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?C(e):null}function H(e){(!e.__d&&(e.__d=!0)&&u.push(e)&&!S.__r++||l!=o.debounceRendering)&&((l=o.debounceRendering)||i)(S)}function S(){for(var e,t,n,_,r,l,i=1;u.length;)u.length>i&&u.sort(c),e=u.shift(),i=u.length,e.__d&&(t=void 0,n=void 0,_=(n=e.__v).__e,r=[],l=[],e.__P&&((t=y({},n)).__v=n.__v+1,o.vnode&&o.vnode(t),A(e.__P,t,n,e.__n,e.__P.namespaceURI,32&n.__u?[_]:null,r,null==_?C(n):_,!!(32&n.__u),l),t.__v=n.__v,t.__.__k[t.__i]=t,j(r,t,l),n.__e=n.__=null,t.__e!=_&&function e(t){var n,_;if(null!=(t=t.__)&&null!=t.__c){for(t.__e=t.__c.base=null,n=0;n<t.__k.length;n++)if(null!=(_=t.__k[n])&&null!=_.__e){t.__e=t.__c.base=_.__e;break}return e(t)}}(t)));S.__r=0}function E(e,t,n,_,r,u,l,i,c,s,f){var a,p,v,y,g,x,H,S=_&&_.__k||h,E=t.length;for(c=function(e,t,n,_,r){var u,l,i,c,s,f=n.length,a=f,p=0;for(e.__k=Array(r),u=0;u<r;u++)null!=(l=t[u])&&"boolean"!=typeof l&&"function"!=typeof l?(c=u+p,(l=e.__k[u]="string"==typeof l||"number"==typeof l||"bigint"==typeof l||l.constructor==String?k(null,l,null,null,null):m(l)?k(w,{children:l},null,null,null):null==l.constructor&&l.__b>0?k(l.type,l.props,l.key,l.ref?l.ref:null,l.__v):l).__=e,l.__b=e.__b+1,i=null,-1!=(s=l.__i=function(e,t,n,_){var o,r,u,l=e.key,i=e.type,c=t[n],s=null!=c&&0==(2&c.__u);if(null===c&&null==e.key||s&&l==c.key&&i==c.type)return n;if(_>+!!s){for(o=n-1,r=n+1;o>=0||r<t.length;)if(null!=(c=t[u=o>=0?o--:r++])&&0==(2&c.__u)&&l==c.key&&i==c.type)return u}return -1}(l,n,c,a))&&(a--,(i=n[s])&&(i.__u|=2)),null==i||null==i.__v?(-1==s&&(r>f?p--:r<f&&p++),"function"!=typeof l.type&&(l.__u|=4)):s!=c&&(s==c-1?p--:s==c+1?p++:(s>c?p--:p++,l.__u|=4))):e.__k[u]=null;if(a)for(u=0;u<f;u++)null!=(i=n[u])&&0==(2&i.__u)&&(i.__e==_&&(_=C(i)),function e(t,n,_){var r,u;if(o.unmount&&o.unmount(t),(r=t.ref)&&(r.current&&r.current!=t.__e||U(r,null,n)),null!=(r=t.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){o.__e(e,n)}r.base=r.__P=null}if(r=t.__k)for(u=0;u<r.length;u++)r[u]&&e(r[u],n,_||"function"!=typeof t.type);_||b(t.__e),t.__c=t.__=t.__e=void 0}(i,i));return _}(n,t,S,c,E),a=0;a<E;a++)null!=(v=n.__k[a])&&(p=-1==v.__i?d:S[v.__i]||d,v.__i=a,x=A(e,v,p,r,u,l,i,c,s,f),y=v.__e,v.ref&&p.ref!=v.ref&&(p.ref&&U(p.ref,null,v),f.push(v.ref,v.__c||y,v)),null==g&&null!=y&&(g=y),(H=!!(4&v.__u))||p.__k===v.__k?c=function e(t,n,_,o){var r,u;if("function"==typeof t.type){for(r=t.__k,u=0;r&&u<r.length;u++)r[u]&&(r[u].__=t,n=e(r[u],n,_,o));return n}t.__e!=n&&(o&&(n&&t.type&&!n.parentNode&&(n=C(t)),_.insertBefore(t.__e,n||null)),n=t.__e);do n=n&&n.nextSibling;while(null!=n&&8==n.nodeType);return n}(v,c,e,H):"function"==typeof v.type&&void 0!==x?c=x:y&&(c=y.nextSibling),v.__u&=-7);return n.__e=g,c}function P(e,t,n){"-"==t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||v.test(t)?n:n+"px"}function F(e,t,n,_,o){var r,u;e:if("style"==t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof _&&(e.style.cssText=_=""),_)for(t in _)n&&t in n||P(e.style,t,"");if(n)for(t in n)_&&n[t]==_[t]||P(e.style,t,n[t])}else if("o"==t[0]&&"n"==t[1])r=t!=(t=t.replace(s,"$1")),t=(u=t.toLowerCase())in e||"onFocusOut"==t||"onFocusIn"==t?u.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+r]=n,n?_?n.u=_.u:(n.u=f,e.addEventListener(t,r?p:a,r)):e.removeEventListener(t,r?p:a,r);else{if("http://www.w3.org/2000/svg"==o)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=t&&"height"!=t&&"href"!=t&&"list"!=t&&"form"!=t&&"tabIndex"!=t&&"download"!=t&&"rowSpan"!=t&&"colSpan"!=t&&"role"!=t&&"popover"!=t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null==n||!1===n&&"-"!=t[4]?e.removeAttribute(t):e.setAttribute(t,"popover"==t&&1==n?"":n))}}function N(e){return function(t){if(this.l){var n=this.l[t.type+e];if(null==t.t)t.t=f++;else if(t.t<n.u)return;return n(o.event?o.event(t):t)}}}function A(e,t,n,r,u,l,i,c,s,f){var a,p,h,v,g,k,H,S,P,N,A,j,U,M,O,D,W,R=t.type;if(null!=t.constructor)return null;128&n.__u&&(s=!!(32&n.__u),l=[c=t.__e=n.__e]),(a=o.__b)&&a(t);e:if("function"==typeof R)try{if(S=t.props,P="prototype"in R&&R.prototype.render,N=(a=R.contextType)&&r[a.__c],A=a?N?N.props.value:a.__:r,n.__c?H=(p=t.__c=n.__c).__=p.__E:(P?t.__c=p=new R(S,A):(t.__c=p=new x(S,A),p.constructor=R,p.render=L),N&&N.sub(p),p.props=S,p.state||(p.state={}),p.context=A,p.__n=r,h=p.__d=!0,p.__h=[],p._sb=[]),P&&null==p.__s&&(p.__s=p.state),P&&null!=R.getDerivedStateFromProps&&(p.__s==p.state&&(p.__s=y({},p.__s)),y(p.__s,R.getDerivedStateFromProps(S,p.__s))),v=p.props,g=p.state,p.__v=t,h)P&&null==R.getDerivedStateFromProps&&null!=p.componentWillMount&&p.componentWillMount(),P&&null!=p.componentDidMount&&p.__h.push(p.componentDidMount);else{if(P&&null==R.getDerivedStateFromProps&&S!==v&&null!=p.componentWillReceiveProps&&p.componentWillReceiveProps(S,A),!p.__e&&null!=p.shouldComponentUpdate&&!1===p.shouldComponentUpdate(S,p.__s,A)||t.__v==n.__v){for(t.__v!=n.__v&&(p.props=S,p.state=p.__s,p.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(e){e&&(e.__=t)}),j=0;j<p._sb.length;j++)p.__h.push(p._sb[j]);p._sb=[],p.__h.length&&i.push(p);break e}null!=p.componentWillUpdate&&p.componentWillUpdate(S,p.__s,A),P&&null!=p.componentDidUpdate&&p.__h.push(function(){p.componentDidUpdate(v,g,k)})}if(p.context=A,p.props=S,p.__P=e,p.__e=!1,U=o.__r,M=0,P){for(p.state=p.__s,p.__d=!1,U&&U(t),a=p.render(p.props,p.state,p.context),O=0;O<p._sb.length;O++)p.__h.push(p._sb[O]);p._sb=[]}else do p.__d=!1,U&&U(t),a=p.render(p.props,p.state,p.context),p.state=p.__s;while(p.__d&&++M<25);p.state=p.__s,null!=p.getChildContext&&(r=y(y({},r),p.getChildContext())),P&&!h&&null!=p.getSnapshotBeforeUpdate&&(k=p.getSnapshotBeforeUpdate(v,g)),D=a,null!=a&&a.type===w&&null==a.key&&(D=function e(t){return"object"!=typeof t||null==t||t.__b&&t.__b>0?t:m(t)?t.map(e):y({},t)}(a.props.children)),c=E(e,m(D)?D:[D],t,n,r,u,l,i,c,s,f),p.base=t.__e,t.__u&=-161,p.__h.length&&i.push(p),H&&(p.__E=p.__=null)}catch(e){if(t.__v=null,s||null!=l)if(e.then){for(t.__u|=s?160:128;c&&8==c.nodeType&&c.nextSibling;)c=c.nextSibling;l[l.indexOf(c)]=null,t.__e=c}else{for(W=l.length;W--;)b(l[W]);T(t)}else t.__e=n.__e,t.__k=n.__k,e.then||T(t);o.__e(e,t,n)}else null==l&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):c=t.__e=function(e,t,n,r,u,l,i,c,s){var f,a,p,h,v,y,g,k=n.props,w=t.props,x=t.type;if("svg"==x?u="http://www.w3.org/2000/svg":"math"==x?u="http://www.w3.org/1998/Math/MathML":u||(u="http://www.w3.org/1999/xhtml"),null!=l){for(f=0;f<l.length;f++)if((v=l[f])&&"setAttribute"in v==!!x&&(x?v.localName==x:3==v.nodeType)){e=v,l[f]=null;break}}if(null==e){if(null==x)return document.createTextNode(w);e=document.createElementNS(u,x,w.is&&w),c&&(o.__m&&o.__m(t,l),c=!1),l=null}if(null==x)k===w||c&&e.data==w||(e.data=w);else{if(l=l&&_.call(e.childNodes),k=n.props||d,!c&&null!=l)for(k={},f=0;f<e.attributes.length;f++)k[(v=e.attributes[f]).name]=v.value;for(f in k)if(v=k[f],"children"==f);else if("dangerouslySetInnerHTML"==f)p=v;else if(!(f in w)){if("value"==f&&"defaultValue"in w||"checked"==f&&"defaultChecked"in w)continue;F(e,f,null,v,u)}for(f in w)v=w[f],"children"==f?h=v:"dangerouslySetInnerHTML"==f?a=v:"value"==f?y=v:"checked"==f?g=v:c&&"function"!=typeof v||k[f]===v||F(e,f,v,k[f],u);if(a)c||p&&(a.__html==p.__html||a.__html==e.innerHTML)||(e.innerHTML=a.__html),t.__k=[];else if(p&&(e.innerHTML=""),E("template"==t.type?e.content:e,m(h)?h:[h],t,n,r,"foreignObject"==x?"http://www.w3.org/1999/xhtml":u,l,i,l?l[0]:n.__k&&C(n,0),c,s),null!=l)for(f=l.length;f--;)b(l[f]);c||(f="value","progress"==x&&null==y?e.removeAttribute("value"):null==y||y===e[f]&&("progress"!=x||y)&&("option"!=x||y==k[f])||F(e,f,y,k[f],u),f="checked",null!=g&&g!=e[f]&&F(e,f,g,k[f],u))}return e}(n.__e,t,n,r,u,l,i,s,f);return(a=o.diffed)&&a(t),128&t.__u?void 0:c}function T(e){e&&e.__c&&(e.__c.__e=!0),e&&e.__k&&e.__k.forEach(T)}function j(e,t,n){for(var _=0;_<n.length;_++)U(n[_],n[++_],n[++_]);o.__c&&o.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){o.__e(e,t.__v)}})}function U(e,t,n){try{if("function"==typeof e){var _="function"==typeof e.__u;_&&e.__u(),_&&null==t||(e.__u=e(t))}else e.current=t}catch(e){o.__e(e,n)}}function L(e,t,n){return this.constructor(e,n)}function M(e,t,n){var r,u,l,i;t==document&&(t=document.documentElement),o.__&&o.__(e,t),u=(r="function"==typeof n)?null:n&&n.__k||t.__k,l=[],i=[],A(t,e=(!r&&n||t).__k=g(w,null,[e]),u||d,d,t.namespaceURI,!r&&n?[n]:u?null:t.firstChild?_.call(t.childNodes):null,l,!r&&n?n:u?u.__e:t.firstChild,r,i),j(l,e,i)}function O(e,t){M(e,t,O)}function D(e,t,n){var o,r,u,l,i=y({},e.props);for(u in e.type&&e.type.defaultProps&&(l=e.type.defaultProps),t)"key"==u?o=t[u]:"ref"==u?r=t[u]:i[u]=void 0===t[u]&&null!=l?l[u]:t[u];return arguments.length>2&&(i.children=arguments.length>3?_.call(arguments,2):n),k(e.type,i,o||e.key,r||e.ref,null)}_=h.slice,o={__e:function(e,t,n,_){for(var o,r,u;t=t.__;)if((o=t.__c)&&!o.__)try{if((r=o.constructor)&&null!=r.getDerivedStateFromError&&(o.setState(r.getDerivedStateFromError(e)),u=o.__d),null!=o.componentDidCatch&&(o.componentDidCatch(e,_||{}),u=o.__d),u)return o.__E=o}catch(t){e=t}throw e}},r=0,x.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=y({},this.state),"function"==typeof e&&(e=e(y({},n),this.props)),e&&y(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),H(this))},x.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),H(this))},x.prototype.render=w,u=[],i="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,c=function(e,t){return e.__v.__b-t.__v.__b},S.__r=0,s=/(PointerCapture)$|Capture$/i,f=0,a=N(!1),p=N(!0)},"../../node_modules/.bun/preact@10.27.2/node_modules/preact/hooks/dist/hooks.module.js":function(e,t,n){n.d(t,{J0:()=>y,Kr:()=>g,hb:()=>k,vJ:()=>b});var _,o,r,u,l=n("../../node_modules/.bun/preact@10.27.2/node_modules/preact/dist/preact.module.js"),i=0,c=[],s=l.fF,f=s.__b,a=s.__r,p=s.diffed,d=s.__c,h=s.unmount,v=s.__;function m(e,t){s.__h&&s.__h(o,e,i||t),i=0;var n=o.__H||(o.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function y(e){return i=1,function(e,t,n){var r=m(_++,2);if(r.t=e,!r.__c&&(r.__=[E(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);t!==n&&(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=o,!o.__f)){var u=function(e,t,n){if(!r.__c.__H)return!0;var _=r.__c.__H.__.filter(function(e){return!!e.__c});if(_.every(function(e){return!e.__N}))return!l||l.call(this,e,t,n);var o=r.__c.props!==e;return _.forEach(function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(o=!0)}}),l&&l.call(this,e,t,n)||o};o.__f=!0;var l=o.shouldComponentUpdate,i=o.componentWillUpdate;o.componentWillUpdate=function(e,t,n){if(this.__e){var _=l;l=void 0,u(e,t,n),l=_}i&&i.call(this,e,t,n)},o.shouldComponentUpdate=u}return r.__N||r.__}(E,e)}function b(e,t){var n=m(_++,3);!s.__s&&S(n.__H,t)&&(n.__=e,n.u=t,o.__H.__h.push(n))}function g(e,t){var n=m(_++,7);return S(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function k(e,t){return i=8,g(function(){return e},t)}function w(){for(var e;e=c.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(C),e.__H.__h.forEach(H),e.__H.__h=[]}catch(t){e.__H.__h=[],s.__e(t,e.__v)}}s.__b=function(e){o=null,f&&f(e)},s.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),v&&v(e,t)},s.__r=function(e){a&&a(e),_=0;var t=(o=e.__c).__H;t&&(r===o?(t.__h=[],o.__h=[],t.__.forEach(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.forEach(C),t.__h.forEach(H),t.__h=[],_=0)),r=o},s.diffed=function(e){p&&p(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==c.push(t)&&u===s.requestAnimationFrame||((u=s.requestAnimationFrame)||function(e){var t,n=function(){clearTimeout(_),x&&cancelAnimationFrame(t),setTimeout(e)},_=setTimeout(n,35);x&&(t=requestAnimationFrame(n))})(w)),t.__H.__.forEach(function(e){e.u&&(e.__H=e.u),e.u=void 0})),r=o=null},s.__c=function(e,t){t.some(function(e){try{e.__h.forEach(C),e.__h=e.__h.filter(function(e){return!e.__||H(e)})}catch(n){t.some(function(e){e.__h&&(e.__h=[])}),t=[],s.__e(n,e.__v)}}),d&&d(e,t)},s.unmount=function(e){h&&h(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(e){try{C(e)}catch(e){t=e}}),n.__H=void 0,t&&s.__e(t,n.__v))};var x="function"==typeof requestAnimationFrame;function C(e){var t=o,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),o=t}function H(e){var t=o;e.__c=e.__(),o=t}function S(e,t){return!e||e.length!==t.length||t.some(function(t,n){return t!==e[n]})}function E(e,t){return"function"==typeof t?t(e):t}},"../../node_modules/.bun/preact@10.27.2/node_modules/preact/jsx-runtime/dist/jsxRuntime.module.js":function(e,t,n){n.d(t,{FD:()=>r,FK:()=>_.FK,Y:()=>r});var _=n("../../node_modules/.bun/preact@10.27.2/node_modules/preact/dist/preact.module.js"),o=0;function r(e,t,n,r,u,l){t||(t={});var i,c,s=t;if("ref"in s)for(c in s={},t)"ref"==c?i=t[c]:s[c]=t[c];var f={type:e,props:s,key:n,ref:i,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--o,__i:-1,__u:0,__source:u,__self:l};if("function"==typeof e&&(i=e.defaultProps))for(c in i)void 0===s[c]&&(s[c]=i[c]);return _.fF.vnode&&_.fF.vnode(f),f}},"../../node_modules/.bun/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.mjs":function(e,t,n){n.d(t,{cx:()=>_});let _=function(){for(var e,t,n=0,_="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=function e(t){var n,_,o="";if("string"==typeof t||"number"==typeof t)o+=t;else if("object"==typeof t)if(Array.isArray(t)){var r=t.length;for(n=0;n<r;n++)t[n]&&(_=e(t[n]))&&(o&&(o+=" "),o+=_)}else for(_ in t)t[_]&&(o&&(o+=" "),o+=_);return o}(e))&&(_&&(_+=" "),_+=t);return _}}};
@@ -0,0 +1 @@
1
+ export const __webpack_id__="286";export const __webpack_ids__=["286"];export const __webpack_modules__={"./src/components/ButtonShare/index.ts":function(e,t,o){o.r(t),o.d(t,{ButtonShare:()=>S});var n=o("./src/utils/registerWebComponent.ts"),r=o("../../node_modules/.bun/preact@10.27.2/node_modules/preact/jsx-runtime/dist/jsxRuntime.module.js"),s=o("../core/dist/index.js"),a=o("../core/dist/actions.js"),i=o("../../node_modules/.bun/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.mjs"),l=o("../../node_modules/.bun/preact@10.27.2/node_modules/preact/hooks/dist/hooks.module.js");let d="spinner__leaf-xtOJmT",c=({ref:e,className:t,...o})=>(0,r.FD)("span",{...o,ref:e,className:(0,i.cx)("spinner-KHk8mw"),children:[(0,r.Y)("span",{className:d}),(0,r.Y)("span",{className:d}),(0,r.Y)("span",{className:d}),(0,r.Y)("span",{className:d}),(0,r.Y)("span",{className:d}),(0,r.Y)("span",{className:d}),(0,r.Y)("span",{className:d}),(0,r.Y)("span",{className:d})]});c.displayName="Spinner";var u=o("./src/hooks/useClientReady.ts"),p=o("./src/hooks/useReward.ts");let m={marginTop:"16px",padding:"16px",backgroundColor:"#FEE2E2",border:"1px solid #FCA5A5",borderRadius:"4px",color:"#991B1B"},f={display:"flex",alignItems:"center",gap:"8px",marginBottom:"12px"},h={margin:0,fontSize:"16px",fontWeight:500},b={fontSize:"14px",lineHeight:"1.5",margin:"0 0 12px 0"},y={color:"#991B1B",textDecoration:"underline",textUnderlineOffset:"2px"},w={display:"inline-flex",alignItems:"center",gap:"8px",marginBottom:"10px",padding:"8px 12px",backgroundColor:"white",border:"1px solid #D1D5DB",borderRadius:"4px",color:"black",fontSize:"14px",fontWeight:500};function x({debugInfo:e}){let[t,o]=(0,l.J0)(!1);return(0,r.FD)("div",{children:[(0,r.Y)("button",{type:"button",style:w,onClick:()=>o(!t),children:"Ouvrir les informations"}),t&&(0,r.Y)("textarea",{style:{display:"block",width:"100%",height:"200px",fontSize:"12px"},children:e})]})}function g({debugInfo:e}){let{copied:t,copy:o}=function(e={}){let{successDuration:t=2e3}=e,[o,n]=(0,l.J0)(!1);return{copy:(0,l.hb)(async e=>{try{if(navigator.clipboard&&window.isSecureContext)await navigator.clipboard.writeText(e),n(!0);else{let t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.opacity="0",document.body.appendChild(t),t.focus(),t.select();try{document.execCommand("copy"),n(!0)}catch(e){return console.error("Failed to copy text:",e),!1}finally{t.remove()}}return setTimeout(()=>{n(!1)},t),!0}catch(e){return console.error("Failed to copy text:",e),!1}},[t]),copied:o}}();return(0,r.FD)("div",{style:m,children:[(0,r.Y)("div",{style:f,children:(0,r.Y)("h3",{style:h,children:"Oups ! Nous avons rencontr\xe9 un petit probl\xe8me"})}),(0,r.FD)("p",{style:b,children:["Impossible d'ouvrir le menu de partage pour le moment. Si le probl\xe8me persiste, copiez les informations ci-dessous et collez-les dans votre mail \xe0"," ",(0,r.Y)("a",{href:"mailto:help@frak-labs.com?subject=Debug",style:y,children:"help@frak-labs.com"})," ",(0,r.Y)("br",{}),"Merci pour votre retour, nous traitons votre demande dans les plus brefs d\xe9lais."]}),(0,r.Y)("button",{type:"button",onClick:()=>o(e??""),style:w,children:t?"Informations copi\xe9es !":"Copier les informations de d\xe9bogage"}),(0,r.Y)(x,{debugInfo:e})]})}var k=o("../../packages/rpc/dist/middleware-B51Ll_ty.js"),_=o("./src/utils/setup.ts");async function v(){if(!window.FrakSetup?.client)throw Error("Frak client not found");await (0,a.wS)(window.FrakSetup.client,window.FrakSetup?.modalWalletConfig??{})}function S({text:e="Share and earn!",classname:t="",useReward:o,noRewardText:n,targetInteraction:a,showWallet:d}){let m=(0,l.Kr)(()=>void 0!==o,[o]),f=(0,l.Kr)(()=>void 0!==d,[d]),{isClientReady:h}=(0,u.g)(),{reward:b}=(0,p.b)(m&&h,a),{handleShare:y,isError:w,debugInfo:x}=function(e){let[t,o]=(0,l.J0)(void 0),[n,r]=(0,l.J0)(!1);return{handleShare:(0,l.hb)(async()=>{if(!window.FrakSetup?.client){console.error("Frak client not found"),o(s.Om.empty().formatDebugInfo("Frak client not found")),r(!0);return}let t=(0,_.et)();if(!t)throw Error("modalBuilderSteps not found");try{await t.sharing(window.FrakSetup?.modalShareConfig??{}).display(t=>({...t,targetInteraction:e}))}catch(t){if(t instanceof k.c&&t.code===k.d.clientAborted)return void console.debug("User aborted the modal");let e=window.FrakSetup.client.debugInfo.formatDebugInfo(t);(0,s.sx)(window.FrakSetup.client,"share_modal_error",{error:t instanceof Object&&"message"in t?t.message:"Unknown error",debugInfo:e}),o(e),r(!0),console.error("Error while opening the modal",t)}},[e]),isError:n,debugInfo:t}}(a),S=(0,l.Kr)(()=>m?b?e.includes("{REWARD}")?e.replace("{REWARD}",b):`${e} ${b}`:n??e.replace("{REWARD}",""):e,[m,e,n,b]),F=(0,l.hb)(async()=>{(0,s.sx)(window.FrakSetup.client,"share_button_clicked"),f?await v():await y()},[f,y]);return(0,r.FD)(r.FK,{children:[(0,r.FD)("button",{type:"button",className:(0,i.cx)("buttonShare-F23Y9m",t,"override"),onClick:F,children:[!h&&(0,r.Y)(c,{})," ",S]}),w&&(0,r.Y)(g,{debugInfo:x})]})}(0,n.$)(S,"frak-button-share",["text"],{shadow:!1})},"./src/hooks/useClientReady.ts":function(e,t,o){o.d(t,{g:()=>s});var n=o("../../node_modules/.bun/preact@10.27.2/node_modules/preact/hooks/dist/hooks.module.js"),r=o("./src/utils/clientReady.ts");function s(){let[e,t]=(0,n.J0)(!0),o=(0,n.hb)(()=>{t(!1)},[]);return(0,n.vJ)(()=>((0,r.S)("add",o),()=>(0,r.S)("remove",o)),[o]),{isClientReady:!e}}},"./src/hooks/useReward.ts":function(e,t,o){o.d(t,{b:()=>i});var n=o("../../node_modules/.bun/preact@10.27.2/node_modules/preact/hooks/dist/hooks.module.js"),r=o("../core/dist/index.js"),s=o("../core/dist/actions.js");async function a({targetInteraction:e}){let t=window.FrakSetup?.client;if(!t)return void console.warn("Frak client not ready yet");let{maxReferrer:o,rewards:n}=await (0,s.k9)(t);if(!o)return;let a=(0,r.hr)(t.config.metadata?.currency),i=Math.round(o[a]);if(e){let t=n.filter(t=>t.interactionTypeKey===e).map(e=>e.referrer[a]).reduce((e,t)=>t>e?t:e,0);t>0&&(i=Math.round(t))}return(0,r.ej)(i,t.config.metadata?.currency)}function i(e,t){let[o,r]=(0,n.J0)(void 0);return(0,n.vJ)(()=>{e&&a({targetInteraction:t}).then(e=>{e&&r(e)})},[e,t]),{reward:o}}},"./src/utils/registerWebComponent.ts":function(e,t,o){o.d(t,{$:()=>a});var n=o("../../packages/ui/utils/onDocumentReady.ts"),r=o("../../node_modules/.bun/preact-custom-element@4.5.1+e9f4a629fd396517/node_modules/preact-custom-element/dist/preact-custom-element.esm.js"),s=o("./src/utils/initFrakSdk.ts");function a(e,t,o=[],i={shadow:!1}){"undefined"!=typeof window&&((0,n.q)(s.$),customElements.get(t)||(0,r.A)(e,t,o,i))}}};
@@ -0,0 +1 @@
1
+ export const __webpack_id__="72";export const __webpack_ids__=["72"];export const __webpack_modules__={"./src/components/ButtonWallet/index.ts":function(e,t,n){n.r(t),n.d(t,{ButtonWallet:()=>U});var o=n("./src/utils/registerWebComponent.ts"),r=n("../../node_modules/.bun/preact@10.27.2/node_modules/preact/jsx-runtime/dist/jsxRuntime.module.js"),i=n("../core/dist/index.js"),l=n("../../node_modules/.bun/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.mjs"),a=n("../../node_modules/.bun/preact@10.27.2/node_modules/preact/hooks/dist/hooks.module.js"),u=n("./src/hooks/useClientReady.ts"),_=n("./src/hooks/useReward.ts"),s=n("../../node_modules/.bun/preact@10.27.2/node_modules/preact/dist/preact.module.js");function c(e,t){for(var n in e)if("__source"!==n&&!(n in t))return!0;for(var o in t)if("__source"!==o&&e[o]!==t[o])return!0;return!1}function d(e,t){this.props=e,this.context=t}(d.prototype=new s.uA).isPureReactComponent=!0,d.prototype.shouldComponentUpdate=function(e,t){return c(this.props,e)||c(this.state,t)};var f=s.fF.__b;s.fF.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),f&&f(e)},"undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref");var p=s.fF.__e;s.fF.__e=function(e,t,n,o){if(e.then){for(var r,i=t;i=i.__;)if((r=i.__c)&&r.__c)return null==t.__e&&(t.__e=n.__e,t.__k=n.__k),r.__c(e,t)}p(e,t,n,o)};var v=s.fF.unmount;function m(){this.__u=0,this.o=null,this.__b=null}function h(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function b(){this.i=null,this.l=null}s.fF.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),v&&v(e)},(m.prototype=new s.uA).__c=function(e,t){var n=t.__c,o=this;null==o.o&&(o.o=[]),o.o.push(n);var r=h(o.__v),i=!1,l=function(){i||(i=!0,n.__R=null,r?r(a):a())};n.__R=l;var a=function(){if(!--o.__u){if(o.state.__a){var e,t=o.state.__a;o.__v.__k[0]=function e(t,n,o){return t&&o&&(t.__v=null,t.__k=t.__k&&t.__k.map(function(t){return e(t,n,o)}),t.__c&&t.__c.__P===n&&(t.__e&&o.appendChild(t.__e),t.__c.__e=!0,t.__c.__P=o)),t}(t,t.__c.__P,t.__c.__O)}for(o.setState({__a:o.__b=null});e=o.o.pop();)e.forceUpdate()}};o.__u++||32&t.__u||o.setState({__a:o.__b=o.__v.__k[0]}),e.then(l,l)},m.prototype.componentWillUnmount=function(){this.o=[]},m.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),o=this.__v.__k[0].__c;this.__v.__k[0]=function e(t,n,o){return t&&(t.__c&&t.__c.__H&&(t.__c.__H.__.forEach(function(e){"function"==typeof e.__c&&e.__c()}),t.__c.__H=null),null!=(t=function(e,t){for(var n in t)e[n]=t[n];return e}({},t)).__c&&(t.__c.__P===o&&(t.__c.__P=n),t.__c.__e=!0,t.__c=null),t.__k=t.__k&&t.__k.map(function(t){return e(t,n,o)})),t}(this.__b,n,o.__O=o.__P)}this.__b=null}var r=t.__a&&(0,s.n)(s.FK,null,e.fallback);return r&&(r.__u&=-33),[(0,s.n)(s.FK,null,t.__a?null:e.children),r]};var y=function(e,t,n){if(++n[1]===n[0]&&e.l.delete(t),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.l.size))for(n=e.i;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.i=n=n[2]}};(b.prototype=new s.uA).__a=function(e){var t=this,n=h(t.__v),o=t.l.get(e);return o[0]++,function(r){var i=function(){t.props.revealOrder?(o.push(r),y(t,e,o)):r()};n?n(i):i()}},b.prototype.render=function(e){this.i=null,this.l=new Map;var t=(0,s.v2)(e.children);e.revealOrder&&"b"===e.revealOrder[0]&&t.reverse();for(var n=t.length;n--;)this.l.set(t[n],this.i=[1,0,this.i]);return e.children},b.prototype.componentDidUpdate=b.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,n){y(e,n,t)})};var k="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,w=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,g=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,F=/[A-Z0-9]/g,x="undefined"!=typeof document;s.uA.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(s.uA.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var S=s.fF.event;function j(){}function R(){return this.cancelBubble}function C(){return this.defaultPrevented}s.fF.event=function(e){return S&&(e=S(e)),e.persist=j,e.isPropagationStopped=R,e.isDefaultPrevented=C,e.nativeEvent=e};var P={enumerable:!1,configurable:!0,get:function(){return this.class}},O=s.fF.vnode;s.fF.vnode=function(e){"string"==typeof e.type&&function(e){var t=e.props,n=e.type,o={},r=-1===n.indexOf("-");for(var i in t){var l=t[i];if(!("value"===i&&"defaultValue"in t&&null==l||x&&"children"===i&&"noscript"===n||"class"===i||"className"===i)){var a,u=i.toLowerCase();"defaultValue"===i&&"value"in t&&null==t.value?i="value":"download"===i&&!0===l?l="":"translate"===u&&"no"===l?l=!1:"o"===u[0]&&"n"===u[1]?"ondoubleclick"===u?i="ondblclick":"onchange"!==u||"input"!==n&&"textarea"!==n||(a=t.type,("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/:/fil|che|ra/).test(a))?"onfocus"===u?i="onfocusin":"onblur"===u?i="onfocusout":g.test(i)&&(i=u):u=i="oninput":r&&w.test(i)?i=i.replace(F,"-$&").toLowerCase():null===l&&(l=void 0),"oninput"===u&&o[i=u]&&(i="oninputCapture"),o[i]=l}}"select"==n&&o.multiple&&Array.isArray(o.value)&&(o.value=(0,s.v2)(t.children).forEach(function(e){e.props.selected=-1!=o.value.indexOf(e.props.value)})),"select"==n&&null!=o.defaultValue&&(o.value=(0,s.v2)(t.children).forEach(function(e){e.props.selected=o.multiple?-1!=o.defaultValue.indexOf(e.props.value):o.defaultValue==e.props.value})),t.class&&!t.className?(o.class=t.class,Object.defineProperty(o,"className",P)):(t.className&&!t.class||t.class&&t.className)&&(o.class=o.className=t.className),e.props=o}(e),e.$$typeof=k,O&&O(e)};var A=s.fF.__r;s.fF.__r=function(e){A&&A(e),e.__c};var W=s.fF.diffed;s.fF.diffed=function(e){W&&W(e);var t=e.props,n=e.__e;null!=n&&"textarea"===e.type&&"value"in t&&t.value!==n.value&&(n.value=null==t.value?"":t.value)};let E=e=>(0,r.Y)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 28 28",...e,children:(0,r.Y)("path",{stroke:"#fff",strokeLinecap:"round",strokeLinejoin:"round",d:"M23.143 14v11.428H4.857V14M14 25.428V8.286m0 0H8.857a2.857 2.857 0 0 1 0-5.715c4 0 5.143 5.715 5.143 5.715m0 0h5.143a2.857 2.857 0 1 0 0-5.715c-4 0-5.143 5.715-5.143 5.715m-11.429 0h22.857V14H2.571z"})});var N=n("./src/components/ButtonWallet/utils.ts");function U({classname:e="",useReward:t,targetInteraction:n}){let o=(0,a.Kr)(()=>void 0!==t,[t]),{isClientReady:s}=(0,u.g)(),{reward:c}=(0,_.b)(o&&s,n),[d,f]=(0,a.J0)("right");return(0,a.vJ)(()=>{f(window.FrakSetup?.modalWalletConfig?.metadata?.position??"right")},[]),(0,r.FD)("button",{type:"button","aria-label":"Open wallet",class:(0,l.cx)("button-aPZnsb","left"===d?"button__left-fQJUnK":"button__right-TkFFFK",e,"override"),disabled:!s,onClick:()=>{(0,i.sx)(window.FrakSetup.client,"wallet_button_clicked"),(0,N.h)()},children:[(0,r.Y)(E,{}),c&&(0,r.Y)("span",{className:"reward-w5dm3K",children:c})]})}(0,o.$)(U,"frak-button-wallet",[],{shadow:!1})},"./src/hooks/useClientReady.ts":function(e,t,n){n.d(t,{g:()=>i});var o=n("../../node_modules/.bun/preact@10.27.2/node_modules/preact/hooks/dist/hooks.module.js"),r=n("./src/utils/clientReady.ts");function i(){let[e,t]=(0,o.J0)(!0),n=(0,o.hb)(()=>{t(!1)},[]);return(0,o.vJ)(()=>((0,r.S)("add",n),()=>(0,r.S)("remove",n)),[n]),{isClientReady:!e}}},"./src/hooks/useReward.ts":function(e,t,n){n.d(t,{b:()=>a});var o=n("../../node_modules/.bun/preact@10.27.2/node_modules/preact/hooks/dist/hooks.module.js"),r=n("../core/dist/index.js"),i=n("../core/dist/actions.js");async function l({targetInteraction:e}){let t=window.FrakSetup?.client;if(!t)return void console.warn("Frak client not ready yet");let{maxReferrer:n,rewards:o}=await (0,i.k9)(t);if(!n)return;let l=(0,r.hr)(t.config.metadata?.currency),a=Math.round(n[l]);if(e){let t=o.filter(t=>t.interactionTypeKey===e).map(e=>e.referrer[l]).reduce((e,t)=>t>e?t:e,0);t>0&&(a=Math.round(t))}return(0,r.ej)(a,t.config.metadata?.currency)}function a(e,t){let[n,r]=(0,o.J0)(void 0);return(0,o.vJ)(()=>{e&&l({targetInteraction:t}).then(e=>{e&&r(e)})},[e,t]),{reward:n}}},"./src/utils/registerWebComponent.ts":function(e,t,n){n.d(t,{$:()=>l});var o=n("../../packages/ui/utils/onDocumentReady.ts"),r=n("../../node_modules/.bun/preact-custom-element@4.5.1+e9f4a629fd396517/node_modules/preact-custom-element/dist/preact-custom-element.esm.js"),i=n("./src/utils/initFrakSdk.ts");function l(e,t,n=[],a={shadow:!1}){"undefined"!=typeof window&&((0,o.q)(i.$),customElements.get(t)||(0,r.A)(e,t,n,a))}}};
package/cdn/components.js CHANGED
@@ -1 +1 @@
1
- import("https://cdn.jsdelivr.net/npm/@frak-labs/components@latest/cdn/loader.js?v=1760443894737");
1
+ import("https://cdn.jsdelivr.net/npm/@frak-labs/components@latest/cdn/loader.js?v=1762287837419");
package/cdn/loader.js CHANGED
@@ -1,11 +1,11 @@
1
1
  /*! For license information please see loader.js.LICENSE.txt */
2
- var e,t,r,n={"../../node_modules/.bun/@jsonjoy.com+json-pack@1.2.0+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/json-pack/lib/JsonPackExtension.js":function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.JsonPackExtension=void 0,t.JsonPackExtension=class{constructor(e,t){this.tag=e,this.val=t}}},"../../node_modules/.bun/@jsonjoy.com+json-pack@1.2.0+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/json-pack/lib/JsonPackValue.js":function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.JsonPackValue=void 0,t.JsonPackValue=class{constructor(e){this.val=e}}},"../../node_modules/.bun/@jsonjoy.com+json-pack@1.2.0+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/json-pack/lib/cbor/CborDecoder.js":function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.CborDecoder=void 0;let n=r("../../node_modules/.bun/@jsonjoy.com+json-pack@1.2.0+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/json-pack/lib/cbor/CborDecoderBase.js"),o=r("../../node_modules/.bun/@jsonjoy.com+json-pack@1.2.0+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/json-pack/lib/JsonPackValue.js");class i extends n.CborDecoderBase{readAsMap(){let e=this.reader.u8();if(e>>5==5)return this.readMap(31&e);throw 0}readMap(e){let t=this.readMinorLen(e);return t>=0?this.readMapRaw(t):this.readMapIndef()}readMapRaw(e){let t=new Map;for(let r=0;r<e;r++){let e=this.val(),r=this.val();t.set(e,r)}return t}readMapIndef(){let e=new Map;for(;255!==this.reader.peak();){let t=this.val();if(255===this.reader.peak())throw 7;let r=this.val();e.set(t,r)}return this.reader.x++,e}skipN(e){for(let t=0;t<e;t++)this.skipAny()}skipAny(){this.skipAnyRaw(this.reader.u8())}skipAnyRaw(e){let t=31&e;switch(e>>5){case 0:case 1:this.skipUNint(t);break;case 2:this.skipBin(t);break;case 3:this.skipStr(t);break;case 4:this.skipArr(t);break;case 5:this.skipObj(t);break;case 7:this.skipTkn(t);break;case 6:this.skipTag(t)}}skipMinorLen(e){if(e<=23)return e;switch(e){case 24:return this.reader.u8();case 25:return this.reader.u16();case 26:return this.reader.u32();case 27:return Number(this.reader.u64());case 31:return -1;default:throw 1}}skipUNint(e){if(!(e<=23))switch(e){case 24:return this.reader.skip(1);case 25:return this.reader.skip(2);case 26:return this.reader.skip(4);case 27:return this.reader.skip(8);default:throw 1}}skipBin(e){let t=this.skipMinorLen(e);if(t>=0)this.reader.skip(t);else{for(;255!==this.reader.peak();)this.skipBinChunk();this.reader.x++}}skipBinChunk(){let e=this.reader.u8(),t=31&e;if(2!=e>>5)throw 2;if(t>27)throw 3;this.skipBin(t)}skipStr(e){let t=this.skipMinorLen(e);if(t>=0)this.reader.skip(t);else{for(;255!==this.reader.peak();)this.skipStrChunk();this.reader.x++}}skipStrChunk(){let e=this.reader.u8(),t=31&e;if(3!=e>>5)throw 4;if(t>27)throw 5;this.skipStr(t)}skipArr(e){let t=this.skipMinorLen(e);if(t>=0)this.skipN(t);else{for(;255!==this.reader.peak();)this.skipAny();this.reader.x++}}skipObj(e){let t=this.readMinorLen(e);if(t>=0)return this.skipN(2*t);for(;255!==this.reader.peak();){if(this.skipAny(),255===this.reader.peak())throw 7;this.skipAny()}this.reader.x++}skipTag(e){if(0>this.skipMinorLen(e))throw 1;this.skipAny()}skipTkn(e){switch(e){case 24:this.reader.skip(1);return;case 25:this.reader.skip(2);return;case 26:this.reader.skip(4);return;case 27:this.reader.skip(8);return}if(!(e<=23))throw 1}validate(e,t=0,r=e.length){if(this.reader.reset(e),this.reader.x=t,this.skipAny(),this.reader.x-t!==r)throw 8}decodeLevel(e){return this.reader.reset(e),this.readLevel()}readLevel(){let e=this.reader.u8(),t=e>>5,r=31&e;switch(t){case 4:return this.readArrLevel(r);case 5:return this.readObjLevel(r);default:return super.readAnyRaw(e)}}readPrimitiveOrVal(){switch(this.reader.peak()>>5){case 4:case 5:return this.readAsValue();default:return this.val()}}readAsValue(){let e=this.reader,t=e.x;this.skipAny();let r=e.x;return new o.JsonPackValue(e.uint8.subarray(t,r))}readObjLevel(e){let t=this.readMinorLen(e);return t>=0?this.readObjRawLevel(t):this.readObjIndefLevel()}readObjRawLevel(e){let t={};for(let r=0;r<e;r++){let e=this.key(),r=this.readPrimitiveOrVal();t[e]=r}return t}readObjIndefLevel(){let e={};for(;255!==this.reader.peak();){let t=this.key();if(255===this.reader.peak())throw 7;let r=this.readPrimitiveOrVal();e[t]=r}return this.reader.x++,e}readArrLevel(e){let t=this.readMinorLen(e);return t>=0?this.readArrRawLevel(t):this.readArrIndefLevel()}readArrRawLevel(e){let t=[];for(let r=0;r<e;r++)t.push(this.readPrimitiveOrVal());return t}readArrIndefLevel(){let e=[];for(;255!==this.reader.peak();)e.push(this.readPrimitiveOrVal());return this.reader.x++,e}readHdr(e){let t=this.reader.u8();if(t>>5!==e)throw 0;let r=31&t;if(r<24)return r;switch(r){case 24:return this.reader.u8();case 25:return this.reader.u16();case 26:return this.reader.u32();case 27:return Number(this.reader.u64());case 31:return -1}throw 1}readStrHdr(){return this.readHdr(3)}readObjHdr(){return this.readHdr(5)}readArrHdr(){return this.readHdr(4)}findKey(e){let t=this.readObjHdr();for(let r=0;r<t;r++){if(this.key()===e)return this;this.skipAny()}throw 9}findIndex(e){if(e>=this.readArrHdr())throw 10;for(let t=0;t<e;t++)this.skipAny();return this}find(e){for(let t=0;t<e.length;t++){let r=e[t];"string"==typeof r?this.findKey(r):this.findIndex(r)}return this}}t.CborDecoder=i},"../../node_modules/.bun/@jsonjoy.com+json-pack@1.2.0+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/json-pack/lib/cbor/CborDecoderBase.js":function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.CborDecoderBase=void 0;let n=r("../../node_modules/.bun/tslib@2.8.1/node_modules/tslib/tslib.es6.mjs"),o=r("../../node_modules/.bun/@jsonjoy.com+util@1.5.0+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/util/lib/buffers/f16.js"),i=r("../../node_modules/.bun/@jsonjoy.com+json-pack@1.2.0+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/json-pack/lib/JsonPackExtension.js"),s=r("../../node_modules/.bun/@jsonjoy.com+json-pack@1.2.0+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/json-pack/lib/JsonPackValue.js"),a=r("../../node_modules/.bun/@jsonjoy.com+util@1.5.0+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/util/lib/buffers/Reader.js"),l=n.__importDefault(r("../../node_modules/.bun/@jsonjoy.com+util@1.5.0+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/util/lib/buffers/utf8/sharedCachedUtf8Decoder.js"));t.CborDecoderBase=class{constructor(e=new a.Reader,t=l.default){this.reader=e,this.keyDecoder=t}read(e){return this.reader.reset(e),this.val()}decode(e){return this.reader.reset(e),this.val()}val(){let e=this.reader.u8(),t=e>>5,r=31&e;if(t<4)if(t<2)return 0===t?this.readUint(r):this.readNint(r);else return 2===t?this.readBin(r):this.readStr(r);return t<6?4===t?this.readArr(r):this.readObj(r):6===t?this.readTag(r):this.readTkn(r)}readAnyRaw(e){let t=e>>5,r=31&e;if(t<4)if(t<2)return 0===t?this.readUint(r):this.readNint(r);else return 2===t?this.readBin(r):this.readStr(r);return t<6?4===t?this.readArr(r):this.readObj(r):6===t?this.readTag(r):this.readTkn(r)}readMinorLen(e){if(e<24)return e;switch(e){case 24:return this.reader.u8();case 25:return this.reader.u16();case 26:return this.reader.u32();case 27:return Number(this.reader.u64());case 31:return -1;default:throw 1}}readUint(e){if(e<25)return 24===e?this.reader.u8():e;{if(e<27)return 25===e?this.reader.u16():this.reader.u32();let t=this.reader.u64();return t>0x1fffffffffffff?t:Number(t)}}readNint(e){if(e<25)return 24===e?-this.reader.u8()-1:-e-1;{if(e<27)return 25===e?-this.reader.u16()-1:-this.reader.u32()-1;let t=this.reader.u64();return t>0x1ffffffffffffe?-t-BigInt(1):-Number(t)-1}}readBin(e){let t=this.reader;if(e<=23)return t.buf(e);switch(e){case 24:return t.buf(t.u8());case 25:return t.buf(t.u16());case 26:return t.buf(t.u32());case 27:return t.buf(Number(t.u64()));case 31:{let e=0,t=[];for(;255!==this.reader.peak();){let r=this.readBinChunk();e+=r.length,t.push(r)}this.reader.x++;let r=new Uint8Array(e),n=0,o=t.length;for(let e=0;e<o;e++){let o=t[e];r.set(o,n),n+=o.length}return r}default:throw 1}}readBinChunk(){let e=this.reader.u8(),t=31&e;if(2!=e>>5)throw 2;if(t>27)throw 3;return this.readBin(t)}readAsStr(){let e=this.reader.u8();if(3!=e>>5)throw 11;return this.readStr(31&e)}readStr(e){let t=this.reader;if(e<=23)return t.utf8(e);switch(e){case 24:return t.utf8(t.u8());case 25:return t.utf8(t.u16());case 26:return t.utf8(t.u32());case 27:return t.utf8(Number(t.u64()));case 31:{let e="";for(;255!==t.peak();)e+=this.readStrChunk();return this.reader.x++,e}default:throw 1}}readStrLen(e){if(e<=23)return e;switch(e){case 24:return this.reader.u8();case 25:return this.reader.u16();case 26:return this.reader.u32();case 27:return Number(this.reader.u64());default:throw 1}}readStrChunk(){let e=this.reader.u8(),t=31&e;if(3!=e>>5)throw 4;if(t>27)throw 5;return this.readStr(t)}readArr(e){let t=this.readMinorLen(e);return t>=0?this.readArrRaw(t):this.readArrIndef()}readArrRaw(e){let t=[];for(let r=0;r<e;r++)t.push(this.val());return t}readArrIndef(){let e=[];for(;255!==this.reader.peak();)e.push(this.val());return this.reader.x++,e}readObj(e){if(e<28){let t=e;switch(e){case 24:t=this.reader.u8();break;case 25:t=this.reader.u16();break;case 26:t=this.reader.u32();break;case 27:t=Number(this.reader.u64())}let r={};for(let e=0;e<t;e++){let e=this.key();if("__proto__"===e)throw 6;let t=this.val();r[e]=t}return r}if(31===e)return this.readObjIndef();throw 1}readObjRaw(e){let t={};for(let r=0;r<e;r++){let e=this.key(),r=this.val();t[e]=r}return t}readObjIndef(){let e={};for(;255!==this.reader.peak();){let t=this.key();if(255===this.reader.peak())throw 7;let r=this.val();e[t]=r}return this.reader.x++,e}key(){let e=this.reader.u8();if(3!=e>>5)return String(this.readAnyRaw(e));let t=this.readStrLen(31&e);if(t>31)return this.reader.utf8(t);let r=this.keyDecoder.decode(this.reader.uint8,this.reader.x,t);return this.reader.skip(t),r}readTag(e){if(e<=23)return this.readTagRaw(e);switch(e){case 24:return this.readTagRaw(this.reader.u8());case 25:return this.readTagRaw(this.reader.u16());case 26:return this.readTagRaw(this.reader.u32());case 27:return this.readTagRaw(Number(this.reader.u64()));default:throw 1}}readTagRaw(e){return new i.JsonPackExtension(e,this.val())}readTkn(e){switch(e){case 20:return!1;case 21:return!0;case 22:return null;case 23:return;case 24:return new s.JsonPackValue(this.reader.u8());case 25:return this.f16();case 26:return this.reader.f32();case 27:return this.reader.f64()}if(e<=23)return new s.JsonPackValue(e);throw 1}f16(){return(0,o.decodeF16)(this.reader.u16())}}},"../../node_modules/.bun/@jsonjoy.com+json-pack@1.2.0+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/json-pack/lib/cbor/CborDecoderDag.js":function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.CborDecoderDag=void 0;let n=r("../../node_modules/.bun/@jsonjoy.com+json-pack@1.2.0+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/json-pack/lib/JsonPackExtension.js"),o=r("../../node_modules/.bun/@jsonjoy.com+json-pack@1.2.0+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/json-pack/lib/cbor/CborDecoder.js");class i extends o.CborDecoder{readTagRaw(e){let t=this.val();return 42===e?new n.JsonPackExtension(e,t):t}}t.CborDecoderDag=i},"../../node_modules/.bun/@jsonjoy.com+json-pack@1.2.0+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/json-pack/lib/cbor/CborEncoder.js":function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.CborEncoder=void 0;let n=r("../../node_modules/.bun/@jsonjoy.com+util@1.5.0+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/util/lib/buffers/isFloat32.js"),o=r("../../node_modules/.bun/@jsonjoy.com+json-pack@1.2.0+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/json-pack/lib/JsonPackExtension.js"),i=r("../../node_modules/.bun/@jsonjoy.com+json-pack@1.2.0+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/json-pack/lib/cbor/CborEncoderFast.js"),s=r("../../node_modules/.bun/@jsonjoy.com+json-pack@1.2.0+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/json-pack/lib/JsonPackValue.js");class a extends i.CborEncoderFast{writeUnknown(e){this.writeNull()}writeAny(e){switch(typeof e){case"number":return this.writeNumber(e);case"string":return this.writeStr(e);case"boolean":return this.writer.u8(244+ +e);case"object":if(!e)return this.writer.u8(246);switch(e.constructor){case Object:return this.writeObj(e);case Array:return this.writeArr(e);case Uint8Array:return this.writeBin(e);case Map:return this.writeMap(e);case o.JsonPackExtension:return this.writeTag(e.tag,e.val);case s.JsonPackValue:let t=e.val;return this.writer.buf(t,t.length);default:if(e instanceof Uint8Array)return this.writeBin(e);if(Array.isArray(e))return this.writeArr(e);if(e instanceof Map)return this.writeMap(e);return this.writeUnknown(e)}case"undefined":return this.writeUndef();case"bigint":return this.writeBigInt(e);default:return this.writeUnknown(e)}}writeFloat(e){(0,n.isFloat32)(e)?this.writer.u8f32(250,e):this.writer.u8f64(251,e)}writeMap(e){this.writeMapHdr(e.size),e.forEach((e,t)=>{this.writeAny(t),this.writeAny(e)})}writeUndef(){this.writer.u8(247)}}t.CborEncoder=a},"../../node_modules/.bun/@jsonjoy.com+json-pack@1.2.0+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/json-pack/lib/cbor/CborEncoderDag.js":function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.CborEncoderDag=void 0;let n=r("../../node_modules/.bun/@jsonjoy.com+json-pack@1.2.0+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/json-pack/lib/cbor/CborEncoderStable.js");class o extends n.CborEncoderStable{writeUndef(){this.writeNull()}writeFloat(e){if(e!=e||!Number.isFinite(e))return this.writeNull();this.writer.u8f64(251,e)}writeTag(e,t){42===e&&this.writeTagHdr(e),this.writeAny(t)}}t.CborEncoderDag=o},"../../node_modules/.bun/@jsonjoy.com+json-pack@1.2.0+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/json-pack/lib/cbor/CborEncoderFast.js":function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.CborEncoderFast=void 0;let n=r("../../node_modules/.bun/@jsonjoy.com+util@1.5.0+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/util/lib/buffers/Writer.js"),o=Number.isSafeInteger;t.CborEncoderFast=class{constructor(e=new n.Writer){this.writer=e}encode(e){return this.writeAny(e),this.writer.flush()}encodeToSlice(e){return this.writeAny(e),this.writer.flushSlice()}writeAny(e){switch(typeof e){case"number":return this.writeNumber(e);case"string":return this.writeStr(e);case"boolean":return this.writer.u8(244+ +e);case"object":if(!e)return this.writer.u8(246);if(e.constructor===Array)return this.writeArr(e);return this.writeObj(e)}}writeCbor(){this.writer.u8u16(217,55799)}writeEnd(){this.writer.u8(255)}writeNull(){this.writer.u8(246)}writeBoolean(e){e?this.writer.u8(245):this.writer.u8(244)}writeNumber(e){o(e)?this.writeInteger(e):"bigint"==typeof e?this.writeBigInt(e):this.writeFloat(e)}writeBigInt(e){e>=0?this.writeBigUint(e):this.writeBigSint(e)}writeBigUint(e){if(e<=Number.MAX_SAFE_INTEGER)return this.writeUInteger(Number(e));this.writer.u8u64(27,e)}writeBigSint(e){if(e>=Number.MIN_SAFE_INTEGER)return this.encodeNint(Number(e));let t=-BigInt(1)-e;this.writer.u8u64(59,t)}writeInteger(e){e>=0?this.writeUInteger(e):this.encodeNint(e)}writeUInteger(e){let t=this.writer;t.ensureCapacity(9);let r=t.uint8,n=t.x;e<=23?r[n++]=0+e:e<=255?(r[n++]=24,r[n++]=e):e<=65535?(r[n++]=25,t.view.setUint16(n,e),n+=2):e<=0xffffffff?(r[n++]=26,t.view.setUint32(n,e),n+=4):(r[n++]=27,t.view.setBigUint64(n,BigInt(e)),n+=8),t.x=n}encodeNumber(e){this.writeNumber(e)}encodeInteger(e){this.writeInteger(e)}encodeUint(e){this.writeUInteger(e)}encodeNint(e){let t=-1-e,r=this.writer;r.ensureCapacity(9);let n=r.uint8,o=r.x;t<24?n[o++]=32+t:t<=255?(n[o++]=56,n[o++]=t):t<=65535?(n[o++]=57,r.view.setUint16(o,t),o+=2):t<=0xffffffff?(n[o++]=58,r.view.setUint32(o,t),o+=4):(n[o++]=59,r.view.setBigUint64(o,BigInt(t)),o+=8),r.x=o}writeFloat(e){this.writer.u8f64(251,e)}writeBin(e){let t=e.length;this.writeBinHdr(t),this.writer.buf(e,t)}writeBinHdr(e){let t=this.writer;e<=23?t.u8(64+e):e<=255?t.u16(22528+e):e<=65535?t.u8u16(89,e):e<=0xffffffff?t.u8u32(90,e):t.u8u64(91,e)}writeStr(e){let t=this.writer,r=4*e.length;t.ensureCapacity(5+r);let n=t.uint8,o=t.x;r<=23?t.x++:r<=255?(n[t.x++]=120,o=t.x,t.x++):r<=65535?(n[t.x++]=121,o=t.x,t.x+=2):(n[t.x++]=122,o=t.x,t.x+=4);let i=t.utf8(e);r<=23?n[o]=96+i:r<=255?n[o]=i:r<=65535?t.view.setUint16(o,i):t.view.setUint32(o,i)}writeStrHdr(e){let t=this.writer;e<=23?t.u8(96+e):e<=255?t.u16(30720+e):e<=65535?t.u8u16(121,e):t.u8u32(122,e)}writeAsciiStr(e){this.writeStrHdr(e.length),this.writer.ascii(e)}writeArr(e){let t=e.length;this.writeArrHdr(t);for(let r=0;r<t;r++)this.writeAny(e[r])}writeArrHdr(e){let t=this.writer;e<=23?t.u8(128+e):e<=255?t.u16(38912+e):e<=65535?t.u8u16(153,e):e<=0xffffffff?t.u8u32(154,e):t.u8u64(155,e)}writeObj(e){let t=Object.keys(e),r=t.length;this.writeObjHdr(r);for(let n=0;n<r;n++){let r=t[n];this.writeStr(r),this.writeAny(e[r])}}writeObjHdr(e){let t=this.writer;e<=23?t.u8(160+e):e<=255?t.u16(47104+e):e<=65535?t.u8u16(185,e):e<=0xffffffff?t.u8u32(186,e):t.u8u64(187,e)}writeMapHdr(e){this.writeObjHdr(e)}writeStartMap(){this.writer.u8(191)}writeTag(e,t){this.writeTagHdr(e),this.writeAny(t)}writeTagHdr(e){let t=this.writer;e<=23?t.u8(192+e):e<=255?t.u16(55296+e):e<=65535?t.u8u16(217,e):e<=0xffffffff?t.u8u32(218,e):t.u8u64(219,e)}writeTkn(e){let t=this.writer;e<=23?t.u8(224+e):e<=255&&t.u16(63488+e)}writeStartStr(){this.writer.u8(127)}writeStrChunk(e){throw Error("Not implemented")}writeEndStr(){throw Error("Not implemented")}writeStartBin(){this.writer.u8(95)}writeBinChunk(e){throw Error("Not implemented")}writeEndBin(){throw Error("Not implemented")}writeStartArr(){this.writer.u8(159)}writeArrChunk(e){throw Error("Not implemented")}writeEndArr(){this.writer.u8(255)}writeStartObj(){this.writer.u8(191)}writeObjChunk(e,t){throw Error("Not implemented")}writeEndObj(){this.writer.u8(255)}}},"../../node_modules/.bun/@jsonjoy.com+json-pack@1.2.0+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/json-pack/lib/cbor/CborEncoderStable.js":function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.CborEncoderStable=void 0;let n=r("../../node_modules/.bun/@jsonjoy.com+json-pack@1.2.0+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/json-pack/lib/cbor/CborEncoder.js"),o=r("../../node_modules/.bun/@jsonjoy.com+util@1.5.0+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/util/lib/sort/insertion2.js"),i=r("../../node_modules/.bun/@jsonjoy.com+util@1.5.0+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/util/lib/objKeyCmp.js"),s=e=>e<=23?1:e<=255?2:e<=65535?3:5;class a extends n.CborEncoder{writeObj(e){let t=Object.keys(e);(0,o.sort)(t,i.objKeyCmp);let r=t.length;this.writeObjHdr(r);for(let n=0;n<r;n++){let r=t[n];this.writeStr(r),this.writeAny(e[r])}}writeStr(e){let t=this.writer,r=e.length,n=4*r;t.ensureCapacity(5+n);let o=s(r),i=t.x,a=i+o;t.x=a;let l=t.utf8(e),c=t.uint8,u=s(l);switch(u!==o&&c.copyWithin(a+(u-o),a,a+l),u){case 1:c[i]=96+l;break;case 2:c[i]=120,c[i+1]=l;break;case 3:c[i]=121,t.view.setUint16(i+1,l);break;case 5:c[i]=122,t.view.setUint32(i+1,l)}t.x=i+u+l}writeUndef(){this.writeNull()}}t.CborEncoderStable=a},"../../node_modules/.bun/@jsonjoy.com+json-pack@1.2.0+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/json-pack/lib/cbor/index.js":function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});let n=r("../../node_modules/.bun/tslib@2.8.1/node_modules/tslib/tslib.es6.mjs");n.__exportStar(r("../../node_modules/.bun/@jsonjoy.com+json-pack@1.2.0+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/json-pack/lib/cbor/types.js"),t),n.__exportStar(r("../../node_modules/.bun/@jsonjoy.com+json-pack@1.2.0+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/json-pack/lib/cbor/CborEncoderFast.js"),t),n.__exportStar(r("../../node_modules/.bun/@jsonjoy.com+json-pack@1.2.0+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/json-pack/lib/cbor/CborEncoder.js"),t),n.__exportStar(r("../../node_modules/.bun/@jsonjoy.com+json-pack@1.2.0+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/json-pack/lib/cbor/CborEncoderStable.js"),t),n.__exportStar(r("../../node_modules/.bun/@jsonjoy.com+json-pack@1.2.0+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/json-pack/lib/cbor/CborEncoderDag.js"),t),n.__exportStar(r("../../node_modules/.bun/@jsonjoy.com+json-pack@1.2.0+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/json-pack/lib/cbor/CborDecoderBase.js"),t),n.__exportStar(r("../../node_modules/.bun/@jsonjoy.com+json-pack@1.2.0+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/json-pack/lib/cbor/CborDecoder.js"),t),n.__exportStar(r("../../node_modules/.bun/@jsonjoy.com+json-pack@1.2.0+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/json-pack/lib/cbor/CborDecoderDag.js"),t)},"../../node_modules/.bun/@jsonjoy.com+json-pack@1.2.0+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/json-pack/lib/cbor/types.js":function(e,t){Object.defineProperty(t,"__esModule",{value:!0})},"../../node_modules/.bun/@jsonjoy.com+util@1.5.0+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/util/lib/buffers/Reader.js":function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.Reader=void 0;let n=r("../../node_modules/.bun/@jsonjoy.com+util@1.5.0+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/util/lib/buffers/utf8/decodeUtf8/index.js");t.Reader=class{constructor(){this.uint8=new Uint8Array([]),this.view=new DataView(this.uint8.buffer),this.x=0}reset(e){this.x=0,this.uint8=e,this.view=new DataView(e.buffer,e.byteOffset,e.length)}peak(){return this.view.getUint8(this.x)}skip(e){this.x+=e}buf(e){let t=this.x+e,r=this.uint8.subarray(this.x,t);return this.x=t,r}u8(){return this.uint8[this.x++]}i8(){return this.view.getInt8(this.x++)}u16(){let e=this.x,t=(this.uint8[e++]<<8)+this.uint8[e++];return this.x=e,t}i16(){let e=this.view.getInt16(this.x);return this.x+=2,e}u32(){let e=this.view.getUint32(this.x);return this.x+=4,e}i32(){let e=this.view.getInt32(this.x);return this.x+=4,e}u64(){let e=this.view.getBigUint64(this.x);return this.x+=8,e}i64(){let e=this.view.getBigInt64(this.x);return this.x+=8,e}f32(){let e=this.x;return this.x+=4,this.view.getFloat32(e)}f64(){let e=this.x;return this.x+=8,this.view.getFloat64(e)}utf8(e){let t=this.x;return this.x+=e,(0,n.decodeUtf8)(this.uint8,t,e)}ascii(e){let t=this.uint8,r="",n=this.x+e;for(let e=this.x;e<n;e++)r+=String.fromCharCode(t[e]);return this.x=n,r}}},"../../node_modules/.bun/@jsonjoy.com+util@1.5.0+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/util/lib/buffers/Slice.js":function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Slice=void 0,t.Slice=class{constructor(e,t,r,n){this.uint8=e,this.view=t,this.start=r,this.end=n}subarray(){return this.uint8.subarray(this.start,this.end)}}},"../../node_modules/.bun/@jsonjoy.com+util@1.5.0+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/util/lib/buffers/Writer.js":function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.Writer=void 0;let n=r("../../node_modules/.bun/@jsonjoy.com+util@1.5.0+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/util/lib/buffers/Slice.js"),o=new DataView(new Uint8Array([]).buffer),i="function"==typeof Buffer,s=i?Buffer.prototype.utf8Write:null,a=i?Buffer.from:null,l="undefined"!=typeof TextEncoder?new TextEncoder:null;t.Writer=class{constructor(e=65536){this.allocSize=e,this.view=o,this.x0=0,this.x=0,this.uint8=new Uint8Array(e),this.size=e,this.view=new DataView(this.uint8.buffer)}grow(e){let t=this.x0,r=this.x,n=this.uint8,o=new Uint8Array(e),i=new DataView(o.buffer),s=n.subarray(t,r);o.set(s,0),this.x=r-t,this.x0=0,this.uint8=o,this.size=e,this.view=i}ensureCapacity(e){let t=this.size,r=t-this.x;if(r<e){let n=t-this.x0+(e-r);this.grow(n<=this.allocSize?this.allocSize:2*n)}}move(e){this.ensureCapacity(e),this.x+=e}reset(){this.x0=this.x}newBuffer(e){let t=this.uint8=new Uint8Array(e);this.size=e,this.view=new DataView(t.buffer),this.x=this.x0=0}flush(){let e=this.uint8.subarray(this.x0,this.x);return this.x0=this.x,e}flushSlice(){let e=new n.Slice(this.uint8,this.view,this.x0,this.x);return this.x0=this.x,e}u8(e){this.ensureCapacity(1),this.uint8[this.x++]=e}u16(e){this.ensureCapacity(2),this.view.setUint16(this.x,e),this.x+=2}u32(e){this.ensureCapacity(4),this.view.setUint32(this.x,e),this.x+=4}i32(e){this.ensureCapacity(4),this.view.setInt32(this.x,e),this.x+=4}u64(e){this.ensureCapacity(8),this.view.setBigUint64(this.x,BigInt(e)),this.x+=8}f64(e){this.ensureCapacity(8),this.view.setFloat64(this.x,e),this.x+=8}u8u16(e,t){this.ensureCapacity(3);let r=this.x;this.uint8[r++]=e,this.uint8[r++]=t>>>8,this.uint8[r++]=255&t,this.x=r}u8u32(e,t){this.ensureCapacity(5);let r=this.x;this.uint8[r++]=e,this.view.setUint32(r,t),this.x=r+4}u8u64(e,t){this.ensureCapacity(9);let r=this.x;this.uint8[r++]=e,this.view.setBigUint64(r,BigInt(t)),this.x=r+8}u8f32(e,t){this.ensureCapacity(5);let r=this.x;this.uint8[r++]=e,this.view.setFloat32(r,t),this.x=r+4}u8f64(e,t){this.ensureCapacity(9);let r=this.x;this.uint8[r++]=e,this.view.setFloat64(r,t),this.x=r+8}buf(e,t){this.ensureCapacity(t);let r=this.x;this.uint8.set(e,r),this.x=r+t}utf8(e){let t=4*e.length;if(t<168)return this.utf8Native(e);if(s){let r=s.call(this.uint8,e,this.x,t);return this.x+=r,r}if(a){let r=this.uint8,n=r.byteOffset+this.x,o=a(r.buffer).subarray(n,n+t).write(e,0,t,"utf8");return this.x+=o,o}if(t>1024&&l){let r=l.encodeInto(e,this.uint8.subarray(this.x,this.x+t)).written;return this.x+=r,r}return this.utf8Native(e)}utf8Native(e){let t=e.length,r=this.uint8,n=this.x,o=0;for(;o<t;){let i=e.charCodeAt(o++);if((0xffffff80&i)==0){r[n++]=i;continue}if((0xfffff800&i)==0)r[n++]=i>>6&31|192;else{if(i>=55296&&i<=56319&&o<t){let t=e.charCodeAt(o);(64512&t)==56320&&(o++,i=((1023&i)<<10)+(1023&t)+65536)}(0xffff0000&i)==0?r[n++]=i>>12&15|224:(r[n++]=i>>18&7|240,r[n++]=i>>12&63|128),r[n++]=i>>6&63|128}r[n++]=63&i|128}let i=n-this.x;return this.x=n,i}ascii(e){let t=e.length;this.ensureCapacity(t);let r=this.uint8,n=this.x,o=0;for(;o<t;)r[n++]=e.charCodeAt(o++);this.x=n}}},"../../node_modules/.bun/@jsonjoy.com+util@1.5.0+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/util/lib/buffers/f16.js":function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.decodeF16=void 0;let r=Math.pow;t.decodeF16=e=>{let t=(31744&e)>>10,n=1023&e;return(e>>15?-1:1)*(t?31===t?n?NaN:1/0:r(2,t-15)*(1+n/1024):n/1024*6103515625e-14)}},"../../node_modules/.bun/@jsonjoy.com+util@1.5.0+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/util/lib/buffers/isFloat32.js":function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.isFloat32=void 0;let r=new DataView(new ArrayBuffer(4));t.isFloat32=e=>(r.setFloat32(0,e),e===r.getFloat32(0))},"../../node_modules/.bun/@jsonjoy.com+util@1.5.0+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/util/lib/buffers/utf8/CachedUtf8Decoder.js":function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.CachedUtf8Decoder=void 0;let n=r("../../node_modules/.bun/tslib@2.8.1/node_modules/tslib/tslib.es6.mjs").__importDefault(r("../../node_modules/.bun/@jsonjoy.com+util@1.5.0+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/util/lib/buffers/utf8/decodeUtf8/v10.js")),o=1+Math.round(0xfffffffe*Math.random());class i{constructor(e,t){this.bytes=e,this.value=t}}t.CachedUtf8Decoder=class{constructor(){this.caches=[];for(let e=0;e<31;e++)this.caches.push([])}get(e,t,r){let n=this.caches[r-1],o=n.length;e:for(let i=0;i<o;i++){let o=n[i],s=o.bytes;for(let n=0;n<r;n++)if(s[n]!==e[t+n])continue e;return o.value}return null}store(e,t){let r=this.caches[e.length-1],n=new i(e,t);if(r.length>=16)r[o^=o<<13,o^=o>>>17,((o^=o<<5)>>>0)%16+0]=n;else r.push(n)}decode(e,t,r){if(!r)return"";let o=this.get(e,t,r);if(null!==o)return o;let i=(0,n.default)(e,t,r),s=Uint8Array.prototype.slice.call(e,t,t+r);return this.store(s,i),i}}},"../../node_modules/.bun/@jsonjoy.com+util@1.5.0+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/util/lib/buffers/utf8/decodeAscii.js":function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.decodeAsciiMax15=t.decodeAscii=void 0;let r=String.fromCharCode;t.decodeAscii=(e,t,n)=>{let o=[];for(let r=0;r<n;r++){let r=e[t++];if(128&r)return;o.push(r)}return r.apply(String,o)},t.decodeAsciiMax15=(e,t,n)=>{if(n<4)if(n<2)if(0===n)return"";else{let n=e[t++];if((128&n)>1){t-=1;return}return r(n)}else{let o=e[t++],i=e[t++];if((128&o)>0||(128&i)>0){t-=2;return}if(n<3)return r(o,i);let s=e[t++];if((128&s)>0){t-=3;return}return r(o,i,s)}{let o=e[t++],i=e[t++],s=e[t++],a=e[t++];if((128&o)>0||(128&i)>0||(128&s)>0||(128&a)>0){t-=4;return}if(n<6)if(4===n)return r(o,i,s,a);else{let n=e[t++];if((128&n)>0){t-=5;return}return r(o,i,s,a,n)}if(n<8){let l=e[t++],c=e[t++];if((128&l)>0||(128&c)>0){t-=6;return}if(n<7)return r(o,i,s,a,l,c);let u=e[t++];if((128&u)>0){t-=7;return}return r(o,i,s,a,l,c,u)}{let l=e[t++],c=e[t++],u=e[t++],d=e[t++];if((128&l)>0||(128&c)>0||(128&u)>0||(128&d)>0){t-=8;return}if(n<10)if(8===n)return r(o,i,s,a,l,c,u,d);else{let n=e[t++];if((128&n)>0){t-=9;return}return r(o,i,s,a,l,c,u,d,n)}if(n<12){let f=e[t++],h=e[t++];if((128&f)>0||(128&h)>0){t-=10;return}if(n<11)return r(o,i,s,a,l,c,u,d,f,h);let b=e[t++];if((128&b)>0){t-=11;return}return r(o,i,s,a,l,c,u,d,f,h,b)}{let f=e[t++],h=e[t++],b=e[t++],p=e[t++];if((128&f)>0||(128&h)>0||(128&b)>0||(128&p)>0){t-=12;return}if(n<14)if(12===n)return r(o,i,s,a,l,c,u,d,f,h,b,p);else{let n=e[t++];if((128&n)>0){t-=13;return}return r(o,i,s,a,l,c,u,d,f,h,b,p,n)}{let m=e[t++],w=e[t++];if((128&m)>0||(128&w)>0){t-=14;return}if(n<15)return r(o,i,s,a,l,c,u,d,f,h,b,p,m,w);let y=e[t++];if((128&y)>0){t-=15;return}return r(o,i,s,a,l,c,u,d,f,h,b,p,m,w,y)}}}}}},"../../node_modules/.bun/@jsonjoy.com+util@1.5.0+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/util/lib/buffers/utf8/decodeUtf8/index.js":function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.decodeUtf8=void 0,t.decodeUtf8=r("../../node_modules/.bun/tslib@2.8.1/node_modules/tslib/tslib.es6.mjs").__importDefault(r("../../node_modules/.bun/@jsonjoy.com+util@1.5.0+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/util/lib/buffers/utf8/decodeUtf8/v16.js")).default},"../../node_modules/.bun/@jsonjoy.com+util@1.5.0+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/util/lib/buffers/utf8/decodeUtf8/v10.js":function(e,t){Object.defineProperty(t,"__esModule",{value:!0});let r=String.fromCharCode;t.default=(e,t,n)=>{let o=t,i=o+n,s="";for(;o<i;){let t=e[o++];if((128&t)==0){s+=r(t);continue}let n=63&e[o++];if((224&t)==192){s+=r((31&t)<<6|n);continue}let i=63&e[o++];if((240&t)==224){s+=r((31&t)<<12|n<<6|i);continue}if((248&t)==240){let a=(7&t)<<18|n<<12|i<<6|63&e[o++];a>65535?s+=r((a-=65536)>>>10&1023|55296,a=56320|1023&a):s+=r(a)}else s+=r(t)}return s}},"../../node_modules/.bun/@jsonjoy.com+util@1.5.0+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/util/lib/buffers/utf8/decodeUtf8/v16.js":function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});let n=r("../../node_modules/.bun/tslib@2.8.1/node_modules/tslib/tslib.es6.mjs"),o=r("../../node_modules/.bun/@jsonjoy.com+util@1.5.0+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/util/lib/buffers/utf8/decodeAscii.js"),i=n.__importDefault(r("../../node_modules/.bun/@jsonjoy.com+util@1.5.0+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/util/lib/buffers/utf8/decodeUtf8/v18.js")),s="undefined"!=typeof Buffer,a=s?Buffer.prototype.utf8Slice:null,l=s?Buffer.from:null,c=(e,t,r)=>(0,o.decodeAsciiMax15)(e,t,r)??(0,i.default)(e,t,r),u=(e,t,r)=>(0,o.decodeAscii)(e,t,r)??(0,i.default)(e,t,r),d=a?(e,t,r)=>a.call(e,t,t+r):l?(e,t,r)=>l(e).subarray(t,t+r).toString("utf8"):i.default;t.default=(e,t,r)=>r<16?c(e,t,r):r<32?u(e,t,r):d(e,t,r)},"../../node_modules/.bun/@jsonjoy.com+util@1.5.0+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/util/lib/buffers/utf8/decodeUtf8/v18.js":function(e,t){Object.defineProperty(t,"__esModule",{value:!0});let r=String.fromCharCode;t.default=(e,t,n)=>{let o=t,i=o+n,s=[];for(;o<i;){let t=e[o++];if((128&t)!=0){let r=63&e[o++];if((224&t)==192)t=(31&t)<<6|r;else{let n=63&e[o++];if((240&t)==224)t=(31&t)<<12|r<<6|n;else if((248&t)==240){let i=(7&t)<<18|r<<12|n<<6|63&e[o++];if(i>65535){let e=(i-=65536)>>>10&1023|55296;t=56320|1023&i,s.push(e)}else t=i}}}s.push(t)}return r.apply(String,s)}},"../../node_modules/.bun/@jsonjoy.com+util@1.5.0+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/util/lib/buffers/utf8/sharedCachedUtf8Decoder.js":function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.default=new(r("../../node_modules/.bun/@jsonjoy.com+util@1.5.0+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/util/lib/buffers/utf8/CachedUtf8Decoder.js")).CachedUtf8Decoder},"../../node_modules/.bun/@jsonjoy.com+util@1.5.0+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/util/lib/objKeyCmp.js":function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.objKeyCmp=void 0,t.objKeyCmp=(e,t)=>{let r=e.length,n=t.length;return r===n?e>t?1:-1:r-n}},"../../node_modules/.bun/@jsonjoy.com+util@1.5.0+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/util/lib/sort/insertion2.js":function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.sort=void 0,t.sort=(e,t)=>{let r=e.length;for(let n=1;n<r;n++){let r=e[n],o=n;for(;0!==o&&t(e[o-1],r)>0;)e[o]=e[o-1],o--;e[o]=r}return e}},"../../packages/rpc/dist/index.js":function(e,t,r){r.d(t,{BH:()=>s,Cz:()=>u,i0:()=>a,j4:()=>d,ss:()=>o,u:()=>i});var n=r("../../node_modules/.bun/@jsonjoy.com+json-pack@1.2.0+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/json-pack/lib/cbor/index.js");let o={parseError:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internalError:-32603,serverError:-32e3,clientNotConnected:-32001,configError:-32002,corruptedResponse:-32003,clientAborted:-32004,walletNotConnected:-32005,serverErrorForInteractionDelegation:-32006,userRejected:-32007};class i extends Error{code;data;constructor(e,t,r){super(t),this.code=e,this.data=r}toJSON(){return{code:this.code,message:this.message,data:this.data}}}class s{_promise;_resolve;_reject;constructor(){this._promise=new Promise((e,t)=>{this._resolve=e,this._reject=t})}get promise(){return this._promise}resolve=e=>{this._resolve?.(e)};reject=e=>{this._reject?.(e)}}function a(e){let{emittingTransport:t,listeningTransport:r,targetOrigin:n,middleware:o=[],lifecycleHandlers:a}=e,l=new Map;async function c(e){try{"clientLifecycle"in e&&a?.clientLifecycle?await a.clientLifecycle(e,{origin:n,source:null}):"iframeLifecycle"in e&&a?.iframeLifecycle&&await a.iframeLifecycle(e,{origin:n,source:null})}catch(e){console.error("[RPC Client] Lifecycle handler error:",e)}}async function u(e){let t={origin:n,source:null};for(let r of o)r.onRequest&&await r.onRequest(e,t);return e}async function d(e,t){let r={origin:n,source:null},i=t;for(let t of o)t.onResponse&&(i=await t.onResponse(e,i,r));return i}async function f(e){var t,r;let o;try{let t=new URL(e.origin).origin.toLowerCase(),r=new URL(n).origin.toLowerCase();if(t!==r)return void console.log("Not expected origin",t,r)}catch(e){console.error("[RPC Client] Invalid origin",e);return}if("object"==typeof(t=e.data)&&t&&("clientLifecycle"in t||"iframeLifecycle"in t))return void await c(e.data);if(!("object"==typeof(r=e.data)&&r&&"id"in r&&"topic"in r&&"data"in r))return;try{let t=e.data.data,r=t instanceof Uint8Array||ArrayBuffer.isView(t);o=await d(e.data,r?{result:t}:t)}catch(e){console.error("[RPC Client] Middleware error on response:",e);return}let i=l.get(e.data.id);i&&i(o)}async function h(e){let r=e;try{r=await u(e)}catch(e){throw console.error("[RPC Client] Middleware error on request:",e),e}t.postMessage(r,n)}function b(){return`${Date.now()}-${Math.random().toString(36).substring(2,9)}`}return r.addEventListener("message",f),{request:function(e){let t=b(),r=new s;return l.set(t,e=>{e.error?r.reject(new i(e.error.code,e.error.message,e.error.data)):r.resolve(e.result),l.delete(t)}),h({id:t,topic:e.method,data:{method:e.method,params:e.params}}).catch(e=>{l.delete(t),r.reject(e)}),r.promise},listen:function(e,t){let r=b();return l.set(r,e=>{e.error?(console.error("[RPC Client] Listener error:",e.error),l.delete(r)):t(e.result)}),h({id:r,topic:e.method,data:{method:e.method,params:e.params}}).catch(e=>{console.error("[RPC Client] Failed to send listener request:",e),l.delete(r)}),()=>{l.delete(r)}},sendLifecycle:function(e){t.postMessage(e,n)},cleanup:function(){r.removeEventListener("message",f),l.clear()}}}let l=new n.CborEncoder,c=new n.CborDecoder;function u(e){return l.encode(e)}function d(e){try{return c.decode(e)}catch(t){return console.error("Invalid compressed data",{e:t,data:e}),null}}},"../../packages/rpc/dist/middleware.js":function(e,t,r){r.d(t,{I:()=>v});var n=r("../../node_modules/.bun/@jsonjoy.com+json-pack@1.2.0+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/json-pack/lib/cbor/index.js"),o=r("../../node_modules/.bun/@noble+hashes@1.8.0/node_modules/@noble/hashes/esm/utils.js");class i extends o.kb{constructor(e,t,r,n){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=e,this.outputLen=t,this.padOffset=r,this.isLE=n,this.buffer=new Uint8Array(e),this.view=(0,o.GL)(this.buffer)}update(e){(0,o.$h)(this),e=(0,o.O0)(e),(0,o.gk)(e);let{view:t,buffer:r,blockLen:n}=this,i=e.length;for(let s=0;s<i;){let a=Math.min(n-this.pos,i-s);if(a===n){let t=(0,o.GL)(e);for(;n<=i-s;s+=n)this.process(t,s);continue}r.set(e.subarray(s,s+a),this.pos),this.pos+=a,s+=a,this.pos===n&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){(0,o.$h)(this),(0,o.eB)(e,this),this.finished=!0;let{buffer:t,view:r,blockLen:n,isLE:i}=this,{pos:s}=this;t[s++]=128,(0,o.ru)(this.buffer.subarray(s)),this.padOffset>n-s&&(this.process(r,0),s=0);for(let e=s;e<n;e++)t[e]=0;!function(e,t,r,n){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,r,n);let o=BigInt(32),i=BigInt(0xffffffff),s=Number(r>>o&i),a=Number(r&i),l=4*!!n,c=4*!n;e.setUint32(t+l,s,n),e.setUint32(t+c,a,n)}(r,n-8,BigInt(8*this.length),i),this.process(r,0);let a=(0,o.GL)(e),l=this.outputLen;if(l%4)throw Error("_sha2: outputLen should be aligned to 32bit");let c=l/4,u=this.get();if(c>u.length)throw Error("_sha2: outputLen bigger than state");for(let e=0;e<c;e++)a.setUint32(4*e,u[e],i)}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());let{blockLen:t,buffer:r,length:n,finished:o,destroyed:i,pos:s}=this;return e.destroyed=i,e.finished=o,e.length=n,e.pos=s,n%t&&e.buffer.set(r),e}clone(){return this._cloneInto()}}let s=Uint32Array.from([0x6a09e667,0xbb67ae85,0x3c6ef372,0xa54ff53a,0x510e527f,0x9b05688c,0x1f83d9ab,0x5be0cd19]);var a=r("../../node_modules/.bun/@noble+hashes@1.8.0/node_modules/@noble/hashes/esm/_u64.js");let l=Uint32Array.from([0x428a2f98,0x71374491,0xb5c0fbcf,0xe9b5dba5,0x3956c25b,0x59f111f1,0x923f82a4,0xab1c5ed5,0xd807aa98,0x12835b01,0x243185be,0x550c7dc3,0x72be5d74,0x80deb1fe,0x9bdc06a7,0xc19bf174,0xe49b69c1,0xefbe4786,0xfc19dc6,0x240ca1cc,0x2de92c6f,0x4a7484aa,0x5cb0a9dc,0x76f988da,0x983e5152,0xa831c66d,0xb00327c8,0xbf597fc7,0xc6e00bf3,0xd5a79147,0x6ca6351,0x14292967,0x27b70a85,0x2e1b2138,0x4d2c6dfc,0x53380d13,0x650a7354,0x766a0abb,0x81c2c92e,0x92722c85,0xa2bfe8a1,0xa81a664b,0xc24b8b70,0xc76c51a3,0xd192e819,0xd6990624,0xf40e3585,0x106aa070,0x19a4c116,0x1e376c08,0x2748774c,0x34b0bcb5,0x391c0cb3,0x4ed8aa4a,0x5b9cca4f,0x682e6ff3,0x748f82ee,0x78a5636f,0x84c87814,0x8cc70208,0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2]),c=new Uint32Array(64);class u extends i{constructor(e=32){super(64,e,8,!1),this.A=0|s["0"],this.B=0|s["1"],this.C=0|s["2"],this.D=0|s["3"],this.E=0|s["4"],this.F=0|s["5"],this.G=0|s["6"],this.H=0|s["7"]}get(){let{A:e,B:t,C:r,D:n,E:o,F:i,G:s,H:a}=this;return[e,t,r,n,o,i,s,a]}set(e,t,r,n,o,i,s,a){this.A=0|e,this.B=0|t,this.C=0|r,this.D=0|n,this.E=0|o,this.F=0|i,this.G=0|s,this.H=0|a}process(e,t){for(let r=0;r<16;r++,t+=4)c[r]=e.getUint32(t,!1);for(let e=16;e<64;e++){let t=c[e-15],r=c[e-2],n=(0,o.np)(t,7)^(0,o.np)(t,18)^t>>>3,i=(0,o.np)(r,17)^(0,o.np)(r,19)^r>>>10;c[e]=i+c[e-7]+n+c[e-16]|0}let{A:r,B:n,C:i,D:s,E:a,F:u,G:d,H:f}=this;for(let e=0;e<64;e++){var h,b,p,m;let t=f+((0,o.np)(a,6)^(0,o.np)(a,11)^(0,o.np)(a,25))+((h=a)&u^~h&d)+l[e]+c[e]|0,w=((0,o.np)(r,2)^(0,o.np)(r,13)^(0,o.np)(r,22))+((b=r)&(p=n)^b&(m=i)^p&m)|0;f=d,d=u,u=a,a=s+t|0,s=i,i=n,n=r,r=t+w|0}r=r+this.A|0,n=n+this.B|0,i=i+this.C|0,s=s+this.D|0,a=a+this.E|0,u=u+this.F|0,d=d+this.G|0,f=f+this.H|0,this.set(r,n,i,s,a,u,d,f)}roundClean(){(0,o.ru)(c)}destroy(){this.set(0,0,0,0,0,0,0,0),(0,o.ru)(this.buffer)}}a.Vl(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(e=>BigInt(e)));let d=(0,o.V1)(()=>new u);var f=r("../../node_modules/.bun/viem@2.31.2+5bbfac422febb175/node_modules/viem/_esm/utils/data/isHex.js"),h=r("../../node_modules/.bun/viem@2.31.2+5bbfac422febb175/node_modules/viem/_esm/utils/encoding/toBytes.js"),b=r("../../node_modules/.bun/viem@2.31.2+5bbfac422febb175/node_modules/viem/_esm/utils/encoding/toHex.js");let p={corruptedResponse:-32003};class m extends Error{code;data;constructor(e,t,r){super(t),this.code=e,this.data=r}toJSON(){return{code:this.code,message:this.message,data:this.data}}}let w=new n.CborEncoder,y=new n.CborDecoder;function g(e){return function(e,t){let r=d((0,f.v)(e,{strict:!1})?(0,h.O0)(e):e);return(0,b.NC)(r)}(w.encode(e))}let v=()=>({onRequest:(e,t)=>{if(e.data instanceof Uint8Array||ArrayBuffer.isView(e.data))return t;try{var r;let t;t={...r=e.data,validationHash:g(r??{})},e.data=w.encode(t)}catch(e){console.error("[Compression Middleware] Failed to compress request",e)}return t},onResponse:(e,t,r)=>{if(t.error||!(t.result instanceof Uint8Array||ArrayBuffer.isView(t.result)))return t;try{let{validationHash:e,...r}=function(e){if(!e.length)throw new m(p.corruptedResponse,"Missing compressed data");let t=function(e){try{return y.decode(e)}catch(t){return console.error("Invalid compressed data",{e:t,data:e}),null}}(e);if(!t)throw new m(p.corruptedResponse,"Invalid compressed data");if(!t?.validationHash)throw new m(p.corruptedResponse,"Missing validation hash");let{validationHash:r,...n}=t,o=g(n);if(o!==t.validationHash)throw console.warn("Validation error",{validationHash:r,rawResultData:n,parsedData:t,expectedValidationHashes:o,recomputedHash:g(void 0)}),new m(p.corruptedResponse,"Invalid validation hash");return t}(t.result);"object"==typeof r&&null!==r&&"result"in r?t.result=r.result:t.result=r}catch(e){console.error("[Compression Middleware] Failed to decompress response",e)}return t}})},"../../packages/ui/utils/onDocumentReady.ts":function(e,t,r){r.d(t,{E:()=>n});function n(e){"complete"===document.readyState||"interactive"===document.readyState?setTimeout(e,1):document.addEventListener?document.addEventListener("DOMContentLoaded",e):document.attachEvent("onreadystatechange",()=>{"complete"===document.readyState&&e()})}},"./src/components/ButtonWallet/utils.ts":function(e,t,r){r.d(t,{G:()=>o});var n=r("../core/dist/actions.js");function o(){if(!window.FrakSetup?.client)return void console.error("Frak client not found");"vibrate"in navigator?navigator.vibrate(10):console.log("Vibration not supported"),(0,n.s9)(window.FrakSetup.client,window.FrakSetup?.modalWalletConfig??{})}},"./src/utils/clientReady.ts":function(e,t,r){r.d(t,{D:()=>i,f:()=>o});let n="frakClientReady";function o(){let e=new CustomEvent(n);window.dispatchEvent(e)}function i(e,t){if(window.FrakSetup?.client&&"add"===e)return void t();("add"===e?window.addEventListener:window.removeEventListener)(n,t,!1)}},"./src/utils/initFrakSdk.ts":function(e,t,r){let n;r.d(t,{m:()=>eD});var o={};r.r(o),r.d(o,{DebugInfoGatherer:()=>R,FrakContextManager:()=>ee,PressInteractionEncoder:()=>eA,PurchaseInteractionEncoder:()=>eO,ReferralInteractionEncoder:()=>ek,RetailInteractionEncoder:()=>eL,WebShopInteractionEncoder:()=>eP,base64urlDecode:()=>V,base64urlEncode:()=>H,baseIframeProps:()=>F,compressJsonToB64:()=>G,createIFrameFrakClient:()=>B,createIframe:()=>D,decompressJsonFromB64:()=>W,displayEmbeddedWallet:()=>ew,displayModal:()=>em,findIframeInOpener:()=>M,formatAmount:()=>en,generateSsoUrl:()=>ei,getCurrencyAmountKey:()=>er,getProductInformation:()=>eg,getSupportedCurrency:()=>z,getSupportedLocale:()=>et,interactionTypes:()=>el,locales:()=>T,modalBuilder:()=>ex,openSso:()=>ef,prepareSso:()=>ey,processReferral:()=>eS,productTypes:()=>es,productTypesMask:()=>ea,referralInteraction:()=>eE,sendInteraction:()=>ep,sendTransaction:()=>e_,setupClient:()=>q,siweAuthenticate:()=>ej,ssoPopupFeatures:()=>eu,ssoPopupName:()=>ed,trackEvent:()=>eo,trackPurchaseStatus:()=>ev,watchWalletStatus:()=>eh});var i=r("../core/dist/index.js"),s=r("../../packages/rpc/dist/index.js"),a=r("../../packages/rpc/dist/middleware.js"),l=r("../../node_modules/.bun/@openpanel+web@1.0.1/node_modules/@openpanel/web/dist/index.js"),c=r("../../node_modules/.bun/viem@2.31.2+5bbfac422febb175/node_modules/viem/_esm/utils/encoding/toBytes.js"),u=r("../../node_modules/.bun/viem@2.31.2+5bbfac422febb175/node_modules/viem/_esm/utils/encoding/toHex.js"),d=r("../../node_modules/.bun/viem@2.31.2+5bbfac422febb175/node_modules/viem/_esm/utils/hash/keccak256.js"),f=r("../../node_modules/.bun/viem@2.31.2+5bbfac422febb175/node_modules/viem/_esm/utils/data/concat.js"),h=r("../../node_modules/.bun/viem@2.31.2+5bbfac422febb175/node_modules/viem/_esm/utils/data/pad.js"),b=r("../../node_modules/.bun/viem@2.31.2+5bbfac422febb175/node_modules/viem/_esm/utils/address/isAddressEqual.js"),p=r("../../node_modules/.bun/viem@2.31.2+5bbfac422febb175/node_modules/viem/_esm/utils/data/size.js"),m=r("../../node_modules/.bun/viem@2.31.2+5bbfac422febb175/node_modules/viem/_esm/errors/base.js");m.G,m.G,m.G,m.G,m.G;class w extends m.G{constructor({expectedLength:e,givenLength:t,type:r}){super(`ABI encoding array length mismatch for type ${r}.
2
+ var e,t,r,n={"../../node_modules/.bun/@jsonjoy.com+buffers@1.2.1+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/buffers/lib/Reader.js":function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.Reader=void 0;let n=r("../../node_modules/.bun/@jsonjoy.com+buffers@1.2.1+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/buffers/lib/utf8/decodeUtf8/index.js");class o{constructor(e=new Uint8Array([]),t=new DataView(e.buffer,e.byteOffset,e.length),r=0,n=e.length){this.uint8=e,this.view=t,this.x=r,this.end=n}reset(e){this.x=0,this.uint8=e,this.view=new DataView(e.buffer,e.byteOffset,e.length)}size(){return this.end-this.x}peek(){return this.view.getUint8(this.x)}peak(){return this.peek()}skip(e){this.x+=e}buf(e=this.size()){let t=this.x,r=t+e,n=this.uint8.subarray(t,r);return this.x=r,n}subarray(e=0,t){let r=this.x,n="number"==typeof t?r+t:this.end;return this.uint8.subarray(r+e,n)}slice(e=0,t){let r=this.x,n="number"==typeof t?r+t:this.end;return new o(this.uint8,this.view,r+e,n)}cut(e=this.size()){let t=this.slice(0,e);return this.skip(e),t}u8(){return this.uint8[this.x++]}i8(){return this.view.getInt8(this.x++)}u16(){let e=this.x,t=(this.uint8[e++]<<8)+this.uint8[e++];return this.x=e,t}i16(){let e=this.view.getInt16(this.x);return this.x+=2,e}u32(){let e=this.view.getUint32(this.x);return this.x+=4,e}i32(){let e=this.view.getInt32(this.x);return this.x+=4,e}u64(){let e=this.view.getBigUint64(this.x);return this.x+=8,e}i64(){let e=this.view.getBigInt64(this.x);return this.x+=8,e}f32(){let e=this.x;return this.x+=4,this.view.getFloat32(e)}f64(){let e=this.x;return this.x+=8,this.view.getFloat64(e)}utf8(e){let t=this.x;return this.x+=e,(0,n.decodeUtf8)(this.uint8,t,e)}ascii(e){let t=this.uint8,r="",n=this.x+e;for(let e=this.x;e<n;e++)r+=String.fromCharCode(t[e]);return this.x=n,r}}t.Reader=o},"../../node_modules/.bun/@jsonjoy.com+buffers@1.2.1+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/buffers/lib/Slice.js":function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Slice=void 0,t.Slice=class{constructor(e,t,r,n){this.uint8=e,this.view=t,this.start=r,this.end=n}subarray(){return this.uint8.subarray(this.start,this.end)}}},"../../node_modules/.bun/@jsonjoy.com+buffers@1.2.1+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/buffers/lib/Writer.js":function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.Writer=void 0;let n=r("../../node_modules/.bun/@jsonjoy.com+buffers@1.2.1+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/buffers/lib/Slice.js"),o=new DataView(new Uint8Array([]).buffer),i="function"==typeof Buffer,s=i?Buffer.prototype.utf8Write:null,a=i?Buffer.from:null,c="undefined"!=typeof TextEncoder?new TextEncoder:null;t.Writer=class{constructor(e=65536){this.allocSize=e,this.view=o,this.x0=0,this.x=0,this.uint8=new Uint8Array(e),this.size=e,this.view=new DataView(this.uint8.buffer)}grow(e){let t=this.x0,r=this.x,n=this.uint8,o=new Uint8Array(e),i=new DataView(o.buffer),s=n.subarray(t,r);o.set(s,0),this.x=r-t,this.x0=0,this.uint8=o,this.size=e,this.view=i}ensureCapacity(e){let t=this.size,r=t-this.x;if(r<e){let n=t-this.x0+(e-r);this.grow(n<=this.allocSize?this.allocSize:2*n)}}move(e){this.ensureCapacity(e),this.x+=e}reset(){this.x0=this.x}newBuffer(e){let t=this.uint8=new Uint8Array(e);this.size=e,this.view=new DataView(t.buffer),this.x=this.x0=0}flush(){let e=this.uint8.subarray(this.x0,this.x);return this.x0=this.x,e}flushSlice(){let e=new n.Slice(this.uint8,this.view,this.x0,this.x);return this.x0=this.x,e}u8(e){this.ensureCapacity(1),this.uint8[this.x++]=e}u16(e){this.ensureCapacity(2),this.view.setUint16(this.x,e),this.x+=2}u32(e){this.ensureCapacity(4),this.view.setUint32(this.x,e),this.x+=4}i32(e){this.ensureCapacity(4),this.view.setInt32(this.x,e),this.x+=4}u64(e){this.ensureCapacity(8),this.view.setBigUint64(this.x,BigInt(e)),this.x+=8}f64(e){this.ensureCapacity(8),this.view.setFloat64(this.x,e),this.x+=8}u8u16(e,t){this.ensureCapacity(3);let r=this.x;this.uint8[r++]=e,this.uint8[r++]=t>>>8,this.uint8[r++]=255&t,this.x=r}u8u32(e,t){this.ensureCapacity(5);let r=this.x;this.uint8[r++]=e,this.view.setUint32(r,t),this.x=r+4}u8u64(e,t){this.ensureCapacity(9);let r=this.x;this.uint8[r++]=e,this.view.setBigUint64(r,BigInt(t)),this.x=r+8}u8f32(e,t){this.ensureCapacity(5);let r=this.x;this.uint8[r++]=e,this.view.setFloat32(r,t),this.x=r+4}u8f64(e,t){this.ensureCapacity(9);let r=this.x;this.uint8[r++]=e,this.view.setFloat64(r,t),this.x=r+8}buf(e,t){this.ensureCapacity(t);let r=this.x;this.uint8.set(e,r),this.x=r+t}utf8(e){let t=4*e.length;if(t<168)return this.utf8Native(e);if(s){let r=s.call(this.uint8,e,this.x,t);return this.x+=r,r}if(a){let r=this.uint8,n=r.byteOffset+this.x,o=a(r.buffer).subarray(n,n+t).write(e,0,t,"utf8");return this.x+=o,o}if(t>1024&&c){let r=c.encodeInto(e,this.uint8.subarray(this.x,this.x+t)).written;return this.x+=r,r}return this.utf8Native(e)}utf8Native(e){let t=e.length,r=this.uint8,n=this.x,o=0;for(;o<t;){let i=e.charCodeAt(o++);if((0xffffff80&i)==0){r[n++]=i;continue}if((0xfffff800&i)==0)r[n++]=i>>6&31|192;else{if(i>=55296&&i<=56319&&o<t){let t=e.charCodeAt(o);(64512&t)==56320&&(o++,i=((1023&i)<<10)+(1023&t)+65536)}(0xffff0000&i)==0?r[n++]=i>>12&15|224:(r[n++]=i>>18&7|240,r[n++]=i>>12&63|128),r[n++]=i>>6&63|128}r[n++]=63&i|128}let i=n-this.x;return this.x=n,i}ascii(e){let t=e.length;this.ensureCapacity(t);let r=this.uint8,n=this.x,o=0;for(;o<t;)r[n++]=e.charCodeAt(o++);this.x=n}}},"../../node_modules/.bun/@jsonjoy.com+buffers@1.2.1+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/buffers/lib/f16.js":function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.decodeF16=void 0;let r=Math.pow;t.decodeF16=e=>{let t=(31744&e)>>10,n=1023&e;return(e>>15?-1:1)*(t?31===t?n?NaN:1/0:r(2,t-15)*(1+n/1024):n/1024*6103515625e-14)}},"../../node_modules/.bun/@jsonjoy.com+buffers@1.2.1+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/buffers/lib/isFloat32.js":function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.isFloat32=void 0;let r=new DataView(new ArrayBuffer(4));t.isFloat32=e=>(r.setFloat32(0,e),e===r.getFloat32(0))},"../../node_modules/.bun/@jsonjoy.com+buffers@1.2.1+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/buffers/lib/utf8/CachedUtf8Decoder.js":function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.CachedUtf8Decoder=void 0;let n=r("../../node_modules/.bun/tslib@2.8.1/node_modules/tslib/tslib.es6.mjs").__importDefault(r("../../node_modules/.bun/@jsonjoy.com+buffers@1.2.1+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/buffers/lib/utf8/decodeUtf8/v10.js")),o=1+Math.round(0xfffffffe*Math.random());class i{constructor(e,t){this.bytes=e,this.value=t}}t.CachedUtf8Decoder=class{constructor(){this.caches=[];for(let e=0;e<31;e++)this.caches.push([])}get(e,t,r){let n=this.caches[r-1],o=n.length;e:for(let i=0;i<o;i++){let o=n[i],s=o.bytes;for(let n=0;n<r;n++)if(s[n]!==e[t+n])continue e;return o.value}return null}store(e,t){let r=this.caches[e.length-1],n=new i(e,t);if(r.length>=16)r[o^=o<<13,o^=o>>>17,((o^=o<<5)>>>0)%16+0]=n;else r.push(n)}decode(e,t,r){if(!r)return"";let o=this.get(e,t,r);if(null!==o)return o;let i=(0,n.default)(e,t,r),s=Uint8Array.prototype.slice.call(e,t,t+r);return this.store(s,i),i}}},"../../node_modules/.bun/@jsonjoy.com+buffers@1.2.1+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/buffers/lib/utf8/decodeAscii.js":function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.decodeAsciiMax15=t.decodeAscii=void 0;let r=String.fromCharCode;t.decodeAscii=(e,t,n)=>{let o=[];for(let r=0;r<n;r++){let r=e[t++];if(128&r)return;o.push(r)}return r.apply(String,o)},t.decodeAsciiMax15=(e,t,n)=>{if(n<4)if(n<2)if(0===n)return"";else{let n=e[t++];if((128&n)>1){t-=1;return}return r(n)}else{let o=e[t++],i=e[t++];if((128&o)>0||(128&i)>0){t-=2;return}if(n<3)return r(o,i);let s=e[t++];if((128&s)>0){t-=3;return}return r(o,i,s)}{let o=e[t++],i=e[t++],s=e[t++],a=e[t++];if((128&o)>0||(128&i)>0||(128&s)>0||(128&a)>0){t-=4;return}if(n<6)if(4===n)return r(o,i,s,a);else{let n=e[t++];if((128&n)>0){t-=5;return}return r(o,i,s,a,n)}if(n<8){let c=e[t++],l=e[t++];if((128&c)>0||(128&l)>0){t-=6;return}if(n<7)return r(o,i,s,a,c,l);let u=e[t++];if((128&u)>0){t-=7;return}return r(o,i,s,a,c,l,u)}{let c=e[t++],l=e[t++],u=e[t++],d=e[t++];if((128&c)>0||(128&l)>0||(128&u)>0||(128&d)>0){t-=8;return}if(n<10)if(8===n)return r(o,i,s,a,c,l,u,d);else{let n=e[t++];if((128&n)>0){t-=9;return}return r(o,i,s,a,c,l,u,d,n)}if(n<12){let f=e[t++],h=e[t++];if((128&f)>0||(128&h)>0){t-=10;return}if(n<11)return r(o,i,s,a,c,l,u,d,f,h);let b=e[t++];if((128&b)>0){t-=11;return}return r(o,i,s,a,c,l,u,d,f,h,b)}{let f=e[t++],h=e[t++],b=e[t++],p=e[t++];if((128&f)>0||(128&h)>0||(128&b)>0||(128&p)>0){t-=12;return}if(n<14)if(12===n)return r(o,i,s,a,c,l,u,d,f,h,b,p);else{let n=e[t++];if((128&n)>0){t-=13;return}return r(o,i,s,a,c,l,u,d,f,h,b,p,n)}{let m=e[t++],w=e[t++];if((128&m)>0||(128&w)>0){t-=14;return}if(n<15)return r(o,i,s,a,c,l,u,d,f,h,b,p,m,w);let y=e[t++];if((128&y)>0){t-=15;return}return r(o,i,s,a,c,l,u,d,f,h,b,p,m,w,y)}}}}}},"../../node_modules/.bun/@jsonjoy.com+buffers@1.2.1+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/buffers/lib/utf8/decodeUtf8/index.js":function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.decodeUtf8=void 0,t.decodeUtf8=r("../../node_modules/.bun/tslib@2.8.1/node_modules/tslib/tslib.es6.mjs").__importDefault(r("../../node_modules/.bun/@jsonjoy.com+buffers@1.2.1+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/buffers/lib/utf8/decodeUtf8/v16.js")).default},"../../node_modules/.bun/@jsonjoy.com+buffers@1.2.1+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/buffers/lib/utf8/decodeUtf8/v10.js":function(e,t){Object.defineProperty(t,"__esModule",{value:!0});let r=String.fromCharCode;t.default=(e,t,n)=>{let o=t,i=o+n,s="";for(;o<i;){let t=e[o++];if((128&t)==0){s+=r(t);continue}let n=63&e[o++];if((224&t)==192){s+=r((31&t)<<6|n);continue}let i=63&e[o++];if((240&t)==224){s+=r((31&t)<<12|n<<6|i);continue}if((248&t)==240){let a=(7&t)<<18|n<<12|i<<6|63&e[o++];a>65535?s+=r((a-=65536)>>>10&1023|55296,a=56320|1023&a):s+=r(a)}else s+=r(t)}return s}},"../../node_modules/.bun/@jsonjoy.com+buffers@1.2.1+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/buffers/lib/utf8/decodeUtf8/v16.js":function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});let n=r("../../node_modules/.bun/tslib@2.8.1/node_modules/tslib/tslib.es6.mjs"),o=r("../../node_modules/.bun/@jsonjoy.com+buffers@1.2.1+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/buffers/lib/utf8/decodeAscii.js"),i=n.__importDefault(r("../../node_modules/.bun/@jsonjoy.com+buffers@1.2.1+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/buffers/lib/utf8/decodeUtf8/v18.js")),s="undefined"!=typeof Buffer,a=s?Buffer.prototype.utf8Slice:null,c=s?Buffer.from:null,l=a?(e,t,r)=>a.call(e,t,t+r):c?(e,t,r)=>c(e).subarray(t,t+r).toString("utf8"):i.default;t.default=(e,t,r)=>{if(r<16)return(0,o.decodeAsciiMax15)(e,t,r)??(0,i.default)(e,t,r);if(r<32)return(0,o.decodeAscii)(e,t,r)??(0,i.default)(e,t,r);return l(e,t,r)}},"../../node_modules/.bun/@jsonjoy.com+buffers@1.2.1+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/buffers/lib/utf8/decodeUtf8/v18.js":function(e,t){Object.defineProperty(t,"__esModule",{value:!0});let r=String.fromCharCode;t.default=(e,t,n)=>{let o=t,i=o+n,s=[];for(;o<i;){let t=e[o++];if((128&t)!=0){let r=63&e[o++];if((224&t)==192)t=(31&t)<<6|r;else{let n=63&e[o++];if((240&t)==224)t=(31&t)<<12|r<<6|n;else if((248&t)==240){let i=(7&t)<<18|r<<12|n<<6|63&e[o++];if(i>65535){let e=(i-=65536)>>>10&1023|55296;t=56320|1023&i,s.push(e)}else t=i}}}s.push(t)}return r.apply(String,s)}},"../../node_modules/.bun/@jsonjoy.com+buffers@1.2.1+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/buffers/lib/utf8/sharedCachedUtf8Decoder.js":function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.default=new(r("../../node_modules/.bun/@jsonjoy.com+buffers@1.2.1+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/buffers/lib/utf8/CachedUtf8Decoder.js")).CachedUtf8Decoder},"../../node_modules/.bun/@jsonjoy.com+json-pack@1.21.0+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/json-pack/lib/JsonPackExtension.js":function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.JsonPackExtension=void 0,t.JsonPackExtension=class{constructor(e,t){this.tag=e,this.val=t}}},"../../node_modules/.bun/@jsonjoy.com+json-pack@1.21.0+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/json-pack/lib/JsonPackValue.js":function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.JsonPackValue=void 0,t.JsonPackValue=class{constructor(e){this.val=e}}},"../../node_modules/.bun/@jsonjoy.com+json-pack@1.21.0+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/json-pack/lib/cbor/CborDecoder.js":function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.CborDecoder=void 0;let n=r("../../node_modules/.bun/@jsonjoy.com+json-pack@1.21.0+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/json-pack/lib/cbor/CborDecoderBase.js"),o=r("../../node_modules/.bun/@jsonjoy.com+json-pack@1.21.0+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/json-pack/lib/JsonPackValue.js");class i extends n.CborDecoderBase{readAsMap(){let e=this.reader.u8();if(e>>5==5)return this.readMap(31&e);throw 0}readMap(e){let t=this.readMinorLen(e);return t>=0?this.readMapRaw(t):this.readMapIndef()}readMapRaw(e){let t=new Map;for(let r=0;r<e;r++){let e=this.readAny(),r=this.readAny();t.set(e,r)}return t}readMapIndef(){let e=new Map;for(;255!==this.reader.peak();){let t=this.readAny();if(255===this.reader.peak())throw 7;let r=this.readAny();e.set(t,r)}return this.reader.x++,e}skipN(e){for(let t=0;t<e;t++)this.skipAny()}skipAny(){this.skipAnyRaw(this.reader.u8())}skipAnyRaw(e){let t=31&e;switch(e>>5){case 0:case 1:this.skipUNint(t);break;case 2:this.skipBin(t);break;case 3:this.skipStr(t);break;case 4:this.skipArr(t);break;case 5:this.skipObj(t);break;case 7:this.skipTkn(t);break;case 6:this.skipTag(t)}}skipMinorLen(e){if(e<=23)return e;switch(e){case 24:return this.reader.u8();case 25:return this.reader.u16();case 26:return this.reader.u32();case 27:return Number(this.reader.u64());case 31:return -1;default:throw 1}}skipUNint(e){if(!(e<=23))switch(e){case 24:return this.reader.skip(1);case 25:return this.reader.skip(2);case 26:return this.reader.skip(4);case 27:return this.reader.skip(8);default:throw 1}}skipBin(e){let t=this.skipMinorLen(e);if(t>=0)this.reader.skip(t);else{for(;255!==this.reader.peak();)this.skipBinChunk();this.reader.x++}}skipBinChunk(){let e=this.reader.u8(),t=31&e;if(2!=e>>5)throw 2;if(t>27)throw 3;this.skipBin(t)}skipStr(e){let t=this.skipMinorLen(e);if(t>=0)this.reader.skip(t);else{for(;255!==this.reader.peak();)this.skipStrChunk();this.reader.x++}}skipStrChunk(){let e=this.reader.u8(),t=31&e;if(3!=e>>5)throw 4;if(t>27)throw 5;this.skipStr(t)}skipArr(e){let t=this.skipMinorLen(e);if(t>=0)this.skipN(t);else{for(;255!==this.reader.peak();)this.skipAny();this.reader.x++}}skipObj(e){let t=this.readMinorLen(e);if(t>=0)return this.skipN(2*t);for(;255!==this.reader.peak();){if(this.skipAny(),255===this.reader.peak())throw 7;this.skipAny()}this.reader.x++}skipTag(e){if(0>this.skipMinorLen(e))throw 1;this.skipAny()}skipTkn(e){switch(e){case 24:this.reader.skip(1);return;case 25:this.reader.skip(2);return;case 26:this.reader.skip(4);return;case 27:this.reader.skip(8);return}if(!(e<=23))throw 1}validate(e,t=0,r=e.length){if(this.reader.reset(e),this.reader.x=t,this.skipAny(),this.reader.x-t!==r)throw 8}decodeLevel(e){return this.reader.reset(e),this.readLevel()}readLevel(){let e=this.reader.u8(),t=e>>5,r=31&e;switch(t){case 4:return this.readArrLevel(r);case 5:return this.readObjLevel(r);default:return super.readAnyRaw(e)}}readPrimitiveOrVal(){switch(this.reader.peak()>>5){case 4:case 5:return this.readAsValue();default:return this.readAny()}}readAsValue(){let e=this.reader,t=e.x;this.skipAny();let r=e.x;return new o.JsonPackValue(e.uint8.subarray(t,r))}readObjLevel(e){let t=this.readMinorLen(e);return t>=0?this.readObjRawLevel(t):this.readObjIndefLevel()}readObjRawLevel(e){let t={};for(let r=0;r<e;r++){let e=this.key(),r=this.readPrimitiveOrVal();t[e]=r}return t}readObjIndefLevel(){let e={};for(;255!==this.reader.peak();){let t=this.key();if(255===this.reader.peak())throw 7;let r=this.readPrimitiveOrVal();e[t]=r}return this.reader.x++,e}readArrLevel(e){let t=this.readMinorLen(e);return t>=0?this.readArrRawLevel(t):this.readArrIndefLevel()}readArrRawLevel(e){let t=[];for(let r=0;r<e;r++)t.push(this.readPrimitiveOrVal());return t}readArrIndefLevel(){let e=[];for(;255!==this.reader.peak();)e.push(this.readPrimitiveOrVal());return this.reader.x++,e}readHdr(e){let t=this.reader.u8();if(t>>5!==e)throw 0;let r=31&t;if(r<24)return r;switch(r){case 24:return this.reader.u8();case 25:return this.reader.u16();case 26:return this.reader.u32();case 27:return Number(this.reader.u64());case 31:return -1}throw 1}readStrHdr(){return this.readHdr(3)}readObjHdr(){return this.readHdr(5)}readArrHdr(){return this.readHdr(4)}findKey(e){let t=this.readObjHdr();for(let r=0;r<t;r++){if(this.key()===e)return this;this.skipAny()}throw 9}findIndex(e){if(e>=this.readArrHdr())throw 10;for(let t=0;t<e;t++)this.skipAny();return this}find(e){for(let t=0;t<e.length;t++){let r=e[t];"string"==typeof r?this.findKey(r):this.findIndex(r)}return this}}t.CborDecoder=i},"../../node_modules/.bun/@jsonjoy.com+json-pack@1.21.0+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/json-pack/lib/cbor/CborDecoderBase.js":function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.CborDecoderBase=void 0;let n=r("../../node_modules/.bun/tslib@2.8.1/node_modules/tslib/tslib.es6.mjs"),o=r("../../node_modules/.bun/@jsonjoy.com+buffers@1.2.1+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/buffers/lib/f16.js"),i=r("../../node_modules/.bun/@jsonjoy.com+json-pack@1.21.0+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/json-pack/lib/JsonPackExtension.js"),s=r("../../node_modules/.bun/@jsonjoy.com+json-pack@1.21.0+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/json-pack/lib/JsonPackValue.js"),a=r("../../node_modules/.bun/@jsonjoy.com+buffers@1.2.1+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/buffers/lib/Reader.js"),c=n.__importDefault(r("../../node_modules/.bun/@jsonjoy.com+buffers@1.2.1+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/buffers/lib/utf8/sharedCachedUtf8Decoder.js"));t.CborDecoderBase=class{constructor(e=new a.Reader,t=c.default){this.reader=e,this.keyDecoder=t}read(e){return this.reader.reset(e),this.readAny()}decode(e){return this.reader.reset(e),this.readAny()}val(){return this.readAny()}readAny(){let e=this.reader.u8(),t=e>>5,r=31&e;if(t<4)if(t<2)return 0===t?this.readUint(r):this.readNint(r);else return 2===t?this.readBin(r):this.readStr(r);return t<6?4===t?this.readArr(r):this.readObj(r):6===t?this.readTag(r):this.readTkn(r)}readAnyRaw(e){let t=e>>5,r=31&e;if(t<4)if(t<2)return 0===t?this.readUint(r):this.readNint(r);else return 2===t?this.readBin(r):this.readStr(r);return t<6?4===t?this.readArr(r):this.readObj(r):6===t?this.readTag(r):this.readTkn(r)}readMinorLen(e){if(e<24)return e;switch(e){case 24:return this.reader.u8();case 25:return this.reader.u16();case 26:return this.reader.u32();case 27:return Number(this.reader.u64());case 31:return -1;default:throw 1}}readUint(e){if(e<25)return 24===e?this.reader.u8():e;{if(e<27)return 25===e?this.reader.u16():this.reader.u32();let t=this.reader.u64();return t>0x1fffffffffffff?t:Number(t)}}readNint(e){if(e<25)return 24===e?-this.reader.u8()-1:-e-1;{if(e<27)return 25===e?-this.reader.u16()-1:-this.reader.u32()-1;let t=this.reader.u64();return t>0x1ffffffffffffe?-t-BigInt(1):-Number(t)-1}}readBin(e){let t=this.reader;if(e<=23)return t.buf(e);switch(e){case 24:return t.buf(t.u8());case 25:return t.buf(t.u16());case 26:return t.buf(t.u32());case 27:return t.buf(Number(t.u64()));case 31:{let e=0,t=[];for(;255!==this.reader.peak();){let r=this.readBinChunk();e+=r.length,t.push(r)}this.reader.x++;let r=new Uint8Array(e),n=0,o=t.length;for(let e=0;e<o;e++){let o=t[e];r.set(o,n),n+=o.length}return r}default:throw 1}}readBinChunk(){let e=this.reader.u8(),t=31&e;if(2!=e>>5)throw 2;if(t>27)throw 3;return this.readBin(t)}readAsStr(){let e=this.reader.u8();if(3!=e>>5)throw 11;return this.readStr(31&e)}readStr(e){let t=this.reader;if(e<=23)return t.utf8(e);switch(e){case 24:return t.utf8(t.u8());case 25:return t.utf8(t.u16());case 26:return t.utf8(t.u32());case 27:return t.utf8(Number(t.u64()));case 31:{let e="";for(;255!==t.peak();)e+=this.readStrChunk();return this.reader.x++,e}default:throw 1}}readStrLen(e){if(e<=23)return e;switch(e){case 24:return this.reader.u8();case 25:return this.reader.u16();case 26:return this.reader.u32();case 27:return Number(this.reader.u64());default:throw 1}}readStrChunk(){let e=this.reader.u8(),t=31&e;if(3!=e>>5)throw 4;if(t>27)throw 5;return this.readStr(t)}readArr(e){let t=this.readMinorLen(e);return t>=0?this.readArrRaw(t):this.readArrIndef()}readArrRaw(e){let t=[];for(let r=0;r<e;r++)t.push(this.readAny());return t}readArrIndef(){let e=[];for(;255!==this.reader.peak();)e.push(this.readAny());return this.reader.x++,e}readObj(e){if(e<28){let t=e;switch(e){case 24:t=this.reader.u8();break;case 25:t=this.reader.u16();break;case 26:t=this.reader.u32();break;case 27:t=Number(this.reader.u64())}let r={};for(let e=0;e<t;e++){let e=this.key();if("__proto__"===e)throw 6;let t=this.readAny();r[e]=t}return r}if(31===e)return this.readObjIndef();throw 1}readObjRaw(e){let t={};for(let r=0;r<e;r++){let e=this.key(),r=this.readAny();t[e]=r}return t}readObjIndef(){let e={};for(;255!==this.reader.peak();){let t=this.key();if(255===this.reader.peak())throw 7;let r=this.readAny();e[t]=r}return this.reader.x++,e}key(){let e=this.reader.u8();if(3!=e>>5)return String(this.readAnyRaw(e));let t=this.readStrLen(31&e);if(t>31)return this.reader.utf8(t);let r=this.keyDecoder.decode(this.reader.uint8,this.reader.x,t);return this.reader.skip(t),r}readTag(e){if(e<=23)return this.readTagRaw(e);switch(e){case 24:return this.readTagRaw(this.reader.u8());case 25:return this.readTagRaw(this.reader.u16());case 26:return this.readTagRaw(this.reader.u32());case 27:return this.readTagRaw(Number(this.reader.u64()));default:throw 1}}readTagRaw(e){return new i.JsonPackExtension(e,this.readAny())}readTkn(e){switch(e){case 20:return!1;case 21:return!0;case 22:return null;case 23:return;case 24:return new s.JsonPackValue(this.reader.u8());case 25:return this.f16();case 26:return this.reader.f32();case 27:return this.reader.f64()}if(e<=23)return new s.JsonPackValue(e);throw 1}f16(){return(0,o.decodeF16)(this.reader.u16())}}},"../../node_modules/.bun/@jsonjoy.com+json-pack@1.21.0+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/json-pack/lib/cbor/CborDecoderDag.js":function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.CborDecoderDag=void 0;let n=r("../../node_modules/.bun/@jsonjoy.com+json-pack@1.21.0+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/json-pack/lib/JsonPackExtension.js"),o=r("../../node_modules/.bun/@jsonjoy.com+json-pack@1.21.0+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/json-pack/lib/cbor/CborDecoder.js");class i extends o.CborDecoder{readTagRaw(e){let t=this.readAny();return 42===e?new n.JsonPackExtension(e,t):t}}t.CborDecoderDag=i},"../../node_modules/.bun/@jsonjoy.com+json-pack@1.21.0+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/json-pack/lib/cbor/CborEncoder.js":function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.CborEncoder=void 0;let n=r("../../node_modules/.bun/@jsonjoy.com+buffers@1.2.1+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/buffers/lib/isFloat32.js"),o=r("../../node_modules/.bun/@jsonjoy.com+json-pack@1.21.0+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/json-pack/lib/JsonPackExtension.js"),i=r("../../node_modules/.bun/@jsonjoy.com+json-pack@1.21.0+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/json-pack/lib/cbor/CborEncoderFast.js"),s=r("../../node_modules/.bun/@jsonjoy.com+json-pack@1.21.0+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/json-pack/lib/JsonPackValue.js");class a extends i.CborEncoderFast{writeUnknown(e){this.writeNull()}writeAny(e){switch(typeof e){case"number":return this.writeNumber(e);case"string":return this.writeStr(e);case"boolean":return this.writer.u8(244+ +e);case"object":if(!e)return this.writer.u8(246);switch(e.constructor){case Object:return this.writeObj(e);case Array:return this.writeArr(e);case Uint8Array:return this.writeBin(e);case Map:return this.writeMap(e);case o.JsonPackExtension:return this.writeTag(e.tag,e.val);case s.JsonPackValue:let t=e.val;return this.writer.buf(t,t.length);default:if(e instanceof Uint8Array)return this.writeBin(e);if(Array.isArray(e))return this.writeArr(e);if(e instanceof Map)return this.writeMap(e);return this.writeUnknown(e)}case"undefined":return this.writeUndef();case"bigint":return this.writeBigInt(e);default:return this.writeUnknown(e)}}writeFloat(e){(0,n.isFloat32)(e)?this.writer.u8f32(250,e):this.writer.u8f64(251,e)}writeMap(e){this.writeMapHdr(e.size),e.forEach((e,t)=>{this.writeAny(t),this.writeAny(e)})}writeUndef(){this.writer.u8(247)}}t.CborEncoder=a},"../../node_modules/.bun/@jsonjoy.com+json-pack@1.21.0+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/json-pack/lib/cbor/CborEncoderDag.js":function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.CborEncoderDag=void 0;let n=r("../../node_modules/.bun/@jsonjoy.com+json-pack@1.21.0+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/json-pack/lib/cbor/CborEncoderStable.js");class o extends n.CborEncoderStable{writeUndef(){this.writeNull()}writeFloat(e){if(e!=e||!Number.isFinite(e))return this.writeNull();this.writer.u8f64(251,e)}writeTag(e,t){42===e&&this.writeTagHdr(e),this.writeAny(t)}}t.CborEncoderDag=o},"../../node_modules/.bun/@jsonjoy.com+json-pack@1.21.0+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/json-pack/lib/cbor/CborEncoderFast.js":function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.CborEncoderFast=void 0;let n=r("../../node_modules/.bun/@jsonjoy.com+buffers@1.2.1+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/buffers/lib/Writer.js"),o=Number.isSafeInteger;t.CborEncoderFast=class{constructor(e=new n.Writer){this.writer=e}encode(e){return this.writeAny(e),this.writer.flush()}encodeToSlice(e){return this.writeAny(e),this.writer.flushSlice()}writeAny(e){switch(typeof e){case"number":return this.writeNumber(e);case"string":return this.writeStr(e);case"boolean":return this.writer.u8(244+ +e);case"object":if(!e)return this.writer.u8(246);if(e.constructor===Array)return this.writeArr(e);return this.writeObj(e)}}writeCbor(){this.writer.u8u16(217,55799)}writeEnd(){this.writer.u8(255)}writeNull(){this.writer.u8(246)}writeBoolean(e){e?this.writer.u8(245):this.writer.u8(244)}writeNumber(e){o(e)?this.writeInteger(e):"bigint"==typeof e?this.writeBigInt(e):this.writeFloat(e)}writeBigInt(e){e>=0?this.writeBigUint(e):this.writeBigSint(e)}writeBigUint(e){if(e<=Number.MAX_SAFE_INTEGER)return this.writeUInteger(Number(e));this.writer.u8u64(27,e)}writeBigSint(e){if(e>=Number.MIN_SAFE_INTEGER)return this.encodeNint(Number(e));let t=-BigInt(1)-e;this.writer.u8u64(59,t)}writeInteger(e){e>=0?this.writeUInteger(e):this.encodeNint(e)}writeUInteger(e){let t=this.writer;t.ensureCapacity(9);let r=t.uint8,n=t.x;e<=23?r[n++]=0+e:e<=255?(r[n++]=24,r[n++]=e):e<=65535?(r[n++]=25,t.view.setUint16(n,e),n+=2):e<=0xffffffff?(r[n++]=26,t.view.setUint32(n,e),n+=4):(r[n++]=27,t.view.setBigUint64(n,BigInt(e)),n+=8),t.x=n}encodeNumber(e){this.writeNumber(e)}encodeInteger(e){this.writeInteger(e)}encodeUint(e){this.writeUInteger(e)}encodeNint(e){let t=-1-e,r=this.writer;r.ensureCapacity(9);let n=r.uint8,o=r.x;t<24?n[o++]=32+t:t<=255?(n[o++]=56,n[o++]=t):t<=65535?(n[o++]=57,r.view.setUint16(o,t),o+=2):t<=0xffffffff?(n[o++]=58,r.view.setUint32(o,t),o+=4):(n[o++]=59,r.view.setBigUint64(o,BigInt(t)),o+=8),r.x=o}writeFloat(e){this.writer.u8f64(251,e)}writeBin(e){let t=e.length;this.writeBinHdr(t),this.writer.buf(e,t)}writeBinHdr(e){let t=this.writer;e<=23?t.u8(64+e):e<=255?t.u16(22528+e):e<=65535?t.u8u16(89,e):e<=0xffffffff?t.u8u32(90,e):t.u8u64(91,e)}writeStr(e){let t=this.writer,r=4*e.length;t.ensureCapacity(5+r);let n=t.uint8,o=t.x;r<=23?t.x++:r<=255?(n[t.x++]=120,o=t.x,t.x++):r<=65535?(n[t.x++]=121,o=t.x,t.x+=2):(n[t.x++]=122,o=t.x,t.x+=4);let i=t.utf8(e);r<=23?n[o]=96+i:r<=255?n[o]=i:r<=65535?t.view.setUint16(o,i):t.view.setUint32(o,i)}writeStrHdr(e){let t=this.writer;e<=23?t.u8(96+e):e<=255?t.u16(30720+e):e<=65535?t.u8u16(121,e):t.u8u32(122,e)}writeAsciiStr(e){this.writeStrHdr(e.length),this.writer.ascii(e)}writeArr(e){let t=e.length;this.writeArrHdr(t);for(let r=0;r<t;r++)this.writeAny(e[r])}writeArrHdr(e){let t=this.writer;e<=23?t.u8(128+e):e<=255?t.u16(38912+e):e<=65535?t.u8u16(153,e):e<=0xffffffff?t.u8u32(154,e):t.u8u64(155,e)}writeObj(e){let t=Object.keys(e),r=t.length;this.writeObjHdr(r);for(let n=0;n<r;n++){let r=t[n];this.writeStr(r),this.writeAny(e[r])}}writeObjHdr(e){let t=this.writer;e<=23?t.u8(160+e):e<=255?t.u16(47104+e):e<=65535?t.u8u16(185,e):e<=0xffffffff?t.u8u32(186,e):t.u8u64(187,e)}writeMapHdr(e){this.writeObjHdr(e)}writeStartMap(){this.writer.u8(191)}writeTag(e,t){this.writeTagHdr(e),this.writeAny(t)}writeTagHdr(e){let t=this.writer;e<=23?t.u8(192+e):e<=255?t.u16(55296+e):e<=65535?t.u8u16(217,e):e<=0xffffffff?t.u8u32(218,e):t.u8u64(219,e)}writeTkn(e){let t=this.writer;e<=23?t.u8(224+e):e<=255&&t.u16(63488+e)}writeStartStr(){this.writer.u8(127)}writeStrChunk(e){throw Error("Not implemented")}writeEndStr(){throw Error("Not implemented")}writeStartBin(){this.writer.u8(95)}writeBinChunk(e){throw Error("Not implemented")}writeEndBin(){throw Error("Not implemented")}writeStartArr(){this.writer.u8(159)}writeArrChunk(e){throw Error("Not implemented")}writeEndArr(){this.writer.u8(255)}writeStartObj(){this.writer.u8(191)}writeObjChunk(e,t){throw Error("Not implemented")}writeEndObj(){this.writer.u8(255)}}},"../../node_modules/.bun/@jsonjoy.com+json-pack@1.21.0+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/json-pack/lib/cbor/CborEncoderStable.js":function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.CborEncoderStable=void 0;let n=r("../../node_modules/.bun/@jsonjoy.com+json-pack@1.21.0+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/json-pack/lib/cbor/CborEncoder.js"),o=r("../../node_modules/.bun/@jsonjoy.com+util@1.9.0+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/util/lib/sort/insertion2.js"),i=r("../../node_modules/.bun/@jsonjoy.com+util@1.9.0+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/util/lib/objKeyCmp.js"),s=e=>e<=23?1:e<=255?2:e<=65535?3:5;class a extends n.CborEncoder{writeObj(e){let t=Object.keys(e);(0,o.sort)(t,i.objKeyCmp);let r=t.length;this.writeObjHdr(r);for(let n=0;n<r;n++){let r=t[n];this.writeStr(r),this.writeAny(e[r])}}writeStr(e){let t=this.writer,r=e.length,n=4*r;t.ensureCapacity(5+n);let o=s(r),i=t.x,a=i+o;t.x=a;let c=t.utf8(e),l=t.uint8,u=s(c);switch(u!==o&&l.copyWithin(a+(u-o),a,a+c),u){case 1:l[i]=96+c;break;case 2:l[i]=120,l[i+1]=c;break;case 3:l[i]=121,t.view.setUint16(i+1,c);break;case 5:l[i]=122,t.view.setUint32(i+1,c)}t.x=i+u+c}writeUndef(){this.writeNull()}}t.CborEncoderStable=a},"../../node_modules/.bun/@jsonjoy.com+json-pack@1.21.0+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/json-pack/lib/cbor/index.js":function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});let n=r("../../node_modules/.bun/tslib@2.8.1/node_modules/tslib/tslib.es6.mjs");n.__exportStar(r("../../node_modules/.bun/@jsonjoy.com+json-pack@1.21.0+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/json-pack/lib/cbor/types.js"),t),n.__exportStar(r("../../node_modules/.bun/@jsonjoy.com+json-pack@1.21.0+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/json-pack/lib/cbor/CborEncoderFast.js"),t),n.__exportStar(r("../../node_modules/.bun/@jsonjoy.com+json-pack@1.21.0+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/json-pack/lib/cbor/CborEncoder.js"),t),n.__exportStar(r("../../node_modules/.bun/@jsonjoy.com+json-pack@1.21.0+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/json-pack/lib/cbor/CborEncoderStable.js"),t),n.__exportStar(r("../../node_modules/.bun/@jsonjoy.com+json-pack@1.21.0+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/json-pack/lib/cbor/CborEncoderDag.js"),t),n.__exportStar(r("../../node_modules/.bun/@jsonjoy.com+json-pack@1.21.0+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/json-pack/lib/cbor/CborDecoderBase.js"),t),n.__exportStar(r("../../node_modules/.bun/@jsonjoy.com+json-pack@1.21.0+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/json-pack/lib/cbor/CborDecoder.js"),t),n.__exportStar(r("../../node_modules/.bun/@jsonjoy.com+json-pack@1.21.0+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/json-pack/lib/cbor/CborDecoderDag.js"),t)},"../../node_modules/.bun/@jsonjoy.com+json-pack@1.21.0+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/json-pack/lib/cbor/types.js":function(e,t){Object.defineProperty(t,"__esModule",{value:!0})},"../../node_modules/.bun/@jsonjoy.com+util@1.9.0+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/util/lib/objKeyCmp.js":function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.objKeyCmp=void 0,t.objKeyCmp=(e,t)=>{let r=e.length,n=t.length;return r===n?e>t?1:-1:r-n}},"../../node_modules/.bun/@jsonjoy.com+util@1.9.0+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/util/lib/sort/insertion2.js":function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.sort=void 0,t.sort=(e,t)=>{let r=e.length;for(let n=1;n<r;n++){let r=e[n],o=n;for(;0!==o&&t(e[o-1],r)>0;)e[o]=e[o-1],o--;e[o]=r}return e}},"../../packages/ui/utils/onDocumentReady.ts":function(e,t,r){r.d(t,{q:()=>n});function n(e){"complete"===document.readyState||"interactive"===document.readyState?setTimeout(e,1):document.addEventListener?document.addEventListener("DOMContentLoaded",e):document.attachEvent("onreadystatechange",()=>{"complete"===document.readyState&&e()})}},"./src/components/ButtonWallet/utils.ts":function(e,t,r){r.d(t,{h:()=>o});var n=r("../core/dist/actions.js");function o(){window.FrakSetup?.client?("vibrate"in navigator?navigator.vibrate(10):console.log("Vibration not supported"),(0,n.wS)(window.FrakSetup.client,window.FrakSetup?.modalWalletConfig??{})):console.error("Frak client not found")}},"./src/utils/clientReady.ts":function(e,t,r){r.d(t,{S:()=>i,T:()=>o});let n="frakClientReady";function o(){let e=new CustomEvent(n);window.dispatchEvent(e)}function i(e,t){window.FrakSetup?.client&&"add"===e?t():("add"===e?window.addEventListener:window.removeEventListener)(n,t,!1)}},"./src/utils/initFrakSdk.ts":function(e,t,r){let n;r.d(t,{$:()=>eD});var o={};r.r(o),r.d(o,{DebugInfoGatherer:()=>ep,FrakContextManager:()=>er,PressInteractionEncoder:()=>eA,PurchaseInteractionEncoder:()=>eP,ReferralInteractionEncoder:()=>K,RetailInteractionEncoder:()=>eO,WebShopInteractionEncoder:()=>eL,base64urlDecode:()=>B,base64urlEncode:()=>T,baseIframeProps:()=>em,compressJsonToB64:()=>M,createIFrameFrakClient:()=>ej,createIframe:()=>ew,decompressJsonFromB64:()=>eS,displayEmbeddedWallet:()=>U,displayModal:()=>R,findIframeInOpener:()=>eg,formatAmount:()=>eE,generateSsoUrl:()=>N,getCurrencyAmountKey:()=>eI,getProductInformation:()=>F,getSupportedCurrency:()=>ex,getSupportedLocale:()=>eC,interactionTypes:()=>q,locales:()=>e_,modalBuilder:()=>ed,openSso:()=>H,prepareSso:()=>V,processReferral:()=>eo,productTypes:()=>W,productTypesMask:()=>J,referralInteraction:()=>el,sendInteraction:()=>en,sendTransaction:()=>ef,setupClient:()=>ek,siweAuthenticate:()=>eh,ssoPopupFeatures:()=>$,ssoPopupName:()=>z,trackEvent:()=>G,trackPurchaseStatus:()=>eu,watchWalletStatus:()=>ea});var i=r("../core/dist/index.js"),s=r("../../node_modules/.bun/viem@2.38.5+1fb4c65d43e298b9/node_modules/viem/_esm/utils/hash/keccak256.js"),a=r("../../node_modules/.bun/viem@2.38.5+1fb4c65d43e298b9/node_modules/viem/_esm/utils/encoding/toHex.js"),c=r("../../node_modules/.bun/viem@2.38.5+1fb4c65d43e298b9/node_modules/viem/_esm/utils/data/concat.js"),l=r("../../node_modules/.bun/viem@2.38.5+1fb4c65d43e298b9/node_modules/viem/_esm/utils/data/pad.js"),u=r("../../node_modules/.bun/viem@2.38.5+1fb4c65d43e298b9/node_modules/viem/_esm/utils/encoding/toBytes.js"),d=r("../../node_modules/.bun/viem@2.38.5+1fb4c65d43e298b9/node_modules/viem/_esm/utils/address/isAddressEqual.js"),f=r("../../node_modules/.bun/viem@2.38.5+1fb4c65d43e298b9/node_modules/viem/_esm/utils/data/size.js"),h=r("../../node_modules/.bun/viem@2.38.5+1fb4c65d43e298b9/node_modules/viem/_esm/errors/base.js");h.C,h.C,h.C,h.C,h.C;class b extends h.C{constructor({expectedLength:e,givenLength:t,type:r}){super(`ABI encoding array length mismatch for type ${r}.
3
3
  Expected length: ${e}
4
- Given length: ${t}`,{name:"AbiEncodingArrayLengthMismatchError"})}}class y extends m.G{constructor({expectedSize:e,value:t}){super(`Size of bytes "${t}" (bytes${(0,p.d)(t)}) does not match expected size (bytes${e}).`,{name:"AbiEncodingBytesSizeMismatchError"})}}class g extends m.G{constructor({expectedLength:e,givenLength:t}){super(`ABI encoding params/values length mismatch.
4
+ Given length: ${t}`,{name:"AbiEncodingArrayLengthMismatchError"})}}class p extends h.C{constructor({expectedSize:e,value:t}){super(`Size of bytes "${t}" (bytes${(0,f.E)(t)}) does not match expected size (bytes${e}).`,{name:"AbiEncodingBytesSizeMismatchError"})}}class m extends h.C{constructor({expectedLength:e,givenLength:t}){super(`ABI encoding params/values length mismatch.
5
5
  Expected length (params): ${e}
6
- Given length (values): ${t}`,{name:"AbiEncodingLengthMismatchError"})}}m.G,m.G,m.G,m.G,m.G,m.G,m.G,m.G,m.G,m.G,m.G,m.G,m.G;class v extends m.G{constructor(e,{docsPath:t}){super(`Type "${e}" is not a valid encoding type.
7
- Please provide a valid ABI type.`,{docsPath:t,name:"InvalidAbiEncodingType"})}}m.G;class j extends m.G{constructor(e){super(`Value "${e}" is not a valid array.`,{name:"InvalidArrayError"})}}class _ extends m.G{constructor(e){super(`"${e}" is not a valid definition type.
8
- Valid types: "function", "event", "error"`,{name:"InvalidDefinitionTypeError"})}}m.G;var x=r("../../node_modules/.bun/viem@2.31.2+5bbfac422febb175/node_modules/viem/_esm/errors/address.js"),k=r("../../node_modules/.bun/viem@2.31.2+5bbfac422febb175/node_modules/viem/_esm/errors/encoding.js"),S=r("../../node_modules/.bun/viem@2.31.2+5bbfac422febb175/node_modules/viem/_esm/utils/address/isAddress.js"),C=r("../../node_modules/.bun/viem@2.31.2+5bbfac422febb175/node_modules/viem/_esm/errors/data.js"),I=r("../../node_modules/.bun/viem@2.31.2+5bbfac422febb175/node_modules/viem/_esm/utils/data/isHex.js");function E(e,t){if("number"==typeof t&&t>0&&t>(0,p.d)(e)-1)throw new C.mV({offset:t,position:"start",size:(0,p.d)(e)})}function A(e,t,r){if("number"==typeof t&&"number"==typeof r&&(0,p.d)(e)!==r-t)throw new C.mV({offset:r,position:"end",size:(0,p.d)(e)})}let O=/^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/;function P(e){let t=0;for(let r=0;r<e.length;r++){let{dynamic:n,encoded:o}=e[r];n?t+=32:t+=(0,p.d)(o)}let r=[],n=[],o=0;for(let i=0;i<e.length;i++){let{dynamic:s,encoded:a}=e[i];s?(r.push((0,u.eC)(t+o,{size:32})),n.push(a),o+=(0,p.d)(a)):r.push(a)}return(0,f.zo)([...r,...n])}let L=256,U="nexus-wallet-backup";class R{config;iframe;isSetupDone=!1;lastResponse=null;lastRequest=null;constructor(e,t){this.config=e,this.iframe=t,this.lastRequest=null,this.lastResponse=null}setLastResponse(e,t){this.lastResponse={message:e,response:t,timestamp:Date.now()}}setLastRequest(e){this.lastRequest={event:e,timestamp:Date.now()}}updateSetupStatus(e){this.isSetupDone=e}base64Encode(e){try{return btoa(JSON.stringify(e))}catch(e){return console.warn("Failed to encode debug data",e),btoa("Failed to encode data")}}getIframeStatus(){return this.iframe?{loading:this.iframe.hasAttribute("loading"),url:this.iframe.src,readyState:this.iframe.contentDocument?.readyState?+("complete"===this.iframe.contentDocument.readyState):-1,contentWindow:!!this.iframe.contentWindow,isConnected:this.iframe.isConnected}:null}getNavigatorInfo(){return navigator?{userAgent:navigator.userAgent,language:navigator.language,onLine:navigator.onLine,screenWidth:window.screen.width,screenHeight:window.screen.height,pixelRatio:window.devicePixelRatio}:null}gatherDebugInfo(e){let t=this.getIframeStatus(),r=this.getNavigatorInfo(),n="Unknown";return e instanceof s.u?n=`FrakRpcError: ${e.code} '${e.message}'`:e instanceof Error?n=e.message:"string"==typeof e&&(n=e),{timestamp:new Date().toISOString(),encodedUrl:btoa(window.location.href),encodedConfig:this.config?this.base64Encode(this.config):"no-config",navigatorInfo:r?this.base64Encode(r):"no-navigator",iframeStatus:t?this.base64Encode(t):"not-iframe",lastRequest:this.lastRequest?this.base64Encode(this.lastRequest):"No Frak request logged",lastResponse:this.lastResponse?this.base64Encode(this.lastResponse):"No Frak response logged",clientStatus:this.isSetupDone?"setup":"not-setup",error:n}}static empty(){return new R}formatDebugInfo(e){let t=this.gatherDebugInfo(e);return`
6
+ Given length (values): ${t}`,{name:"AbiEncodingLengthMismatchError"})}}h.C,h.C,h.C,h.C,h.C,h.C,h.C,h.C,h.C,h.C,h.C,h.C,h.C;class w extends h.C{constructor(e,{docsPath:t}){super(`Type "${e}" is not a valid encoding type.
7
+ Please provide a valid ABI type.`,{docsPath:t,name:"InvalidAbiEncodingType"})}}h.C;class y extends h.C{constructor(e){super(`Value "${e}" is not a valid array.`,{name:"InvalidArrayError"})}}class g extends h.C{constructor(e){super(`"${e}" is not a valid definition type.
8
+ Valid types: "function", "event", "error"`,{name:"InvalidDefinitionTypeError"})}}h.C;var j=r("../../node_modules/.bun/viem@2.38.5+1fb4c65d43e298b9/node_modules/viem/_esm/errors/address.js"),v=r("../../node_modules/.bun/viem@2.38.5+1fb4c65d43e298b9/node_modules/viem/_esm/errors/encoding.js"),_=r("../../node_modules/.bun/viem@2.38.5+1fb4c65d43e298b9/node_modules/viem/_esm/utils/address/isAddress.js"),x=r("../../node_modules/.bun/viem@2.38.5+1fb4c65d43e298b9/node_modules/viem/_esm/errors/data.js"),k=r("../../node_modules/.bun/viem@2.38.5+1fb4c65d43e298b9/node_modules/viem/_esm/utils/data/isHex.js");function S(e,t){if("number"==typeof t&&t>0&&t>(0,f.E)(e)-1)throw new x.ii({offset:t,position:"start",size:(0,f.E)(e)})}function C(e,t,r){if("number"==typeof t&&"number"==typeof r&&(0,f.E)(e)!==r-t)throw new x.ii({offset:r,position:"end",size:(0,f.E)(e)})}let E=/^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/;function I(e){let t=0;for(let r=0;r<e.length;r++){let{dynamic:n,encoded:o}=e[r];n?t+=32:t+=(0,f.E)(o)}let r=[],n=[],o=0;for(let i=0;i<e.length;i++){let{dynamic:s,encoded:c}=e[i];s?(r.push((0,a.cK)(t+o,{size:32})),n.push(c),o+=(0,f.E)(c)):r.push(c)}return(0,c.xW)([...r,...n])}var A=r("../../packages/rpc/dist/middleware-B51Ll_ty.js"),P=r("../../packages/rpc/dist/index.js");let O=256;var L=r("../../node_modules/.bun/@openpanel+web@1.0.1/node_modules/@openpanel/web/dist/index.js");async function U(e,t){return await e.request({method:"frak_displayEmbeddedWallet",params:[t,e.config.metadata]})}async function R(e,{steps:t,metadata:r}){return await e.request({method:"frak_displayModal",params:[t,r,e.config.metadata]})}async function F(e){return await e.request({method:"frak_getProductInformation"})}function D({domain:e}={}){return(0,s.S)((0,a.nj)((e??window.location.host).replace("www.","")))}function T(e){return btoa(Array.from(e,e=>String.fromCharCode(e)).join("")).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function B(e){let t=e.length%4;return Uint8Array.from(atob(e.replace(/-/g,"+").replace(/_/g,"/").padEnd(e.length+(0===t?0:4-t),"=")),e=>e.charCodeAt(0))}function M(e){return T((0,A.r)(e))}function N(e,t,r,n,o){var i;let s=M({r:(i={redirectUrl:t.redirectUrl,directExit:t.directExit,lang:t.lang,productId:r,metadata:{name:n,css:o,logoUrl:t.metadata?.logoUrl,homepageLink:t.metadata?.homepageLink}}).redirectUrl,d:i.directExit,l:i.lang,p:i.productId,m:{n:i.metadata?.name,css:i.metadata?.css,l:i.metadata?.logoUrl,h:i.metadata?.homepageLink}}),a=new URL(e);return a.pathname="/sso",a.searchParams.set("p",s),a.toString()}let $="menubar=no,status=no,scrollbars=no,fullscreen=no,width=500, height=800",z="frak-sso";async function H(e,t){let{metadata:r,customizations:n,walletUrl:o}=e.config;if(t.openInSameWindow??!!t.redirectUrl)return await e.request({method:"frak_openSso",params:[t,r.name,n?.css]});let i=t.ssoPopupUrl??N(o??"https://wallet.frak.id",t,D(),r.name,n?.css),s=window.open(i,z,$);if(!s)throw Error("Popup was blocked. Please allow popups for this site.");return s.focus(),await e.request({method:"frak_openSso",params:[t,r.name,n?.css]})??{}}async function V(e,t){let{metadata:r,customizations:n}=e.config;return await e.request({method:"frak_prepareSso",params:[t,r.name,n?.css]})}let q={press:{openArticle:"0xc0a24ffb",readArticle:"0xd5bd0fbe"},dapp:{proofVerifiableStorageUpdate:"0x2ab2aeef",callableVerifiableStorageUpdate:"0xa07da986"},webshop:{open:"0xb311798f"},referral:{referred:"0x010cc3b9",createLink:"0xb2c0f17c"},purchase:{started:"0xd87e90c3",completed:"0x8403aeb4",unsafeCompleted:"0x4d5b14e0"},retail:{customerMeeting:"0x74489004"}},W={dapp:1,press:2,webshop:3,retail:4,referral:30,purchase:31},J=Object.entries(W).reduce((e,[t,r])=>(e[t]=BigInt(1)<<BigInt(r),e),{}),K={createLink:()=>({handlerTypeDenominator:(0,a.nj)(W.referral),interactionData:q.referral.createLink}),referred({referrer:e}){let t=(0,c.aP)([q.referral.referred,(0,l.eV)(e,{size:32})]);return{handlerTypeDenominator:(0,a.nj)(W.referral),interactionData:t}}};function G(e,t,r={}){if(!e)return void console.debug("[Frak] No client provided, skipping event tracking");try{e.openPanel?.track(t,r)}catch(e){console.debug("[Frak] Failed to track event:",t,e)}}let X="fCtx";function Z(e){if(e?.r)try{let t=(0,u.aT)(e.r);return T(t)}catch(t){console.error("Error compressing Frak context",{e:t,context:e})}}function Y(e){if(e&&0!==e.length)try{let t=B(e);return{r:(0,a.My)(t,{size:20})}}catch(t){console.error("Error decompressing Frak context",{e:t,context:e})}}function Q({url:e}){if(!e)return null;let t=new URL(e).searchParams.get(X);return t?Y(t):null}function ee({url:e,context:t}){if(!e)return null;let r=Q({url:e}),n=r?{...r,...t}:t;if(!n.r)return null;let o=Z(n);if(!o)return null;let i=new URL(e);return i.searchParams.set(X,o),i.toString()}function et(e){let t=new URL(e);return t.searchParams.delete(X),t.toString()}let er={compress:Z,decompress:Y,parse:Q,update:ee,remove:et,replaceUrl:function({url:e,context:t}){let r;if(!window.location?.href||"undefined"==typeof window)return void console.error("No window found, can't update context");let n=e??window.location.href;(r=null!==t?ee({url:n,context:t}):et(n))&&window.history.replaceState(null,"",r.toString())}};async function en(e,{productId:t,interaction:r,validation:n}){let o=t??D(e.config);return await e.request({method:"frak_sendInteraction",params:[o,r,n]})}async function eo(e,{walletStatus:t,frakContext:r,modalConfig:n,productId:o,options:i}){let s=!1;async function a(){if(!s)return s=!0,es(e,{modalConfig:{...n,loggedIn:{action:{key:"referred"}}},walletStatus:t})}async function c(t){let r=K.referred({referrer:t});await Promise.allSettled([en(e,{productId:o,interaction:r}),G(e,"user_referred",{properties:{referrer:t}})])}try{let{status:e,currentWallet:n}=await ei({initialWalletStatus:t,getFreshWalletStatus:a,pushReferralInteraction:c,frakContext:r});return er.replaceUrl({url:window.location?.href,context:i?.alwaysAppendUrl?{r:n}:null}),e}catch(e){return console.log("Error processing referral",{error:e}),er.replaceUrl({url:window.location?.href,context:i?.alwaysAppendUrl?{r:t?.wallet}:null}),function(e){if(e instanceof A.c)switch(e.code){case A.d.walletNotConnected:return"no-wallet";case A.d.serverErrorForInteractionDelegation:return"no-session"}return"error"}(e)}}async function ei({initialWalletStatus:e,getFreshWalletStatus:t,pushReferralInteraction:r,frakContext:n}){let o=e?.wallet;return n?.r?(o||(o=await t()),o&&(0,d.h)(n.r,o))?{status:"self-referral",currentWallet:o}:(e?.interactionSession||(o=await t()),await r(n.r),{status:"success",currentWallet:o}):{status:"no-referrer",currentWallet:o}}async function es(e,{modalConfig:t,walletStatus:r}){if(!r?.interactionSession){let r=await U(e,t??{});return r?.wallet??void 0}return r.wallet??void 0}function ea(e,t){if(!t)return e.request({method:"frak_listenToWalletStatus"}).then(t=>(ec(e,t),t));let r=new P.cY,n=!1;return e.listenerRequest({method:"frak_listenToWalletStatus"},o=>{ec(e,o),t(o),n||(r.resolve(o),n=!0)}),r.promise}function ec(e,t){"undefined"!=typeof window&&(e.openPanel?.setGlobalProperties({wallet:t.wallet??null}),t.interactionToken?window.sessionStorage.setItem("frak-wallet-interaction-token",t.interactionToken):window.sessionStorage.removeItem("frak-wallet-interaction-token"))}async function el(e,{productId:t,modalConfig:r,options:n}={}){let o=er.parse({url:window.location.href}),i=await ea(e);try{return await eo(e,{walletStatus:i,frakContext:o,modalConfig:r,productId:t,options:n})}catch(e){console.warn("Error processing referral",{error:e})}}async function eu(e){if("undefined"==typeof window)return void console.warn("[Frak] No window found, can't track purchase");let t=window.sessionStorage.getItem("frak-wallet-interaction-token");t?await fetch("https://backend.frak.id/interactions/listenForPurchase",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json","x-wallet-sdk-auth":t},body:JSON.stringify(e)}):console.warn("[Frak] No frak session found, skipping purchase check")}function ed(e,{metadata:t,login:r,openSession:n}){return function e(t,r){async function n(e){return e&&(r.metadata=e(r.metadata??{})),await R(t,r)}return{params:r,sendTx:function(n){return e(t,{...r,steps:{...r.steps,sendTransaction:n}})},reward:function(n){return e(t,{...r,steps:{...r.steps,final:{...n,action:{key:"reward"}}}})},sharing:function(n,o){return e(t,{...r,steps:{...r.steps,final:{...o,action:{key:"sharing",options:n}}}})},display:n}}(e,{steps:{login:r??{},openSession:n??{}},metadata:t})}async function ef(e,{tx:t,metadata:r}){return(await R(e,{metadata:r,steps:{login:{},sendTransaction:{tx:t}}})).sendTransaction}async function eh(e,{siwe:t,metadata:r}){let o=e.config?.domain??window.location.host,i=t?.statement??`I confirm that I want to use my Frak wallet on: ${e.config.metadata.name}`,s={...t,statement:i,nonce:t?.nonce??function(e=11){if(!n||O+e>512){n="",O=0;for(let e=0;e<256;e++)n+=(256+256*Math.random()|0).toString(16).substring(1)}return n.substring(O,O+++e)}(96),uri:t?.uri??`https://${o}`,version:t?.version??"1",domain:o};return(await R(e,{metadata:r,steps:{login:{},siweAuthenticate:{siwe:s}}})).siweAuthenticate}let eb="nexus-wallet-backup";class ep{config;iframe;isSetupDone=!1;lastResponse=null;lastRequest=null;constructor(e,t){this.config=e,this.iframe=t,this.lastRequest=null,this.lastResponse=null}setLastResponse(e,t){this.lastResponse={message:e,response:t,timestamp:Date.now()}}setLastRequest(e){this.lastRequest={event:e,timestamp:Date.now()}}updateSetupStatus(e){this.isSetupDone=e}base64Encode(e){try{return btoa(JSON.stringify(e))}catch(e){return console.warn("Failed to encode debug data",e),btoa("Failed to encode data")}}getIframeStatus(){return this.iframe?{loading:this.iframe.hasAttribute("loading"),url:this.iframe.src,readyState:this.iframe.contentDocument?.readyState?+("complete"===this.iframe.contentDocument.readyState):-1,contentWindow:!!this.iframe.contentWindow,isConnected:this.iframe.isConnected}:null}getNavigatorInfo(){return navigator?{userAgent:navigator.userAgent,language:navigator.language,onLine:navigator.onLine,screenWidth:window.screen.width,screenHeight:window.screen.height,pixelRatio:window.devicePixelRatio}:null}gatherDebugInfo(e){let t=this.getIframeStatus(),r=this.getNavigatorInfo(),n="Unknown";return e instanceof A.c?n=`FrakRpcError: ${e.code} '${e.message}'`:e instanceof Error?n=e.message:"string"==typeof e&&(n=e),{timestamp:new Date().toISOString(),encodedUrl:btoa(window.location.href),encodedConfig:this.config?this.base64Encode(this.config):"no-config",navigatorInfo:r?this.base64Encode(r):"no-navigator",iframeStatus:t?this.base64Encode(t):"not-iframe",lastRequest:this.lastRequest?this.base64Encode(this.lastRequest):"No Frak request logged",lastResponse:this.lastResponse?this.base64Encode(this.lastResponse):"No Frak response logged",clientStatus:this.isSetupDone?"setup":"not-setup",error:n}}static empty(){return new ep}formatDebugInfo(e){let t=this.gatherDebugInfo(e);return`
9
9
  Debug Information:
10
10
  -----------------
11
11
  Timestamp: ${t.timestamp}
@@ -17,7 +17,7 @@ Valid types: "function", "event", "error"`,{name:"InvalidDefinitionTypeError"})}
17
17
  Last Response: ${t.lastResponse}
18
18
  Client Status: ${t.clientStatus}
19
19
  Error: ${t.error}
20
- `.trim()}}let F={id:"frak-wallet",name:"frak-wallet",title:"Frak Wallet",allow:"publickey-credentials-get *; clipboard-write; web-share *",style:{width:"0",height:"0",border:"0",position:"absolute",zIndex:2000001,top:"-1000px",left:"-1000px",colorScheme:"auto"}};function D({walletBaseUrl:e,config:t}){let r=document.querySelector("#frak-wallet");r&&r.remove();let n=document.createElement("iframe");return n.id=F.id,n.name=F.name,n.allow=F.allow,n.style.zIndex=F.style.zIndex.toString(),N({iframe:n,isVisible:!1}),document.body.appendChild(n),new Promise(r=>{n?.addEventListener("load",()=>r(n)),n.src=`${t?.walletUrl??e??"https://wallet.frak.id"}/listener`})}function N({iframe:e,isVisible:t}){if(!t){e.style.width="0",e.style.height="0",e.style.border="0",e.style.position="fixed",e.style.top="-1000px",e.style.left="-1000px";return}e.style.position="fixed",e.style.top="0",e.style.left="0",e.style.width="100%",e.style.height="100%",e.style.pointerEvents="auto"}function M(e="/listener"){if(!window.opener)return null;let t=t=>{try{return t.location.origin===window.location.origin&&t.location.pathname===e}catch{return!1}};if(t(window.opener))return window.opener;try{let e=window.opener.frames;for(let r=0;r<e.length;r++)if(t(e[r]))return e[r];return null}catch(t){return console.error(`[findIframeInOpener] Error finding iframe with pathname ${e}:`,t),null}}function B({config:e,iframe:t}){let r,n=e?.walletUrl??"https://wallet.frak.id",o=function({iframe:e}){let t=new s.BH;return{handleEvent:async r=>{if(!("iframeLifecycle"in r))return;let{iframeLifecycle:n,data:o}=r;switch(n){case"connected":t.resolve(!0);break;case"do-backup":o.backup?localStorage.setItem(U,o.backup):localStorage.removeItem(U);break;case"remove-backup":localStorage.removeItem(U);break;case"show":case"hide":N({iframe:e,isVisible:"show"===n});break;case"handshake":e.contentWindow?.postMessage({clientLifecycle:"handshake-response",data:{token:o.token,currentUrl:window.location.href}},"*");break;case"redirect":{let e=new URL(o.baseRedirectUrl);e.searchParams.has("u")?(e.searchParams.delete("u"),e.searchParams.append("u",window.location.href),window.location.href=e.toString()):window.location.href=o.baseRedirectUrl}}},isConnected:t.promise}}({iframe:t}),i=new R(e,t);if(!t.contentWindow)throw new s.u(s.ss.configError,"The iframe does not have a content window");let c=(0,s.i0)({emittingTransport:t.contentWindow,listeningTransport:window,targetOrigin:n,middleware:[{async onRequest(e,t){if(!await o.isConnected)throw new s.u(s.ss.clientNotConnected,"The iframe provider isn't connected yet");return t}},(0,a.I)(),{onRequest:(e,t)=>(i.setLastRequest(e),t),onResponse:(e,t)=>(i.setLastResponse(e,t),t)}],lifecycleHandlers:{iframeLifecycle:async(e,t)=>{await o.handleEvent(e)}}}),u=function(e,t){let r,n,o=()=>e.sendLifecycle({clientLifecycle:"heartbeat"});function i(){r&&clearInterval(r),n&&clearTimeout(n)}return async function(){o(),r=setInterval(o,1e3),n=setTimeout(()=>{i(),console.log("Heartbeat timeout: connection failed")},3e4),await t.isConnected,i()}(),i}(c,o),d=async()=>{u(),c.cleanup(),t.remove()};console.log("[Frak SDK] Initializing OpenPanel"),(r=new l.J({apiUrl:"https://op-api.gcp.frak.id",clientId:"6eacc8d7-49ac-4936-95e9-81ef29449570",trackScreenViews:!0,trackOutgoingLinks:!0,trackAttributes:!1,filter:({type:e,payload:t})=>!("track"===e&&t?.properties)||("sdkVersion"in t.properties||(t.properties={...t.properties,sdkVersion:"0.1.0"}),!0)})).setGlobalProperties({sdkVersion:"0.1.0"}),r.init();let f=$({config:e,rpcClient:c,lifecycleManager:o}).then(()=>i.updateSetupStatus(!0));return{config:e,debugInfo:i,waitForConnection:o.isConnected,waitForSetup:f,request:c.request,listenerRequest:c.listen,destroy:d,openPanel:r}}async function $({config:e,rpcClient:t,lifecycleManager:r}){async function n(){let r=e.customizations?.css;r&&t.sendLifecycle({clientLifecycle:"modal-css",data:{cssLink:r}})}async function o(){let r=e.customizations?.i18n;r&&t.sendLifecycle({clientLifecycle:"modal-i18n",data:{i18n:r}})}async function i(){if("undefined"==typeof window)return;let e=window.localStorage.getItem(U);e&&t.sendLifecycle({clientLifecycle:"restore-backup",data:{backup:e}})}await r.isConnected,function(e,t){if("undefined"==typeof window)return;let r=new URL(window.location.href),n=r.searchParams.get("sso");n&&(t.then(()=>{e.sendLifecycle({clientLifecycle:"sso-redirect-complete",data:{compressed:n}}),console.log("[SSO URL Listener] Forwarded compressed SSO data to iframe")}).catch(e=>{console.error("[SSO URL Listener] Failed to forward SSO data:",e)}),r.searchParams.delete("sso"),window.history.replaceState({},"",r.toString()),console.log("[SSO URL Listener] SSO parameter detected and URL cleaned"))}(t,r.isConnected),await Promise.allSettled([n(),o(),i()])}let T={eur:"fr-FR",usd:"en-US",gbp:"en-GB"};function z(e){return e&&e in T?e:"eur"}async function q({config:e}){let t,r=(t=z(e.metadata?.currency),{...e,metadata:{...e.metadata,currency:t}}),n=await D({config:r});if(!n)return void console.error("Failed to create iframe");let o=B({config:r,iframe:n});return(await o.waitForSetup,await o.waitForConnection)?o:void console.error("Failed to connect to client")}function H(e){return btoa(Array.from(e,e=>String.fromCharCode(e)).join("")).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function V(e){let t=e.length%4;return Uint8Array.from(atob(e.replace(/-/g,"+").replace(/_/g,"/").padEnd(e.length+(0===t?0:4-t),"=")),e=>e.charCodeAt(0))}function G(e){return H((0,s.Cz)(e))}function W(e){return(0,s.j4)(V(e))}let J="fCtx";function K(e){if(e?.r)try{let t=(0,c.nr)(e.r);return H(t)}catch(t){console.error("Error compressing Frak context",{e:t,context:e})}}function X(e){if(e&&0!==e.length)try{let t=V(e);return{r:(0,u.ci)(t,{size:20})}}catch(t){console.error("Error decompressing Frak context",{e:t,context:e})}}function Y({url:e}){if(!e)return null;let t=new URL(e).searchParams.get(J);return t?X(t):null}function Q({url:e,context:t}){if(!e)return null;let r=Y({url:e}),n=r?{...r,...t}:t;if(!n.r)return null;let o=K(n);if(!o)return null;let i=new URL(e);return i.searchParams.set(J,o),i.toString()}function Z(e){let t=new URL(e);return t.searchParams.delete(J),t.toString()}let ee={compress:K,decompress:X,parse:Y,update:Q,remove:Z,replaceUrl:function({url:e,context:t}){let r;if(!window.location?.href||"undefined"==typeof window)return void console.error("No window found, can't update context");let n=e??window.location.href;(r=null!==t?Q({url:n,context:t}):Z(n))&&window.history.replaceState(null,"",r.toString())}};function et(e){return e?T[e]??T.eur:T.eur}function er(e){return e?`${e}Amount`:"eurAmount"}function en(e,t){let r=et(t),n=z(t);return e.toLocaleString(r,{style:"currency",currency:n,minimumFractionDigits:0,maximumFractionDigits:2})}function eo(e,t,r={}){if(!e)return void console.debug("[Frak] No client provided, skipping event tracking");try{e.openPanel?.track(t,r)}catch(e){console.debug("[Frak] Failed to track event:",t,e)}}function ei(e,t,r,n,o){var i;let s=G({r:(i={redirectUrl:t.redirectUrl,directExit:t.directExit,lang:t.lang,productId:r,metadata:{name:n,css:o,logoUrl:t.metadata?.logoUrl,homepageLink:t.metadata?.homepageLink}}).redirectUrl,d:i.directExit,l:i.lang,p:i.productId,m:{n:i.metadata?.name,css:i.metadata?.css,l:i.metadata?.logoUrl,h:i.metadata?.homepageLink}}),a=new URL(e);return a.pathname="/sso",a.searchParams.set("p",s),a.toString()}let es={dapp:1,press:2,webshop:3,retail:4,referral:30,purchase:31},ea=Object.entries(es).reduce((e,[t,r])=>(e[t]=BigInt(1)<<BigInt(r),e),{}),el={press:{openArticle:"0xc0a24ffb",readArticle:"0xd5bd0fbe"},dapp:{proofVerifiableStorageUpdate:"0x2ab2aeef",callableVerifiableStorageUpdate:"0xa07da986"},webshop:{open:"0xb311798f"},referral:{referred:"0x010cc3b9",createLink:"0xb2c0f17c"},purchase:{started:"0xd87e90c3",completed:"0x8403aeb4",unsafeCompleted:"0x4d5b14e0"},retail:{customerMeeting:"0x74489004"}};function ec({domain:e}={}){return(0,d.w)((0,u.NC)((e??window.location.host).replace("www.","")))}let eu="menubar=no,status=no,scrollbars=no,fullscreen=no,width=500, height=800",ed="frak-sso";async function ef(e,t){let{metadata:r,customizations:n,walletUrl:o}=e.config;if(t.openInSameWindow??!!t.redirectUrl)return await e.request({method:"frak_openSso",params:[t,r.name,n?.css]});let i=t.ssoPopupUrl??ei(o??"https://wallet.frak.id",t,ec(),r.name,n?.css),s=window.open(i,ed,eu);if(!s)throw Error("Popup was blocked. Please allow popups for this site.");return s.focus(),await e.request({method:"frak_openSso",params:[t,r.name,n?.css]})??{}}function eh(e,t){if(!t)return e.request({method:"frak_listenToWalletStatus"}).then(t=>(eb(e,t),t));let r=new s.BH,n=!1;return e.listenerRequest({method:"frak_listenToWalletStatus"},o=>{eb(e,o),t(o),n||(r.resolve(o),n=!0)}),r.promise}function eb(e,t){"undefined"!=typeof window&&(e.openPanel?.setGlobalProperties({wallet:t.wallet??null}),t.interactionToken?window.sessionStorage.setItem("frak-wallet-interaction-token",t.interactionToken):window.sessionStorage.removeItem("frak-wallet-interaction-token"))}async function ep(e,{productId:t,interaction:r,validation:n}){let o=t??ec(e.config);return await e.request({method:"frak_sendInteraction",params:[o,r,n]})}async function em(e,{steps:t,metadata:r}){return await e.request({method:"frak_displayModal",params:[t,r,e.config.metadata]})}async function ew(e,t){return await e.request({method:"frak_displayEmbeddedWallet",params:[t,e.config.metadata]})}async function ey(e,t){let{metadata:r,customizations:n}=e.config;return await e.request({method:"frak_prepareSso",params:[t,r.name,n?.css]})}async function eg(e){return await e.request({method:"frak_getProductInformation"})}async function ev(e){if("undefined"==typeof window)return void console.warn("[Frak] No window found, can't track purchase");let t=window.sessionStorage.getItem("frak-wallet-interaction-token");if(!t)return void console.warn("[Frak] No frak session found, skipping purchase check");await fetch("https://backend.frak.id/interactions/listenForPurchase",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json","x-wallet-sdk-auth":t},body:JSON.stringify(e)})}async function ej(e,{siwe:t,metadata:r}){let o=e.config?.domain??window.location.host,i=t?.statement??`I confirm that I want to use my Frak wallet on: ${e.config.metadata.name}`,s={...t,statement:i,nonce:t?.nonce??function(e=11){if(!n||L+e>512){n="",L=0;for(let e=0;e<256;e++)n+=(256+256*Math.random()|0).toString(16).substring(1)}return n.substring(L,L+++e)}(96),uri:t?.uri??`https://${o}`,version:t?.version??"1",domain:o};return(await em(e,{metadata:r,steps:{login:{},siweAuthenticate:{siwe:s}}})).siweAuthenticate}async function e_(e,{tx:t,metadata:r}){return(await em(e,{metadata:r,steps:{login:{},sendTransaction:{tx:t}}})).sendTransaction}function ex(e,{metadata:t,login:r,openSession:n}){return function e(t,r){async function n(e){return e&&(r.metadata=e(r.metadata??{})),await em(t,r)}return{params:r,sendTx:function(n){return e(t,{...r,steps:{...r.steps,sendTransaction:n}})},reward:function(n){return e(t,{...r,steps:{...r.steps,final:{...n,action:{key:"reward"}}}})},sharing:function(n,o){return e(t,{...r,steps:{...r.steps,final:{...o,action:{key:"sharing",options:n}}}})},display:n}}(e,{steps:{login:r??{},openSession:n??{}},metadata:t})}let ek={createLink:()=>({handlerTypeDenominator:(0,u.NC)(es.referral),interactionData:el.referral.createLink}),referred({referrer:e}){let t=(0,f.SM)([el.referral.referred,(0,h.vk)(e,{size:32})]);return{handlerTypeDenominator:(0,u.NC)(es.referral),interactionData:t}}};async function eS(e,{walletStatus:t,frakContext:r,modalConfig:n,productId:o,options:i}){let a=!1;async function l(){if(!a)return a=!0,eI(e,{modalConfig:{...n,loggedIn:{action:{key:"referred"}}},walletStatus:t})}async function c(t){let r=ek.referred({referrer:t});await Promise.allSettled([ep(e,{productId:o,interaction:r}),eo(e,"user_referred",{properties:{referrer:t}})])}try{let{status:e,currentWallet:n}=await eC({initialWalletStatus:t,getFreshWalletStatus:l,pushReferralInteraction:c,frakContext:r});return ee.replaceUrl({url:window.location?.href,context:i?.alwaysAppendUrl?{r:n}:null}),e}catch(e){return console.log("Error processing referral",{error:e}),ee.replaceUrl({url:window.location?.href,context:i?.alwaysAppendUrl?{r:t?.wallet}:null}),function(e){if(e instanceof s.u)switch(e.code){case s.ss.walletNotConnected:return"no-wallet";case s.ss.serverErrorForInteractionDelegation:return"no-session"}return"error"}(e)}}async function eC({initialWalletStatus:e,getFreshWalletStatus:t,pushReferralInteraction:r,frakContext:n}){let o=e?.wallet;return n?.r?(o||(o=await t()),o&&(0,b.E)(n.r,o))?{status:"self-referral",currentWallet:o}:(e?.interactionSession||(o=await t()),await r(n.r),{status:"success",currentWallet:o}):{status:"no-referrer",currentWallet:o}}async function eI(e,{modalConfig:t,walletStatus:r}){if(!r?.interactionSession){let r=await ew(e,t??{});return r?.wallet??void 0}return r.wallet??void 0}async function eE(e,{productId:t,modalConfig:r,options:n}={}){let o=ee.parse({url:window.location.href}),i=await eh(e);try{return await eS(e,{walletStatus:i,frakContext:o,modalConfig:r,productId:t,options:n})}catch(e){console.warn("Error processing referral",{error:e})}}let eA={openArticle({articleId:e}){let t=(0,f.SM)([el.press.openArticle,(0,h.vk)(e,{size:32})]);return{handlerTypeDenominator:(0,u.NC)(es.press),interactionData:t}},readArticle({articleId:e}){let t=(0,f.SM)([el.press.readArticle,(0,h.vk)(e,{size:32})]);return{handlerTypeDenominator:(0,u.NC)(es.press),interactionData:t}}},eO={startPurchase({purchaseId:e}){let t=(0,f.SM)([el.purchase.started,(0,h.vk)(e,{size:32})]);return{handlerTypeDenominator:(0,u.NC)(es.purchase),interactionData:t}},completedPurchase({purchaseId:e,proof:t}){let r=function(e,t){if(e.length!==t.length)throw new g({expectedLength:e.length,givenLength:t.length});let r=P(function({params:e,values:t}){let r=[];for(let n=0;n<e.length;n++)r.push(function e({param:t,value:r}){let n=function(e){let t=e.match(/^(.*)\[(\d+)?\]$/);return t?[t[2]?Number(t[2]):null,t[1]]:void 0}(t.type);if(n){let[o,i]=n;return function(t,{length:r,param:n}){let o=null===r;if(!Array.isArray(t))throw new j(t);if(!o&&t.length!==r)throw new w({expectedLength:r,givenLength:t.length,type:`${n.type}[${r}]`});let i=!1,s=[];for(let r=0;r<t.length;r++){let o=e({param:n,value:t[r]});o.dynamic&&(i=!0),s.push(o)}if(o||i){let e=P(s);if(o){let t=(0,u.eC)(s.length,{size:32});return{dynamic:!0,encoded:s.length>0?(0,f.zo)([t,e]):t}}if(i)return{dynamic:!0,encoded:e}}return{dynamic:!1,encoded:(0,f.zo)(s.map(({encoded:e})=>e))}}(r,{length:o,param:{...t,type:i}})}if("tuple"===t.type)return function(t,{param:r}){let n=!1,o=[];for(let i=0;i<r.components.length;i++){let s=r.components[i],a=Array.isArray(t)?i:s.name,l=e({param:s,value:t[a]});o.push(l),l.dynamic&&(n=!0)}return{dynamic:n,encoded:n?P(o):(0,f.zo)(o.map(({encoded:e})=>e))}}(r,{param:t});if("address"===t.type){var o=r;if(!(0,S.U)(o))throw new x.b({address:o});return{dynamic:!1,encoded:(0,h.gc)(o.toLowerCase())}}if("bool"===t.type){var i=r;if("boolean"!=typeof i)throw new m.G(`Invalid boolean value: "${i}" (type: ${typeof i}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:(0,h.gc)((0,u.C4)(i))}}if(t.type.startsWith("uint")||t.type.startsWith("int")){let e=t.type.startsWith("int"),[,,n="256"]=O.exec(t.type)??[];return function(e,{signed:t,size:r=256}){if("number"==typeof r){let n=2n**(BigInt(r)-(t?1n:0n))-1n,o=t?-n-1n:0n;if(e>n||e<o)throw new k.J5({max:n.toString(),min:o.toString(),signed:t,size:r/8,value:e.toString()})}return{dynamic:!1,encoded:(0,u.eC)(e,{size:32,signed:t})}}(r,{signed:e,size:Number(n)})}if(t.type.startsWith("bytes"))return function(e,{param:t}){let[,r]=t.type.split("bytes"),n=(0,p.d)(e);if(!r){let t=e;return n%32!=0&&(t=(0,h.gc)(t,{dir:"right",size:32*Math.ceil((e.length-2)/2/32)})),{dynamic:!0,encoded:(0,f.zo)([(0,h.gc)((0,u.eC)(n,{size:32})),t])}}if(n!==Number.parseInt(r))throw new y({expectedSize:Number.parseInt(r),value:e});return{dynamic:!1,encoded:(0,h.gc)(e,{dir:"right"})}}(r,{param:t});if("string"===t.type){var s=r;let e=(0,u.$G)(s),t=Math.ceil((0,p.d)(e)/32),n=[];for(let r=0;r<t;r++)n.push((0,h.gc)(function(e,t,r,{strict:n}={}){return(0,I.v)(e,{strict:!1})?function(e,t,r,{strict:n}={}){E(e,t);let o=`0x${e.replace("0x","").slice((t??0)*2,(r??e.length)*2)}`;return n&&A(o,t,r),o}(e,t,r,{strict:n}):function(e,t,r,{strict:n}={}){E(e,t);let o=e.slice(t,r);return n&&A(o,t,r),o}(e,t,r,{strict:n})}(e,32*r,(r+1)*32),{dir:"right"}));return{dynamic:!0,encoded:(0,f.zo)([(0,h.gc)((0,u.eC)((0,p.d)(e),{size:32})),...n])}}throw new v(t.type,{docsPath:"/docs/contract/encodeAbiParameters"})}({param:e[n],value:t[n]}));return r}({params:e,values:t}));return 0===r.length?"0x":r}([{type:"uint256"},{type:"bytes32[]"}],[BigInt(e),t]),n=(0,f.SM)([el.purchase.completed,r]);return{handlerTypeDenominator:(0,u.NC)(es.purchase),interactionData:n}},unsafeCompletedPurchase({purchaseId:e}){let t=(0,f.SM)([el.purchase.unsafeCompleted,(0,h.vk)(e,{size:32})]);return{handlerTypeDenominator:(0,u.NC)(es.purchase),interactionData:t}}},eP={open:()=>({handlerTypeDenominator:(0,u.NC)(es.webshop),interactionData:el.webshop.open})},eL={customerMeeting({agencyId:e}){let t=(0,f.SM)([el.retail.customerMeeting,(0,h.vk)(e,{size:32})]);return{handlerTypeDenominator:(0,u.NC)(es.retail),interactionData:t}}};var eU=r("./src/components/ButtonWallet/utils.ts"),eR=r("./src/utils/clientReady.ts"),eF=r("./src/utils/setup.ts");async function eD(){if(window.FrakSetup.core=o,!(window.frakSetupInProgress?(console.log("[Frak SDK] Initialization already in progress"),!1):window.FrakSetup?.client?(console.log("[Frak SDK] Client already initialized"),!1):!!window.FrakSetup?.config||(console.error("[Frak SDK] Configuration not found. Please ensure window.FrakSetup.config is set."),!1)))return;if(console.log("[Frak SDK] Starting initialization"),window.frakSetupInProgress=!0,!window.FrakSetup.config){console.error("[Frak SDK] Configuration not found"),window.frakSetupInProgress=!1;return}let e=await (0,i.lD)({config:window.FrakSetup.config});if(!e){console.error("[Frak SDK] Failed to create client"),window.frakSetupInProgress=!1;return}window.FrakSetup.client=e,console.log("[Frak SDK] Client initialized successfully"),(0,eR.f)(),(0,eF.N3)(e),(0,eF.zK)(e),window.frakSetupInProgress=!1,function(){let e=new URLSearchParams(window.location.search).get("frakAction");e&&"share"===e&&(console.log("[Frak SDK] Auto open query param found"),(0,eU.G)())}()}},"./src/utils/setup.ts":function(e,t,r){r.d(t,{Gt:()=>s,N3:()=>o,zK:()=>i});var n=r("../core/dist/actions.js");function o(e){window.modalBuilderSteps=(0,n.jy)(e,window.FrakSetup?.modalConfig??{})}async function i(e){console.log("referral",await (0,n.KS)(e,{modalConfig:window.FrakSetup?.modalWalletConfig}))}function s(){if(!window.modalBuilderSteps)throw Error("modalBuilderSteps not found");return window.modalBuilderSteps}},"../core/dist/actions.js":function(e,t,r){r.d(t,{KS:()=>x,jy:()=>b,pO:()=>h,s9:()=>f});var n=r("../../packages/rpc/dist/index.js"),o=r("../../node_modules/.bun/viem@2.31.2+5bbfac422febb175/node_modules/viem/_esm/utils/hash/keccak256.js"),i=r("../../node_modules/.bun/viem@2.31.2+5bbfac422febb175/node_modules/viem/_esm/utils/encoding/toHex.js"),s=r("../../node_modules/.bun/viem@2.31.2+5bbfac422febb175/node_modules/viem/_esm/utils/encoding/toBytes.js"),a=r("../../node_modules/.bun/viem@2.31.2+5bbfac422febb175/node_modules/viem/_esm/utils/data/concat.js"),l=r("../../node_modules/.bun/viem@2.31.2+5bbfac422febb175/node_modules/viem/_esm/utils/data/pad.js"),c=r("../../node_modules/.bun/viem@2.31.2+5bbfac422febb175/node_modules/viem/_esm/utils/address/isAddressEqual.js");async function u(e,{productId:t,interaction:r,validation:n}){let s=t??function({domain:e}={}){return(0,o.w)((0,i.NC)((e??window.location.host).replace("www.","")))}(e.config);return await e.request({method:"frak_sendInteraction",params:[s,r,n]})}async function d(e,{steps:t,metadata:r}){return await e.request({method:"frak_displayModal",params:[t,r,e.config.metadata]})}async function f(e,t){return await e.request({method:"frak_displayEmbeddedWallet",params:[t,e.config.metadata]})}async function h(e){return await e.request({method:"frak_getProductInformation"})}function b(e,{metadata:t,login:r,openSession:n}){return function e(t,r){async function n(e){return e&&(r.metadata=e(r.metadata??{})),await d(t,r)}return{params:r,sendTx:function(n){return e(t,{...r,steps:{...r.steps,sendTransaction:n}})},reward:function(n){return e(t,{...r,steps:{...r.steps,final:{...n,action:{key:"reward"}}}})},sharing:function(n,o){return e(t,{...r,steps:{...r.steps,final:{...o,action:{key:"sharing",options:n}}}})},display:n}}(e,{steps:{login:r??{},openSession:n??{}},metadata:t})}let p="fCtx";function m({url:e}){if(!e)return null;let t=new URL(e).searchParams.get(p);return t?function(e){if(e&&0!==e.length)try{let t,r=(t=e.length%4,Uint8Array.from(atob(e.replace(/-/g,"+").replace(/_/g,"/").padEnd(e.length+(0===t?0:4-t),"=")),e=>e.charCodeAt(0)));return{r:(0,i.ci)(r,{size:20})}}catch(t){console.error("Error decompressing Frak context",{e:t,context:e})}}(t):null}let w={parse:m,replaceUrl:function({url:e,context:t}){let r,n;if(!window.location?.href||"undefined"==typeof window)return void console.error("No window found, can't update context");let o=e??window.location.href;(r=null!==t?function({url:e,context:t}){if(!e)return null;let r=m({url:e}),n=r?{...r,...t}:t;if(!n.r)return null;let o=function(e){if(e?.r)try{var t;return t=(0,s.nr)(e.r),btoa(Array.from(t,e=>String.fromCharCode(e)).join("")).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}catch(t){console.error("Error compressing Frak context",{e:t,context:e})}}(n);if(!o)return null;let i=new URL(e);return i.searchParams.set(p,o),i.toString()}({url:o,context:t}):((n=new URL(o)).searchParams.delete(p),n.toString()))&&window.history.replaceState(null,"",r.toString())}},y={dapp:1,press:2,webshop:3,retail:4,referral:30,purchase:31};Object.entries(y).reduce((e,[t,r])=>(e[t]=BigInt(1)<<BigInt(r),e),{});let g={createLink:()=>({handlerTypeDenominator:(0,i.NC)(y.referral),interactionData:"0xb2c0f17c"}),referred({referrer:e}){let t=(0,a.SM)(["0x010cc3b9",(0,l.vk)(e,{size:32})]);return{handlerTypeDenominator:(0,i.NC)(y.referral),interactionData:t}}};async function v(e,{walletStatus:t,frakContext:r,modalConfig:o,productId:i,options:s}){let a=!1;async function l(){if(!a)return a=!0,_(e,{modalConfig:{...o,loggedIn:{action:{key:"referred"}}},walletStatus:t})}async function c(t){let r=g.referred({referrer:t});await Promise.allSettled([u(e,{productId:i,interaction:r}),function(e,t,r={}){if(!e)return void console.debug("[Frak] No client provided, skipping event tracking");try{e.openPanel?.track(t,r)}catch(e){console.debug("[Frak] Failed to track event:",t,e)}}(e,"user_referred",{properties:{referrer:t}})])}try{let{status:e,currentWallet:n}=await j({initialWalletStatus:t,getFreshWalletStatus:l,pushReferralInteraction:c,frakContext:r});return w.replaceUrl({url:window.location?.href,context:s?.alwaysAppendUrl?{r:n}:null}),e}catch(e){return console.log("Error processing referral",{error:e}),w.replaceUrl({url:window.location?.href,context:s?.alwaysAppendUrl?{r:t?.wallet}:null}),function(e){if(e instanceof n.u)switch(e.code){case n.ss.walletNotConnected:return"no-wallet";case n.ss.serverErrorForInteractionDelegation:return"no-session"}return"error"}(e)}}async function j({initialWalletStatus:e,getFreshWalletStatus:t,pushReferralInteraction:r,frakContext:n}){let o=e?.wallet;return n?.r?(o||(o=await t()),o&&(0,c.E)(n.r,o))?{status:"self-referral",currentWallet:o}:(e?.interactionSession||(o=await t()),await r(n.r),{status:"success",currentWallet:o}):{status:"no-referrer",currentWallet:o}}async function _(e,{modalConfig:t,walletStatus:r}){if(!r?.interactionSession){let r=await f(e,t??{});return r?.wallet??void 0}return r.wallet??void 0}async function x(e,{productId:t,modalConfig:r,options:n}={}){var o,i;let s=w.parse({url:window.location.href}),a=await (o=e).request({method:"frak_listenToWalletStatus"}).then(e=>{var t,r;return t=o,r=e,"undefined"!=typeof window&&(t.openPanel?.setGlobalProperties({wallet:r.wallet??null}),r.interactionToken?window.sessionStorage.setItem("frak-wallet-interaction-token",r.interactionToken):window.sessionStorage.removeItem("frak-wallet-interaction-token")),e});try{return await v(e,{walletStatus:a,frakContext:s,modalConfig:r,productId:t,options:n})}catch(e){console.warn("Error processing referral",{error:e})}}},"../core/dist/index.js":function(e,t,r){r.d(t,{L9:()=>m,Up:()=>b,dN:()=>p,lD:()=>h,oC:()=>a});var n=r("../../packages/rpc/dist/index.js"),o=r("../../packages/rpc/dist/middleware.js"),i=r("../../node_modules/.bun/@openpanel+web@1.0.1/node_modules/@openpanel/web/dist/index.js");let s="nexus-wallet-backup";class a{config;iframe;isSetupDone=!1;lastResponse=null;lastRequest=null;constructor(e,t){this.config=e,this.iframe=t,this.lastRequest=null,this.lastResponse=null}setLastResponse(e,t){this.lastResponse={message:e,response:t,timestamp:Date.now()}}setLastRequest(e){this.lastRequest={event:e,timestamp:Date.now()}}updateSetupStatus(e){this.isSetupDone=e}base64Encode(e){try{return btoa(JSON.stringify(e))}catch(e){return console.warn("Failed to encode debug data",e),btoa("Failed to encode data")}}getIframeStatus(){return this.iframe?{loading:this.iframe.hasAttribute("loading"),url:this.iframe.src,readyState:this.iframe.contentDocument?.readyState?+("complete"===this.iframe.contentDocument.readyState):-1,contentWindow:!!this.iframe.contentWindow,isConnected:this.iframe.isConnected}:null}getNavigatorInfo(){return navigator?{userAgent:navigator.userAgent,language:navigator.language,onLine:navigator.onLine,screenWidth:window.screen.width,screenHeight:window.screen.height,pixelRatio:window.devicePixelRatio}:null}gatherDebugInfo(e){let t=this.getIframeStatus(),r=this.getNavigatorInfo(),o="Unknown";return e instanceof n.u?o=`FrakRpcError: ${e.code} '${e.message}'`:e instanceof Error?o=e.message:"string"==typeof e&&(o=e),{timestamp:new Date().toISOString(),encodedUrl:btoa(window.location.href),encodedConfig:this.config?this.base64Encode(this.config):"no-config",navigatorInfo:r?this.base64Encode(r):"no-navigator",iframeStatus:t?this.base64Encode(t):"not-iframe",lastRequest:this.lastRequest?this.base64Encode(this.lastRequest):"No Frak request logged",lastResponse:this.lastResponse?this.base64Encode(this.lastResponse):"No Frak response logged",clientStatus:this.isSetupDone?"setup":"not-setup",error:o}}static empty(){return new a}formatDebugInfo(e){let t=this.gatherDebugInfo(e);return`
20
+ `.trim()}}let em={id:"frak-wallet",name:"frak-wallet",title:"Frak Wallet",allow:"publickey-credentials-get *; clipboard-write; web-share *",style:{width:"0",height:"0",border:"0",position:"absolute",zIndex:2000001,top:"-1000px",left:"-1000px",colorScheme:"auto"}};function ew({walletBaseUrl:e,config:t}){let r=document.querySelector("#frak-wallet");r&&r.remove();let n=document.createElement("iframe");return n.id=em.id,n.name=em.name,n.allow=em.allow,n.style.zIndex=em.style.zIndex.toString(),ey({iframe:n,isVisible:!1}),document.body.appendChild(n),new Promise(r=>{n?.addEventListener("load",()=>r(n)),n.src=`${t?.walletUrl??e??"https://wallet.frak.id"}/listener`})}function ey({iframe:e,isVisible:t}){if(!t){e.style.width="0",e.style.height="0",e.style.border="0",e.style.position="fixed",e.style.top="-1000px",e.style.left="-1000px";return}e.style.position="fixed",e.style.top="0",e.style.left="0",e.style.width="100%",e.style.height="100%",e.style.pointerEvents="auto"}function eg(e="/listener"){if(!window.opener)return null;let t=t=>{try{return t.location.origin===window.location.origin&&t.location.pathname===e}catch{return!1}};if(t(window.opener))return window.opener;try{let e=window.opener.frames;for(let r=0;r<e.length;r++)if(t(e[r]))return e[r];return null}catch(t){return console.error(`[findIframeInOpener] Error finding iframe with pathname ${e}:`,t),null}}function ej({config:e,iframe:t}){let r,n=e?.walletUrl??"https://wallet.frak.id",o=function({iframe:e}){let t=new P.cY;return{handleEvent:async r=>{if(!("iframeLifecycle"in r))return;let{iframeLifecycle:n,data:o}=r;switch(n){case"connected":t.resolve(!0);break;case"do-backup":o.backup?localStorage.setItem(eb,o.backup):localStorage.removeItem(eb);break;case"remove-backup":localStorage.removeItem(eb);break;case"show":case"hide":ey({iframe:e,isVisible:"show"===n});break;case"handshake":e.contentWindow?.postMessage({clientLifecycle:"handshake-response",data:{token:o.token,currentUrl:window.location.href}},"*");break;case"redirect":{let e=new URL(o.baseRedirectUrl);e.searchParams.has("u")?(e.searchParams.delete("u"),e.searchParams.append("u",window.location.href),window.location.href=e.toString()):window.location.href=o.baseRedirectUrl}}},isConnected:t.promise}}({iframe:t}),i=new ep(e,t);if(!t.contentWindow)throw new A.c(A.d.configError,"The iframe does not have a content window");let s=(0,P.H4)({emittingTransport:t.contentWindow,listeningTransport:window,targetOrigin:n,middleware:[{async onRequest(e,t){if(!await o.isConnected)throw new A.c(A.d.clientNotConnected,"The iframe provider isn't connected yet");return t}},(0,A.t)(),{onRequest:(e,t)=>(i.setLastRequest(e),t),onResponse:(e,t)=>(i.setLastResponse(e,t),t)}],lifecycleHandlers:{iframeLifecycle:async(e,t)=>{await o.handleEvent(e)}}}),a=function(e,t){let r,n,o=()=>e.sendLifecycle({clientLifecycle:"heartbeat"});function i(){r&&clearInterval(r),n&&clearTimeout(n)}return async function(){o(),r=setInterval(o,1e3),n=setTimeout(()=>{i(),console.log("Heartbeat timeout: connection failed")},3e4),await t.isConnected,i()}(),i}(s,o),c=async()=>{a(),s.cleanup(),t.remove()};console.log("[Frak SDK] Initializing OpenPanel"),(r=new L.j({apiUrl:"https://op-api.gcp.frak.id",clientId:"6eacc8d7-49ac-4936-95e9-81ef29449570",trackScreenViews:!0,trackOutgoingLinks:!0,trackAttributes:!1,filter:({type:e,payload:t})=>!("track"===e&&t?.properties)||("sdkVersion"in t.properties||(t.properties={...t.properties,sdkVersion:"0.1.0"}),!0)})).setGlobalProperties({sdkVersion:"0.1.0"}),r.init();let l=ev({config:e,rpcClient:s,lifecycleManager:o}).then(()=>i.updateSetupStatus(!0));return{config:e,debugInfo:i,waitForConnection:o.isConnected,waitForSetup:l,request:s.request,listenerRequest:s.listen,destroy:c,openPanel:r}}async function ev({config:e,rpcClient:t,lifecycleManager:r}){async function n(){let r=e.customizations?.css;r&&t.sendLifecycle({clientLifecycle:"modal-css",data:{cssLink:r}})}async function o(){let r=e.customizations?.i18n;r&&t.sendLifecycle({clientLifecycle:"modal-i18n",data:{i18n:r}})}async function i(){if("undefined"==typeof window)return;let e=window.localStorage.getItem(eb);e&&t.sendLifecycle({clientLifecycle:"restore-backup",data:{backup:e}})}await r.isConnected,function(e,t){if("undefined"==typeof window)return;let r=new URL(window.location.href),n=r.searchParams.get("sso");n&&(t.then(()=>{e.sendLifecycle({clientLifecycle:"sso-redirect-complete",data:{compressed:n}}),console.log("[SSO URL Listener] Forwarded compressed SSO data to iframe")}).catch(e=>{console.error("[SSO URL Listener] Failed to forward SSO data:",e)}),r.searchParams.delete("sso"),window.history.replaceState({},"",r.toString()),console.log("[SSO URL Listener] SSO parameter detected and URL cleaned"))}(t,r.isConnected),await Promise.allSettled([n(),o(),i()])}let e_={eur:"fr-FR",usd:"en-US",gbp:"en-GB"};function ex(e){return e&&e in e_?e:"eur"}async function ek({config:e}){let t,r=(t=ex(e.metadata?.currency),{...e,metadata:{...e.metadata,currency:t}}),n=await ew({config:r});if(!n)return void console.error("Failed to create iframe");let o=ej({config:r,iframe:n});return(await o.waitForSetup,await o.waitForConnection)?o:void console.error("Failed to connect to client")}function eS(e){return(0,A.a)(B(e))}function eC(e){return e?e_[e]??e_.eur:e_.eur}function eE(e,t){let r=eC(t),n=ex(t);return e.toLocaleString(r,{style:"currency",currency:n,minimumFractionDigits:0,maximumFractionDigits:2})}function eI(e){return e?`${e}Amount`:"eurAmount"}let eA={openArticle({articleId:e}){let t=(0,c.aP)([q.press.openArticle,(0,l.eV)(e,{size:32})]);return{handlerTypeDenominator:(0,a.nj)(W.press),interactionData:t}},readArticle({articleId:e}){let t=(0,c.aP)([q.press.readArticle,(0,l.eV)(e,{size:32})]);return{handlerTypeDenominator:(0,a.nj)(W.press),interactionData:t}}},eP={startPurchase({purchaseId:e}){let t=(0,c.aP)([q.purchase.started,(0,l.eV)(e,{size:32})]);return{handlerTypeDenominator:(0,a.nj)(W.purchase),interactionData:t}},completedPurchase({purchaseId:e,proof:t}){let r=function(e,t){if(e.length!==t.length)throw new m({expectedLength:e.length,givenLength:t.length});let r=I(function({params:e,values:t}){let r=[];for(let n=0;n<e.length;n++)r.push(function e({param:t,value:r}){let n,o=(n=t.type.match(/^(.*)\[(\d+)?\]$/))?[n[2]?Number(n[2]):null,n[1]]:void 0;if(o){let[n,i]=o;return function(t,{length:r,param:n}){let o=null===r;if(!Array.isArray(t))throw new y(t);if(!o&&t.length!==r)throw new b({expectedLength:r,givenLength:t.length,type:`${n.type}[${r}]`});let i=!1,s=[];for(let r=0;r<t.length;r++){let o=e({param:n,value:t[r]});o.dynamic&&(i=!0),s.push(o)}if(o||i){let e=I(s);if(o){let t=(0,a.cK)(s.length,{size:32});return{dynamic:!0,encoded:s.length>0?(0,c.xW)([t,e]):t}}if(i)return{dynamic:!0,encoded:e}}return{dynamic:!1,encoded:(0,c.xW)(s.map(({encoded:e})=>e))}}(r,{length:n,param:{...t,type:i}})}if("tuple"===t.type)return function(t,{param:r}){let n=!1,o=[];for(let i=0;i<r.components.length;i++){let s=r.components[i],a=Array.isArray(t)?i:s.name,c=e({param:s,value:t[a]});o.push(c),c.dynamic&&(n=!0)}return{dynamic:n,encoded:n?I(o):(0,c.xW)(o.map(({encoded:e})=>e))}}(r,{param:t});if("address"===t.type){var i=r;if(!(0,_.P)(i))throw new j.M({address:i});return{dynamic:!1,encoded:(0,l.db)(i.toLowerCase())}}if("bool"===t.type){var s=r;if("boolean"!=typeof s)throw new h.C(`Invalid boolean value: "${s}" (type: ${typeof s}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:(0,l.db)((0,a.$P)(s))}}if(t.type.startsWith("uint")||t.type.startsWith("int")){let e=t.type.startsWith("int"),[,,n="256"]=E.exec(t.type)??[];return function(e,{signed:t,size:r=256}){if("number"==typeof r){let n=2n**(BigInt(r)-(t?1n:0n))-1n,o=t?-n-1n:0n;if(e>n||e<o)throw new v.Ty({max:n.toString(),min:o.toString(),signed:t,size:r/8,value:e.toString()})}return{dynamic:!1,encoded:(0,a.cK)(e,{size:32,signed:t})}}(r,{signed:e,size:Number(n)})}if(t.type.startsWith("bytes"))return function(e,{param:t}){let[,r]=t.type.split("bytes"),n=(0,f.E)(e);if(!r){let t=e;return n%32!=0&&(t=(0,l.db)(t,{dir:"right",size:32*Math.ceil((e.length-2)/2/32)})),{dynamic:!0,encoded:(0,c.xW)([(0,l.db)((0,a.cK)(n,{size:32})),t])}}if(n!==Number.parseInt(r,10))throw new p({expectedSize:Number.parseInt(r,10),value:e});return{dynamic:!1,encoded:(0,l.db)(e,{dir:"right"})}}(r,{param:t});if("string"===t.type){var u=r;let e=(0,a.i3)(u),t=Math.ceil((0,f.E)(e)/32),n=[];for(let r=0;r<t;r++)n.push((0,l.db)(function(e,t,r,{strict:n}={}){return(0,k.q)(e,{strict:!1})?function(e,t,r,{strict:n}={}){S(e,t);let o=`0x${e.replace("0x","").slice((t??0)*2,(r??e.length)*2)}`;return n&&C(o,t,r),o}(e,t,r,{strict:n}):function(e,t,r,{strict:n}={}){S(e,t);let o=e.slice(t,r);return n&&C(o,t,r),o}(e,t,r,{strict:n})}(e,32*r,(r+1)*32),{dir:"right"}));return{dynamic:!0,encoded:(0,c.xW)([(0,l.db)((0,a.cK)((0,f.E)(e),{size:32})),...n])}}throw new w(t.type,{docsPath:"/docs/contract/encodeAbiParameters"})}({param:e[n],value:t[n]}));return r}({params:e,values:t}));return 0===r.length?"0x":r}([{type:"uint256"},{type:"bytes32[]"}],[BigInt(e),t]),n=(0,c.aP)([q.purchase.completed,r]);return{handlerTypeDenominator:(0,a.nj)(W.purchase),interactionData:n}},unsafeCompletedPurchase({purchaseId:e}){let t=(0,c.aP)([q.purchase.unsafeCompleted,(0,l.eV)(e,{size:32})]);return{handlerTypeDenominator:(0,a.nj)(W.purchase),interactionData:t}}},eO={customerMeeting({agencyId:e}){let t=(0,c.aP)([q.retail.customerMeeting,(0,l.eV)(e,{size:32})]);return{handlerTypeDenominator:(0,a.nj)(W.retail),interactionData:t}}},eL={open:()=>({handlerTypeDenominator:(0,a.nj)(W.webshop),interactionData:q.webshop.open})};var eU=r("./src/components/ButtonWallet/utils.ts"),eR=r("./src/utils/clientReady.ts"),eF=r("./src/utils/setup.ts");async function eD(){let e;if(window.FrakSetup.core=o,!(window.frakSetupInProgress?(console.log("[Frak SDK] Initialization already in progress"),!1):window.FrakSetup?.client?(console.log("[Frak SDK] Client already initialized"),!1):!!window.FrakSetup?.config||(console.error("[Frak SDK] Configuration not found. Please ensure window.FrakSetup.config is set."),!1)))return;if(console.log("[Frak SDK] Starting initialization"),window.frakSetupInProgress=!0,!window.FrakSetup.config){console.error("[Frak SDK] Configuration not found"),window.frakSetupInProgress=!1;return}let t=await (0,i.l2)({config:window.FrakSetup.config});if(!t){console.error("[Frak SDK] Failed to create client"),window.frakSetupInProgress=!1;return}window.FrakSetup.client=t,console.log("[Frak SDK] Client initialized successfully"),(0,eR.T)(),(0,eF.LF)(t),(0,eF.VH)(t),window.frakSetupInProgress=!1,(e=new URLSearchParams(window.location.search).get("frakAction"))&&"share"===e&&(console.log("[Frak SDK] Auto open query param found"),(0,eU.h)())}},"./src/utils/setup.ts":function(e,t,r){r.d(t,{LF:()=>o,VH:()=>i,et:()=>s});var n=r("../core/dist/actions.js");function o(e){window.modalBuilderSteps=(0,n.hc)(e,window.FrakSetup?.modalConfig??{})}async function i(e){console.log("referral",await (0,n.kn)(e,{modalConfig:window.FrakSetup?.modalWalletConfig}))}function s(){if(!window.modalBuilderSteps)throw Error("modalBuilderSteps not found");return window.modalBuilderSteps}},"../../node_modules/.bun/@noble+hashes@1.8.0/node_modules/@noble/hashes/esm/_u64.js":function(e,t,r){r.d(t,{B4:()=>h,CQ:()=>j,CW:()=>g,Ei:()=>d,F8:()=>v,P5:()=>f,TH:()=>_,Vl:()=>w,Vr:()=>y,WM:()=>b,WQ:()=>m,im:()=>p,jm:()=>a,lD:()=>i,qh:()=>u,rE:()=>c,ry:()=>l,xn:()=>s});let n=BigInt(0x100000000-1),o=BigInt(32);function i(e,t=!1){let r=e.length,s=new Uint32Array(r),a=new Uint32Array(r);for(let i=0;i<r;i++){let{h:r,l:c}=function(e,t=!1){return t?{h:Number(e&n),l:Number(e>>o&n)}:{h:0|Number(e>>o&n),l:0|Number(e&n)}}(e[i],t);[s[i],a[i]]=[r,c]}return[s,a]}let s=(e,t,r)=>e>>>r,a=(e,t,r)=>e<<32-r|t>>>r,c=(e,t,r)=>e>>>r|t<<32-r,l=(e,t,r)=>e<<32-r|t>>>r,u=(e,t,r)=>e<<64-r|t>>>r-32,d=(e,t,r)=>e>>>r-32|t<<64-r,f=(e,t,r)=>e<<r|t>>>32-r,h=(e,t,r)=>t<<r|e>>>32-r,b=(e,t,r)=>t<<r-32|e>>>64-r,p=(e,t,r)=>e<<r-32|t>>>64-r;function m(e,t,r,n){let o=(t>>>0)+(n>>>0);return{h:e+r+(o/0x100000000|0)|0,l:0|o}}let w=(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0),y=(e,t,r,n)=>t+r+n+(e/0x100000000|0)|0,g=(e,t,r,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0),j=(e,t,r,n,o)=>t+r+n+o+(e/0x100000000|0)|0,v=(e,t,r,n,o)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(o>>>0),_=(e,t,r,n,o,i)=>t+r+n+o+i+(e/0x100000000|0)|0},"../../node_modules/.bun/@noble+hashes@1.8.0/node_modules/@noble/hashes/esm/utils.js":function(e,t,r){function n(e){if(!Number.isSafeInteger(e)||e<0)throw Error("positive integer expected, got "+e)}function o(e,...t){if(!(e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name))throw Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw Error("Uint8Array expected of length "+t+", got length="+e.length)}function i(e,t=!0){if(e.destroyed)throw Error("Hash instance has been destroyed");if(t&&e.finished)throw Error("Hash#digest() has already been called")}function s(e,t){o(e);let r=t.outputLen;if(e.length<r)throw Error("digestInto() expects output buffer of length at least "+r)}function a(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function c(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function l(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function u(e,t){return e<<32-t|e>>>t}r.d(t,{CC:()=>i,DH:()=>a,DO:()=>o,Fe:()=>n,Ht:()=>s,O8:()=>l,Ow:()=>u,Vw:()=>h,ZJ:()=>f,fd:()=>d,qj:()=>b,uH:()=>c});let d=68===new Uint8Array(new Uint32Array([0x11223344]).buffer)[0]?e=>e:function(e){for(let r=0;r<e.length;r++){var t;e[r]=(t=e[r])<<24&0xff000000|t<<8&0xff0000|t>>>8&65280|t>>>24&255}return e};function f(e){return"string"==typeof e&&(e=function(e){if("string"!=typeof e)throw Error("string expected");return new Uint8Array(new TextEncoder().encode(e))}(e)),o(e),e}class h{}function b(e){let t=t=>e().update(f(t)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}},"../../node_modules/.bun/@openpanel+web@1.0.1/node_modules/@openpanel/web/dist/index.js":function(e,t,r){r.d(t,{j:()=>i});var n=class{constructor(e){this.baseUrl=e.baseUrl,this.headers={"Content-Type":"application/json",...e.defaultHeaders},this.maxRetries=e.maxRetries??3,this.initialRetryDelay=e.initialRetryDelay??500}async resolveHeaders(){let e={};for(let[t,r]of Object.entries(this.headers)){let n=await r;null!==n&&(e[t]=n)}return e}addHeader(e,t){this.headers[e]=t}async post(e,t,r,n){try{let n=await fetch(e,{method:"POST",headers:await this.resolveHeaders(),body:JSON.stringify(t??{}),keepalive:!0,...r});if(401===n.status)return null;if(200!==n.status&&202!==n.status)throw Error(`HTTP error! status: ${n.status}`);let o=await n.text();return o?JSON.parse(o):null}catch(o){if(n<this.maxRetries){let o=this.initialRetryDelay*Math.pow(2,n);return await new Promise(e=>setTimeout(e,o)),this.post(e,t,r,n+1)}return console.error("Max retries reached:",o),null}}async fetch(e,t,r={}){let n=`${this.baseUrl}${e}`;return this.post(n,t,r,0)}},o=class{constructor(e){this.options=e,this.queue=[];let t={"openpanel-client-id":e.clientId};e.clientSecret&&(t["openpanel-client-secret"]=e.clientSecret),t["openpanel-sdk-name"]=e.sdk||"node",t["openpanel-sdk-version"]=e.sdkVersion||"1.0.0",this.api=new n({baseUrl:e.apiUrl||"https://api.openpanel.dev",defaultHeaders:t})}init(){}ready(){this.options.waitForProfile=!1,this.flush()}async send(e){return this.options.disabled||this.options.filter&&!this.options.filter(e)?Promise.resolve():this.options.waitForProfile&&!this.profileId?(this.queue.push(e),Promise.resolve()):this.api.fetch("/track",e)}setGlobalProperties(e){this.global={...this.global,...e}}async track(e,t){return this.send({type:"track",payload:{name:e,profileId:t?.profileId??this.profileId,properties:{...this.global??{},...t??{}}}})}async identify(e){if(e.profileId&&(this.profileId=e.profileId,this.flush()),Object.keys(e).length>1)return this.send({type:"identify",payload:{...e,properties:{...this.global,...e.properties}}})}async alias(e){return this.send({type:"alias",payload:e})}async increment(e){return this.send({type:"increment",payload:e})}async decrement(e){return this.send({type:"decrement",payload:e})}clear(){this.profileId=void 0}flush(){this.queue.forEach(e=>{this.send({...e,payload:{...e.payload,profileId:e.payload.profileId??this.profileId}})}),this.queue=[]}},i=class extends o{constructor(e){super({sdk:"web",sdkVersion:"1.0.1",...e}),this.options=e,this.lastPath="",this.isServer()||(this.setGlobalProperties({__referrer:document.referrer}),this.options.trackScreenViews&&this.trackScreenViews(),this.options.trackOutgoingLinks&&this.trackOutgoingLinks(),this.options.trackAttributes&&this.trackAttributes())}debounce(e,t){clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(e,t)}isServer(){return typeof document>"u"}trackOutgoingLinks(){this.isServer()||document.addEventListener("click",e=>{let t=e.target,r=t.closest("a");if(r&&t){let e=r.getAttribute("href");e?.startsWith("http")&&super.track("link_out",{href:e,text:r.innerText||r.getAttribute("title")||t.getAttribute("alt")||t.getAttribute("title")})}})}trackScreenViews(){if(this.isServer())return;this.screenView();let e=history.pushState;history.pushState=function(...t){let r=e.apply(this,t);return window.dispatchEvent(new Event("pushstate")),window.dispatchEvent(new Event("locationchange")),r};let t=history.replaceState;history.replaceState=function(...e){let r=t.apply(this,e);return window.dispatchEvent(new Event("replacestate")),window.dispatchEvent(new Event("locationchange")),r},window.addEventListener("popstate",()=>{window.dispatchEvent(new Event("locationchange"))});let r=()=>this.debounce(()=>this.screenView(),50);this.options.trackHashChanges?window.addEventListener("hashchange",r):window.addEventListener("locationchange",r)}trackAttributes(){this.isServer()||document.addEventListener("click",e=>{let t=e.target,r=t.closest("button"),n=t.closest("a"),o=r?.getAttribute("data-track")?r:n?.getAttribute("data-track")?n:null;if(o){let e={};for(let t of o.attributes)t.name.startsWith("data-")&&"data-track"!==t.name&&(e[t.name.replace(/^data-/,"").replace(/([-_][a-z])/gi,e=>e.toUpperCase().replace("-","").replace("_",""))]=t.value);let t=o.getAttribute("data-track");t&&super.track(t,e)}})}screenView(e,t){let r,n;this.isServer()||("string"==typeof e?(r=e,n=t):(r=window.location.href,n=e),this.lastPath!==r&&(this.lastPath=r,super.track("screen_view",{...n??{},__path:r,__title:document.title})))}}},"../../node_modules/.bun/tslib@2.8.1/node_modules/tslib/tslib.es6.mjs":function(e,t,r){r.r(t),r.d(t,{__addDisposableResource:()=>F,__assign:()=>i,__asyncDelegator:()=>S,__asyncGenerator:()=>k,__asyncValues:()=>C,__await:()=>x,__awaiter:()=>b,__classPrivateFieldGet:()=>L,__classPrivateFieldIn:()=>R,__classPrivateFieldSet:()=>U,__createBinding:()=>m,__decorate:()=>a,__disposeResources:()=>T,__esDecorate:()=>l,__exportStar:()=>w,__extends:()=>o,__generator:()=>p,__importDefault:()=>O,__importStar:()=>P,__makeTemplateObject:()=>E,__metadata:()=>h,__param:()=>c,__propKey:()=>d,__read:()=>g,__rest:()=>s,__rewriteRelativeImportExtension:()=>B,__runInitializers:()=>u,__setFunctionName:()=>f,__spread:()=>j,__spreadArray:()=>_,__spreadArrays:()=>v,__values:()=>y,default:()=>M});var n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)};function o(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var i=function(){return(i=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function s(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)0>t.indexOf(n[o])&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r}function a(e,t,r,n){var o,i=arguments.length,s=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(i<3?o(s):i>3?o(t,r,s):o(t,r))||s);return i>3&&s&&Object.defineProperty(t,r,s),s}function c(e,t){return function(r,n){t(r,n,e)}}function l(e,t,r,n,o,i){function s(e){if(void 0!==e&&"function"!=typeof e)throw TypeError("Function expected");return e}for(var a,c=n.kind,l="getter"===c?"get":"setter"===c?"set":"value",u=!t&&e?n.static?e:e.prototype:null,d=t||(u?Object.getOwnPropertyDescriptor(u,n.name):{}),f=!1,h=r.length-1;h>=0;h--){var b={};for(var p in n)b[p]="access"===p?{}:n[p];for(var p in n.access)b.access[p]=n.access[p];b.addInitializer=function(e){if(f)throw TypeError("Cannot add initializers after decoration has completed");i.push(s(e||null))};var m=(0,r[h])("accessor"===c?{get:d.get,set:d.set}:d[l],b);if("accessor"===c){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw TypeError("Object expected");(a=s(m.get))&&(d.get=a),(a=s(m.set))&&(d.set=a),(a=s(m.init))&&o.unshift(a)}else(a=s(m))&&("field"===c?o.unshift(a):d[l]=a)}u&&Object.defineProperty(u,n.name,d),f=!0}function u(e,t,r){for(var n=arguments.length>2,o=0;o<t.length;o++)r=n?t[o].call(e,r):t[o].call(e);return n?r:void 0}function d(e){return"symbol"==typeof e?e:"".concat(e)}function f(e,t,r){return"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:r?"".concat(r," ",t):t})}function h(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function b(e,t,r,n){return new(r||(r=Promise))(function(o,i){function s(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(s,a)}c((n=n.apply(e,t||[])).next())})}function p(e,t){var r,n,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(c){var l=[a,c];if(r)throw TypeError("Generator is already executing.");for(;s&&(s=0,l[0]&&(i=0)),i;)try{if(r=1,n&&(o=2&l[0]?n.return:l[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,l[1])).done)return o;switch(n=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,n=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===l[0]||2===l[0])){i=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){i.label=l[1];break}if(6===l[0]&&i.label<o[1]){i.label=o[1],o=l;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(l);break}o[2]&&i.ops.pop(),i.trys.pop();continue}l=t.call(e,i)}catch(e){l=[6,e],n=0}finally{r=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}}var m=Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]};function w(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||m(t,e,r)}function y(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function g(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)s.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return s}function j(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(g(arguments[t]));return e}function v(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;for(var n=Array(e),o=0,t=0;t<r;t++)for(var i=arguments[t],s=0,a=i.length;s<a;s++,o++)n[o]=i[s];return n}function _(e,t,r){if(r||2==arguments.length)for(var n,o=0,i=t.length;o<i;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))}function x(e){return this instanceof x?(this.v=e,this):new x(e)}function k(e,t,r){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var n,o=r.apply(e,t||[]),i=[];return n=Object.create(("function"==typeof AsyncIterator?AsyncIterator:Object).prototype),s("next"),s("throw"),s("return",function(e){return function(t){return Promise.resolve(t).then(e,l)}}),n[Symbol.asyncIterator]=function(){return this},n;function s(e,t){o[e]&&(n[e]=function(t){return new Promise(function(r,n){i.push([e,t,r,n])>1||a(e,t)})},t&&(n[e]=t(n[e])))}function a(e,t){try{var r;(r=o[e](t)).value instanceof x?Promise.resolve(r.value.v).then(c,l):u(i[0][2],r)}catch(e){u(i[0][3],e)}}function c(e){a("next",e)}function l(e){a("throw",e)}function u(e,t){e(t),i.shift(),i.length&&a(i[0][0],i[0][1])}}function S(e){var t,r;return t={},n("next"),n("throw",function(e){throw e}),n("return"),t[Symbol.iterator]=function(){return this},t;function n(n,o){t[n]=e[n]?function(t){return(r=!r)?{value:x(e[n](t)),done:!1}:o?o(t):t}:o}}function C(e){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e=y(e),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=e[r]&&function(t){return new Promise(function(n,o){var i,s,a;i=n,s=o,a=(t=e[r](t)).done,Promise.resolve(t.value).then(function(e){i({value:e,done:a})},s)})}}}function E(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var I=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t},A=function(e){return(A=Object.getOwnPropertyNames||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[t.length]=r);return t})(e)};function P(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=A(e),n=0;n<r.length;n++)"default"!==r[n]&&m(t,e,r[n]);return I(t,e),t}function O(e){return e&&e.__esModule?e:{default:e}}function L(e,t,r,n){if("a"===r&&!n)throw TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)}function U(e,t,r,n,o){if("m"===n)throw TypeError("Private method is not writable");if("a"===n&&!o)throw TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?o.call(e,r):o?o.value=r:t.set(e,r),r}function R(e,t){if(null===t||"object"!=typeof t&&"function"!=typeof t)throw TypeError("Cannot use 'in' operator on non-object");return"function"==typeof e?t===e:e.has(t)}function F(e,t,r){if(null!=t){var n,o;if("object"!=typeof t&&"function"!=typeof t)throw TypeError("Object expected.");if(r){if(!Symbol.asyncDispose)throw TypeError("Symbol.asyncDispose is not defined.");n=t[Symbol.asyncDispose]}if(void 0===n){if(!Symbol.dispose)throw TypeError("Symbol.dispose is not defined.");n=t[Symbol.dispose],r&&(o=n)}if("function"!=typeof n)throw TypeError("Object not disposable.");o&&(n=function(){try{o.call(this)}catch(e){return Promise.reject(e)}}),e.stack.push({value:t,dispose:n,async:r})}else r&&e.stack.push({async:!0});return t}var D="function"==typeof SuppressedError?SuppressedError:function(e,t,r){var n=Error(r);return n.name="SuppressedError",n.error=e,n.suppressed=t,n};function T(e){function t(t){e.error=e.hasError?new D(t,e.error,"An error was suppressed during disposal."):t,e.hasError=!0}var r,n=0;return function o(){for(;r=e.stack.pop();)try{if(!r.async&&1===n)return n=0,e.stack.push(r),Promise.resolve().then(o);if(r.dispose){var i=r.dispose.call(r.value);if(r.async)return n|=2,Promise.resolve(i).then(o,function(e){return t(e),o()})}else n|=1}catch(e){t(e)}if(1===n)return e.hasError?Promise.reject(e.error):Promise.resolve();if(e.hasError)throw e.error}()}function B(e,t){return"string"==typeof e&&/^\.\.?\//.test(e)?e.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(e,r,n,o,i){return r?t?".jsx":".js":!n||o&&i?n+o+"."+i.toLowerCase()+"js":e}):e}let M={__extends:o,__assign:i,__rest:s,__decorate:a,__param:c,__esDecorate:l,__runInitializers:u,__propKey:d,__setFunctionName:f,__metadata:h,__awaiter:b,__generator:p,__createBinding:m,__exportStar:w,__values:y,__read:g,__spread:j,__spreadArrays:v,__spreadArray:_,__await:x,__asyncGenerator:k,__asyncDelegator:S,__asyncValues:C,__makeTemplateObject:E,__importStar:P,__importDefault:O,__classPrivateFieldGet:L,__classPrivateFieldSet:U,__classPrivateFieldIn:R,__addDisposableResource:F,__disposeResources:T,__rewriteRelativeImportExtension:B}},"../../node_modules/.bun/viem@2.38.5+1fb4c65d43e298b9/node_modules/viem/_esm/errors/address.js":function(e,t,r){r.d(t,{M:()=>o});var n=r("../../node_modules/.bun/viem@2.38.5+1fb4c65d43e298b9/node_modules/viem/_esm/errors/base.js");class o extends n.C{constructor({address:e}){super(`Address "${e}" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."],name:"InvalidAddressError"})}}},"../../node_modules/.bun/viem@2.38.5+1fb4c65d43e298b9/node_modules/viem/_esm/errors/base.js":function(e,t,r){r.d(t,{C:()=>i});let n=({docsBaseUrl:e,docsPath:t="",docsSlug:r})=>t?`${e??"https://viem.sh"}${t}${r?`#${r}`:""}`:void 0,o="viem@2.38.5";class i extends Error{constructor(e,t={}){let r=t.cause instanceof i?t.cause.details:t.cause?.message?t.cause.message:t.details,s=t.cause instanceof i&&t.cause.docsPath||t.docsPath,a=n?.({...t,docsPath:s});super([e||"An error occurred.","",...t.metaMessages?[...t.metaMessages,""]:[],...a?[`Docs: ${a}`]:[],...r?[`Details: ${r}`]:[],...o?[`Version: ${o}`]:[]].join("\n"),t.cause?{cause:t.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.details=r,this.docsPath=s,this.metaMessages=t.metaMessages,this.name=t.name??this.name,this.shortMessage=e,this.version="2.38.5"}walk(e){return function e(t,r){return r?.(t)?t:t&&"object"==typeof t&&"cause"in t&&void 0!==t.cause?e(t.cause,r):r?null:t}(this,e)}}},"../../node_modules/.bun/viem@2.38.5+1fb4c65d43e298b9/node_modules/viem/_esm/errors/data.js":function(e,t,r){r.d(t,{Fl:()=>i,ii:()=>o});var n=r("../../node_modules/.bun/viem@2.38.5+1fb4c65d43e298b9/node_modules/viem/_esm/errors/base.js");class o extends n.C{constructor({offset:e,position:t,size:r}){super(`Slice ${"start"===t?"starting":"ending"} at offset "${e}" is out-of-bounds (size: ${r}).`,{name:"SliceOffsetOutOfBoundsError"})}}class i extends n.C{constructor({size:e,targetSize:t,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (${e}) exceeds padding size (${t}).`,{name:"SizeExceedsPaddingSizeError"})}}n.C},"../../node_modules/.bun/viem@2.38.5+1fb4c65d43e298b9/node_modules/viem/_esm/errors/encoding.js":function(e,t,r){r.d(t,{Ty:()=>o,u:()=>i});var n=r("../../node_modules/.bun/viem@2.38.5+1fb4c65d43e298b9/node_modules/viem/_esm/errors/base.js");class o extends n.C{constructor({max:e,min:t,signed:r,size:n,value:o}){super(`Number "${o}" is not in safe ${n?`${8*n}-bit ${r?"signed":"unsigned"} `:""}integer range ${e?`(${t} to ${e})`:`(above ${t})`}`,{name:"IntegerOutOfRangeError"})}}n.C,n.C,n.C;class i extends n.C{constructor({givenSize:e,maxSize:t}){super(`Size cannot exceed ${t} bytes. Given size: ${e} bytes.`,{name:"SizeOverflowError"})}}},"../../node_modules/.bun/viem@2.38.5+1fb4c65d43e298b9/node_modules/viem/_esm/utils/address/isAddress.js":function(e,t,r){r.d(t,{P:()=>l});class n extends Map{constructor(e){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=e}get(e){let t=super.get(e);return super.has(e)&&void 0!==t&&(this.delete(e),super.set(e,t)),t}set(e,t){if(super.set(e,t),this.maxSize&&this.size>this.maxSize){let e=this.keys().next().value;e&&this.delete(e)}return this}}var o=r("../../node_modules/.bun/viem@2.38.5+1fb4c65d43e298b9/node_modules/viem/_esm/utils/encoding/toBytes.js"),i=r("../../node_modules/.bun/viem@2.38.5+1fb4c65d43e298b9/node_modules/viem/_esm/utils/hash/keccak256.js");let s=new n(8192),a=/^0x[a-fA-F0-9]{40}$/,c=new n(8192);function l(e,t){let{strict:r=!0}=t??{},n=`${e}.${r}`;if(c.has(n))return c.get(n);let l=!!a.test(e)&&(e.toLowerCase()===e||!r||function(e,t){if(s.has(`${e}.undefined`))return s.get(`${e}.undefined`);let r=e.substring(2).toLowerCase(),n=(0,i.S)((0,o.Af)(r),"bytes"),a=r.split("");for(let e=0;e<40;e+=2)n[e>>1]>>4>=8&&a[e]&&(a[e]=a[e].toUpperCase()),(15&n[e>>1])>=8&&a[e+1]&&(a[e+1]=a[e+1].toUpperCase());let c=`0x${a.join("")}`;return s.set(`${e}.undefined`,c),c}(e)===e);return c.set(n,l),l}},"../../node_modules/.bun/viem@2.38.5+1fb4c65d43e298b9/node_modules/viem/_esm/utils/address/isAddressEqual.js":function(e,t,r){r.d(t,{h:()=>i});var n=r("../../node_modules/.bun/viem@2.38.5+1fb4c65d43e298b9/node_modules/viem/_esm/errors/address.js"),o=r("../../node_modules/.bun/viem@2.38.5+1fb4c65d43e298b9/node_modules/viem/_esm/utils/address/isAddress.js");function i(e,t){if(!(0,o.P)(e,{strict:!1}))throw new n.M({address:e});if(!(0,o.P)(t,{strict:!1}))throw new n.M({address:t});return e.toLowerCase()===t.toLowerCase()}},"../../node_modules/.bun/viem@2.38.5+1fb4c65d43e298b9/node_modules/viem/_esm/utils/data/concat.js":function(e,t,r){function n(e){return"string"==typeof e[0]?o(e):function(e){let t=0;for(let r of e)t+=r.length;let r=new Uint8Array(t),n=0;for(let t of e)r.set(t,n),n+=t.length;return r}(e)}function o(e){return`0x${e.reduce((e,t)=>e+t.replace("0x",""),"")}`}r.d(t,{aP:()=>o,xW:()=>n})},"../../node_modules/.bun/viem@2.38.5+1fb4c65d43e298b9/node_modules/viem/_esm/utils/data/isHex.js":function(e,t,r){r.d(t,{q:()=>n});function n(e,{strict:t=!0}={}){return!!e&&"string"==typeof e&&(t?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x"))}},"../../node_modules/.bun/viem@2.38.5+1fb4c65d43e298b9/node_modules/viem/_esm/utils/data/pad.js":function(e,t,r){r.d(t,{db:()=>i,eV:()=>o});var n=r("../../node_modules/.bun/viem@2.38.5+1fb4c65d43e298b9/node_modules/viem/_esm/errors/data.js");function o(e,{dir:t,size:r=32}={}){return"string"==typeof e?i(e,{dir:t,size:r}):function(e,{dir:t,size:r=32}={}){if(null===r)return e;if(e.length>r)throw new n.Fl({size:e.length,targetSize:r,type:"bytes"});let o=new Uint8Array(r);for(let n=0;n<r;n++){let i="right"===t;o[i?n:r-n-1]=e[i?n:e.length-n-1]}return o}(e,{dir:t,size:r})}function i(e,{dir:t,size:r=32}={}){if(null===r)return e;let o=e.replace("0x","");if(o.length>2*r)throw new n.Fl({size:Math.ceil(o.length/2),targetSize:r,type:"hex"});return`0x${o["right"===t?"padEnd":"padStart"](2*r,"0")}`}},"../../node_modules/.bun/viem@2.38.5+1fb4c65d43e298b9/node_modules/viem/_esm/utils/data/size.js":function(e,t,r){r.d(t,{E:()=>o});var n=r("../../node_modules/.bun/viem@2.38.5+1fb4c65d43e298b9/node_modules/viem/_esm/utils/data/isHex.js");function o(e){return(0,n.q)(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}},"../../node_modules/.bun/viem@2.38.5+1fb4c65d43e298b9/node_modules/viem/_esm/utils/encoding/fromHex.js":function(e,t,r){r.d(t,{Sl:()=>i});var n=r("../../node_modules/.bun/viem@2.38.5+1fb4c65d43e298b9/node_modules/viem/_esm/errors/encoding.js"),o=r("../../node_modules/.bun/viem@2.38.5+1fb4c65d43e298b9/node_modules/viem/_esm/utils/data/size.js");function i(e,{size:t}){if((0,o.E)(e)>t)throw new n.u({givenSize:(0,o.E)(e),maxSize:t})}},"../../node_modules/.bun/viem@2.38.5+1fb4c65d43e298b9/node_modules/viem/_esm/utils/encoding/toBytes.js":function(e,t,r){r.d(t,{Af:()=>f,ZJ:()=>l,aT:()=>d});var n=r("../../node_modules/.bun/viem@2.38.5+1fb4c65d43e298b9/node_modules/viem/_esm/errors/base.js"),o=r("../../node_modules/.bun/viem@2.38.5+1fb4c65d43e298b9/node_modules/viem/_esm/utils/data/isHex.js"),i=r("../../node_modules/.bun/viem@2.38.5+1fb4c65d43e298b9/node_modules/viem/_esm/utils/data/pad.js"),s=r("../../node_modules/.bun/viem@2.38.5+1fb4c65d43e298b9/node_modules/viem/_esm/utils/encoding/fromHex.js"),a=r("../../node_modules/.bun/viem@2.38.5+1fb4c65d43e298b9/node_modules/viem/_esm/utils/encoding/toHex.js");let c=new TextEncoder;function l(e,t={}){var r,n;return"number"==typeof e||"bigint"==typeof e?(r=e,n=t,d((0,a.cK)(r,n))):"boolean"==typeof e?function(e,t={}){let r=new Uint8Array(1);return(r[0]=Number(e),"number"==typeof t.size)?((0,s.Sl)(r,{size:t.size}),(0,i.eV)(r,{size:t.size})):r}(e,t):(0,o.q)(e)?d(e,t):f(e,t)}function u(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:void 0}function d(e,t={}){let r=e;t.size&&((0,s.Sl)(r,{size:t.size}),r=(0,i.eV)(r,{dir:"right",size:t.size}));let o=r.slice(2);o.length%2&&(o=`0${o}`);let a=o.length/2,c=new Uint8Array(a);for(let e=0,t=0;e<a;e++){let r=u(o.charCodeAt(t++)),i=u(o.charCodeAt(t++));if(void 0===r||void 0===i)throw new n.C(`Invalid byte sequence ("${o[t-2]}${o[t-1]}" in "${o}").`);c[e]=16*r+i}return c}function f(e,t={}){let r=c.encode(e);return"number"==typeof t.size?((0,s.Sl)(r,{size:t.size}),(0,i.eV)(r,{dir:"right",size:t.size})):r}},"../../node_modules/.bun/viem@2.38.5+1fb4c65d43e298b9/node_modules/viem/_esm/utils/encoding/toHex.js":function(e,t,r){r.d(t,{$P:()=>c,My:()=>l,cK:()=>u,i3:()=>f,nj:()=>a});var n=r("../../node_modules/.bun/viem@2.38.5+1fb4c65d43e298b9/node_modules/viem/_esm/errors/encoding.js"),o=r("../../node_modules/.bun/viem@2.38.5+1fb4c65d43e298b9/node_modules/viem/_esm/utils/data/pad.js"),i=r("../../node_modules/.bun/viem@2.38.5+1fb4c65d43e298b9/node_modules/viem/_esm/utils/encoding/fromHex.js");let s=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function a(e,t={}){return"number"==typeof e||"bigint"==typeof e?u(e,t):"string"==typeof e?f(e,t):"boolean"==typeof e?c(e,t):l(e,t)}function c(e,t={}){let r=`0x${Number(e)}`;return"number"==typeof t.size?((0,i.Sl)(r,{size:t.size}),(0,o.eV)(r,{size:t.size})):r}function l(e,t={}){let r="";for(let t=0;t<e.length;t++)r+=s[e[t]];let n=`0x${r}`;return"number"==typeof t.size?((0,i.Sl)(n,{size:t.size}),(0,o.eV)(n,{dir:"right",size:t.size})):n}function u(e,t={}){let r,{signed:i,size:s}=t,a=BigInt(e);s?r=i?(1n<<8n*BigInt(s)-1n)-1n:2n**(8n*BigInt(s))-1n:"number"==typeof e&&(r=BigInt(Number.MAX_SAFE_INTEGER));let c="bigint"==typeof r&&i?-r-1n:0;if(r&&a>r||a<c){let t="bigint"==typeof e?"n":"";throw new n.Ty({max:r?`${r}${t}`:void 0,min:`${c}${t}`,signed:i,size:s,value:`${e}${t}`})}let l=`0x${(i&&a<0?(1n<<BigInt(8*s))+BigInt(a):a).toString(16)}`;return s?(0,o.eV)(l,{size:s}):l}let d=new TextEncoder;function f(e,t={}){return l(d.encode(e),t)}},"../../node_modules/.bun/viem@2.38.5+1fb4c65d43e298b9/node_modules/viem/_esm/utils/hash/keccak256.js":function(e,t,r){r.d(t,{S:()=>k});var n=r("../../node_modules/.bun/@noble+hashes@1.8.0/node_modules/@noble/hashes/esm/_u64.js"),o=r("../../node_modules/.bun/@noble+hashes@1.8.0/node_modules/@noble/hashes/esm/utils.js");let i=BigInt(0),s=BigInt(1),a=BigInt(2),c=BigInt(7),l=BigInt(256),u=BigInt(113),d=[],f=[],h=[];for(let e=0,t=s,r=1,n=0;e<24;e++){[r,n]=[n,(2*r+3*n)%5],d.push(2*(5*n+r)),f.push((e+1)*(e+2)/2%64);let o=i;for(let e=0;e<7;e++)(t=(t<<s^(t>>c)*u)%l)&a&&(o^=s<<(s<<BigInt(e))-s);h.push(o)}let b=(0,n.lD)(h,!0),p=b[0],m=b[1],w=(e,t,r)=>r>32?(0,n.WM)(e,t,r):(0,n.P5)(e,t,r),y=(e,t,r)=>r>32?(0,n.im)(e,t,r):(0,n.B4)(e,t,r);class g extends o.Vw{constructor(e,t,r,n=!1,i=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=e,this.suffix=t,this.outputLen=r,this.enableXOF=n,this.rounds=i,(0,o.Fe)(r),!(0<e&&e<200))throw Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=(0,o.DH)(this.state)}clone(){return this._cloneInto()}keccak(){(0,o.fd)(this.state32),function(e,t=24){let r=new Uint32Array(10);for(let n=24-t;n<24;n++){for(let t=0;t<10;t++)r[t]=e[t]^e[t+10]^e[t+20]^e[t+30]^e[t+40];for(let t=0;t<10;t+=2){let n=(t+8)%10,o=(t+2)%10,i=r[o],s=r[o+1],a=w(i,s,1)^r[n],c=y(i,s,1)^r[n+1];for(let r=0;r<50;r+=10)e[t+r]^=a,e[t+r+1]^=c}let t=e[2],o=e[3];for(let r=0;r<24;r++){let n=f[r],i=w(t,o,n),s=y(t,o,n),a=d[r];t=e[a],o=e[a+1],e[a]=i,e[a+1]=s}for(let t=0;t<50;t+=10){for(let n=0;n<10;n++)r[n]=e[t+n];for(let n=0;n<10;n++)e[t+n]^=~r[(n+2)%10]&r[(n+4)%10]}e[0]^=p[n],e[1]^=m[n]}(0,o.uH)(r)}(this.state32,this.rounds),(0,o.fd)(this.state32),this.posOut=0,this.pos=0}update(e){(0,o.CC)(this),e=(0,o.ZJ)(e),(0,o.DO)(e);let{blockLen:t,state:r}=this,n=e.length;for(let o=0;o<n;){let i=Math.min(t-this.pos,n-o);for(let t=0;t<i;t++)r[this.pos++]^=e[o++];this.pos===t&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;let{state:e,suffix:t,pos:r,blockLen:n}=this;e[r]^=t,(128&t)!=0&&r===n-1&&this.keccak(),e[n-1]^=128,this.keccak()}writeInto(e){(0,o.CC)(this,!1),(0,o.DO)(e),this.finish();let t=this.state,{blockLen:r}=this;for(let n=0,o=e.length;n<o;){this.posOut>=r&&this.keccak();let i=Math.min(r-this.posOut,o-n);e.set(t.subarray(this.posOut,this.posOut+i),n),this.posOut+=i,n+=i}return e}xofInto(e){if(!this.enableXOF)throw Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return(0,o.Fe)(e),this.xofInto(new Uint8Array(e))}digestInto(e){if((0,o.Ht)(e,this),this.finished)throw Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,(0,o.uH)(this.state)}_cloneInto(e){let{blockLen:t,suffix:r,outputLen:n,rounds:o,enableXOF:i}=this;return e||(e=new g(t,r,n,i,o)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=o,e.suffix=r,e.outputLen=n,e.enableXOF=i,e.destroyed=this.destroyed,e}}let j=(0,o.qj)(()=>new g(136,1,32));var v=r("../../node_modules/.bun/viem@2.38.5+1fb4c65d43e298b9/node_modules/viem/_esm/utils/data/isHex.js"),_=r("../../node_modules/.bun/viem@2.38.5+1fb4c65d43e298b9/node_modules/viem/_esm/utils/encoding/toBytes.js"),x=r("../../node_modules/.bun/viem@2.38.5+1fb4c65d43e298b9/node_modules/viem/_esm/utils/encoding/toHex.js");function k(e,t){let r=j((0,v.q)(e,{strict:!1})?(0,_.ZJ)(e):e);return"bytes"===(t||"hex")?r:(0,x.nj)(r)}},"../../packages/rpc/dist/index.js":function(e,t,r){r.d(t,{H4:()=>i,cY:()=>o});var n=r("../../packages/rpc/dist/middleware-B51Ll_ty.js"),o=class{_promise;_resolve;_reject;constructor(){this._promise=new Promise((e,t)=>{this._resolve=e,this._reject=t})}get promise(){return this._promise}resolve=e=>{this._resolve?.(e)};reject=e=>{this._reject?.(e)}};function i(e){let{emittingTransport:t,listeningTransport:r,targetOrigin:i,middleware:s=[],lifecycleHandlers:a}=e,c=new Map;async function l(e){try{"clientLifecycle"in e&&a?.clientLifecycle?await a.clientLifecycle(e,{origin:i,source:null}):"iframeLifecycle"in e&&a?.iframeLifecycle&&await a.iframeLifecycle(e,{origin:i,source:null})}catch(e){console.error("[RPC Client] Lifecycle handler error:",e)}}async function u(e){let t={origin:i,source:null};for(let r of s)r.onRequest&&await r.onRequest(e,t);return e}async function d(e,t){let r={origin:i,source:null},n=t;for(let t of s)t.onResponse&&(n=await t.onResponse(e,n,r));return n}async function f(e){var t,r;let n;try{let t=new URL(e.origin).origin.toLowerCase(),r=new URL(i).origin.toLowerCase();if(t!==r)return void console.log("Not expected origin",t,r)}catch(e){console.error("[RPC Client] Invalid origin",e);return}if("object"==typeof(t=e.data)&&t&&("clientLifecycle"in t||"iframeLifecycle"in t))return void await l(e.data);if(!("object"==typeof(r=e.data)&&r&&"id"in r&&"topic"in r&&"data"in r))return;try{let t=e.data.data,r=t instanceof Uint8Array||ArrayBuffer.isView(t)?{result:t}:t;n=await d(e.data,r)}catch(e){console.error("[RPC Client] Middleware error on response:",e);return}let o=c.get(e.data.id);o&&o(n)}async function h(e){let r=e;try{r=await u(e)}catch(e){throw console.error("[RPC Client] Middleware error on request:",e),e}t.postMessage(r,i)}function b(){return`${Date.now()}-${Math.random().toString(36).substring(2,9)}`}return r.addEventListener("message",f),{request:function(e){let t=b(),r=new o;return c.set(t,e=>{e.error?r.reject(new n.c(e.error.code,e.error.message,e.error.data)):r.resolve(e.result),c.delete(t)}),h({id:t,topic:e.method,data:{method:e.method,params:e.params}}).catch(e=>{c.delete(t),r.reject(e)}),r.promise},listen:function(e,t){let r=b();return c.set(r,e=>{e.error?(console.error("[RPC Client] Listener error:",e.error),c.delete(r)):t(e.result)}),h({id:r,topic:e.method,data:{method:e.method,params:e.params}}).catch(e=>{console.error("[RPC Client] Failed to send listener request:",e),c.delete(r)}),()=>{c.delete(r)}},sendLifecycle:function(e){t.postMessage(e,i)},cleanup:function(){r.removeEventListener("message",f),c.clear()}}}},"../../packages/rpc/dist/middleware-B51Ll_ty.js":function(e,t,r){r.d(t,{r:()=>g,t:()=>_,a:()=>j,c:()=>m,d:()=>p});var n=r("../../node_modules/.bun/@jsonjoy.com+json-pack@1.21.0+2bdbff6ebab26a9c/node_modules/@jsonjoy.com/json-pack/lib/cbor/index.js"),o=r("../../node_modules/.bun/@noble+hashes@1.8.0/node_modules/@noble/hashes/esm/utils.js");class i extends o.Vw{constructor(e,t,r,n){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=e,this.outputLen=t,this.padOffset=r,this.isLE=n,this.buffer=new Uint8Array(e),this.view=(0,o.O8)(this.buffer)}update(e){(0,o.CC)(this),e=(0,o.ZJ)(e),(0,o.DO)(e);let{view:t,buffer:r,blockLen:n}=this,i=e.length;for(let s=0;s<i;){let a=Math.min(n-this.pos,i-s);if(a===n){let t=(0,o.O8)(e);for(;n<=i-s;s+=n)this.process(t,s);continue}r.set(e.subarray(s,s+a),this.pos),this.pos+=a,s+=a,this.pos===n&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){(0,o.CC)(this),(0,o.Ht)(e,this),this.finished=!0;let{buffer:t,view:r,blockLen:n,isLE:i}=this,{pos:s}=this;t[s++]=128,(0,o.uH)(this.buffer.subarray(s)),this.padOffset>n-s&&(this.process(r,0),s=0);for(let e=s;e<n;e++)t[e]=0;!function(e,t,r,n){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,r,n);let o=BigInt(32),i=BigInt(0xffffffff),s=Number(r>>o&i),a=Number(r&i),c=4*!!n,l=4*!n;e.setUint32(t+c,s,n),e.setUint32(t+l,a,n)}(r,n-8,BigInt(8*this.length),i),this.process(r,0);let a=(0,o.O8)(e),c=this.outputLen;if(c%4)throw Error("_sha2: outputLen should be aligned to 32bit");let l=c/4,u=this.get();if(l>u.length)throw Error("_sha2: outputLen bigger than state");for(let e=0;e<l;e++)a.setUint32(4*e,u[e],i)}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());let{blockLen:t,buffer:r,length:n,finished:o,destroyed:i,pos:s}=this;return e.destroyed=i,e.finished=o,e.length=n,e.pos=s,n%t&&e.buffer.set(r),e}clone(){return this._cloneInto()}}let s=Uint32Array.from([0x6a09e667,0xbb67ae85,0x3c6ef372,0xa54ff53a,0x510e527f,0x9b05688c,0x1f83d9ab,0x5be0cd19]);var a=r("../../node_modules/.bun/@noble+hashes@1.8.0/node_modules/@noble/hashes/esm/_u64.js");let c=Uint32Array.from([0x428a2f98,0x71374491,0xb5c0fbcf,0xe9b5dba5,0x3956c25b,0x59f111f1,0x923f82a4,0xab1c5ed5,0xd807aa98,0x12835b01,0x243185be,0x550c7dc3,0x72be5d74,0x80deb1fe,0x9bdc06a7,0xc19bf174,0xe49b69c1,0xefbe4786,0xfc19dc6,0x240ca1cc,0x2de92c6f,0x4a7484aa,0x5cb0a9dc,0x76f988da,0x983e5152,0xa831c66d,0xb00327c8,0xbf597fc7,0xc6e00bf3,0xd5a79147,0x6ca6351,0x14292967,0x27b70a85,0x2e1b2138,0x4d2c6dfc,0x53380d13,0x650a7354,0x766a0abb,0x81c2c92e,0x92722c85,0xa2bfe8a1,0xa81a664b,0xc24b8b70,0xc76c51a3,0xd192e819,0xd6990624,0xf40e3585,0x106aa070,0x19a4c116,0x1e376c08,0x2748774c,0x34b0bcb5,0x391c0cb3,0x4ed8aa4a,0x5b9cca4f,0x682e6ff3,0x748f82ee,0x78a5636f,0x84c87814,0x8cc70208,0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2]),l=new Uint32Array(64);class u extends i{constructor(e=32){super(64,e,8,!1),this.A=0|s["0"],this.B=0|s["1"],this.C=0|s["2"],this.D=0|s["3"],this.E=0|s["4"],this.F=0|s["5"],this.G=0|s["6"],this.H=0|s["7"]}get(){let{A:e,B:t,C:r,D:n,E:o,F:i,G:s,H:a}=this;return[e,t,r,n,o,i,s,a]}set(e,t,r,n,o,i,s,a){this.A=0|e,this.B=0|t,this.C=0|r,this.D=0|n,this.E=0|o,this.F=0|i,this.G=0|s,this.H=0|a}process(e,t){for(let r=0;r<16;r++,t+=4)l[r]=e.getUint32(t,!1);for(let e=16;e<64;e++){let t=l[e-15],r=l[e-2],n=(0,o.Ow)(t,7)^(0,o.Ow)(t,18)^t>>>3,i=(0,o.Ow)(r,17)^(0,o.Ow)(r,19)^r>>>10;l[e]=i+l[e-7]+n+l[e-16]|0}let{A:r,B:n,C:i,D:s,E:a,F:u,G:d,H:f}=this;for(let e=0;e<64;e++){var h,b,p,m;let t=f+((0,o.Ow)(a,6)^(0,o.Ow)(a,11)^(0,o.Ow)(a,25))+((h=a)&u^~h&d)+c[e]+l[e]|0,w=((0,o.Ow)(r,2)^(0,o.Ow)(r,13)^(0,o.Ow)(r,22))+((b=r)&(p=n)^b&(m=i)^p&m)|0;f=d,d=u,u=a,a=s+t|0,s=i,i=n,n=r,r=t+w|0}r=r+this.A|0,n=n+this.B|0,i=i+this.C|0,s=s+this.D|0,a=a+this.E|0,u=u+this.F|0,d=d+this.G|0,f=f+this.H|0,this.set(r,n,i,s,a,u,d,f)}roundClean(){(0,o.uH)(l)}destroy(){this.set(0,0,0,0,0,0,0,0),(0,o.uH)(this.buffer)}}a.lD(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(e=>BigInt(e)));let d=(0,o.qj)(()=>new u);var f=r("../../node_modules/.bun/viem@2.38.5+1fb4c65d43e298b9/node_modules/viem/_esm/utils/data/isHex.js"),h=r("../../node_modules/.bun/viem@2.38.5+1fb4c65d43e298b9/node_modules/viem/_esm/utils/encoding/toBytes.js"),b=r("../../node_modules/.bun/viem@2.38.5+1fb4c65d43e298b9/node_modules/viem/_esm/utils/encoding/toHex.js");let p={parseError:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internalError:-32603,serverError:-32e3,clientNotConnected:-32001,configError:-32002,corruptedResponse:-32003,clientAborted:-32004,walletNotConnected:-32005,serverErrorForInteractionDelegation:-32006,userRejected:-32007};var m=class extends Error{constructor(e,t,r){super(t),this.code=e,this.data=r}toJSON(){return{code:this.code,message:this.message,data:this.data}}};let w=new n.CborEncoder,y=new n.CborDecoder;function g(e){return w.encode(e)}function j(e){try{return y.decode(e)}catch(t){return console.error("Invalid compressed data",{e:t,data:e}),null}}function v(e){var t;let r;return t=w.encode(e),r=d((0,f.q)(t,{strict:!1})?(0,h.ZJ)(t):t),(0,b.nj)(r)}let _=()=>({onRequest:(e,t)=>{if(e.data instanceof Uint8Array||ArrayBuffer.isView(e.data))return t;try{var r;let t;t={...r=e.data,validationHash:v(r??{})},e.data=w.encode(t)}catch(e){console.error("[Compression Middleware] Failed to compress request",e)}return t},onResponse:(e,t,r)=>{if(t.error||!(t.result instanceof Uint8Array||ArrayBuffer.isView(t.result)))return t;try{let{validationHash:e,...r}=function(e){if(!e.length)throw new m(p.corruptedResponse,"Missing compressed data");let t=j(e);if(!t)throw new m(p.corruptedResponse,"Invalid compressed data");if(!t?.validationHash)throw new m(p.corruptedResponse,"Missing validation hash");let{validationHash:r,...n}=t,o=v(n);if(o!==t.validationHash)throw console.warn("Validation error",{validationHash:r,rawResultData:n,parsedData:t,expectedValidationHashes:o,recomputedHash:v(void 0)}),new m(p.corruptedResponse,"Invalid validation hash");return t}(t.result);"object"==typeof r&&r&&"result"in r?t.result=r.result:t.result=r}catch(e){console.error("[Compression Middleware] Failed to decompress response",e)}return t}})},"../core/dist/actions.js":function(e,t,r){r.d(t,{hc:()=>x,k9:()=>f,kn:()=>_,wS:()=>u});var n=r("../../node_modules/.bun/viem@2.38.5+1fb4c65d43e298b9/node_modules/viem/_esm/utils/hash/keccak256.js"),o=r("../../node_modules/.bun/viem@2.38.5+1fb4c65d43e298b9/node_modules/viem/_esm/utils/encoding/toHex.js"),i=r("../../node_modules/.bun/viem@2.38.5+1fb4c65d43e298b9/node_modules/viem/_esm/utils/data/concat.js"),s=r("../../node_modules/.bun/viem@2.38.5+1fb4c65d43e298b9/node_modules/viem/_esm/utils/data/pad.js"),a=r("../../node_modules/.bun/viem@2.38.5+1fb4c65d43e298b9/node_modules/viem/_esm/utils/encoding/toBytes.js"),c=r("../../node_modules/.bun/viem@2.38.5+1fb4c65d43e298b9/node_modules/viem/_esm/utils/address/isAddressEqual.js"),l=r("../../packages/rpc/dist/middleware-B51Ll_ty.js");async function u(e,t){return await e.request({method:"frak_displayEmbeddedWallet",params:[t,e.config.metadata]})}async function d(e,{steps:t,metadata:r}){return await e.request({method:"frak_displayModal",params:[t,r,e.config.metadata]})}async function f(e){return await e.request({method:"frak_getProductInformation"})}r("../../packages/rpc/dist/index.js");let h={dapp:1,press:2,webshop:3,retail:4,referral:30,purchase:31};Object.entries(h).reduce((e,[t,r])=>(e[t]=BigInt(1)<<BigInt(r),e),{});let b={createLink:()=>({handlerTypeDenominator:(0,o.nj)(h.referral),interactionData:"0xb2c0f17c"}),referred({referrer:e}){let t=(0,i.aP)(["0x010cc3b9",(0,s.eV)(e,{size:32})]);return{handlerTypeDenominator:(0,o.nj)(h.referral),interactionData:t}}},p="fCtx";function m({url:e}){if(!e)return null;let t=new URL(e).searchParams.get(p);return t?function(e){if(e&&0!==e.length)try{let t,r=(t=e.length%4,Uint8Array.from(atob(e.replace(/-/g,"+").replace(/_/g,"/").padEnd(e.length+(0===t?0:4-t),"=")),e=>e.charCodeAt(0)));return{r:(0,o.My)(r,{size:20})}}catch(t){console.error("Error decompressing Frak context",{e:t,context:e})}}(t):null}let w=function({url:e,context:t}){let r,n;if(!window.location?.href||"undefined"==typeof window)return void console.error("No window found, can't update context");let o=e??window.location.href;(r=null!==t?function({url:e,context:t}){if(!e)return null;let r=m({url:e}),n=r?{...r,...t}:t;if(!n.r)return null;let o=function(e){if(e?.r)try{var t;return t=(0,a.aT)(e.r),btoa(Array.from(t,e=>String.fromCharCode(e)).join("")).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}catch(t){console.error("Error compressing Frak context",{e:t,context:e})}}(n);if(!o)return null;let i=new URL(e);return i.searchParams.set(p,o),i.toString()}({url:o,context:t}):((n=new URL(o)).searchParams.delete(p),n.toString()))&&window.history.replaceState(null,"",r.toString())};async function y(e,{productId:t,interaction:r,validation:i}){let s=t??function({domain:e}={}){return(0,n.S)((0,o.nj)((e??window.location.host).replace("www.","")))}(e.config);return await e.request({method:"frak_sendInteraction",params:[s,r,i]})}async function g(e,{walletStatus:t,frakContext:r,modalConfig:n,productId:o,options:i}){let s=!1;async function a(){if(!s)return s=!0,v(e,{modalConfig:{...n,loggedIn:{action:{key:"referred"}}},walletStatus:t})}async function c(t){let r=b.referred({referrer:t});await Promise.allSettled([y(e,{productId:o,interaction:r}),function(e,t,r={}){if(!e)return void console.debug("[Frak] No client provided, skipping event tracking");try{e.openPanel?.track(t,r)}catch(e){console.debug("[Frak] Failed to track event:",t,e)}}(e,"user_referred",{properties:{referrer:t}})])}try{let{status:e,currentWallet:n}=await j({initialWalletStatus:t,getFreshWalletStatus:a,pushReferralInteraction:c,frakContext:r});return w({url:window.location?.href,context:i?.alwaysAppendUrl?{r:n}:null}),e}catch(e){return console.log("Error processing referral",{error:e}),w({url:window.location?.href,context:i?.alwaysAppendUrl?{r:t?.wallet}:null}),function(e){if(e instanceof l.c)switch(e.code){case l.d.walletNotConnected:return"no-wallet";case l.d.serverErrorForInteractionDelegation:return"no-session"}return"error"}(e)}}async function j({initialWalletStatus:e,getFreshWalletStatus:t,pushReferralInteraction:r,frakContext:n}){let o=e?.wallet;return n?.r?(o||(o=await t()),o&&(0,c.h)(n.r,o))?{status:"self-referral",currentWallet:o}:(e?.interactionSession||(o=await t()),await r(n.r),{status:"success",currentWallet:o}):{status:"no-referrer",currentWallet:o}}async function v(e,{modalConfig:t,walletStatus:r}){if(!r?.interactionSession){let r=await u(e,t??{});return r?.wallet??void 0}return r.wallet??void 0}async function _(e,{productId:t,modalConfig:r,options:n}={}){var o;let i=m({url:window.location.href}),s=await (o=e).request({method:"frak_listenToWalletStatus"}).then(e=>{var t,r;return t=o,r=e,"undefined"!=typeof window&&(t.openPanel?.setGlobalProperties({wallet:r.wallet??null}),r.interactionToken?window.sessionStorage.setItem("frak-wallet-interaction-token",r.interactionToken):window.sessionStorage.removeItem("frak-wallet-interaction-token")),e});try{return await g(e,{walletStatus:s,frakContext:i,modalConfig:r,productId:t,options:n})}catch(e){console.warn("Error processing referral",{error:e})}}function x(e,{metadata:t,login:r,openSession:n}){return function e(t,r){async function n(e){return e&&(r.metadata=e(r.metadata??{})),await d(t,r)}return{params:r,sendTx:function(n){return e(t,{...r,steps:{...r.steps,sendTransaction:n}})},reward:function(n){return e(t,{...r,steps:{...r.steps,final:{...n,action:{key:"reward"}}}})},sharing:function(n,o){return e(t,{...r,steps:{...r.steps,final:{...o,action:{key:"sharing",options:n}}}})},display:n}}(e,{steps:{login:r??{},openSession:n??{}},metadata:t})}},"../core/dist/index.js":function(e,t,r){r.d(t,{Om:()=>a,ej:()=>b,hr:()=>p,l2:()=>h,sx:()=>m});var n=r("../../packages/rpc/dist/middleware-B51Ll_ty.js"),o=r("../../packages/rpc/dist/index.js"),i=r("../../node_modules/.bun/@openpanel+web@1.0.1/node_modules/@openpanel/web/dist/index.js");let s="nexus-wallet-backup";class a{config;iframe;isSetupDone=!1;lastResponse=null;lastRequest=null;constructor(e,t){this.config=e,this.iframe=t,this.lastRequest=null,this.lastResponse=null}setLastResponse(e,t){this.lastResponse={message:e,response:t,timestamp:Date.now()}}setLastRequest(e){this.lastRequest={event:e,timestamp:Date.now()}}updateSetupStatus(e){this.isSetupDone=e}base64Encode(e){try{return btoa(JSON.stringify(e))}catch(e){return console.warn("Failed to encode debug data",e),btoa("Failed to encode data")}}getIframeStatus(){return this.iframe?{loading:this.iframe.hasAttribute("loading"),url:this.iframe.src,readyState:this.iframe.contentDocument?.readyState?+("complete"===this.iframe.contentDocument.readyState):-1,contentWindow:!!this.iframe.contentWindow,isConnected:this.iframe.isConnected}:null}getNavigatorInfo(){return navigator?{userAgent:navigator.userAgent,language:navigator.language,onLine:navigator.onLine,screenWidth:window.screen.width,screenHeight:window.screen.height,pixelRatio:window.devicePixelRatio}:null}gatherDebugInfo(e){let t=this.getIframeStatus(),r=this.getNavigatorInfo(),o="Unknown";return e instanceof n.c?o=`FrakRpcError: ${e.code} '${e.message}'`:e instanceof Error?o=e.message:"string"==typeof e&&(o=e),{timestamp:new Date().toISOString(),encodedUrl:btoa(window.location.href),encodedConfig:this.config?this.base64Encode(this.config):"no-config",navigatorInfo:r?this.base64Encode(r):"no-navigator",iframeStatus:t?this.base64Encode(t):"not-iframe",lastRequest:this.lastRequest?this.base64Encode(this.lastRequest):"No Frak request logged",lastResponse:this.lastResponse?this.base64Encode(this.lastResponse):"No Frak response logged",clientStatus:this.isSetupDone?"setup":"not-setup",error:o}}static empty(){return new a}formatDebugInfo(e){let t=this.gatherDebugInfo(e);return`
21
21
  Debug Information:
22
22
  -----------------
23
23
  Timestamp: ${t.timestamp}
@@ -29,4 +29,4 @@ Valid types: "function", "event", "error"`,{name:"InvalidDefinitionTypeError"})}
29
29
  Last Response: ${t.lastResponse}
30
30
  Client Status: ${t.clientStatus}
31
31
  Error: ${t.error}
32
- `.trim()}}let l=2000001;function c({iframe:e,isVisible:t}){if(!t){e.style.width="0",e.style.height="0",e.style.border="0",e.style.position="fixed",e.style.top="-1000px",e.style.left="-1000px";return}e.style.position="fixed",e.style.top="0",e.style.left="0",e.style.width="100%",e.style.height="100%",e.style.pointerEvents="auto"}async function u({config:e,rpcClient:t,lifecycleManager:r}){async function n(){let r=e.customizations?.css;r&&t.sendLifecycle({clientLifecycle:"modal-css",data:{cssLink:r}})}async function o(){let r=e.customizations?.i18n;r&&t.sendLifecycle({clientLifecycle:"modal-i18n",data:{i18n:r}})}async function i(){if("undefined"==typeof window)return;let e=window.localStorage.getItem(s);e&&t.sendLifecycle({clientLifecycle:"restore-backup",data:{backup:e}})}await r.isConnected,function(e,t){if("undefined"==typeof window)return;let r=new URL(window.location.href),n=r.searchParams.get("sso");n&&(t.then(()=>{e.sendLifecycle({clientLifecycle:"sso-redirect-complete",data:{compressed:n}}),console.log("[SSO URL Listener] Forwarded compressed SSO data to iframe")}).catch(e=>{console.error("[SSO URL Listener] Failed to forward SSO data:",e)}),r.searchParams.delete("sso"),window.history.replaceState({},"",r.toString()),console.log("[SSO URL Listener] SSO parameter detected and URL cleaned"))}(t,r.isConnected),await Promise.allSettled([n(),o(),i()])}let d={eur:"fr-FR",usd:"en-US",gbp:"en-GB"};function f(e){return e&&e in d?e:"eur"}async function h({config:e}){let t,r=(t=f(e.metadata?.currency),{...e,metadata:{...e.metadata,currency:t}}),d=await function({walletBaseUrl:e,config:t}){let r=document.querySelector("#frak-wallet");r&&r.remove();let n=document.createElement("iframe");return n.id="frak-wallet",n.name="frak-wallet",n.allow="publickey-credentials-get *; clipboard-write; web-share *",n.style.zIndex=l.toString(),c({iframe:n,isVisible:!1}),document.body.appendChild(n),new Promise(r=>{n?.addEventListener("load",()=>r(n)),n.src=`${t?.walletUrl??e??"https://wallet.frak.id"}/listener`})}({config:r});if(!d)return void console.error("Failed to create iframe");let h=function({config:e,iframe:t}){let r,l=e?.walletUrl??"https://wallet.frak.id",d=function({iframe:e}){let t=new n.BH;return{handleEvent:async r=>{if(!("iframeLifecycle"in r))return;let{iframeLifecycle:n,data:o}=r;switch(n){case"connected":t.resolve(!0);break;case"do-backup":o.backup?localStorage.setItem(s,o.backup):localStorage.removeItem(s);break;case"remove-backup":localStorage.removeItem(s);break;case"show":case"hide":c({iframe:e,isVisible:"show"===n});break;case"handshake":e.contentWindow?.postMessage({clientLifecycle:"handshake-response",data:{token:o.token,currentUrl:window.location.href}},"*");break;case"redirect":{let e=new URL(o.baseRedirectUrl);e.searchParams.has("u")?(e.searchParams.delete("u"),e.searchParams.append("u",window.location.href),window.location.href=e.toString()):window.location.href=o.baseRedirectUrl}}},isConnected:t.promise}}({iframe:t}),f=new a(e,t);if(!t.contentWindow)throw new n.u(n.ss.configError,"The iframe does not have a content window");let h=(0,n.i0)({emittingTransport:t.contentWindow,listeningTransport:window,targetOrigin:l,middleware:[{async onRequest(e,t){if(!await d.isConnected)throw new n.u(n.ss.clientNotConnected,"The iframe provider isn't connected yet");return t}},(0,o.I)(),{onRequest:(e,t)=>(f.setLastRequest(e),t),onResponse:(e,t)=>(f.setLastResponse(e,t),t)}],lifecycleHandlers:{iframeLifecycle:async(e,t)=>{await d.handleEvent(e)}}}),b=function(e,t){let r,n,o=()=>e.sendLifecycle({clientLifecycle:"heartbeat"});function i(){r&&clearInterval(r),n&&clearTimeout(n)}return async function(){o(),r=setInterval(o,1e3),n=setTimeout(()=>{i(),console.log("Heartbeat timeout: connection failed")},3e4),await t.isConnected,i()}(),i}(h,d),p=async()=>{b(),h.cleanup(),t.remove()};console.log("[Frak SDK] Initializing OpenPanel"),(r=new i.J({apiUrl:"https://op-api.gcp.frak.id",clientId:"6eacc8d7-49ac-4936-95e9-81ef29449570",trackScreenViews:!0,trackOutgoingLinks:!0,trackAttributes:!1,filter:({type:e,payload:t})=>!("track"===e&&t?.properties)||("sdkVersion"in t.properties||(t.properties={...t.properties,sdkVersion:"0.1.0"}),!0)})).setGlobalProperties({sdkVersion:"0.1.0"}),r.init();let m=u({config:e,rpcClient:h,lifecycleManager:d}).then(()=>f.updateSetupStatus(!0));return{config:e,debugInfo:f,waitForConnection:d.isConnected,waitForSetup:m,request:h.request,listenerRequest:h.listen,destroy:p,openPanel:r}}({config:r,iframe:d});return(await h.waitForSetup,await h.waitForConnection)?h:void console.error("Failed to connect to client")}function b(e){return e?`${e}Amount`:"eurAmount"}function p(e,t){let r=t?d[t]??d.eur:d.eur,n=f(t);return e.toLocaleString(r,{style:"currency",currency:n,minimumFractionDigits:0,maximumFractionDigits:2})}function m(e,t,r={}){if(!e)return void console.debug("[Frak] No client provided, skipping event tracking");try{e.openPanel?.track(t,r)}catch(e){console.debug("[Frak] Failed to track event:",t,e)}}Object.entries({dapp:1,press:2,webshop:3,retail:4,referral:30,purchase:31}).reduce((e,[t,r])=>(e[t]=BigInt(1)<<BigInt(r),e),{})},"../../node_modules/.bun/@noble+hashes@1.8.0/node_modules/@noble/hashes/esm/_u64.js":function(e,t,r){r.d(t,{$p:()=>d,EP:()=>f,FL:()=>u,Fn:()=>y,IH:()=>m,Iq:()=>a,NI:()=>s,Ou:()=>c,SD:()=>b,Vl:()=>i,Xb:()=>g,ac:()=>w,gm:()=>h,m_:()=>l,mk:()=>p,pp:()=>_,u8:()=>v,zP:()=>j});let n=BigInt(0x100000000-1),o=BigInt(32);function i(e,t=!1){let r=e.length,s=new Uint32Array(r),a=new Uint32Array(r);for(let i=0;i<r;i++){let{h:r,l}=function(e,t=!1){return t?{h:Number(e&n),l:Number(e>>o&n)}:{h:0|Number(e>>o&n),l:0|Number(e&n)}}(e[i],t);[s[i],a[i]]=[r,l]}return[s,a]}let s=(e,t,r)=>e>>>r,a=(e,t,r)=>e<<32-r|t>>>r,l=(e,t,r)=>e>>>r|t<<32-r,c=(e,t,r)=>e<<32-r|t>>>r,u=(e,t,r)=>e<<64-r|t>>>r-32,d=(e,t,r)=>e>>>r-32|t<<64-r,f=(e,t,r)=>e<<r|t>>>32-r,h=(e,t,r)=>t<<r|e>>>32-r,b=(e,t,r)=>t<<r-32|e>>>64-r,p=(e,t,r)=>e<<r-32|t>>>64-r;function m(e,t,r,n){let o=(t>>>0)+(n>>>0);return{h:e+r+(o/0x100000000|0)|0,l:0|o}}let w=(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0),y=(e,t,r,n)=>t+r+n+(e/0x100000000|0)|0,g=(e,t,r,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0),v=(e,t,r,n,o)=>t+r+n+o+(e/0x100000000|0)|0,j=(e,t,r,n,o)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(o>>>0),_=(e,t,r,n,o,i)=>t+r+n+o+i+(e/0x100000000|0)|0},"../../node_modules/.bun/@noble+hashes@1.8.0/node_modules/@noble/hashes/esm/utils.js":function(e,t,r){function n(e){if(!Number.isSafeInteger(e)||e<0)throw Error("positive integer expected, got "+e)}function o(e,...t){if(!(e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name))throw Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw Error("Uint8Array expected of length "+t+", got length="+e.length)}function i(e,t=!0){if(e.destroyed)throw Error("Hash instance has been destroyed");if(t&&e.finished)throw Error("Hash#digest() has already been called")}function s(e,t){o(e);let r=t.outputLen;if(e.length<r)throw Error("digestInto() expects output buffer of length at least "+r)}function a(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function l(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function c(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function u(e,t){return e<<32-t|e>>>t}r.d(t,{$h:()=>i,GL:()=>c,Jq:()=>a,O0:()=>f,Ux:()=>d,V1:()=>b,eB:()=>s,gk:()=>o,k8:()=>n,kb:()=>h,np:()=>u,ru:()=>l});let d=68===new Uint8Array(new Uint32Array([0x11223344]).buffer)[0]?e=>e:function(e){for(let r=0;r<e.length;r++){var t;e[r]=(t=e[r])<<24&0xff000000|t<<8&0xff0000|t>>>8&65280|t>>>24&255}return e};function f(e){return"string"==typeof e&&(e=function(e){if("string"!=typeof e)throw Error("string expected");return new Uint8Array(new TextEncoder().encode(e))}(e)),o(e),e}class h{}function b(e){let t=t=>e().update(f(t)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}},"../../node_modules/.bun/@openpanel+web@1.0.1/node_modules/@openpanel/web/dist/index.js":function(e,t,r){r.d(t,{J:()=>i});var n=class{constructor(e){this.baseUrl=e.baseUrl,this.headers={"Content-Type":"application/json",...e.defaultHeaders},this.maxRetries=e.maxRetries??3,this.initialRetryDelay=e.initialRetryDelay??500}async resolveHeaders(){let e={};for(let[t,r]of Object.entries(this.headers)){let n=await r;null!==n&&(e[t]=n)}return e}addHeader(e,t){this.headers[e]=t}async post(e,t,r,n){try{let n=await fetch(e,{method:"POST",headers:await this.resolveHeaders(),body:JSON.stringify(t??{}),keepalive:!0,...r});if(401===n.status)return null;if(200!==n.status&&202!==n.status)throw Error(`HTTP error! status: ${n.status}`);let o=await n.text();return o?JSON.parse(o):null}catch(o){if(n<this.maxRetries){let o=this.initialRetryDelay*Math.pow(2,n);return await new Promise(e=>setTimeout(e,o)),this.post(e,t,r,n+1)}return console.error("Max retries reached:",o),null}}async fetch(e,t,r={}){let n=`${this.baseUrl}${e}`;return this.post(n,t,r,0)}},o=class{constructor(e){this.options=e,this.queue=[];let t={"openpanel-client-id":e.clientId};e.clientSecret&&(t["openpanel-client-secret"]=e.clientSecret),t["openpanel-sdk-name"]=e.sdk||"node",t["openpanel-sdk-version"]=e.sdkVersion||"1.0.0",this.api=new n({baseUrl:e.apiUrl||"https://api.openpanel.dev",defaultHeaders:t})}init(){}ready(){this.options.waitForProfile=!1,this.flush()}async send(e){return this.options.disabled||this.options.filter&&!this.options.filter(e)?Promise.resolve():this.options.waitForProfile&&!this.profileId?(this.queue.push(e),Promise.resolve()):this.api.fetch("/track",e)}setGlobalProperties(e){this.global={...this.global,...e}}async track(e,t){return this.send({type:"track",payload:{name:e,profileId:t?.profileId??this.profileId,properties:{...this.global??{},...t??{}}}})}async identify(e){if(e.profileId&&(this.profileId=e.profileId,this.flush()),Object.keys(e).length>1)return this.send({type:"identify",payload:{...e,properties:{...this.global,...e.properties}}})}async alias(e){return this.send({type:"alias",payload:e})}async increment(e){return this.send({type:"increment",payload:e})}async decrement(e){return this.send({type:"decrement",payload:e})}clear(){this.profileId=void 0}flush(){this.queue.forEach(e=>{this.send({...e,payload:{...e.payload,profileId:e.payload.profileId??this.profileId}})}),this.queue=[]}},i=class extends o{constructor(e){super({sdk:"web",sdkVersion:"1.0.1",...e}),this.options=e,this.lastPath="",this.isServer()||(this.setGlobalProperties({__referrer:document.referrer}),this.options.trackScreenViews&&this.trackScreenViews(),this.options.trackOutgoingLinks&&this.trackOutgoingLinks(),this.options.trackAttributes&&this.trackAttributes())}debounce(e,t){clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(e,t)}isServer(){return typeof document>"u"}trackOutgoingLinks(){this.isServer()||document.addEventListener("click",e=>{let t=e.target,r=t.closest("a");if(r&&t){let e=r.getAttribute("href");e?.startsWith("http")&&super.track("link_out",{href:e,text:r.innerText||r.getAttribute("title")||t.getAttribute("alt")||t.getAttribute("title")})}})}trackScreenViews(){if(this.isServer())return;this.screenView();let e=history.pushState;history.pushState=function(...t){let r=e.apply(this,t);return window.dispatchEvent(new Event("pushstate")),window.dispatchEvent(new Event("locationchange")),r};let t=history.replaceState;history.replaceState=function(...e){let r=t.apply(this,e);return window.dispatchEvent(new Event("replacestate")),window.dispatchEvent(new Event("locationchange")),r},window.addEventListener("popstate",()=>{window.dispatchEvent(new Event("locationchange"))});let r=()=>this.debounce(()=>this.screenView(),50);this.options.trackHashChanges?window.addEventListener("hashchange",r):window.addEventListener("locationchange",r)}trackAttributes(){this.isServer()||document.addEventListener("click",e=>{let t=e.target,r=t.closest("button"),n=t.closest("a"),o=r?.getAttribute("data-track")?r:n?.getAttribute("data-track")?n:null;if(o){let e={};for(let t of o.attributes)t.name.startsWith("data-")&&"data-track"!==t.name&&(e[t.name.replace(/^data-/,"").replace(/([-_][a-z])/gi,e=>e.toUpperCase().replace("-","").replace("_",""))]=t.value);let t=o.getAttribute("data-track");t&&super.track(t,e)}})}screenView(e,t){let r,n;this.isServer()||("string"==typeof e?(r=e,n=t):(r=window.location.href,n=e),this.lastPath!==r&&(this.lastPath=r,super.track("screen_view",{...n??{},__path:r,__title:document.title})))}}},"../../node_modules/.bun/tslib@2.8.1/node_modules/tslib/tslib.es6.mjs":function(e,t,r){r.r(t),r.d(t,{__addDisposableResource:()=>F,__assign:()=>i,__asyncDelegator:()=>S,__asyncGenerator:()=>k,__asyncValues:()=>C,__await:()=>x,__awaiter:()=>b,__classPrivateFieldGet:()=>L,__classPrivateFieldIn:()=>R,__classPrivateFieldSet:()=>U,__createBinding:()=>m,__decorate:()=>a,__disposeResources:()=>N,__esDecorate:()=>c,__exportStar:()=>w,__extends:()=>o,__generator:()=>p,__importDefault:()=>P,__importStar:()=>O,__makeTemplateObject:()=>I,__metadata:()=>h,__param:()=>l,__propKey:()=>d,__read:()=>g,__rest:()=>s,__rewriteRelativeImportExtension:()=>M,__runInitializers:()=>u,__setFunctionName:()=>f,__spread:()=>v,__spreadArray:()=>_,__spreadArrays:()=>j,__values:()=>y,default:()=>B});var n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)};function o(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var i=function(){return(i=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function s(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)0>t.indexOf(n[o])&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r}function a(e,t,r,n){var o,i=arguments.length,s=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(i<3?o(s):i>3?o(t,r,s):o(t,r))||s);return i>3&&s&&Object.defineProperty(t,r,s),s}function l(e,t){return function(r,n){t(r,n,e)}}function c(e,t,r,n,o,i){function s(e){if(void 0!==e&&"function"!=typeof e)throw TypeError("Function expected");return e}for(var a,l=n.kind,c="getter"===l?"get":"setter"===l?"set":"value",u=!t&&e?n.static?e:e.prototype:null,d=t||(u?Object.getOwnPropertyDescriptor(u,n.name):{}),f=!1,h=r.length-1;h>=0;h--){var b={};for(var p in n)b[p]="access"===p?{}:n[p];for(var p in n.access)b.access[p]=n.access[p];b.addInitializer=function(e){if(f)throw TypeError("Cannot add initializers after decoration has completed");i.push(s(e||null))};var m=(0,r[h])("accessor"===l?{get:d.get,set:d.set}:d[c],b);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw TypeError("Object expected");(a=s(m.get))&&(d.get=a),(a=s(m.set))&&(d.set=a),(a=s(m.init))&&o.unshift(a)}else(a=s(m))&&("field"===l?o.unshift(a):d[c]=a)}u&&Object.defineProperty(u,n.name,d),f=!0}function u(e,t,r){for(var n=arguments.length>2,o=0;o<t.length;o++)r=n?t[o].call(e,r):t[o].call(e);return n?r:void 0}function d(e){return"symbol"==typeof e?e:"".concat(e)}function f(e,t,r){return"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:r?"".concat(r," ",t):t})}function h(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function b(e,t,r,n){return new(r||(r=Promise))(function(o,i){function s(e){try{l(n.next(e))}catch(e){i(e)}}function a(e){try{l(n.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?o(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(s,a)}l((n=n.apply(e,t||[])).next())})}function p(e,t){var r,n,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(l){var c=[a,l];if(r)throw TypeError("Generator is already executing.");for(;s&&(s=0,c[0]&&(i=0)),i;)try{if(r=1,n&&(o=2&c[0]?n.return:c[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,c[1])).done)return o;switch(n=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,n=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=t.call(e,i)}catch(e){c=[6,e],n=0}finally{r=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}var m=Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]};function w(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||m(t,e,r)}function y(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function g(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)s.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return s}function v(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(g(arguments[t]));return e}function j(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;for(var n=Array(e),o=0,t=0;t<r;t++)for(var i=arguments[t],s=0,a=i.length;s<a;s++,o++)n[o]=i[s];return n}function _(e,t,r){if(r||2==arguments.length)for(var n,o=0,i=t.length;o<i;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))}function x(e){return this instanceof x?(this.v=e,this):new x(e)}function k(e,t,r){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var n,o=r.apply(e,t||[]),i=[];return n=Object.create(("function"==typeof AsyncIterator?AsyncIterator:Object).prototype),s("next"),s("throw"),s("return",function(e){return function(t){return Promise.resolve(t).then(e,c)}}),n[Symbol.asyncIterator]=function(){return this},n;function s(e,t){o[e]&&(n[e]=function(t){return new Promise(function(r,n){i.push([e,t,r,n])>1||a(e,t)})},t&&(n[e]=t(n[e])))}function a(e,t){try{var r;(r=o[e](t)).value instanceof x?Promise.resolve(r.value.v).then(l,c):u(i[0][2],r)}catch(e){u(i[0][3],e)}}function l(e){a("next",e)}function c(e){a("throw",e)}function u(e,t){e(t),i.shift(),i.length&&a(i[0][0],i[0][1])}}function S(e){var t,r;return t={},n("next"),n("throw",function(e){throw e}),n("return"),t[Symbol.iterator]=function(){return this},t;function n(n,o){t[n]=e[n]?function(t){return(r=!r)?{value:x(e[n](t)),done:!1}:o?o(t):t}:o}}function C(e){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e=y(e),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=e[r]&&function(t){return new Promise(function(n,o){var i,s,a;i=n,s=o,a=(t=e[r](t)).done,Promise.resolve(t.value).then(function(e){i({value:e,done:a})},s)})}}}function I(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var E=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t},A=function(e){return(A=Object.getOwnPropertyNames||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[t.length]=r);return t})(e)};function O(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=A(e),n=0;n<r.length;n++)"default"!==r[n]&&m(t,e,r[n]);return E(t,e),t}function P(e){return e&&e.__esModule?e:{default:e}}function L(e,t,r,n){if("a"===r&&!n)throw TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)}function U(e,t,r,n,o){if("m"===n)throw TypeError("Private method is not writable");if("a"===n&&!o)throw TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?o.call(e,r):o?o.value=r:t.set(e,r),r}function R(e,t){if(null===t||"object"!=typeof t&&"function"!=typeof t)throw TypeError("Cannot use 'in' operator on non-object");return"function"==typeof e?t===e:e.has(t)}function F(e,t,r){if(null!=t){var n,o;if("object"!=typeof t&&"function"!=typeof t)throw TypeError("Object expected.");if(r){if(!Symbol.asyncDispose)throw TypeError("Symbol.asyncDispose is not defined.");n=t[Symbol.asyncDispose]}if(void 0===n){if(!Symbol.dispose)throw TypeError("Symbol.dispose is not defined.");n=t[Symbol.dispose],r&&(o=n)}if("function"!=typeof n)throw TypeError("Object not disposable.");o&&(n=function(){try{o.call(this)}catch(e){return Promise.reject(e)}}),e.stack.push({value:t,dispose:n,async:r})}else r&&e.stack.push({async:!0});return t}var D="function"==typeof SuppressedError?SuppressedError:function(e,t,r){var n=Error(r);return n.name="SuppressedError",n.error=e,n.suppressed=t,n};function N(e){function t(t){e.error=e.hasError?new D(t,e.error,"An error was suppressed during disposal."):t,e.hasError=!0}var r,n=0;return function o(){for(;r=e.stack.pop();)try{if(!r.async&&1===n)return n=0,e.stack.push(r),Promise.resolve().then(o);if(r.dispose){var i=r.dispose.call(r.value);if(r.async)return n|=2,Promise.resolve(i).then(o,function(e){return t(e),o()})}else n|=1}catch(e){t(e)}if(1===n)return e.hasError?Promise.reject(e.error):Promise.resolve();if(e.hasError)throw e.error}()}function M(e,t){return"string"==typeof e&&/^\.\.?\//.test(e)?e.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(e,r,n,o,i){return r?t?".jsx":".js":!n||o&&i?n+o+"."+i.toLowerCase()+"js":e}):e}let B={__extends:o,__assign:i,__rest:s,__decorate:a,__param:l,__esDecorate:c,__runInitializers:u,__propKey:d,__setFunctionName:f,__metadata:h,__awaiter:b,__generator:p,__createBinding:m,__exportStar:w,__values:y,__read:g,__spread:v,__spreadArrays:j,__spreadArray:_,__await:x,__asyncGenerator:k,__asyncDelegator:S,__asyncValues:C,__makeTemplateObject:I,__importStar:O,__importDefault:P,__classPrivateFieldGet:L,__classPrivateFieldSet:U,__classPrivateFieldIn:R,__addDisposableResource:F,__disposeResources:N,__rewriteRelativeImportExtension:M}},"../../node_modules/.bun/viem@2.31.2+5bbfac422febb175/node_modules/viem/_esm/errors/address.js":function(e,t,r){r.d(t,{b:()=>o});var n=r("../../node_modules/.bun/viem@2.31.2+5bbfac422febb175/node_modules/viem/_esm/errors/base.js");class o extends n.G{constructor({address:e}){super(`Address "${e}" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."],name:"InvalidAddressError"})}}},"../../node_modules/.bun/viem@2.31.2+5bbfac422febb175/node_modules/viem/_esm/errors/base.js":function(e,t,r){r.d(t,{G:()=>i});let n="2.31.2",o={getDocsUrl:({docsBaseUrl:e,docsPath:t="",docsSlug:r})=>t?`${e??"https://viem.sh"}${t}${r?`#${r}`:""}`:void 0,version:`viem@${n}`};class i extends Error{constructor(e,t={}){let r=t.cause instanceof i?t.cause.details:t.cause?.message?t.cause.message:t.details,s=t.cause instanceof i&&t.cause.docsPath||t.docsPath,a=o.getDocsUrl?.({...t,docsPath:s});super([e||"An error occurred.","",...t.metaMessages?[...t.metaMessages,""]:[],...a?[`Docs: ${a}`]:[],...r?[`Details: ${r}`]:[],...o.version?[`Version: ${o.version}`]:[]].join("\n"),t.cause?{cause:t.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.details=r,this.docsPath=s,this.metaMessages=t.metaMessages,this.name=t.name??this.name,this.shortMessage=e,this.version=n}walk(e){return function e(t,r){return r?.(t)?t:t&&"object"==typeof t&&"cause"in t&&void 0!==t.cause?e(t.cause,r):r?null:t}(this,e)}}},"../../node_modules/.bun/viem@2.31.2+5bbfac422febb175/node_modules/viem/_esm/errors/data.js":function(e,t,r){r.d(t,{$s:()=>i,mV:()=>o});var n=r("../../node_modules/.bun/viem@2.31.2+5bbfac422febb175/node_modules/viem/_esm/errors/base.js");class o extends n.G{constructor({offset:e,position:t,size:r}){super(`Slice ${"start"===t?"starting":"ending"} at offset "${e}" is out-of-bounds (size: ${r}).`,{name:"SliceOffsetOutOfBoundsError"})}}class i extends n.G{constructor({size:e,targetSize:t,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (${e}) exceeds padding size (${t}).`,{name:"SizeExceedsPaddingSizeError"})}}n.G},"../../node_modules/.bun/viem@2.31.2+5bbfac422febb175/node_modules/viem/_esm/errors/encoding.js":function(e,t,r){r.d(t,{J5:()=>o,M6:()=>i});var n=r("../../node_modules/.bun/viem@2.31.2+5bbfac422febb175/node_modules/viem/_esm/errors/base.js");class o extends n.G{constructor({max:e,min:t,signed:r,size:n,value:o}){super(`Number "${o}" is not in safe ${n?`${8*n}-bit ${r?"signed":"unsigned"} `:""}integer range ${e?`(${t} to ${e})`:`(above ${t})`}`,{name:"IntegerOutOfRangeError"})}}n.G,n.G,n.G;class i extends n.G{constructor({givenSize:e,maxSize:t}){super(`Size cannot exceed ${t} bytes. Given size: ${e} bytes.`,{name:"SizeOverflowError"})}}},"../../node_modules/.bun/viem@2.31.2+5bbfac422febb175/node_modules/viem/_esm/utils/address/isAddress.js":function(e,t,r){r.d(t,{U:()=>c});class n extends Map{constructor(e){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=e}get(e){let t=super.get(e);return super.has(e)&&void 0!==t&&(this.delete(e),super.set(e,t)),t}set(e,t){if(super.set(e,t),this.maxSize&&this.size>this.maxSize){let e=this.keys().next().value;e&&this.delete(e)}return this}}var o=r("../../node_modules/.bun/viem@2.31.2+5bbfac422febb175/node_modules/viem/_esm/utils/encoding/toBytes.js"),i=r("../../node_modules/.bun/viem@2.31.2+5bbfac422febb175/node_modules/viem/_esm/utils/hash/keccak256.js");let s=new n(8192),a=/^0x[a-fA-F0-9]{40}$/,l=new n(8192);function c(e,t){let{strict:r=!0}=t??{},n=`${e}.${r}`;if(l.has(n))return l.get(n);let c=!!a.test(e)&&(e.toLowerCase()===e||!r||function(e,t){if(s.has(`${e}.undefined`))return s.get(`${e}.${void 0}`);let r=t?`${t}${e.toLowerCase()}`:e.substring(2).toLowerCase(),n=(0,i.w)((0,o.qX)(r),"bytes"),a=(t?r.substring(`${t}0x`.length):r).split("");for(let e=0;e<40;e+=2)n[e>>1]>>4>=8&&a[e]&&(a[e]=a[e].toUpperCase()),(15&n[e>>1])>=8&&a[e+1]&&(a[e+1]=a[e+1].toUpperCase());let l=`0x${a.join("")}`;return s.set(`${e}.${t}`,l),l}(e)===e);return l.set(n,c),c}},"../../node_modules/.bun/viem@2.31.2+5bbfac422febb175/node_modules/viem/_esm/utils/address/isAddressEqual.js":function(e,t,r){r.d(t,{E:()=>i});var n=r("../../node_modules/.bun/viem@2.31.2+5bbfac422febb175/node_modules/viem/_esm/errors/address.js"),o=r("../../node_modules/.bun/viem@2.31.2+5bbfac422febb175/node_modules/viem/_esm/utils/address/isAddress.js");function i(e,t){if(!(0,o.U)(e,{strict:!1}))throw new n.b({address:e});if(!(0,o.U)(t,{strict:!1}))throw new n.b({address:t});return e.toLowerCase()===t.toLowerCase()}},"../../node_modules/.bun/viem@2.31.2+5bbfac422febb175/node_modules/viem/_esm/utils/data/concat.js":function(e,t,r){function n(e){return"string"==typeof e[0]?o(e):function(e){let t=0;for(let r of e)t+=r.length;let r=new Uint8Array(t),n=0;for(let t of e)r.set(t,n),n+=t.length;return r}(e)}function o(e){return`0x${e.reduce((e,t)=>e+t.replace("0x",""),"")}`}r.d(t,{SM:()=>o,zo:()=>n})},"../../node_modules/.bun/viem@2.31.2+5bbfac422febb175/node_modules/viem/_esm/utils/data/isHex.js":function(e,t,r){r.d(t,{v:()=>n});function n(e,{strict:t=!0}={}){return!!e&&"string"==typeof e&&(t?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x"))}},"../../node_modules/.bun/viem@2.31.2+5bbfac422febb175/node_modules/viem/_esm/utils/data/pad.js":function(e,t,r){r.d(t,{gc:()=>i,vk:()=>o});var n=r("../../node_modules/.bun/viem@2.31.2+5bbfac422febb175/node_modules/viem/_esm/errors/data.js");function o(e,{dir:t,size:r=32}={}){return"string"==typeof e?i(e,{dir:t,size:r}):function(e,{dir:t,size:r=32}={}){if(null===r)return e;if(e.length>r)throw new n.$s({size:e.length,targetSize:r,type:"bytes"});let o=new Uint8Array(r);for(let n=0;n<r;n++){let i="right"===t;o[i?n:r-n-1]=e[i?n:e.length-n-1]}return o}(e,{dir:t,size:r})}function i(e,{dir:t,size:r=32}={}){if(null===r)return e;let o=e.replace("0x","");if(o.length>2*r)throw new n.$s({size:Math.ceil(o.length/2),targetSize:r,type:"hex"});return`0x${o["right"===t?"padEnd":"padStart"](2*r,"0")}`}},"../../node_modules/.bun/viem@2.31.2+5bbfac422febb175/node_modules/viem/_esm/utils/data/size.js":function(e,t,r){r.d(t,{d:()=>o});var n=r("../../node_modules/.bun/viem@2.31.2+5bbfac422febb175/node_modules/viem/_esm/utils/data/isHex.js");function o(e){return(0,n.v)(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}},"../../node_modules/.bun/viem@2.31.2+5bbfac422febb175/node_modules/viem/_esm/utils/encoding/fromHex.js":function(e,t,r){r.d(t,{Yf:()=>i});var n=r("../../node_modules/.bun/viem@2.31.2+5bbfac422febb175/node_modules/viem/_esm/errors/encoding.js"),o=r("../../node_modules/.bun/viem@2.31.2+5bbfac422febb175/node_modules/viem/_esm/utils/data/size.js");function i(e,{size:t}){if((0,o.d)(e)>t)throw new n.M6({givenSize:(0,o.d)(e),maxSize:t})}},"../../node_modules/.bun/viem@2.31.2+5bbfac422febb175/node_modules/viem/_esm/utils/encoding/toBytes.js":function(e,t,r){r.d(t,{O0:()=>c,nr:()=>f,qX:()=>h});var n=r("../../node_modules/.bun/viem@2.31.2+5bbfac422febb175/node_modules/viem/_esm/errors/base.js"),o=r("../../node_modules/.bun/viem@2.31.2+5bbfac422febb175/node_modules/viem/_esm/utils/data/isHex.js"),i=r("../../node_modules/.bun/viem@2.31.2+5bbfac422febb175/node_modules/viem/_esm/utils/data/pad.js"),s=r("../../node_modules/.bun/viem@2.31.2+5bbfac422febb175/node_modules/viem/_esm/utils/encoding/fromHex.js"),a=r("../../node_modules/.bun/viem@2.31.2+5bbfac422febb175/node_modules/viem/_esm/utils/encoding/toHex.js");let l=new TextEncoder;function c(e,t={}){var r,n;return"number"==typeof e||"bigint"==typeof e?(r=e,n=t,f((0,a.eC)(r,n))):"boolean"==typeof e?function(e,t={}){let r=new Uint8Array(1);return(r[0]=Number(e),"number"==typeof t.size)?((0,s.Yf)(r,{size:t.size}),(0,i.vk)(r,{size:t.size})):r}(e,t):(0,o.v)(e)?f(e,t):h(e,t)}let u={zero:48,nine:57,A:65,F:70,a:97,f:102};function d(e){return e>=u.zero&&e<=u.nine?e-u.zero:e>=u.A&&e<=u.F?e-(u.A-10):e>=u.a&&e<=u.f?e-(u.a-10):void 0}function f(e,t={}){let r=e;t.size&&((0,s.Yf)(r,{size:t.size}),r=(0,i.vk)(r,{dir:"right",size:t.size}));let o=r.slice(2);o.length%2&&(o=`0${o}`);let a=o.length/2,l=new Uint8Array(a);for(let e=0,t=0;e<a;e++){let r=d(o.charCodeAt(t++)),i=d(o.charCodeAt(t++));if(void 0===r||void 0===i)throw new n.G(`Invalid byte sequence ("${o[t-2]}${o[t-1]}" in "${o}").`);l[e]=16*r+i}return l}function h(e,t={}){let r=l.encode(e);return"number"==typeof t.size?((0,s.Yf)(r,{size:t.size}),(0,i.vk)(r,{dir:"right",size:t.size})):r}},"../../node_modules/.bun/viem@2.31.2+5bbfac422febb175/node_modules/viem/_esm/utils/encoding/toHex.js":function(e,t,r){r.d(t,{$G:()=>f,C4:()=>l,NC:()=>a,ci:()=>c,eC:()=>u});var n=r("../../node_modules/.bun/viem@2.31.2+5bbfac422febb175/node_modules/viem/_esm/errors/encoding.js"),o=r("../../node_modules/.bun/viem@2.31.2+5bbfac422febb175/node_modules/viem/_esm/utils/data/pad.js"),i=r("../../node_modules/.bun/viem@2.31.2+5bbfac422febb175/node_modules/viem/_esm/utils/encoding/fromHex.js");let s=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function a(e,t={}){return"number"==typeof e||"bigint"==typeof e?u(e,t):"string"==typeof e?f(e,t):"boolean"==typeof e?l(e,t):c(e,t)}function l(e,t={}){let r=`0x${Number(e)}`;return"number"==typeof t.size?((0,i.Yf)(r,{size:t.size}),(0,o.vk)(r,{size:t.size})):r}function c(e,t={}){let r="";for(let t=0;t<e.length;t++)r+=s[e[t]];let n=`0x${r}`;return"number"==typeof t.size?((0,i.Yf)(n,{size:t.size}),(0,o.vk)(n,{dir:"right",size:t.size})):n}function u(e,t={}){let r,{signed:i,size:s}=t,a=BigInt(e);s?r=i?(1n<<8n*BigInt(s)-1n)-1n:2n**(8n*BigInt(s))-1n:"number"==typeof e&&(r=BigInt(Number.MAX_SAFE_INTEGER));let l="bigint"==typeof r&&i?-r-1n:0;if(r&&a>r||a<l){let t="bigint"==typeof e?"n":"";throw new n.J5({max:r?`${r}${t}`:void 0,min:`${l}${t}`,signed:i,size:s,value:`${e}${t}`})}let c=`0x${(i&&a<0?(1n<<BigInt(8*s))+BigInt(a):a).toString(16)}`;return s?(0,o.vk)(c,{size:s}):c}let d=new TextEncoder;function f(e,t={}){return c(d.encode(e),t)}},"../../node_modules/.bun/viem@2.31.2+5bbfac422febb175/node_modules/viem/_esm/utils/hash/keccak256.js":function(e,t,r){let n,o,i;r.d(t,{w:()=>I});var s=r("../../node_modules/.bun/@noble+hashes@1.8.0/node_modules/@noble/hashes/esm/_u64.js"),a=r("../../node_modules/.bun/@noble+hashes@1.8.0/node_modules/@noble/hashes/esm/utils.js");let l=BigInt(0),c=BigInt(1),u=BigInt(2),d=BigInt(7),f=BigInt(256),h=BigInt(113),b=[],p=[],m=[];for(let e=0,t=c,r=1,n=0;e<24;e++){[r,n]=[n,(2*r+3*n)%5],b.push(2*(5*n+r)),p.push((e+1)*(e+2)/2%64);let o=l;for(let e=0;e<7;e++)(t=(t<<c^(t>>d)*h)%f)&u&&(o^=c<<(c<<BigInt(e))-c);m.push(o)}let w=(0,s.Vl)(m,!0),y=w[0],g=w[1],v=(e,t,r)=>r>32?(0,s.SD)(e,t,r):(0,s.EP)(e,t,r),j=(e,t,r)=>r>32?(0,s.mk)(e,t,r):(0,s.gm)(e,t,r);class _ extends a.kb{constructor(e,t,r,n=!1,o=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=e,this.suffix=t,this.outputLen=r,this.enableXOF=n,this.rounds=o,(0,a.k8)(r),!(0<e&&e<200))throw Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=(0,a.Jq)(this.state)}clone(){return this._cloneInto()}keccak(){(0,a.Ux)(this.state32),function(e,t=24){let r=new Uint32Array(10);for(let n=24-t;n<24;n++){for(let t=0;t<10;t++)r[t]=e[t]^e[t+10]^e[t+20]^e[t+30]^e[t+40];for(let t=0;t<10;t+=2){let n=(t+8)%10,o=(t+2)%10,i=r[o],s=r[o+1],a=v(i,s,1)^r[n],l=j(i,s,1)^r[n+1];for(let r=0;r<50;r+=10)e[t+r]^=a,e[t+r+1]^=l}let t=e[2],o=e[3];for(let r=0;r<24;r++){let n=p[r],i=v(t,o,n),s=j(t,o,n),a=b[r];t=e[a],o=e[a+1],e[a]=i,e[a+1]=s}for(let t=0;t<50;t+=10){for(let n=0;n<10;n++)r[n]=e[t+n];for(let n=0;n<10;n++)e[t+n]^=~r[(n+2)%10]&r[(n+4)%10]}e[0]^=y[n],e[1]^=g[n]}(0,a.ru)(r)}(this.state32,this.rounds),(0,a.Ux)(this.state32),this.posOut=0,this.pos=0}update(e){(0,a.$h)(this),e=(0,a.O0)(e),(0,a.gk)(e);let{blockLen:t,state:r}=this,n=e.length;for(let o=0;o<n;){let i=Math.min(t-this.pos,n-o);for(let t=0;t<i;t++)r[this.pos++]^=e[o++];this.pos===t&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;let{state:e,suffix:t,pos:r,blockLen:n}=this;e[r]^=t,(128&t)!=0&&r===n-1&&this.keccak(),e[n-1]^=128,this.keccak()}writeInto(e){(0,a.$h)(this,!1),(0,a.gk)(e),this.finish();let t=this.state,{blockLen:r}=this;for(let n=0,o=e.length;n<o;){this.posOut>=r&&this.keccak();let i=Math.min(r-this.posOut,o-n);e.set(t.subarray(this.posOut,this.posOut+i),n),this.posOut+=i,n+=i}return e}xofInto(e){if(!this.enableXOF)throw Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return(0,a.k8)(e),this.xofInto(new Uint8Array(e))}digestInto(e){if((0,a.eB)(e,this),this.finished)throw Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,(0,a.ru)(this.state)}_cloneInto(e){let{blockLen:t,suffix:r,outputLen:n,rounds:o,enableXOF:i}=this;return e||(e=new _(t,r,n,i,o)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=o,e.suffix=r,e.outputLen=n,e.enableXOF=i,e.destroyed=this.destroyed,e}}let x=(n=1,o=136,i=32,(0,a.V1)(()=>new _(o,n,i)));var k=r("../../node_modules/.bun/viem@2.31.2+5bbfac422febb175/node_modules/viem/_esm/utils/data/isHex.js"),S=r("../../node_modules/.bun/viem@2.31.2+5bbfac422febb175/node_modules/viem/_esm/utils/encoding/toBytes.js"),C=r("../../node_modules/.bun/viem@2.31.2+5bbfac422febb175/node_modules/viem/_esm/utils/encoding/toHex.js");function I(e,t){let r=x((0,k.v)(e,{strict:!1})?(0,S.O0)(e):e);return"bytes"===(t||"hex")?r:(0,C.NC)(r)}}},o={};function i(e){var t=o[e];if(void 0!==t)return t.exports;var r=o[e]={exports:{}};return n[e](r,r.exports,i),r.exports}if(i.m=n,i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{for(var r in t)i.o(t,r)&&!i.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},i.f={},i.e=e=>Promise.all(Object.keys(i.f).reduce((t,r)=>(i.f[r](e,t),t),[])),i.u=e=>""+(({438:"button-wallet",766:"button-share"})[e]||e)+"."+({438:"f8172761",441:"b4ee5514",766:"2799f927"})[e]+".js",i.miniCssF=e=>""+({438:"button-wallet",766:"button-share"})[e]+"."+({438:"390d543a",766:"823884d0"})[e]+".css",i.h=()=>"8a56d76906cad52e",i.g=(()=>{if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}})(),i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},"string"==typeof import.meta.url&&(e=import.meta.url),!e)throw Error("Automatic publicPath is not supported in this browser");if(i.p=e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),"undefined"!=typeof document){var s=function(e,t,r,n,o){var s=document.createElement("link");return s.rel="stylesheet",s.type="text/css",i.nc&&(s.nonce=i.nc),s.onerror=s.onload=function(r){if(s.onerror=s.onload=null,"load"===r.type)n();else{var i=r&&("load"===r.type?"missing":r.type),a=r&&r.target&&r.target.href||t,l=Error("Loading CSS chunk "+e+" failed.\\n("+a+")");l.code="CSS_CHUNK_LOAD_FAILED",l.type=i,l.request=a,s.parentNode&&s.parentNode.removeChild(s),o(l)}},s.href=t,r?r.parentNode.insertBefore(s,r.nextSibling):document.head.appendChild(s),s},a=function(e,t){for(var r=document.getElementsByTagName("link"),n=0;n<r.length;n++){var o=r[n],i=o.getAttribute("data-href")||o.getAttribute("href");if("stylesheet"===o.rel&&(i===e||i===t))return o}for(var s=document.getElementsByTagName("style"),n=0;n<s.length;n++){var o=s[n],i=o.getAttribute("data-href");if(i===e||i===t)return o}},l={276:0};i.f.miniCss=function(e,t){if(l[e])t.push(l[e]);else 0!==l[e]&&({438:1,766:1})[e]&&t.push(l[e]=new Promise(function(t,r){var n=i.miniCssF(e),o=i.p+n;if(a(n,o))return t();s(e,o,null,t,r)}).then(function(){l[e]=0},function(t){throw delete l[e],t}))}}t={276:0},r=e=>{var r,n,o=e.__webpack_ids__,s=e.__webpack_modules__,a=e.__webpack_runtime__,l=0;for(r in s)i.o(s,r)&&(i.m[r]=s[r]);for(a&&a(i);l<o.length;l++)n=o[l],i.o(t,n)&&t[n]&&t[n][0](),t[o[l]]=0},i.f.j=function(e,n){var o=i.o(t,e)?t[e]:void 0;if(0!==o)if(o)n.push(o[1]);else{var s=import("./"+i.u(e)).then(r,r=>{throw 0!==t[e]&&(t[e]=void 0),r}),s=Promise.race([s,new Promise(r=>{o=t[e]=[r]})]);n.push(o[1]=s)}};var c=i("../../packages/ui/utils/onDocumentReady.ts"),u=i("./src/utils/initFrakSdk.ts");(0,c.E)(u.m);const d={"button-share":()=>Promise.all([i.e("441"),i.e("766")]).then(i.bind(i,"./src/components/ButtonShare/index.ts")),"button-wallet":()=>Promise.all([i.e("441"),i.e("438")]).then(i.bind(i,"./src/components/ButtonWallet/index.ts"))},f=new MutationObserver(e=>{for(let{addedNodes:t}of e)for(let e of Array.from(t))e.nodeType===Node.ELEMENT_NODE&&h(e)});async function h(e){let t=e instanceof Element?e.tagName.toLowerCase():"",r=t?.startsWith("frak-"),n=Array.from(e.querySelectorAll(":not(:defined)")).map(e=>e.tagName.toLowerCase()).filter(e=>e.startsWith("frak-"));r&&!customElements.get(t)&&n.push(t);let o=[...new Set(n)];await Promise.allSettled(o.map(e=>b(e)))}async function b(e){if(customElements.get(e))return Promise.resolve();try{let t=e.replace(/^frak-/i,"");if(!(t in d))throw Error(`Component ${e} is not supported.`);await d[t]()}catch(e){console.error(e)}}h(document.body),f.observe(document.documentElement,{subtree:!0,childList:!0});
32
+ `.trim()}}let c=2000001;function l({iframe:e,isVisible:t}){if(!t){e.style.width="0",e.style.height="0",e.style.border="0",e.style.position="fixed",e.style.top="-1000px",e.style.left="-1000px";return}e.style.position="fixed",e.style.top="0",e.style.left="0",e.style.width="100%",e.style.height="100%",e.style.pointerEvents="auto"}async function u({config:e,rpcClient:t,lifecycleManager:r}){async function n(){let r=e.customizations?.css;r&&t.sendLifecycle({clientLifecycle:"modal-css",data:{cssLink:r}})}async function o(){let r=e.customizations?.i18n;r&&t.sendLifecycle({clientLifecycle:"modal-i18n",data:{i18n:r}})}async function i(){if("undefined"==typeof window)return;let e=window.localStorage.getItem(s);e&&t.sendLifecycle({clientLifecycle:"restore-backup",data:{backup:e}})}await r.isConnected,function(e,t){if("undefined"==typeof window)return;let r=new URL(window.location.href),n=r.searchParams.get("sso");n&&(t.then(()=>{e.sendLifecycle({clientLifecycle:"sso-redirect-complete",data:{compressed:n}}),console.log("[SSO URL Listener] Forwarded compressed SSO data to iframe")}).catch(e=>{console.error("[SSO URL Listener] Failed to forward SSO data:",e)}),r.searchParams.delete("sso"),window.history.replaceState({},"",r.toString()),console.log("[SSO URL Listener] SSO parameter detected and URL cleaned"))}(t,r.isConnected),await Promise.allSettled([n(),o(),i()])}let d={eur:"fr-FR",usd:"en-US",gbp:"en-GB"};function f(e){return e&&e in d?e:"eur"}async function h({config:e}){let t,r=(t=f(e.metadata?.currency),{...e,metadata:{...e.metadata,currency:t}}),d=await function({walletBaseUrl:e,config:t}){let r=document.querySelector("#frak-wallet");r&&r.remove();let n=document.createElement("iframe");return n.id="frak-wallet",n.name="frak-wallet",n.allow="publickey-credentials-get *; clipboard-write; web-share *",n.style.zIndex=c.toString(),l({iframe:n,isVisible:!1}),document.body.appendChild(n),new Promise(r=>{n?.addEventListener("load",()=>r(n)),n.src=`${t?.walletUrl??e??"https://wallet.frak.id"}/listener`})}({config:r});if(!d)return void console.error("Failed to create iframe");let h=function({config:e,iframe:t}){let r,c=e?.walletUrl??"https://wallet.frak.id",d=function({iframe:e}){let t=new o.cY;return{handleEvent:async r=>{if(!("iframeLifecycle"in r))return;let{iframeLifecycle:n,data:o}=r;switch(n){case"connected":t.resolve(!0);break;case"do-backup":o.backup?localStorage.setItem(s,o.backup):localStorage.removeItem(s);break;case"remove-backup":localStorage.removeItem(s);break;case"show":case"hide":l({iframe:e,isVisible:"show"===n});break;case"handshake":e.contentWindow?.postMessage({clientLifecycle:"handshake-response",data:{token:o.token,currentUrl:window.location.href}},"*");break;case"redirect":{let e=new URL(o.baseRedirectUrl);e.searchParams.has("u")?(e.searchParams.delete("u"),e.searchParams.append("u",window.location.href),window.location.href=e.toString()):window.location.href=o.baseRedirectUrl}}},isConnected:t.promise}}({iframe:t}),f=new a(e,t);if(!t.contentWindow)throw new n.c(n.d.configError,"The iframe does not have a content window");let h=(0,o.H4)({emittingTransport:t.contentWindow,listeningTransport:window,targetOrigin:c,middleware:[{async onRequest(e,t){if(!await d.isConnected)throw new n.c(n.d.clientNotConnected,"The iframe provider isn't connected yet");return t}},(0,n.t)(),{onRequest:(e,t)=>(f.setLastRequest(e),t),onResponse:(e,t)=>(f.setLastResponse(e,t),t)}],lifecycleHandlers:{iframeLifecycle:async(e,t)=>{await d.handleEvent(e)}}}),b=function(e,t){let r,n,o=()=>e.sendLifecycle({clientLifecycle:"heartbeat"});function i(){r&&clearInterval(r),n&&clearTimeout(n)}return async function(){o(),r=setInterval(o,1e3),n=setTimeout(()=>{i(),console.log("Heartbeat timeout: connection failed")},3e4),await t.isConnected,i()}(),i}(h,d),p=async()=>{b(),h.cleanup(),t.remove()};console.log("[Frak SDK] Initializing OpenPanel"),(r=new i.j({apiUrl:"https://op-api.gcp.frak.id",clientId:"6eacc8d7-49ac-4936-95e9-81ef29449570",trackScreenViews:!0,trackOutgoingLinks:!0,trackAttributes:!1,filter:({type:e,payload:t})=>!("track"===e&&t?.properties)||("sdkVersion"in t.properties||(t.properties={...t.properties,sdkVersion:"0.1.0"}),!0)})).setGlobalProperties({sdkVersion:"0.1.0"}),r.init();let m=u({config:e,rpcClient:h,lifecycleManager:d}).then(()=>f.updateSetupStatus(!0));return{config:e,debugInfo:f,waitForConnection:d.isConnected,waitForSetup:m,request:h.request,listenerRequest:h.listen,destroy:p,openPanel:r}}({config:r,iframe:d});return(await h.waitForSetup,await h.waitForConnection)?h:void console.error("Failed to connect to client")}function b(e,t){let r=t?d[t]??d.eur:d.eur,n=f(t);return e.toLocaleString(r,{style:"currency",currency:n,minimumFractionDigits:0,maximumFractionDigits:2})}function p(e){return e?`${e}Amount`:"eurAmount"}function m(e,t,r={}){if(!e)return void console.debug("[Frak] No client provided, skipping event tracking");try{e.openPanel?.track(t,r)}catch(e){console.debug("[Frak] Failed to track event:",t,e)}}Object.entries({dapp:1,press:2,webshop:3,retail:4,referral:30,purchase:31}).reduce((e,[t,r])=>(e[t]=BigInt(1)<<BigInt(r),e),{})}},o={};function i(e){var t=o[e];if(void 0!==t)return t.exports;var r=o[e]={exports:{}};return n[e](r,r.exports,i),r.exports}if(i.m=n,i.d=(e,t)=>{for(var r in t)i.o(t,r)&&!i.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},i.f={},i.e=e=>Promise.all(Object.keys(i.f).reduce((t,r)=>(i.f[r](e,t),t),[])),i.u=e=>"1~"+(({286:"button-share",72:"button-wallet"})[e]||e)+"."+({286:"0a799081",72:"8539529b",767:"acb2c63c"})[e]+".js",i.miniCssF=e=>""+({286:"button-share",72:"button-wallet"})[e]+"."+({286:"823884d0",72:"390d543a"})[e]+".css",i.g=(()=>{if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}})(),i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},"string"==typeof import.meta.url&&(e=import.meta.url),!e)throw Error("Automatic publicPath is not supported in this browser");if(i.p=e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),"undefined"!=typeof document){var s=function(e,t,r,n,o){var s=document.createElement("link");return s.rel="stylesheet",s.type="text/css",i.nc&&(s.nonce=i.nc),s.onerror=s.onload=function(r){if(s.onerror=s.onload=null,"load"===r.type)n();else{var i=r&&("load"===r.type?"missing":r.type),a=r&&r.target&&r.target.href||t,c=Error("Loading CSS chunk "+e+" failed.\\n("+a+")");c.code="CSS_CHUNK_LOAD_FAILED",c.type=i,c.request=a,s.parentNode&&s.parentNode.removeChild(s),o(c)}},s.href=t,r?r.parentNode.insertBefore(s,r.nextSibling):document.head.appendChild(s),s},a=function(e,t){for(var r=document.getElementsByTagName("link"),n=0;n<r.length;n++){var o=r[n],i=o.getAttribute("data-href")||o.getAttribute("href");if(i&&(i=i.split("?")[0]),"stylesheet"===o.rel&&(i===e||i===t))return o}for(var s=document.getElementsByTagName("style"),n=0;n<s.length;n++){var o=s[n],i=o.getAttribute("data-href");if(i===e||i===t)return o}},c={67:0};i.f.miniCss=function(e,t){if(c[e])t.push(c[e]);else 0!==c[e]&&({72:1,286:1})[e]&&t.push(c[e]=new Promise(function(t,r){var n=i.miniCssF(e),o=i.p+n;if(a(n,o))return t();s(e,o,null,t,r)}).then(function(){c[e]=0},function(t){throw delete c[e],t}))}}t={67:0},r=e=>{var r,n,o=e.__webpack_ids__,s=e.__webpack_modules__,a=e.__webpack_runtime__,c=0;for(r in s)i.o(s,r)&&(i.m[r]=s[r]);for(a&&a(i);c<o.length;c++)n=o[c],i.o(t,n)&&t[n]&&t[n][0](),t[o[c]]=0},i.f.j=function(e,n){var o=i.o(t,e)?t[e]:void 0;if(0!==o)if(o)n.push(o[1]);else{var s=import("./"+i.u(e)).then(r,r=>{throw 0!==t[e]&&(t[e]=void 0),r}),s=Promise.race([s,new Promise(r=>{o=t[e]=[r]})]);n.push(o[1]=s)}};var l=i("../../packages/ui/utils/onDocumentReady.ts"),u=i("./src/utils/initFrakSdk.ts");(0,l.q)(u.$);let d={"button-share":()=>Promise.all([i.e("767"),i.e("286")]).then(i.bind(i,"./src/components/ButtonShare/index.ts")),"button-wallet":()=>Promise.all([i.e("767"),i.e("72")]).then(i.bind(i,"./src/components/ButtonWallet/index.ts"))},f=new MutationObserver(e=>{for(let{addedNodes:t}of e)for(let e of Array.from(t))e.nodeType===Node.ELEMENT_NODE&&h(e)});async function h(e){let t=e instanceof Element?e.tagName.toLowerCase():"",r=t?.startsWith("frak-"),n=Array.from(e.querySelectorAll(":not(:defined)")).map(e=>e.tagName.toLowerCase()).filter(e=>e.startsWith("frak-"));r&&!customElements.get(t)&&n.push(t);let o=[...new Set(n)];await Promise.allSettled(o.map(e=>b(e)))}async function b(e){if(customElements.get(e))return Promise.resolve();try{let t=e.replace(/^frak-/i,"");if(!(t in d))throw Error(`Component ${e} is not supported.`);await d[t]()}catch(e){console.error(e)}}h(document.body),f.observe(document.documentElement,{subtree:!0,childList:!0});
@@ -1 +1 @@
1
- import e from"preact-custom-element";import{DebugInfoGatherer as t,formatAmount as n,getCurrencyAmountKey as o,setupClient as r,trackEvent as a}from"@frak-labs/core-sdk";import{displayEmbeddedWallet as i,getProductInformation as l,modalBuilder as d,referralInteraction as s}from"@frak-labs/core-sdk/actions";import{Fragment as c,jsx as u,jsxs as p}from"preact/jsx-runtime";import{cx as f}from"class-variance-authority";import{useCallback as m,useEffect as w,useMemo as g,useState as k}from"preact/hooks";import{FrakRpcError as h,RpcErrorCodes as S}from"@frak-labs/frame-connector";import*as y from"@frak-labs/core-sdk/bundle";let b="frakClientReady";function F(e,t){if(window.FrakSetup?.client&&"add"===e)return void t();("add"===e?window.addEventListener:window.removeEventListener)(b,t,!1)}async function v(e){console.log("referral",await s(e,{modalConfig:window.FrakSetup?.modalWalletConfig}))}async function x(){if(window.FrakSetup.core=y,!(window.frakSetupInProgress?(console.log("[Frak SDK] Initialization already in progress"),!1):window.FrakSetup?.client?(console.log("[Frak SDK] Client already initialized"),!1):!!window.FrakSetup?.config||(console.error("[Frak SDK] Configuration not found. Please ensure window.FrakSetup.config is set."),!1)))return;if(console.log("[Frak SDK] Starting initialization"),window.frakSetupInProgress=!0,!window.FrakSetup.config){console.error("[Frak SDK] Configuration not found"),window.frakSetupInProgress=!1;return}let e=await r({config:window.FrakSetup.config});if(!e){console.error("[Frak SDK] Failed to create client"),window.frakSetupInProgress=!1;return}window.FrakSetup.client=e,console.log("[Frak SDK] Client initialized successfully");let t=new CustomEvent(b);window.dispatchEvent(t),window.modalBuilderSteps=d(e,window.FrakSetup?.modalConfig??{}),v(e),window.frakSetupInProgress=!1,function(){let e=new URLSearchParams(window.location.search).get("frakAction");e&&"share"===e&&(console.log("[Frak SDK] Auto open query param found"),function(){if(!window.FrakSetup?.client)return console.error("Frak client not found");"vibrate"in navigator?navigator.vibrate(10):console.log("Vibration not supported"),i(window.FrakSetup.client,window.FrakSetup?.modalWalletConfig??{})}())}()}let C="spinner__leaf-xtOJmT",D=({ref:e,className:t,...n})=>p("span",{...n,ref:e,className:f("spinner-KHk8mw"),children:[u("span",{className:C}),u("span",{className:C}),u("span",{className:C}),u("span",{className:C}),u("span",{className:C}),u("span",{className:C}),u("span",{className:C}),u("span",{className:C})]});async function E({targetInteraction:e}){let t=window.FrakSetup?.client;if(!t)return void console.warn("Frak client not ready yet");let{maxReferrer:r,rewards:a}=await l(t);if(!r)return;let i=o(t.config.metadata?.currency),d=Math.round(r[i]);if(e){let t=a.filter(t=>t.interactionTypeKey===e).map(e=>e.referrer[i]).reduce((e,t)=>t>e?t:e,0);t>0&&(d=Math.round(t))}return n(d,t.config.metadata?.currency)}D.displayName="Spinner";let I={marginTop:"16px",padding:"16px",backgroundColor:"#FEE2E2",border:"1px solid #FCA5A5",borderRadius:"4px",color:"#991B1B"},B={display:"flex",alignItems:"center",gap:"8px",marginBottom:"12px"},N={margin:0,fontSize:"16px",fontWeight:500},R={fontSize:"14px",lineHeight:"1.5",margin:"0 0 12px 0"},z={color:"#991B1B",textDecoration:"underline",textUnderlineOffset:"2px"},K={display:"inline-flex",alignItems:"center",gap:"8px",marginBottom:"10px",padding:"8px 12px",backgroundColor:"white",border:"1px solid #D1D5DB",borderRadius:"4px",color:"black",fontSize:"14px",fontWeight:500};function W({debugInfo:e}){let[t,n]=k(!1);return p("div",{children:[u("button",{type:"button",style:K,onClick:()=>n(!t),children:"Ouvrir les informations"}),t&&u("textarea",{style:{display:"block",width:"100%",height:"200px",fontSize:"12px"},children:e})]})}function A({debugInfo:e}){let{copied:t,copy:n}=function(e={}){let{successDuration:t=2e3}=e,[n,o]=k(!1);return{copy:m(async e=>{try{if(navigator.clipboard&&window.isSecureContext)await navigator.clipboard.writeText(e),o(!0);else{let t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.opacity="0",document.body.appendChild(t),t.focus(),t.select();try{document.execCommand("copy"),o(!0)}catch(e){return console.error("Failed to copy text:",e),!1}finally{t.remove()}}return setTimeout(()=>{o(!1)},t),!0}catch(e){return console.error("Failed to copy text:",e),!1}},[t]),copied:n}}();return p("div",{style:I,children:[u("div",{style:B,children:u("h3",{style:N,children:"Oups ! Nous avons rencontr\xe9 un petit probl\xe8me"})}),p("p",{style:R,children:["Impossible d'ouvrir le menu de partage pour le moment. Si le probl\xe8me persiste, copiez les informations ci-dessous et collez-les dans votre mail \xe0"," ",u("a",{href:"mailto:help@frak-labs.com?subject=Debug",style:z,children:"help@frak-labs.com"})," ",u("br",{}),"Merci pour votre retour, nous traitons votre demande dans les plus brefs d\xe9lais."]}),u("button",{type:"button",onClick:()=>n(e??""),style:K,children:t?"Informations copi\xe9es !":"Copier les informations de d\xe9bogage"}),u(W,{debugInfo:e})]})}async function P(){if(!window.FrakSetup?.client)throw Error("Frak client not found");await i(window.FrakSetup.client,window.FrakSetup?.modalWalletConfig??{})}function L({text:e="Share and earn!",classname:n="",useReward:o,noRewardText:r,targetInteraction:i,showWallet:l}){let d=g(()=>void 0!==o,[o]),s=g(()=>void 0!==l,[l]),{isClientReady:y}=function(){let[e,t]=k(!0),n=m(()=>{t(!1)},[]);return w(()=>(F("add",n),()=>F("remove",n)),[n]),{isClientReady:!e}}(),{reward:b}=function(e,t){let[n,o]=k(void 0);return w(()=>{e&&E({targetInteraction:t}).then(e=>{e&&o(e)})},[e,t]),{reward:n}}(d&&y,i),{handleShare:v,isError:x,debugInfo:C}=function(e){let[n,o]=k(void 0),[r,i]=k(!1);return{handleShare:m(async()=>{if(!window.FrakSetup?.client){console.error("Frak client not found"),o(t.empty().formatDebugInfo("Frak client not found")),i(!0);return}let n=function(){if(!window.modalBuilderSteps)throw Error("modalBuilderSteps not found");return window.modalBuilderSteps}();if(!n)throw Error("modalBuilderSteps not found");try{await n.sharing(window.FrakSetup?.modalShareConfig??{}).display(t=>({...t,targetInteraction:e}))}catch(t){if(t instanceof h&&t.code===S.clientAborted)return void console.debug("User aborted the modal");let e=window.FrakSetup.client.debugInfo.formatDebugInfo(t);a(window.FrakSetup.client,"share_modal_error",{error:t instanceof Object&&"message"in t?t.message:"Unknown error",debugInfo:e}),o(e),i(!0),console.error("Error while opening the modal",t)}},[e]),isError:r,debugInfo:n}}(i),I=g(()=>d?b?e.includes("{REWARD}")?e.replace("{REWARD}",b):`${e} ${b}`:r??e.replace("{REWARD}",""):e,[d,e,r,b]),B=m(async()=>{a(window.FrakSetup.client,"share_button_clicked"),s?await P():await v()},[s,v]);return p(c,{children:[p("button",{type:"button",className:f("buttonShare-F23Y9m",n,"override"),onClick:B,children:[!y&&u(D,{})," ",I]}),x&&u(A,{debugInfo:C})]})}!function(t,n,o=[],r={shadow:!1}){"undefined"!=typeof window&&("complete"===document.readyState||"interactive"===document.readyState?setTimeout(x,1):document.addEventListener?document.addEventListener("DOMContentLoaded",x):document.attachEvent("onreadystatechange",()=>{"complete"===document.readyState&&x()}),customElements.get(n)||e(t,n,o,r))}(L,"frak-button-share",["text"],{shadow:!1});export{L as ButtonShare};
1
+ import e from"preact-custom-element";import{DebugInfoGatherer as o,formatAmount as t,getCurrencyAmountKey as n,setupClient as r,trackEvent as a}from"@frak-labs/core-sdk";import{displayEmbeddedWallet as i,getProductInformation as l,modalBuilder as d,referralInteraction as s}from"@frak-labs/core-sdk/actions";import{Fragment as c,jsx as u,jsxs as p}from"preact/jsx-runtime";import{cx as f}from"class-variance-authority";import{useCallback as m,useEffect as w,useMemo as g,useState as k}from"preact/hooks";import{FrakRpcError as h,RpcErrorCodes as S}from"@frak-labs/frame-connector";import*as y from"@frak-labs/core-sdk/bundle";let b="frakClientReady";function F(e,o){window.FrakSetup?.client&&"add"===e?o():("add"===e?window.addEventListener:window.removeEventListener)(b,o,!1)}async function v(e){console.log("referral",await s(e,{modalConfig:window.FrakSetup?.modalWalletConfig}))}async function x(){let e,o;if(window.FrakSetup.core=y,!(window.frakSetupInProgress?(console.log("[Frak SDK] Initialization already in progress"),!1):window.FrakSetup?.client?(console.log("[Frak SDK] Client already initialized"),!1):!!window.FrakSetup?.config||(console.error("[Frak SDK] Configuration not found. Please ensure window.FrakSetup.config is set."),!1)))return;if(console.log("[Frak SDK] Starting initialization"),window.frakSetupInProgress=!0,!window.FrakSetup.config){console.error("[Frak SDK] Configuration not found"),window.frakSetupInProgress=!1;return}let t=await r({config:window.FrakSetup.config});if(!t){console.error("[Frak SDK] Failed to create client"),window.frakSetupInProgress=!1;return}window.FrakSetup.client=t,console.log("[Frak SDK] Client initialized successfully");e=new CustomEvent(b),window.dispatchEvent(e),window.modalBuilderSteps=d(t,window.FrakSetup?.modalConfig??{}),v(t),window.frakSetupInProgress=!1,(o=new URLSearchParams(window.location.search).get("frakAction"))&&"share"===o&&(console.log("[Frak SDK] Auto open query param found"),window.FrakSetup?.client?("vibrate"in navigator?navigator.vibrate(10):console.log("Vibration not supported"),i(window.FrakSetup.client,window.FrakSetup?.modalWalletConfig??{})):console.error("Frak client not found"))}let C="spinner__leaf-xtOJmT",D=({ref:e,className:o,...t})=>p("span",{...t,ref:e,className:f("spinner-KHk8mw"),children:[u("span",{className:C}),u("span",{className:C}),u("span",{className:C}),u("span",{className:C}),u("span",{className:C}),u("span",{className:C}),u("span",{className:C}),u("span",{className:C})]});async function E({targetInteraction:e}){let o=window.FrakSetup?.client;if(!o)return void console.warn("Frak client not ready yet");let{maxReferrer:r,rewards:a}=await l(o);if(!r)return;let i=n(o.config.metadata?.currency),d=Math.round(r[i]);if(e){let o=a.filter(o=>o.interactionTypeKey===e).map(e=>e.referrer[i]).reduce((e,o)=>o>e?o:e,0);o>0&&(d=Math.round(o))}return t(d,o.config.metadata?.currency)}D.displayName="Spinner";let I={marginTop:"16px",padding:"16px",backgroundColor:"#FEE2E2",border:"1px solid #FCA5A5",borderRadius:"4px",color:"#991B1B"},B={display:"flex",alignItems:"center",gap:"8px",marginBottom:"12px"},N={margin:0,fontSize:"16px",fontWeight:500},R={fontSize:"14px",lineHeight:"1.5",margin:"0 0 12px 0"},z={color:"#991B1B",textDecoration:"underline",textUnderlineOffset:"2px"},K={display:"inline-flex",alignItems:"center",gap:"8px",marginBottom:"10px",padding:"8px 12px",backgroundColor:"white",border:"1px solid #D1D5DB",borderRadius:"4px",color:"black",fontSize:"14px",fontWeight:500};function W({debugInfo:e}){let[o,t]=k(!1);return p("div",{children:[u("button",{type:"button",style:K,onClick:()=>t(!o),children:"Ouvrir les informations"}),o&&u("textarea",{style:{display:"block",width:"100%",height:"200px",fontSize:"12px"},children:e})]})}function A({debugInfo:e}){let{copied:o,copy:t}=function(e={}){let{successDuration:o=2e3}=e,[t,n]=k(!1);return{copy:m(async e=>{try{if(navigator.clipboard&&window.isSecureContext)await navigator.clipboard.writeText(e),n(!0);else{let o=document.createElement("textarea");o.value=e,o.style.position="fixed",o.style.opacity="0",document.body.appendChild(o),o.focus(),o.select();try{document.execCommand("copy"),n(!0)}catch(e){return console.error("Failed to copy text:",e),!1}finally{o.remove()}}return setTimeout(()=>{n(!1)},o),!0}catch(e){return console.error("Failed to copy text:",e),!1}},[o]),copied:t}}();return p("div",{style:I,children:[u("div",{style:B,children:u("h3",{style:N,children:"Oups ! Nous avons rencontr\xe9 un petit probl\xe8me"})}),p("p",{style:R,children:["Impossible d'ouvrir le menu de partage pour le moment. Si le probl\xe8me persiste, copiez les informations ci-dessous et collez-les dans votre mail \xe0"," ",u("a",{href:"mailto:help@frak-labs.com?subject=Debug",style:z,children:"help@frak-labs.com"})," ",u("br",{}),"Merci pour votre retour, nous traitons votre demande dans les plus brefs d\xe9lais."]}),u("button",{type:"button",onClick:()=>t(e??""),style:K,children:o?"Informations copi\xe9es !":"Copier les informations de d\xe9bogage"}),u(W,{debugInfo:e})]})}async function P(){if(!window.FrakSetup?.client)throw Error("Frak client not found");await i(window.FrakSetup.client,window.FrakSetup?.modalWalletConfig??{})}function L({text:e="Share and earn!",classname:t="",useReward:n,noRewardText:r,targetInteraction:i,showWallet:l}){let d=g(()=>void 0!==n,[n]),s=g(()=>void 0!==l,[l]),{isClientReady:y}=function(){let[e,o]=k(!0),t=m(()=>{o(!1)},[]);return w(()=>(F("add",t),()=>F("remove",t)),[t]),{isClientReady:!e}}(),{reward:b}=function(e,o){let[t,n]=k(void 0);return w(()=>{e&&E({targetInteraction:o}).then(e=>{e&&n(e)})},[e,o]),{reward:t}}(d&&y,i),{handleShare:v,isError:x,debugInfo:C}=function(e){let[t,n]=k(void 0),[r,i]=k(!1);return{handleShare:m(async()=>{if(!window.FrakSetup?.client){console.error("Frak client not found"),n(o.empty().formatDebugInfo("Frak client not found")),i(!0);return}let t=function(){if(!window.modalBuilderSteps)throw Error("modalBuilderSteps not found");return window.modalBuilderSteps}();if(!t)throw Error("modalBuilderSteps not found");try{await t.sharing(window.FrakSetup?.modalShareConfig??{}).display(o=>({...o,targetInteraction:e}))}catch(o){if(o instanceof h&&o.code===S.clientAborted)return void console.debug("User aborted the modal");let e=window.FrakSetup.client.debugInfo.formatDebugInfo(o);a(window.FrakSetup.client,"share_modal_error",{error:o instanceof Object&&"message"in o?o.message:"Unknown error",debugInfo:e}),n(e),i(!0),console.error("Error while opening the modal",o)}},[e]),isError:r,debugInfo:t}}(i),I=g(()=>d?b?e.includes("{REWARD}")?e.replace("{REWARD}",b):`${e} ${b}`:r??e.replace("{REWARD}",""):e,[d,e,r,b]),B=m(async()=>{a(window.FrakSetup.client,"share_button_clicked"),s?await P():await v()},[s,v]);return p(c,{children:[p("button",{type:"button",className:f("buttonShare-F23Y9m",t,"override"),onClick:B,children:[!y&&u(D,{})," ",I]}),x&&u(A,{debugInfo:C})]})}!function(o,t,n=[],r={shadow:!1}){"undefined"!=typeof window&&("complete"===document.readyState||"interactive"===document.readyState?setTimeout(x,1):document.addEventListener?document.addEventListener("DOMContentLoaded",x):document.attachEvent("onreadystatechange",()=>{"complete"===document.readyState&&x()}),customElements.get(t)||e(o,t,n,r))}(L,"frak-button-share",["text"],{shadow:!1});export{L as ButtonShare};
@@ -1 +1 @@
1
- import e from"preact-custom-element";import{formatAmount as t,getCurrencyAmountKey as n,setupClient as o,trackEvent as r}from"@frak-labs/core-sdk";import{displayEmbeddedWallet as i,getProductInformation as a,modalBuilder as l,referralInteraction as u}from"@frak-labs/core-sdk/actions";import{jsx as c,jsxs as _}from"preact/jsx-runtime";import{useCallback as s,useEffect as f,useMemo as d,useState as p}from"preact/hooks";import{cx as v}from"class-variance-authority";import{Component as m,Fragment as h,createElement as w,options as k,toChildArray as y}from"preact";import*as g from"@frak-labs/core-sdk/bundle";function b(){if(!window.FrakSetup?.client)return void console.error("Frak client not found");"vibrate"in navigator?navigator.vibrate(10):console.log("Vibration not supported"),i(window.FrakSetup.client,window.FrakSetup?.modalWalletConfig??{})}let S="frakClientReady";function F(e,t){if(window.FrakSetup?.client&&"add"===e)return void t();("add"===e?window.addEventListener:window.removeEventListener)(S,t,!1)}async function C(e){console.log("referral",await u(e,{modalConfig:window.FrakSetup?.modalWalletConfig}))}async function P(){if(window.FrakSetup.core=g,!(window.frakSetupInProgress?(console.log("[Frak SDK] Initialization already in progress"),!1):window.FrakSetup?.client?(console.log("[Frak SDK] Client already initialized"),!1):!!window.FrakSetup?.config||(console.error("[Frak SDK] Configuration not found. Please ensure window.FrakSetup.config is set."),!1)))return;if(console.log("[Frak SDK] Starting initialization"),window.frakSetupInProgress=!0,!window.FrakSetup.config){console.error("[Frak SDK] Configuration not found"),window.frakSetupInProgress=!1;return}let e=await o({config:window.FrakSetup.config});if(!e){console.error("[Frak SDK] Failed to create client"),window.frakSetupInProgress=!1;return}window.FrakSetup.client=e,console.log("[Frak SDK] Client initialized successfully");let t=new CustomEvent(S);window.dispatchEvent(t),window.modalBuilderSteps=l(e,window.FrakSetup?.modalConfig??{}),C(e),window.frakSetupInProgress=!1,function(){let e=new URLSearchParams(window.location.search).get("frakAction");e&&"share"===e&&(console.log("[Frak SDK] Auto open query param found"),b())}()}async function E({targetInteraction:e}){let o=window.FrakSetup?.client;if(!o)return void console.warn("Frak client not ready yet");let{maxReferrer:r,rewards:i}=await a(o);if(!r)return;let l=n(o.config.metadata?.currency),u=Math.round(r[l]);if(e){let t=i.filter(t=>t.interactionTypeKey===e).map(e=>e.referrer[l]).reduce((e,t)=>t>e?t:e,0);t>0&&(u=Math.round(t))}return t(u,o.config.metadata?.currency)}let O={button:"button-aPZnsb",button__left:"button__left-fQJUnK",button__right:"button__right-TkFFFK",reward:"reward-w5dm3K"};function x(e,t){for(var n in e)if("__source"!==n&&!(n in t))return!0;for(var o in t)if("__source"!==o&&e[o]!==t[o])return!0;return!1}function D(e,t){this.props=e,this.context=t}(D.prototype=new m).isPureReactComponent=!0,D.prototype.shouldComponentUpdate=function(e,t){return x(this.props,e)||x(this.state,t)};var K=k.__b;k.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),K&&K(e)},"undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref");var R=k.__e;k.__e=function(e,t,n,o){if(e.then){for(var r,i=t;i=i.__;)if((r=i.__c)&&r.__c)return null==t.__e&&(t.__e=n.__e,t.__k=n.__k),r.__c(e,t)}R(e,t,n,o)};var L=k.unmount;function U(){this.__u=0,this.o=null,this.__b=null}function N(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function V(){this.i=null,this.l=null}k.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),L&&L(e)},(U.prototype=new m).__c=function(e,t){var n=t.__c,o=this;null==o.o&&(o.o=[]),o.o.push(n);var r=N(o.__v),i=!1,a=function(){i||(i=!0,n.__R=null,r?r(l):l())};n.__R=a;var l=function(){if(!--o.__u){if(o.state.__a){var e,t=o.state.__a;o.__v.__k[0]=function e(t,n,o){return t&&o&&(t.__v=null,t.__k=t.__k&&t.__k.map(function(t){return e(t,n,o)}),t.__c&&t.__c.__P===n&&(t.__e&&o.appendChild(t.__e),t.__c.__e=!0,t.__c.__P=o)),t}(t,t.__c.__P,t.__c.__O)}for(o.setState({__a:o.__b=null});e=o.o.pop();)e.forceUpdate()}};o.__u++||32&t.__u||o.setState({__a:o.__b=o.__v.__k[0]}),e.then(a,a)},U.prototype.componentWillUnmount=function(){this.o=[]},U.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),o=this.__v.__k[0].__c;this.__v.__k[0]=function e(t,n,o){return t&&(t.__c&&t.__c.__H&&(t.__c.__H.__.forEach(function(e){"function"==typeof e.__c&&e.__c()}),t.__c.__H=null),null!=(t=function(e,t){for(var n in t)e[n]=t[n];return e}({},t)).__c&&(t.__c.__P===o&&(t.__c.__P=n),t.__c.__e=!0,t.__c=null),t.__k=t.__k&&t.__k.map(function(t){return e(t,n,o)})),t}(this.__b,n,o.__O=o.__P)}this.__b=null}var r=t.__a&&w(h,null,e.fallback);return r&&(r.__u&=-33),[w(h,null,t.__a?null:e.children),r]};var W=function(e,t,n){if(++n[1]===n[0]&&e.l.delete(t),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.l.size))for(n=e.i;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.i=n=n[2]}};(V.prototype=new m).__a=function(e){var t=this,n=N(t.__v),o=t.l.get(e);return o[0]++,function(r){var i=function(){t.props.revealOrder?(o.push(r),W(t,e,o)):r()};n?n(i):i()}},V.prototype.render=function(e){this.i=null,this.l=new Map;var t=y(e.children);e.revealOrder&&"b"===e.revealOrder[0]&&t.reverse();for(var n=t.length;n--;)this.l.set(t[n],this.i=[1,0,this.i]);return e.children},V.prototype.componentDidUpdate=V.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,n){W(e,n,t)})};var A="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,M=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,z=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,H=/[A-Z0-9]/g,I="undefined"!=typeof document;m.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(m.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var j=k.event;function B(){}function T(){return this.cancelBubble}function Z(){return this.defaultPrevented}k.event=function(e){return j&&(e=j(e)),e.persist=B,e.isPropagationStopped=T,e.isDefaultPrevented=Z,e.nativeEvent=e};var $={enumerable:!1,configurable:!0,get:function(){return this.class}},q=k.vnode;k.vnode=function(e){"string"==typeof e.type&&function(e){var t=e.props,n=e.type,o={},r=-1===n.indexOf("-");for(var i in t){var a=t[i];if(!("value"===i&&"defaultValue"in t&&null==a||I&&"children"===i&&"noscript"===n||"class"===i||"className"===i)){var l,u=i.toLowerCase();"defaultValue"===i&&"value"in t&&null==t.value?i="value":"download"===i&&!0===a?a="":"translate"===u&&"no"===a?a=!1:"o"===u[0]&&"n"===u[1]?"ondoubleclick"===u?i="ondblclick":"onchange"!==u||"input"!==n&&"textarea"!==n||(l=t.type,("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/:/fil|che|ra/).test(l))?"onfocus"===u?i="onfocusin":"onblur"===u?i="onfocusout":z.test(i)&&(i=u):u=i="oninput":r&&M.test(i)?i=i.replace(H,"-$&").toLowerCase():null===a&&(a=void 0),"oninput"===u&&o[i=u]&&(i="oninputCapture"),o[i]=a}}"select"==n&&o.multiple&&Array.isArray(o.value)&&(o.value=y(t.children).forEach(function(e){e.props.selected=-1!=o.value.indexOf(e.props.value)})),"select"==n&&null!=o.defaultValue&&(o.value=y(t.children).forEach(function(e){e.props.selected=o.multiple?-1!=o.defaultValue.indexOf(e.props.value):o.defaultValue==e.props.value})),t.class&&!t.className?(o.class=t.class,Object.defineProperty(o,"className",$)):(t.className&&!t.class||t.class&&t.className)&&(o.class=o.className=t.className),e.props=o}(e),e.$$typeof=A,q&&q(e)};var J=k.__r;k.__r=function(e){J&&J(e),e.__c};var Q=k.diffed;k.diffed=function(e){Q&&Q(e);var t=e.props,n=e.__e;null!=n&&"textarea"===e.type&&"value"in t&&t.value!==n.value&&(n.value=null==t.value?"":t.value)};let G=e=>c("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 28 28",...e,children:c("path",{stroke:"#fff",strokeLinecap:"round",strokeLinejoin:"round",d:"M23.143 14v11.428H4.857V14M14 25.428V8.286m0 0H8.857a2.857 2.857 0 0 1 0-5.715c4 0 5.143 5.715 5.143 5.715m0 0h5.143a2.857 2.857 0 1 0 0-5.715c-4 0-5.143 5.715-5.143 5.715m-11.429 0h22.857V14H2.571z"})});function X({classname:e="",useReward:t,targetInteraction:n}){let o=d(()=>void 0!==t,[t]),{isClientReady:i}=function(){let[e,t]=p(!0),n=s(()=>{t(!1)},[]);return f(()=>(F("add",n),()=>F("remove",n)),[n]),{isClientReady:!e}}(),{reward:a}=function(e,t){let[n,o]=p(void 0);return f(()=>{e&&E({targetInteraction:t}).then(e=>{e&&o(e)})},[e,t]),{reward:n}}(o&&i,n),[l,u]=p("right");return f(()=>{u(window.FrakSetup?.modalWalletConfig?.metadata?.position??"right")},[]),_("button",{type:"button","aria-label":"Open wallet",class:v(O.button,"left"===l?O.button__left:O.button__right,e,"override"),disabled:!i,onClick:()=>{r(window.FrakSetup.client,"wallet_button_clicked"),b()},children:[c(G,{}),a&&c("span",{className:O.reward,children:a})]})}!function(t,n,o=[],r={shadow:!1}){"undefined"!=typeof window&&("complete"===document.readyState||"interactive"===document.readyState?setTimeout(P,1):document.addEventListener?document.addEventListener("DOMContentLoaded",P):document.attachEvent("onreadystatechange",()=>{"complete"===document.readyState&&P()}),customElements.get(n)||e(t,n,o,r))}(X,"frak-button-wallet",[],{shadow:!1});export{X as ButtonWallet};
1
+ import e from"preact-custom-element";import{formatAmount as t,getCurrencyAmountKey as n,setupClient as o,trackEvent as r}from"@frak-labs/core-sdk";import{displayEmbeddedWallet as i,getProductInformation as a,modalBuilder as l,referralInteraction as u}from"@frak-labs/core-sdk/actions";import{jsx as c,jsxs as _}from"preact/jsx-runtime";import{cx as s}from"class-variance-authority";import{useCallback as f,useEffect as d,useMemo as p,useState as v}from"preact/hooks";import{Component as m,Fragment as h,createElement as w,options as k,toChildArray as y}from"preact";import*as g from"@frak-labs/core-sdk/bundle";function b(){window.FrakSetup?.client?("vibrate"in navigator?navigator.vibrate(10):console.log("Vibration not supported"),i(window.FrakSetup.client,window.FrakSetup?.modalWalletConfig??{})):console.error("Frak client not found")}let S="frakClientReady";function F(e,t){window.FrakSetup?.client&&"add"===e?t():("add"===e?window.addEventListener:window.removeEventListener)(S,t,!1)}async function C(e){console.log("referral",await u(e,{modalConfig:window.FrakSetup?.modalWalletConfig}))}async function P(){let e,t;if(window.FrakSetup.core=g,!(window.frakSetupInProgress?(console.log("[Frak SDK] Initialization already in progress"),!1):window.FrakSetup?.client?(console.log("[Frak SDK] Client already initialized"),!1):!!window.FrakSetup?.config||(console.error("[Frak SDK] Configuration not found. Please ensure window.FrakSetup.config is set."),!1)))return;if(console.log("[Frak SDK] Starting initialization"),window.frakSetupInProgress=!0,!window.FrakSetup.config){console.error("[Frak SDK] Configuration not found"),window.frakSetupInProgress=!1;return}let n=await o({config:window.FrakSetup.config});if(!n){console.error("[Frak SDK] Failed to create client"),window.frakSetupInProgress=!1;return}window.FrakSetup.client=n,console.log("[Frak SDK] Client initialized successfully");e=new CustomEvent(S),window.dispatchEvent(e),window.modalBuilderSteps=l(n,window.FrakSetup?.modalConfig??{}),C(n),window.frakSetupInProgress=!1,(t=new URLSearchParams(window.location.search).get("frakAction"))&&"share"===t&&(console.log("[Frak SDK] Auto open query param found"),b())}async function E({targetInteraction:e}){let o=window.FrakSetup?.client;if(!o)return void console.warn("Frak client not ready yet");let{maxReferrer:r,rewards:i}=await a(o);if(!r)return;let l=n(o.config.metadata?.currency),u=Math.round(r[l]);if(e){let t=i.filter(t=>t.interactionTypeKey===e).map(e=>e.referrer[l]).reduce((e,t)=>t>e?t:e,0);t>0&&(u=Math.round(t))}return t(u,o.config.metadata?.currency)}function O(e,t){for(var n in e)if("__source"!==n&&!(n in t))return!0;for(var o in t)if("__source"!==o&&e[o]!==t[o])return!0;return!1}function x(e,t){this.props=e,this.context=t}(x.prototype=new m).isPureReactComponent=!0,x.prototype.shouldComponentUpdate=function(e,t){return O(this.props,e)||O(this.state,t)};var D=k.__b;k.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),D&&D(e)},"undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref");var K=k.__e;k.__e=function(e,t,n,o){if(e.then){for(var r,i=t;i=i.__;)if((r=i.__c)&&r.__c)return null==t.__e&&(t.__e=n.__e,t.__k=n.__k),r.__c(e,t)}K(e,t,n,o)};var R=k.unmount;function L(){this.__u=0,this.o=null,this.__b=null}function U(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function N(){this.i=null,this.l=null}k.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),R&&R(e)},(L.prototype=new m).__c=function(e,t){var n=t.__c,o=this;null==o.o&&(o.o=[]),o.o.push(n);var r=U(o.__v),i=!1,a=function(){i||(i=!0,n.__R=null,r?r(l):l())};n.__R=a;var l=function(){if(!--o.__u){if(o.state.__a){var e,t=o.state.__a;o.__v.__k[0]=function e(t,n,o){return t&&o&&(t.__v=null,t.__k=t.__k&&t.__k.map(function(t){return e(t,n,o)}),t.__c&&t.__c.__P===n&&(t.__e&&o.appendChild(t.__e),t.__c.__e=!0,t.__c.__P=o)),t}(t,t.__c.__P,t.__c.__O)}for(o.setState({__a:o.__b=null});e=o.o.pop();)e.forceUpdate()}};o.__u++||32&t.__u||o.setState({__a:o.__b=o.__v.__k[0]}),e.then(a,a)},L.prototype.componentWillUnmount=function(){this.o=[]},L.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),o=this.__v.__k[0].__c;this.__v.__k[0]=function e(t,n,o){return t&&(t.__c&&t.__c.__H&&(t.__c.__H.__.forEach(function(e){"function"==typeof e.__c&&e.__c()}),t.__c.__H=null),null!=(t=function(e,t){for(var n in t)e[n]=t[n];return e}({},t)).__c&&(t.__c.__P===o&&(t.__c.__P=n),t.__c.__e=!0,t.__c=null),t.__k=t.__k&&t.__k.map(function(t){return e(t,n,o)})),t}(this.__b,n,o.__O=o.__P)}this.__b=null}var r=t.__a&&w(h,null,e.fallback);return r&&(r.__u&=-33),[w(h,null,t.__a?null:e.children),r]};var V=function(e,t,n){if(++n[1]===n[0]&&e.l.delete(t),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.l.size))for(n=e.i;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.i=n=n[2]}};(N.prototype=new m).__a=function(e){var t=this,n=U(t.__v),o=t.l.get(e);return o[0]++,function(r){var i=function(){t.props.revealOrder?(o.push(r),V(t,e,o)):r()};n?n(i):i()}},N.prototype.render=function(e){this.i=null,this.l=new Map;var t=y(e.children);e.revealOrder&&"b"===e.revealOrder[0]&&t.reverse();for(var n=t.length;n--;)this.l.set(t[n],this.i=[1,0,this.i]);return e.children},N.prototype.componentDidUpdate=N.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,n){V(e,n,t)})};var W="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,A=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,M=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,z=/[A-Z0-9]/g,H="undefined"!=typeof document;m.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(m.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var I=k.event;function j(){}function B(){return this.cancelBubble}function T(){return this.defaultPrevented}k.event=function(e){return I&&(e=I(e)),e.persist=j,e.isPropagationStopped=B,e.isDefaultPrevented=T,e.nativeEvent=e};var Z={enumerable:!1,configurable:!0,get:function(){return this.class}},$=k.vnode;k.vnode=function(e){"string"==typeof e.type&&function(e){var t=e.props,n=e.type,o={},r=-1===n.indexOf("-");for(var i in t){var a=t[i];if(!("value"===i&&"defaultValue"in t&&null==a||H&&"children"===i&&"noscript"===n||"class"===i||"className"===i)){var l,u=i.toLowerCase();"defaultValue"===i&&"value"in t&&null==t.value?i="value":"download"===i&&!0===a?a="":"translate"===u&&"no"===a?a=!1:"o"===u[0]&&"n"===u[1]?"ondoubleclick"===u?i="ondblclick":"onchange"!==u||"input"!==n&&"textarea"!==n||(l=t.type,("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/:/fil|che|ra/).test(l))?"onfocus"===u?i="onfocusin":"onblur"===u?i="onfocusout":M.test(i)&&(i=u):u=i="oninput":r&&A.test(i)?i=i.replace(z,"-$&").toLowerCase():null===a&&(a=void 0),"oninput"===u&&o[i=u]&&(i="oninputCapture"),o[i]=a}}"select"==n&&o.multiple&&Array.isArray(o.value)&&(o.value=y(t.children).forEach(function(e){e.props.selected=-1!=o.value.indexOf(e.props.value)})),"select"==n&&null!=o.defaultValue&&(o.value=y(t.children).forEach(function(e){e.props.selected=o.multiple?-1!=o.defaultValue.indexOf(e.props.value):o.defaultValue==e.props.value})),t.class&&!t.className?(o.class=t.class,Object.defineProperty(o,"className",Z)):(t.className&&!t.class||t.class&&t.className)&&(o.class=o.className=t.className),e.props=o}(e),e.$$typeof=W,$&&$(e)};var q=k.__r;k.__r=function(e){q&&q(e),e.__c};var J=k.diffed;k.diffed=function(e){J&&J(e);var t=e.props,n=e.__e;null!=n&&"textarea"===e.type&&"value"in t&&t.value!==n.value&&(n.value=null==t.value?"":t.value)};let Q=e=>c("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 28 28",...e,children:c("path",{stroke:"#fff",strokeLinecap:"round",strokeLinejoin:"round",d:"M23.143 14v11.428H4.857V14M14 25.428V8.286m0 0H8.857a2.857 2.857 0 0 1 0-5.715c4 0 5.143 5.715 5.143 5.715m0 0h5.143a2.857 2.857 0 1 0 0-5.715c-4 0-5.143 5.715-5.143 5.715m-11.429 0h22.857V14H2.571z"})});function G({classname:e="",useReward:t,targetInteraction:n}){let o=p(()=>void 0!==t,[t]),{isClientReady:i}=function(){let[e,t]=v(!0),n=f(()=>{t(!1)},[]);return d(()=>(F("add",n),()=>F("remove",n)),[n]),{isClientReady:!e}}(),{reward:a}=function(e,t){let[n,o]=v(void 0);return d(()=>{e&&E({targetInteraction:t}).then(e=>{e&&o(e)})},[e,t]),{reward:n}}(o&&i,n),[l,u]=v("right");return d(()=>{u(window.FrakSetup?.modalWalletConfig?.metadata?.position??"right")},[]),_("button",{type:"button","aria-label":"Open wallet",class:s("button-aPZnsb","left"===l?"button__left-fQJUnK":"button__right-TkFFFK",e,"override"),disabled:!i,onClick:()=>{r(window.FrakSetup.client,"wallet_button_clicked"),b()},children:[c(Q,{}),a&&c("span",{className:"reward-w5dm3K",children:a})]})}!function(t,n,o=[],r={shadow:!1}){"undefined"!=typeof window&&("complete"===document.readyState||"interactive"===document.readyState?setTimeout(P,1):document.addEventListener?document.addEventListener("DOMContentLoaded",P):document.attachEvent("onreadystatechange",()=>{"complete"===document.readyState&&P()}),customElements.get(n)||e(t,n,o,r))}(G,"frak-button-wallet",[],{shadow:!1});export{G as ButtonWallet};
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "url": "https://twitter.com/QNivelais"
12
12
  }
13
13
  ],
14
- "version": "0.0.23-beta.de6e0d34",
14
+ "version": "0.0.23-beta.ebc9d3a3",
15
15
  "description": "Frak Wallet components, helping any person to interact with the Frak wallet.",
16
16
  "repository": {
17
17
  "url": "https://github.com/frak-id/wallet",
@@ -55,17 +55,17 @@
55
55
  "@frak-labs/frame-connector": "0.1.0",
56
56
  "@frak-labs/core-sdk": "0.1.0",
57
57
  "class-variance-authority": "^0.7.1",
58
- "preact": "^10.26.9",
59
- "preact-custom-element": "^4.3.0"
58
+ "preact": "^10.27.2",
59
+ "preact-custom-element": "^4.5.1"
60
60
  },
61
61
  "devDependencies": {
62
62
  "@frak-labs/browserslist-config": "0.0.1",
63
63
  "@frak-labs/dev-tooling": "0.0.0",
64
64
  "@frak-labs/ui": "0.0.0",
65
- "@rsbuild/plugin-preact": "^1.4.0",
66
- "@rsbuild/plugin-svgr": "^1.2.0",
67
- "@rslib/core": "^0.9.2",
68
- "@types/node": "^24",
65
+ "@rsbuild/plugin-preact": "^1.5.2",
66
+ "@rsbuild/plugin-svgr": "^1.2.2",
67
+ "@rslib/core": "^0.16.1",
68
+ "@types/node": "^24.9.1",
69
69
  "@types/preact-custom-element": "^4.0.4",
70
70
  "typescript": "^5"
71
71
  },
@@ -1 +0,0 @@
1
- export const __webpack_ids__=["441"];export const __webpack_modules__={"../../node_modules/.bun/preact-custom-element@4.3.0+accb3cc49205d0dc/node_modules/preact-custom-element/dist/preact-custom-element.esm.js":function(e,t,n){n.d(t,{Z:()=>a});var _=n("../../node_modules/.bun/preact@10.26.9/node_modules/preact/dist/preact.module.js");function o(){return(o=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var _ in n)Object.prototype.hasOwnProperty.call(n,_)&&(e[_]=n[_])}return e}).apply(this,arguments)}var r=["context","children"];function u(e){this.getChildContext=function(){return e.context};var t=e.children,n=function(e,t){if(null==e)return{};var n,_,o={},r=Object.keys(e);for(_=0;_<r.length;_++)t.indexOf(n=r[_])>=0||(o[n]=e[n]);return o}(e,r);return(0,_.Tm)(t,n)}function l(){var e=new CustomEvent("_preact",{detail:{},bubbles:!0,cancelable:!0});this.dispatchEvent(e),this._vdom=(0,_.h)(u,o({},this._props,{context:e.detail.context}),function e(t,n){if(3===t.nodeType)return t.data;if(1!==t.nodeType)return null;var o=[],r={},u=0,l=t.attributes,c=t.childNodes;for(u=l.length;u--;)"slot"!==l[u].name&&(r[l[u].name]=l[u].value,r[i(l[u].name)]=l[u].value);for(u=c.length;u--;){var s=e(c[u],null),a=c[u].slot;a?r[a]=(0,_.h)(f,{name:a},s):o[u]=s}var p=n?(0,_.h)(f,null,o):o;return(0,_.h)(n||t.nodeName.toLowerCase(),r,p)}(this,this._vdomComponent)),(this.hasAttribute("hydrate")?_.ZB:_.sY)(this._vdom,this._root)}function i(e){return e.replace(/-(\w)/g,function(e,t){return t?t.toUpperCase():""})}function c(e,t,n){if(this._vdom){var o={};o[e]=n=null==n?void 0:n,o[i(e)]=n,this._vdom=(0,_.Tm)(this._vdom,o),(0,_.sY)(this._vdom,this._root)}}function s(){(0,_.sY)(this._vdom=null,this._root)}function f(e,t){var n=this;return(0,_.h)("slot",o({},e,{ref:function(e){e?(n.ref=e,n._listener||(n._listener=function(e){e.stopPropagation(),e.detail.context=t},e.addEventListener("_preact",n._listener))):n.ref.removeEventListener("_preact",n._listener)}}))}function a(e,t,n,_){function o(){var t=Reflect.construct(HTMLElement,[],o);return t._vdomComponent=e,t._root=_&&_.shadow?t.attachShadow({mode:_.mode||"open"}):t,t}return(o.prototype=Object.create(HTMLElement.prototype)).constructor=o,o.prototype.connectedCallback=l,o.prototype.attributeChangedCallback=c,o.prototype.disconnectedCallback=s,o.observedAttributes=n=n||e.observedAttributes||Object.keys(e.propTypes||{}),n.forEach(function(e){Object.defineProperty(o.prototype,e,{get:function(){return this._vdom.props[e]},set:function(t){this._vdom?this.attributeChangedCallback(e,null,t):(this._props||(this._props={}),this._props[e]=t,this.connectedCallback());var n=typeof t;null!=t&&"string"!==n&&"boolean"!==n&&"number"!==n||this.setAttribute(e,t)}})}),customElements.define(t||e.tagName||e.displayName||e.name,o)}},"../../node_modules/.bun/preact@10.26.9/node_modules/preact/dist/preact.module.js":function(e,t,n){n.d(t,{HY:()=>w,Tm:()=>D,YM:()=>o,ZB:()=>F,az:()=>g,bR:()=>function e(t,n){return n=n||[],null==t||"boolean"==typeof t||(m(t)?t.some(function(t){e(t,n)}):n.push(t)),n},h:()=>g,sY:()=>L,wA:()=>x});var _,o,r,u,l,i,c,s,f,a,p,d={},h=[],v=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,m=Array.isArray;function y(e,t){for(var n in t)e[n]=t[n];return e}function b(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function g(e,t,n){var o,r,u,l={};for(u in t)"key"==u?o=t[u]:"ref"==u?r=t[u]:l[u]=t[u];if(arguments.length>2&&(l.children=arguments.length>3?_.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(u in e.defaultProps)void 0===l[u]&&(l[u]=e.defaultProps[u]);return k(e,l,o,r,null)}function k(e,t,n,_,u){var l={type:e,props:t,key:n,ref:_,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==u?++r:u,__i:-1,__u:0};return null==u&&null!=o.vnode&&o.vnode(l),l}function w(e){return e.children}function x(e,t){this.props=e,this.context=t}function H(e,t){if(null==t)return e.__?H(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?H(e):null}function C(e){(!e.__d&&(e.__d=!0)&&u.push(e)&&!E.__r++||l!=o.debounceRendering)&&((l=o.debounceRendering)||i)(E)}function E(){for(var e,t,n,_,r,l,i=1;u.length;)u.length>i&&u.sort(c),e=u.shift(),i=u.length,e.__d&&(t=void 0,_=(n=e.__v).__e,r=[],l=[],e.__P&&((t=y({},n)).__v=n.__v+1,o.vnode&&o.vnode(t),j(e.__P,t,n,e.__n,e.__P.namespaceURI,32&n.__u?[_]:null,r,null==_?H(n):_,!!(32&n.__u),l),t.__v=n.__v,t.__.__k[t.__i]=t,A(r,t,l),t.__e!=_&&function e(t){var n,_;if(null!=(t=t.__)&&null!=t.__c){for(t.__e=t.__c.base=null,n=0;n<t.__k.length;n++)if(null!=(_=t.__k[n])&&null!=_.__e){t.__e=t.__c.base=_.__e;break}return e(t)}}(t)));E.__r=0}function P(e,t,n,_,r,u,l,i,c,s,f){var a,p,v,y,g,x,C=_&&_.__k||h,E=t.length;for(c=function(e,t,n,_,r){var u,l,i,c,s,f=n.length,a=f,p=0;for(e.__k=Array(r),u=0;u<r;u++)null!=(l=t[u])&&"boolean"!=typeof l&&"function"!=typeof l?(c=u+p,(l=e.__k[u]="string"==typeof l||"number"==typeof l||"bigint"==typeof l||l.constructor==String?k(null,l,null,null,null):m(l)?k(w,{children:l},null,null,null):null==l.constructor&&l.__b>0?k(l.type,l.props,l.key,l.ref?l.ref:null,l.__v):l).__=e,l.__b=e.__b+1,i=null,-1!=(s=l.__i=function(e,t,n,_){var o,r,u=e.key,l=e.type,i=t[n];if(null===i&&null==e.key||i&&u==i.key&&l==i.type&&0==(2&i.__u))return n;if(_>+(null!=i&&0==(2&i.__u)))for(o=n-1,r=n+1;o>=0||r<t.length;){if(o>=0){if((i=t[o])&&0==(2&i.__u)&&u==i.key&&l==i.type)return o;o--}if(r<t.length){if((i=t[r])&&0==(2&i.__u)&&u==i.key&&l==i.type)return r;r++}}return -1}(l,n,c,a))&&(a--,(i=n[s])&&(i.__u|=2)),null==i||null==i.__v?(-1==s&&(r>f?p--:r<f&&p++),"function"!=typeof l.type&&(l.__u|=4)):s!=c&&(s==c-1?p--:s==c+1?p++:(s>c?p--:p++,l.__u|=4))):e.__k[u]=null;if(a)for(u=0;u<f;u++)null!=(i=n[u])&&0==(2&i.__u)&&(i.__e==_&&(_=H(i)),function e(t,n,_){var r,u;if(o.unmount&&o.unmount(t),(r=t.ref)&&(r.current&&r.current!=t.__e||M(r,null,n)),null!=(r=t.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){o.__e(e,n)}r.base=r.__P=null}if(r=t.__k)for(u=0;u<r.length;u++)r[u]&&e(r[u],n,_||"function"!=typeof t.type);_||b(t.__e),t.__c=t.__=t.__e=void 0}(i,i));return _}(n,t,C,c,E),a=0;a<E;a++)null!=(v=n.__k[a])&&(p=-1==v.__i?d:C[v.__i]||d,v.__i=a,x=j(e,v,p,r,u,l,i,c,s,f),y=v.__e,v.ref&&p.ref!=v.ref&&(p.ref&&M(p.ref,null,v),f.push(v.ref,v.__c||y,v)),null==g&&null!=y&&(g=y),4&v.__u||p.__k===v.__k?c=function e(t,n,_){var o,r;if("function"==typeof t.type){for(o=t.__k,r=0;o&&r<o.length;r++)o[r]&&(o[r].__=t,n=e(o[r],n,_));return n}t.__e!=n&&(n&&t.type&&!_.contains(n)&&(n=H(t)),_.insertBefore(t.__e,n||null),n=t.__e);do n=n&&n.nextSibling;while(null!=n&&8==n.nodeType);return n}(v,c,e):"function"==typeof v.type&&void 0!==x?c=x:y&&(c=y.nextSibling),v.__u&=-7);return n.__e=g,c}function T(e,t,n){"-"==t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||v.test(t)?n:n+"px"}function N(e,t,n,_,o){var r,u;e:if("style"==t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof _&&(e.style.cssText=_=""),_)for(t in _)n&&t in n||T(e.style,t,"");if(n)for(t in n)_&&n[t]==_[t]||T(e.style,t,n[t])}else if("o"==t[0]&&"n"==t[1])r=t!=(t=t.replace(s,"$1")),t=(u=t.toLowerCase())in e||"onFocusOut"==t||"onFocusIn"==t?u.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+r]=n,n?_?n.u=_.u:(n.u=f,e.addEventListener(t,r?p:a,r)):e.removeEventListener(t,r?p:a,r);else{if("http://www.w3.org/2000/svg"==o)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=t&&"height"!=t&&"href"!=t&&"list"!=t&&"form"!=t&&"tabIndex"!=t&&"download"!=t&&"rowSpan"!=t&&"colSpan"!=t&&"role"!=t&&"popover"!=t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null==n||!1===n&&"-"!=t[4]?e.removeAttribute(t):e.setAttribute(t,"popover"==t&&1==n?"":n))}}function S(e){return function(t){if(this.l){var n=this.l[t.type+e];if(null==t.t)t.t=f++;else if(t.t<n.u)return;return n(o.event?o.event(t):t)}}}function j(e,t,n,r,u,l,i,c,s,f){var a,p,h,v,g,k,C,E,T,S,j,A,M,L,F,D,O,Y=t.type;if(null!=t.constructor)return null;128&n.__u&&(s=!!(32&n.__u),l=[c=t.__e=n.__e]),(a=o.__b)&&a(t);e:if("function"==typeof Y)try{if(E=t.props,T="prototype"in Y&&Y.prototype.render,S=(a=Y.contextType)&&r[a.__c],j=a?S?S.props.value:a.__:r,n.__c?C=(p=t.__c=n.__c).__=p.__E:(T?t.__c=p=new Y(E,j):(t.__c=p=new x(E,j),p.constructor=Y,p.render=U),S&&S.sub(p),p.props=E,p.state||(p.state={}),p.context=j,p.__n=r,h=p.__d=!0,p.__h=[],p._sb=[]),T&&null==p.__s&&(p.__s=p.state),T&&null!=Y.getDerivedStateFromProps&&(p.__s==p.state&&(p.__s=y({},p.__s)),y(p.__s,Y.getDerivedStateFromProps(E,p.__s))),v=p.props,g=p.state,p.__v=t,h)T&&null==Y.getDerivedStateFromProps&&null!=p.componentWillMount&&p.componentWillMount(),T&&null!=p.componentDidMount&&p.__h.push(p.componentDidMount);else{if(T&&null==Y.getDerivedStateFromProps&&E!==v&&null!=p.componentWillReceiveProps&&p.componentWillReceiveProps(E,j),!p.__e&&null!=p.shouldComponentUpdate&&!1===p.shouldComponentUpdate(E,p.__s,j)||t.__v==n.__v){for(t.__v!=n.__v&&(p.props=E,p.state=p.__s,p.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(e){e&&(e.__=t)}),A=0;A<p._sb.length;A++)p.__h.push(p._sb[A]);p._sb=[],p.__h.length&&i.push(p);break e}null!=p.componentWillUpdate&&p.componentWillUpdate(E,p.__s,j),T&&null!=p.componentDidUpdate&&p.__h.push(function(){p.componentDidUpdate(v,g,k)})}if(p.context=j,p.props=E,p.__P=e,p.__e=!1,M=o.__r,L=0,T){for(p.state=p.__s,p.__d=!1,M&&M(t),a=p.render(p.props,p.state,p.context),F=0;F<p._sb.length;F++)p.__h.push(p._sb[F]);p._sb=[]}else do p.__d=!1,M&&M(t),a=p.render(p.props,p.state,p.context),p.state=p.__s;while(p.__d&&++L<25);p.state=p.__s,null!=p.getChildContext&&(r=y(y({},r),p.getChildContext())),T&&!h&&null!=p.getSnapshotBeforeUpdate&&(k=p.getSnapshotBeforeUpdate(v,g)),D=a,null!=a&&a.type===w&&null==a.key&&(D=function e(t){return"object"!=typeof t||null==t||t.__b&&t.__b>0?t:m(t)?t.map(e):y({},t)}(a.props.children)),c=P(e,m(D)?D:[D],t,n,r,u,l,i,c,s,f),p.base=t.__e,t.__u&=-161,p.__h.length&&i.push(p),C&&(p.__E=p.__=null)}catch(e){if(t.__v=null,s||null!=l)if(e.then){for(t.__u|=s?160:128;c&&8==c.nodeType&&c.nextSibling;)c=c.nextSibling;l[l.indexOf(c)]=null,t.__e=c}else for(O=l.length;O--;)b(l[O]);else t.__e=n.__e,t.__k=n.__k;o.__e(e,t,n)}else null==l&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):c=t.__e=function(e,t,n,r,u,l,i,c,s){var f,a,p,h,v,y,g,k=n.props,w=t.props,x=t.type;if("svg"==x?u="http://www.w3.org/2000/svg":"math"==x?u="http://www.w3.org/1998/Math/MathML":u||(u="http://www.w3.org/1999/xhtml"),null!=l){for(f=0;f<l.length;f++)if((v=l[f])&&"setAttribute"in v==!!x&&(x?v.localName==x:3==v.nodeType)){e=v,l[f]=null;break}}if(null==e){if(null==x)return document.createTextNode(w);e=document.createElementNS(u,x,w.is&&w),c&&(o.__m&&o.__m(t,l),c=!1),l=null}if(null==x)k===w||c&&e.data==w||(e.data=w);else{if(l=l&&_.call(e.childNodes),k=n.props||d,!c&&null!=l)for(k={},f=0;f<e.attributes.length;f++)k[(v=e.attributes[f]).name]=v.value;for(f in k)if(v=k[f],"children"==f);else if("dangerouslySetInnerHTML"==f)p=v;else if(!(f in w)){if("value"==f&&"defaultValue"in w||"checked"==f&&"defaultChecked"in w)continue;N(e,f,null,v,u)}for(f in w)v=w[f],"children"==f?h=v:"dangerouslySetInnerHTML"==f?a=v:"value"==f?y=v:"checked"==f?g=v:c&&"function"!=typeof v||k[f]===v||N(e,f,v,k[f],u);if(a)c||p&&(a.__html==p.__html||a.__html==e.innerHTML)||(e.innerHTML=a.__html),t.__k=[];else if(p&&(e.innerHTML=""),P("template"==t.type?e.content:e,m(h)?h:[h],t,n,r,"foreignObject"==x?"http://www.w3.org/1999/xhtml":u,l,i,l?l[0]:n.__k&&H(n,0),c,s),null!=l)for(f=l.length;f--;)b(l[f]);c||(f="value","progress"==x&&null==y?e.removeAttribute("value"):null==y||y===e[f]&&("progress"!=x||y)&&("option"!=x||y==k[f])||N(e,f,y,k[f],u),f="checked",null!=g&&g!=e[f]&&N(e,f,g,k[f],u))}return e}(n.__e,t,n,r,u,l,i,s,f);return(a=o.diffed)&&a(t),128&t.__u?void 0:c}function A(e,t,n){for(var _=0;_<n.length;_++)M(n[_],n[++_],n[++_]);o.__c&&o.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){o.__e(e,t.__v)}})}function M(e,t,n){try{if("function"==typeof e){var _="function"==typeof e.__u;_&&e.__u(),_&&null==t||(e.__u=e(t))}else e.current=t}catch(e){o.__e(e,n)}}function U(e,t,n){return this.constructor(e,n)}function L(e,t,n){var r,u,l,i;t==document&&(t=document.documentElement),o.__&&o.__(e,t),u=(r="function"==typeof n)?null:n&&n.__k||t.__k,l=[],i=[],j(t,e=(!r&&n||t).__k=g(w,null,[e]),u||d,d,t.namespaceURI,!r&&n?[n]:u?null:t.firstChild?_.call(t.childNodes):null,l,!r&&n?n:u?u.__e:t.firstChild,r,i),A(l,e,i)}function F(e,t){L(e,t,F)}function D(e,t,n){var o,r,u,l,i=y({},e.props);for(u in e.type&&e.type.defaultProps&&(l=e.type.defaultProps),t)"key"==u?o=t[u]:"ref"==u?r=t[u]:i[u]=void 0===t[u]&&null!=l?l[u]:t[u];return arguments.length>2&&(i.children=arguments.length>3?_.call(arguments,2):n),k(e.type,i,o||e.key,r||e.ref,null)}_=h.slice,o={__e:function(e,t,n,_){for(var o,r,u;t=t.__;)if((o=t.__c)&&!o.__)try{if((r=o.constructor)&&null!=r.getDerivedStateFromError&&(o.setState(r.getDerivedStateFromError(e)),u=o.__d),null!=o.componentDidCatch&&(o.componentDidCatch(e,_||{}),u=o.__d),u)return o.__E=o}catch(t){e=t}throw e}},r=0,x.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=y({},this.state),"function"==typeof e&&(e=e(y({},n),this.props)),e&&y(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),C(this))},x.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),C(this))},x.prototype.render=w,u=[],i="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,c=function(e,t){return e.__v.__b-t.__v.__b},E.__r=0,s=/(PointerCapture)$|Capture$/i,f=0,a=S(!1),p=S(!0)},"../../node_modules/.bun/preact@10.26.9/node_modules/preact/hooks/dist/hooks.module.js":function(e,t,n){n.d(t,{I4:()=>k,Ye:()=>g,d4:()=>b,eJ:()=>y});var _,o,r,u,l=n("../../node_modules/.bun/preact@10.26.9/node_modules/preact/dist/preact.module.js"),i=0,c=[],s=l.YM,f=s.__b,a=s.__r,p=s.diffed,d=s.__c,h=s.unmount,v=s.__;function m(e,t){s.__h&&s.__h(o,e,i||t),i=0;var n=o.__H||(o.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function y(e){return i=1,function(e,t,n){var r=m(_++,2);if(r.t=e,!r.__c&&(r.__=[P(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);t!==n&&(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=o,!o.__f)){var u=function(e,t,n){if(!r.__c.__H)return!0;var _=r.__c.__H.__.filter(function(e){return!!e.__c});if(_.every(function(e){return!e.__N}))return!l||l.call(this,e,t,n);var o=r.__c.props!==e;return _.forEach(function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(o=!0)}}),l&&l.call(this,e,t,n)||o};o.__f=!0;var l=o.shouldComponentUpdate,i=o.componentWillUpdate;o.componentWillUpdate=function(e,t,n){if(this.__e){var _=l;l=void 0,u(e,t,n),l=_}i&&i.call(this,e,t,n)},o.shouldComponentUpdate=u}return r.__N||r.__}(P,e)}function b(e,t){var n=m(_++,3);!s.__s&&E(n.__H,t)&&(n.__=e,n.u=t,o.__H.__h.push(n))}function g(e,t){var n=m(_++,7);return E(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function k(e,t){return i=8,g(function(){return e},t)}function w(){for(var e;e=c.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(H),e.__H.__h.forEach(C),e.__H.__h=[]}catch(t){e.__H.__h=[],s.__e(t,e.__v)}}s.__b=function(e){o=null,f&&f(e)},s.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),v&&v(e,t)},s.__r=function(e){a&&a(e),_=0;var t=(o=e.__c).__H;t&&(r===o?(t.__h=[],o.__h=[],t.__.forEach(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.forEach(H),t.__h.forEach(C),t.__h=[],_=0)),r=o},s.diffed=function(e){p&&p(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==c.push(t)&&u===s.requestAnimationFrame||((u=s.requestAnimationFrame)||function(e){var t,n=function(){clearTimeout(_),x&&cancelAnimationFrame(t),setTimeout(e)},_=setTimeout(n,35);x&&(t=requestAnimationFrame(n))})(w)),t.__H.__.forEach(function(e){e.u&&(e.__H=e.u),e.u=void 0})),r=o=null},s.__c=function(e,t){t.some(function(e){try{e.__h.forEach(H),e.__h=e.__h.filter(function(e){return!e.__||C(e)})}catch(n){t.some(function(e){e.__h&&(e.__h=[])}),t=[],s.__e(n,e.__v)}}),d&&d(e,t)},s.unmount=function(e){h&&h(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(e){try{H(e)}catch(e){t=e}}),n.__H=void 0,t&&s.__e(t,n.__v))};var x="function"==typeof requestAnimationFrame;function H(e){var t=o,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),o=t}function C(e){var t=o;e.__c=e.__(),o=t}function E(e,t){return!e||e.length!==t.length||t.some(function(t,n){return t!==e[n]})}function P(e,t){return"function"==typeof t?t(e):t}},"../../node_modules/.bun/preact@10.26.9/node_modules/preact/jsx-runtime/dist/jsxRuntime.module.js":function(e,t,n){n.d(t,{BX:()=>r,HY:()=>_.HY,tZ:()=>r});var _=n("../../node_modules/.bun/preact@10.26.9/node_modules/preact/dist/preact.module.js"),o=0;function r(e,t,n,r,u,l){t||(t={});var i,c,s=t;if("ref"in s)for(c in s={},t)"ref"==c?i=t[c]:s[c]=t[c];var f={type:e,props:s,key:n,ref:i,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--o,__i:-1,__u:0,__source:u,__self:l};if("function"==typeof e&&(i=e.defaultProps))for(c in i)void 0===s[c]&&(s[c]=i[c]);return _.YM.vnode&&_.YM.vnode(f),f}},"../../node_modules/.bun/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.mjs":function(e,t,n){n.d(t,{cx:()=>_});let _=function(){for(var e,t,n=0,_="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=function e(t){var n,_,o="";if("string"==typeof t||"number"==typeof t)o+=t;else if("object"==typeof t)if(Array.isArray(t)){var r=t.length;for(n=0;n<r;n++)t[n]&&(_=e(t[n]))&&(o&&(o+=" "),o+=_)}else for(_ in t)t[_]&&(o&&(o+=" "),o+=_);return o}(e))&&(_&&(_+=" "),_+=t);return _}}};
@@ -1 +0,0 @@
1
- export const __webpack_ids__=["766"];export const __webpack_modules__={"./src/components/ButtonShare/index.ts":function(e,t,o){o.r(t),o.d(t,{ButtonShare:()=>S});var n=o("./src/utils/registerWebComponent.ts"),r=o("../../node_modules/.bun/preact@10.26.9/node_modules/preact/jsx-runtime/dist/jsxRuntime.module.js"),s=o("../../node_modules/.bun/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.mjs");let a="spinner__leaf-xtOJmT",i=({ref:e,className:t,...o})=>(0,r.BX)("span",{...o,ref:e,className:(0,s.cx)("spinner-KHk8mw"),children:[(0,r.tZ)("span",{className:a}),(0,r.tZ)("span",{className:a}),(0,r.tZ)("span",{className:a}),(0,r.tZ)("span",{className:a}),(0,r.tZ)("span",{className:a}),(0,r.tZ)("span",{className:a}),(0,r.tZ)("span",{className:a}),(0,r.tZ)("span",{className:a})]});i.displayName="Spinner";var d=o("./src/hooks/useClientReady.ts"),l=o("./src/hooks/useReward.ts"),c=o("../core/dist/index.js"),u=o("../core/dist/actions.js"),p=o("../../node_modules/.bun/preact@10.26.9/node_modules/preact/hooks/dist/hooks.module.js");let m={marginTop:"16px",padding:"16px",backgroundColor:"#FEE2E2",border:"1px solid #FCA5A5",borderRadius:"4px",color:"#991B1B"},f={display:"flex",alignItems:"center",gap:"8px",marginBottom:"12px"},h={margin:0,fontSize:"16px",fontWeight:500},b={fontSize:"14px",lineHeight:"1.5",margin:"0 0 12px 0"},y={color:"#991B1B",textDecoration:"underline",textUnderlineOffset:"2px"},w={display:"inline-flex",alignItems:"center",gap:"8px",marginBottom:"10px",padding:"8px 12px",backgroundColor:"white",border:"1px solid #D1D5DB",borderRadius:"4px",color:"black",fontSize:"14px",fontWeight:500};function x({debugInfo:e}){let[t,o]=(0,p.eJ)(!1);return(0,r.BX)("div",{children:[(0,r.tZ)("button",{type:"button",style:w,onClick:()=>o(!t),children:"Ouvrir les informations"}),t&&(0,r.tZ)("textarea",{style:{display:"block",width:"100%",height:"200px",fontSize:"12px"},children:e})]})}function g({debugInfo:e}){let{copied:t,copy:o}=function(e={}){let{successDuration:t=2e3}=e,[o,n]=(0,p.eJ)(!1);return{copy:(0,p.I4)(async e=>{try{if(navigator.clipboard&&window.isSecureContext)await navigator.clipboard.writeText(e),n(!0);else{let t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.opacity="0",document.body.appendChild(t),t.focus(),t.select();try{document.execCommand("copy"),n(!0)}catch(e){return console.error("Failed to copy text:",e),!1}finally{t.remove()}}return setTimeout(()=>{n(!1)},t),!0}catch(e){return console.error("Failed to copy text:",e),!1}},[t]),copied:o}}();return(0,r.BX)("div",{style:m,children:[(0,r.tZ)("div",{style:f,children:(0,r.tZ)("h3",{style:h,children:"Oups ! Nous avons rencontr\xe9 un petit probl\xe8me"})}),(0,r.BX)("p",{style:b,children:["Impossible d'ouvrir le menu de partage pour le moment. Si le probl\xe8me persiste, copiez les informations ci-dessous et collez-les dans votre mail \xe0"," ",(0,r.tZ)("a",{href:"mailto:help@frak-labs.com?subject=Debug",style:y,children:"help@frak-labs.com"})," ",(0,r.tZ)("br",{}),"Merci pour votre retour, nous traitons votre demande dans les plus brefs d\xe9lais."]}),(0,r.tZ)("button",{type:"button",onClick:()=>o(e??""),style:w,children:t?"Informations copi\xe9es !":"Copier les informations de d\xe9bogage"}),(0,r.tZ)(x,{debugInfo:e})]})}var k=o("./src/utils/setup.ts"),v=o("../../packages/rpc/dist/index.js");async function _(){if(!window.FrakSetup?.client)throw Error("Frak client not found");await (0,u.s9)(window.FrakSetup.client,window.FrakSetup?.modalWalletConfig??{})}function S({text:e="Share and earn!",classname:t="",useReward:o,noRewardText:n,targetInteraction:a,showWallet:u}){let m=(0,p.Ye)(()=>void 0!==o,[o]),f=(0,p.Ye)(()=>void 0!==u,[u]),{isClientReady:h}=(0,d.t)(),{reward:b}=(0,l.w)(m&&h,a),{handleShare:y,isError:w,debugInfo:x}=function(e){let[t,o]=(0,p.eJ)(void 0),[n,r]=(0,p.eJ)(!1);return{handleShare:(0,p.I4)(async()=>{if(!window.FrakSetup?.client){console.error("Frak client not found"),o(c.oC.empty().formatDebugInfo("Frak client not found")),r(!0);return}let t=(0,k.Gt)();if(!t)throw Error("modalBuilderSteps not found");try{await t.sharing(window.FrakSetup?.modalShareConfig??{}).display(t=>({...t,targetInteraction:e}))}catch(t){if(t instanceof v.u&&t.code===v.ss.clientAborted)return void console.debug("User aborted the modal");let e=window.FrakSetup.client.debugInfo.formatDebugInfo(t);(0,c.L9)(window.FrakSetup.client,"share_modal_error",{error:t instanceof Object&&"message"in t?t.message:"Unknown error",debugInfo:e}),o(e),r(!0),console.error("Error while opening the modal",t)}},[e]),isError:n,debugInfo:t}}(a),S=(0,p.Ye)(()=>m?b?e.includes("{REWARD}")?e.replace("{REWARD}",b):`${e} ${b}`:n??e.replace("{REWARD}",""):e,[m,e,n,b]),F=(0,p.I4)(async()=>{(0,c.L9)(window.FrakSetup.client,"share_button_clicked"),f?await _():await y()},[f,y]);return(0,r.BX)(r.HY,{children:[(0,r.BX)("button",{type:"button",className:(0,s.cx)("buttonShare-F23Y9m",t,"override"),onClick:F,children:[!h&&(0,r.tZ)(i,{})," ",S]}),w&&(0,r.tZ)(g,{debugInfo:x})]})}(0,n.A)(S,"frak-button-share",["text"],{shadow:!1})},"./src/hooks/useClientReady.ts":function(e,t,o){o.d(t,{t:()=>s});var n=o("./src/utils/clientReady.ts"),r=o("../../node_modules/.bun/preact@10.26.9/node_modules/preact/hooks/dist/hooks.module.js");function s(){let[e,t]=(0,r.eJ)(!0),o=(0,r.I4)(()=>{t(!1)},[]);return(0,r.d4)(()=>((0,n.D)("add",o),()=>(0,n.D)("remove",o)),[o]),{isClientReady:!e}}},"./src/hooks/useReward.ts":function(e,t,o){o.d(t,{w:()=>i});var n=o("../core/dist/index.js"),r=o("../core/dist/actions.js");async function s({targetInteraction:e}){let t=window.FrakSetup?.client;if(!t)return void console.warn("Frak client not ready yet");let{maxReferrer:o,rewards:s}=await (0,r.pO)(t);if(!o)return;let a=(0,n.Up)(t.config.metadata?.currency),i=Math.round(o[a]);if(e){let t=s.filter(t=>t.interactionTypeKey===e).map(e=>e.referrer[a]).reduce((e,t)=>t>e?t:e,0);t>0&&(i=Math.round(t))}return(0,n.dN)(i,t.config.metadata?.currency)}var a=o("../../node_modules/.bun/preact@10.26.9/node_modules/preact/hooks/dist/hooks.module.js");function i(e,t){let[o,n]=(0,a.eJ)(void 0);return(0,a.d4)(()=>{e&&s({targetInteraction:t}).then(e=>{e&&n(e)})},[e,t]),{reward:o}}},"./src/utils/registerWebComponent.ts":function(e,t,o){o.d(t,{A:()=>a});var n=o("../../packages/ui/utils/onDocumentReady.ts"),r=o("../../node_modules/.bun/preact-custom-element@4.3.0+accb3cc49205d0dc/node_modules/preact-custom-element/dist/preact-custom-element.esm.js"),s=o("./src/utils/initFrakSdk.ts");function a(e,t,o=[],i={shadow:!1}){"undefined"!=typeof window&&((0,n.E)(s.m),customElements.get(t)||(0,r.Z)(e,t,o,i))}}};
@@ -1 +0,0 @@
1
- export const __webpack_ids__=["438"];export const __webpack_modules__={"./src/components/ButtonWallet/index.ts":function(e,t,n){n.r(t),n.d(t,{ButtonWallet:()=>U});var o=n("./src/utils/registerWebComponent.ts"),r=n("../../node_modules/.bun/preact@10.26.9/node_modules/preact/jsx-runtime/dist/jsxRuntime.module.js"),i=n("./src/hooks/useClientReady.ts"),a=n("./src/hooks/useReward.ts"),l=n("../core/dist/index.js"),u=n("../../node_modules/.bun/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.mjs"),_=n("../../node_modules/.bun/preact@10.26.9/node_modules/preact/hooks/dist/hooks.module.js");let s={button:"button-aPZnsb",button__left:"button__left-fQJUnK",button__right:"button__right-TkFFFK",reward:"reward-w5dm3K"};var c=n("../../node_modules/.bun/preact@10.26.9/node_modules/preact/dist/preact.module.js");function d(e,t){for(var n in e)if("__source"!==n&&!(n in t))return!0;for(var o in t)if("__source"!==o&&e[o]!==t[o])return!0;return!1}function p(e,t){this.props=e,this.context=t}(p.prototype=new c.wA).isPureReactComponent=!0,p.prototype.shouldComponentUpdate=function(e,t){return d(this.props,e)||d(this.state,t)};var f=c.YM.__b;c.YM.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),f&&f(e)},"undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref");var v=c.YM.__e;c.YM.__e=function(e,t,n,o){if(e.then){for(var r,i=t;i=i.__;)if((r=i.__c)&&r.__c)return null==t.__e&&(t.__e=n.__e,t.__k=n.__k),r.__c(e,t)}v(e,t,n,o)};var m=c.YM.unmount;function h(){this.__u=0,this.o=null,this.__b=null}function b(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function y(){this.i=null,this.l=null}c.YM.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),m&&m(e)},(h.prototype=new c.wA).__c=function(e,t){var n=t.__c,o=this;null==o.o&&(o.o=[]),o.o.push(n);var r=b(o.__v),i=!1,a=function(){i||(i=!0,n.__R=null,r?r(l):l())};n.__R=a;var l=function(){if(!--o.__u){if(o.state.__a){var e,t=o.state.__a;o.__v.__k[0]=function e(t,n,o){return t&&o&&(t.__v=null,t.__k=t.__k&&t.__k.map(function(t){return e(t,n,o)}),t.__c&&t.__c.__P===n&&(t.__e&&o.appendChild(t.__e),t.__c.__e=!0,t.__c.__P=o)),t}(t,t.__c.__P,t.__c.__O)}for(o.setState({__a:o.__b=null});e=o.o.pop();)e.forceUpdate()}};o.__u++||32&t.__u||o.setState({__a:o.__b=o.__v.__k[0]}),e.then(a,a)},h.prototype.componentWillUnmount=function(){this.o=[]},h.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),o=this.__v.__k[0].__c;this.__v.__k[0]=function e(t,n,o){return t&&(t.__c&&t.__c.__H&&(t.__c.__H.__.forEach(function(e){"function"==typeof e.__c&&e.__c()}),t.__c.__H=null),null!=(t=function(e,t){for(var n in t)e[n]=t[n];return e}({},t)).__c&&(t.__c.__P===o&&(t.__c.__P=n),t.__c.__e=!0,t.__c=null),t.__k=t.__k&&t.__k.map(function(t){return e(t,n,o)})),t}(this.__b,n,o.__O=o.__P)}this.__b=null}var r=t.__a&&(0,c.az)(c.HY,null,e.fallback);return r&&(r.__u&=-33),[(0,c.az)(c.HY,null,t.__a?null:e.children),r]};var w=function(e,t,n){if(++n[1]===n[0]&&e.l.delete(t),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.l.size))for(n=e.i;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.i=n=n[2]}};(y.prototype=new c.wA).__a=function(e){var t=this,n=b(t.__v),o=t.l.get(e);return o[0]++,function(r){var i=function(){t.props.revealOrder?(o.push(r),w(t,e,o)):r()};n?n(i):i()}},y.prototype.render=function(e){this.i=null,this.l=new Map;var t=(0,c.bR)(e.children);e.revealOrder&&"b"===e.revealOrder[0]&&t.reverse();for(var n=t.length;n--;)this.l.set(t[n],this.i=[1,0,this.i]);return e.children},y.prototype.componentDidUpdate=y.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,n){w(e,n,t)})};var k="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,g=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,M=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,R=/[A-Z0-9]/g,x="undefined"!=typeof document;c.wA.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(c.wA.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var S=c.YM.event;function Y(){}function j(){return this.cancelBubble}function C(){return this.defaultPrevented}c.YM.event=function(e){return S&&(e=S(e)),e.persist=Y,e.isPropagationStopped=j,e.isDefaultPrevented=C,e.nativeEvent=e};var P={enumerable:!1,configurable:!0,get:function(){return this.class}},O=c.YM.vnode;c.YM.vnode=function(e){"string"==typeof e.type&&function(e){var t=e.props,n=e.type,o={},r=-1===n.indexOf("-");for(var i in t){var a=t[i];if(!("value"===i&&"defaultValue"in t&&null==a||x&&"children"===i&&"noscript"===n||"class"===i||"className"===i)){var l,u=i.toLowerCase();"defaultValue"===i&&"value"in t&&null==t.value?i="value":"download"===i&&!0===a?a="":"translate"===u&&"no"===a?a=!1:"o"===u[0]&&"n"===u[1]?"ondoubleclick"===u?i="ondblclick":"onchange"!==u||"input"!==n&&"textarea"!==n||(l=t.type,("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/:/fil|che|ra/).test(l))?"onfocus"===u?i="onfocusin":"onblur"===u?i="onfocusout":M.test(i)&&(i=u):u=i="oninput":r&&g.test(i)?i=i.replace(R,"-$&").toLowerCase():null===a&&(a=void 0),"oninput"===u&&o[i=u]&&(i="oninputCapture"),o[i]=a}}"select"==n&&o.multiple&&Array.isArray(o.value)&&(o.value=(0,c.bR)(t.children).forEach(function(e){e.props.selected=-1!=o.value.indexOf(e.props.value)})),"select"==n&&null!=o.defaultValue&&(o.value=(0,c.bR)(t.children).forEach(function(e){e.props.selected=o.multiple?-1!=o.defaultValue.indexOf(e.props.value):o.defaultValue==e.props.value})),t.class&&!t.className?(o.class=t.class,Object.defineProperty(o,"className",P)):(t.className&&!t.class||t.class&&t.className)&&(o.class=o.className=t.className),e.props=o}(e),e.$$typeof=k,O&&O(e)};var A=c.YM.__r;c.YM.__r=function(e){A&&A(e),e.__c};var W=c.YM.diffed;c.YM.diffed=function(e){W&&W(e);var t=e.props,n=e.__e;null!=n&&"textarea"===e.type&&"value"in t&&t.value!==n.value&&(n.value=null==t.value?"":t.value)};let E=e=>(0,r.tZ)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 28 28",...e,children:(0,r.tZ)("path",{stroke:"#fff",strokeLinecap:"round",strokeLinejoin:"round",d:"M23.143 14v11.428H4.857V14M14 25.428V8.286m0 0H8.857a2.857 2.857 0 0 1 0-5.715c4 0 5.143 5.715 5.143 5.715m0 0h5.143a2.857 2.857 0 1 0 0-5.715c-4 0-5.143 5.715-5.143 5.715m-11.429 0h22.857V14H2.571z"})});var N=n("./src/components/ButtonWallet/utils.ts");function U({classname:e="",useReward:t,targetInteraction:n}){let o=(0,_.Ye)(()=>void 0!==t,[t]),{isClientReady:c}=(0,i.t)(),{reward:d}=(0,a.w)(o&&c,n),[p,f]=(0,_.eJ)("right");return(0,_.d4)(()=>{f(window.FrakSetup?.modalWalletConfig?.metadata?.position??"right")},[]),(0,r.BX)("button",{type:"button","aria-label":"Open wallet",class:(0,u.cx)(s.button,"left"===p?s.button__left:s.button__right,e,"override"),disabled:!c,onClick:()=>{(0,l.L9)(window.FrakSetup.client,"wallet_button_clicked"),(0,N.G)()},children:[(0,r.tZ)(E,{}),d&&(0,r.tZ)("span",{className:s.reward,children:d})]})}(0,o.A)(U,"frak-button-wallet",[],{shadow:!1})},"./src/hooks/useClientReady.ts":function(e,t,n){n.d(t,{t:()=>i});var o=n("./src/utils/clientReady.ts"),r=n("../../node_modules/.bun/preact@10.26.9/node_modules/preact/hooks/dist/hooks.module.js");function i(){let[e,t]=(0,r.eJ)(!0),n=(0,r.I4)(()=>{t(!1)},[]);return(0,r.d4)(()=>((0,o.D)("add",n),()=>(0,o.D)("remove",n)),[n]),{isClientReady:!e}}},"./src/hooks/useReward.ts":function(e,t,n){n.d(t,{w:()=>l});var o=n("../core/dist/index.js"),r=n("../core/dist/actions.js");async function i({targetInteraction:e}){let t=window.FrakSetup?.client;if(!t)return void console.warn("Frak client not ready yet");let{maxReferrer:n,rewards:i}=await (0,r.pO)(t);if(!n)return;let a=(0,o.Up)(t.config.metadata?.currency),l=Math.round(n[a]);if(e){let t=i.filter(t=>t.interactionTypeKey===e).map(e=>e.referrer[a]).reduce((e,t)=>t>e?t:e,0);t>0&&(l=Math.round(t))}return(0,o.dN)(l,t.config.metadata?.currency)}var a=n("../../node_modules/.bun/preact@10.26.9/node_modules/preact/hooks/dist/hooks.module.js");function l(e,t){let[n,o]=(0,a.eJ)(void 0);return(0,a.d4)(()=>{e&&i({targetInteraction:t}).then(e=>{e&&o(e)})},[e,t]),{reward:n}}},"./src/utils/registerWebComponent.ts":function(e,t,n){n.d(t,{A:()=>a});var o=n("../../packages/ui/utils/onDocumentReady.ts"),r=n("../../node_modules/.bun/preact-custom-element@4.3.0+accb3cc49205d0dc/node_modules/preact-custom-element/dist/preact-custom-element.esm.js"),i=n("./src/utils/initFrakSdk.ts");function a(e,t,n=[],l={shadow:!1}){"undefined"!=typeof window&&((0,o.E)(i.m),customElements.get(t)||(0,r.Z)(e,t,n,l))}}};