@frak-labs/components 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components.js +1 -1
- package/package.json +1 -3
package/dist/components.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var FrakComponents=(()=>{var K=Object.defineProperty;var Ke=Object.getOwnPropertyDescriptor;var Ge=Object.getOwnPropertyNames;var Je=Object.prototype.hasOwnProperty;var Ze=(t,e)=>{for(var n in e)K(t,n,{get:e[n],enumerable:!0})},Qe=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let _ of Ge(e))!Je.call(t,_)&&_!==n&&K(t,_,{get:()=>e[_],enumerable:!(r=Ke(e,_))||r.enumerable});return t};var Xe=t=>Qe(K({},"__esModule",{value:!0}),t);var gt={};Ze(gt,{ButtonShare:()=>V});async function se(t,e){return document.getElementById(t)?Promise.resolve(!0):new Promise((n,r)=>{let _=document.createElement("script");_.id=t,_.src=e,_.async=!0,_.onload=()=>n(!0),_.onerror=()=>r(new Error(`Script load error for ${e}`)),document.head.appendChild(_)})}function ce(t){document.readyState==="complete"||document.readyState==="interactive"?setTimeout(t,1):document.addEventListener?document.addEventListener("DOMContentLoaded",t):document.attachEvent("onreadystatechange",()=>{document.readyState==="complete"&&t()})}var fe="frakClientReady";function Ye(){let t=new CustomEvent(fe);window.dispatchEvent(t)}function G(t,e){(t==="add"?window.addEventListener:window.removeEventListener)(fe,e,!1)}async function pe(){if(!window?.FrakSetup.config){console.error("window.FrakSetup.config not found");return}let t=await window.NexusSDK.createIframe({walletBaseUrl:window.FrakSetup.config.walletUrl??"https://wallet.frak.id"});if(!t){console.error("Failed to create iframe");return}let e=window.NexusSDK.createIFrameNexusClient({config:window.FrakSetup.config,iframe:t});if(!await e.waitForConnection){console.error("Failed to connect to Frak client");return}return window.FrakSetup.client=e,Ye(),e}function de(t){if(!window.FrakSetup.modalConfig){console.error("window.FrakSetup.modalConfig not found");return}window.FrakSetup.modalBuilderSteps=window.NexusSDK.modalBuilder(t,window.FrakSetup.modalConfig)}async function he(t){let e=await window.NexusSDK.referralInteraction(t,{modalConfig:window.FrakSetup.modalBuilderSteps?.reward().params,options:{alwaysAppendUrl:!0}});console.log("referral",e)}var L,d,be,et,S,me,we,J,ke,X,Z,Q,tt,A={},Ce=[],nt=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Y=Array.isArray;function C(t,e){for(var n in e)t[n]=e[n];return t}function ee(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function E(t,e,n){var r,_,o,a={};for(o in e)o=="key"?r=e[o]:o=="ref"?_=e[o]:a[o]=e[o];if(arguments.length>2&&(a.children=arguments.length>3?L.call(arguments,2):n),typeof t=="function"&&t.defaultProps!=null)for(o in t.defaultProps)a[o]===void 0&&(a[o]=t.defaultProps[o]);return D(t,a,r,_,null)}function D(t,e,n,r,_){var o={type:t,props:e,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:_??++be,__i:-1,__u:0};return _==null&&d.vnode!=null&&d.vnode(o),o}function F(t){return t.children}function O(t,e){this.props=t,this.context=e}function H(t,e){if(e==null)return t.__?H(t.__,t.__i+1):null;for(var n;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null)return n.__e;return typeof t.type=="function"?H(t):null}function xe(t){var e,n;if((t=t.__)!=null&&t.__c!=null){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null){t.__e=t.__c.base=n.__e;break}return xe(t)}}function ve(t){(!t.__d&&(t.__d=!0)&&S.push(t)&&!I.__r++||me!==d.debounceRendering)&&((me=d.debounceRendering)||we)(I)}function I(){var t,e,n,r,_,o,a,u;for(S.sort(J);t=S.shift();)t.__d&&(e=S.length,r=void 0,o=(_=(n=t).__v).__e,a=[],u=[],n.__P&&((r=C({},_)).__v=_.__v+1,d.vnode&&d.vnode(r),te(n.__P,r,_,n.__n,n.__P.namespaceURI,32&_.__u?[o]:null,a,o??H(_),!!(32&_.__u),u),r.__v=_.__v,r.__.__k[r.__i]=r,Fe(a,r,u),r.__e!=o&&xe(r)),S.length>e&&S.sort(J));I.__r=0}function Se(t,e,n,r,_,o,a,u,l,s,f){var i,p,c,g,w,b,h=r&&r.__k||Ce,m=e.length;for(l=rt(n,e,h,l),i=0;i<m;i++)(c=n.__k[i])!=null&&(p=c.__i===-1?A:h[c.__i]||A,c.__i=i,b=te(t,c,p,_,o,a,u,l,s,f),g=c.__e,c.ref&&p.ref!=c.ref&&(p.ref&&ne(p.ref,null,c),f.push(c.ref,c.__c||g,c)),w==null&&g!=null&&(w=g),4&c.__u||p.__k===c.__k?l=Ee(c,l,t):typeof c.type=="function"&&b!==void 0?l=b:g&&(l=g.nextSibling),c.__u&=-7);return n.__e=w,l}function rt(t,e,n,r){var _,o,a,u,l,s=e.length,f=n.length,i=f,p=0;for(t.__k=[],_=0;_<s;_++)(o=e[_])!=null&&typeof o!="boolean"&&typeof o!="function"?(u=_+p,(o=t.__k[_]=typeof o=="string"||typeof o=="number"||typeof o=="bigint"||o.constructor==String?D(null,o,null,null,null):Y(o)?D(F,{children:o},null,null,null):o.constructor===void 0&&o.__b>0?D(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o).__=t,o.__b=t.__b+1,a=null,(l=o.__i=ot(o,n,u,i))!==-1&&(i--,(a=n[l])&&(a.__u|=2)),a==null||a.__v===null?(l==-1&&p--,typeof o.type!="function"&&(o.__u|=4)):l!==u&&(l==u-1?p--:l==u+1?p++:(l>u?p--:p++,o.__u|=4))):o=t.__k[_]=null;if(i)for(_=0;_<f;_++)(a=n[_])!=null&&!(2&a.__u)&&(a.__e==r&&(r=H(a)),He(a,a));return r}function Ee(t,e,n){var r,_;if(typeof t.type=="function"){for(r=t.__k,_=0;r&&_<r.length;_++)r[_]&&(r[_].__=t,e=Ee(r[_],e,n));return e}t.__e!=e&&(e&&t.type&&!n.contains(e)&&(e=H(t)),n.insertBefore(t.__e,e||null),e=t.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType===8);return e}function ot(t,e,n,r){var _=t.key,o=t.type,a=n-1,u=n+1,l=e[n];if(l===null||l&&_==l.key&&o===l.type&&!(2&l.__u))return n;if((typeof o!="function"||o===F||_)&&r>(l!=null&&!(2&l.__u)?1:0))for(;a>=0||u<e.length;){if(a>=0){if((l=e[a])&&!(2&l.__u)&&_==l.key&&o===l.type)return a;a--}if(u<e.length){if((l=e[u])&&!(2&l.__u)&&_==l.key&&o===l.type)return u;u++}}return-1}function ye(t,e,n){e[0]==="-"?t.setProperty(e,n??""):t[e]=n==null?"":typeof n!="number"||nt.test(e)?n:n+"px"}function R(t,e,n,r,_){var o;e:if(e==="style")if(typeof n=="string")t.style.cssText=n;else{if(typeof r=="string"&&(t.style.cssText=r=""),r)for(e in r)n&&e in n||ye(t.style,e,"");if(n)for(e in n)r&&n[e]===r[e]||ye(t.style,e,n[e])}else if(e[0]==="o"&&e[1]==="n")o=e!==(e=e.replace(ke,"$1")),e=e.toLowerCase()in t||e==="onFocusOut"||e==="onFocusIn"?e.toLowerCase().slice(2):e.slice(2),t.l||(t.l={}),t.l[e+o]=n,n?r?n.u=r.u:(n.u=X,t.addEventListener(e,o?Q:Z,o)):t.removeEventListener(e,o?Q:Z,o);else{if(_=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in t)try{t[e]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&e[4]!=="-"?t.removeAttribute(e):t.setAttribute(e,e=="popover"&&n==1?"":n))}}function ge(t){return function(e){if(this.l){var n=this.l[e.type+t];if(e.t==null)e.t=X++;else if(e.t<n.u)return;return n(d.event?d.event(e):e)}}}function te(t,e,n,r,_,o,a,u,l,s){var f,i,p,c,g,w,b,h,m,P,x,j,N,le,B,q,z,k=e.type;if(e.constructor!==void 0)return null;128&n.__u&&(l=!!(32&n.__u),o=[u=e.__e=n.__e]),(f=d.__b)&&f(e);e:if(typeof k=="function")try{if(h=e.props,m="prototype"in k&&k.prototype.render,P=(f=k.contextType)&&r[f.__c],x=f?P?P.props.value:f.__:r,n.__c?b=(i=e.__c=n.__c).__=i.__E:(m?e.__c=i=new k(h,x):(e.__c=i=new O(h,x),i.constructor=k,i.render=it),P&&P.sub(i),i.props=h,i.state||(i.state={}),i.context=x,i.__n=r,p=i.__d=!0,i.__h=[],i._sb=[]),m&&i.__s==null&&(i.__s=i.state),m&&k.getDerivedStateFromProps!=null&&(i.__s==i.state&&(i.__s=C({},i.__s)),C(i.__s,k.getDerivedStateFromProps(h,i.__s))),c=i.props,g=i.state,i.__v=e,p)m&&k.getDerivedStateFromProps==null&&i.componentWillMount!=null&&i.componentWillMount(),m&&i.componentDidMount!=null&&i.__h.push(i.componentDidMount);else{if(m&&k.getDerivedStateFromProps==null&&h!==c&&i.componentWillReceiveProps!=null&&i.componentWillReceiveProps(h,x),!i.__e&&(i.shouldComponentUpdate!=null&&i.shouldComponentUpdate(h,i.__s,x)===!1||e.__v===n.__v)){for(e.__v!==n.__v&&(i.props=h,i.state=i.__s,i.__d=!1),e.__e=n.__e,e.__k=n.__k,e.__k.some(function(T){T&&(T.__=e)}),j=0;j<i._sb.length;j++)i.__h.push(i._sb[j]);i._sb=[],i.__h.length&&a.push(i);break e}i.componentWillUpdate!=null&&i.componentWillUpdate(h,i.__s,x),m&&i.componentDidUpdate!=null&&i.__h.push(function(){i.componentDidUpdate(c,g,w)})}if(i.context=x,i.props=h,i.__P=t,i.__e=!1,N=d.__r,le=0,m){for(i.state=i.__s,i.__d=!1,N&&N(e),f=i.render(i.props,i.state,i.context),B=0;B<i._sb.length;B++)i.__h.push(i._sb[B]);i._sb=[]}else do i.__d=!1,N&&N(e),f=i.render(i.props,i.state,i.context),i.state=i.__s;while(i.__d&&++le<25);i.state=i.__s,i.getChildContext!=null&&(r=C(C({},r),i.getChildContext())),m&&!p&&i.getSnapshotBeforeUpdate!=null&&(w=i.getSnapshotBeforeUpdate(c,g)),u=Se(t,Y(q=f!=null&&f.type===F&&f.key==null?f.props.children:f)?q:[q],e,n,r,_,o,a,u,l,s),i.base=e.__e,e.__u&=-161,i.__h.length&&a.push(i),b&&(i.__E=i.__=null)}catch(T){if(e.__v=null,l||o!=null)if(T.then){for(e.__u|=l?160:128;u&&u.nodeType===8&&u.nextSibling;)u=u.nextSibling;o[o.indexOf(u)]=null,e.__e=u}else for(z=o.length;z--;)ee(o[z]);else e.__e=n.__e,e.__k=n.__k;d.__e(T,e,n)}else o==null&&e.__v===n.__v?(e.__k=n.__k,e.__e=n.__e):u=e.__e=_t(n.__e,e,n,r,_,o,a,l,s);return(f=d.diffed)&&f(e),128&e.__u?void 0:u}function Fe(t,e,n){for(var r=0;r<n.length;r++)ne(n[r],n[++r],n[++r]);d.__c&&d.__c(e,t),t.some(function(_){try{t=_.__h,_.__h=[],t.some(function(o){o.call(_)})}catch(o){d.__e(o,_.__v)}})}function _t(t,e,n,r,_,o,a,u,l){var s,f,i,p,c,g,w,b=n.props,h=e.props,m=e.type;if(m==="svg"?_="http://www.w3.org/2000/svg":m==="math"?_="http://www.w3.org/1998/Math/MathML":_||(_="http://www.w3.org/1999/xhtml"),o!=null){for(s=0;s<o.length;s++)if((c=o[s])&&"setAttribute"in c==!!m&&(m?c.localName===m:c.nodeType===3)){t=c,o[s]=null;break}}if(t==null){if(m===null)return document.createTextNode(h);t=document.createElementNS(_,m,h.is&&h),u&&(d.__m&&d.__m(e,o),u=!1),o=null}if(m===null)b===h||u&&t.data===h||(t.data=h);else{if(o=o&&L.call(t.childNodes),b=n.props||A,!u&&o!=null)for(b={},s=0;s<t.attributes.length;s++)b[(c=t.attributes[s]).name]=c.value;for(s in b)if(c=b[s],s!="children"){if(s=="dangerouslySetInnerHTML")i=c;else if(!(s in h)){if(s=="value"&&"defaultValue"in h||s=="checked"&&"defaultChecked"in h)continue;R(t,s,null,c,_)}}for(s in h)c=h[s],s=="children"?p=c:s=="dangerouslySetInnerHTML"?f=c:s=="value"?g=c:s=="checked"?w=c:u&&typeof c!="function"||b[s]===c||R(t,s,c,b[s],_);if(f)u||i&&(f.__html===i.__html||f.__html===t.innerHTML)||(t.innerHTML=f.__html),e.__k=[];else if(i&&(t.innerHTML=""),Se(t,Y(p)?p:[p],e,n,r,m==="foreignObject"?"http://www.w3.org/1999/xhtml":_,o,a,o?o[0]:n.__k&&H(n,0),u,l),o!=null)for(s=o.length;s--;)ee(o[s]);u||(s="value",m==="progress"&&g==null?t.removeAttribute("value"):g!==void 0&&(g!==t[s]||m==="progress"&&!g||m==="option"&&g!==b[s])&&R(t,s,g,b[s],_),s="checked",w!==void 0&&w!==t[s]&&R(t,s,w,b[s],_))}return t}function ne(t,e,n){try{if(typeof t=="function"){var r=typeof t.__u=="function";r&&t.__u(),r&&e==null||(t.__u=t(e))}else t.current=e}catch(_){d.__e(_,n)}}function He(t,e,n){var r,_;if(d.unmount&&d.unmount(t),(r=t.ref)&&(r.current&&r.current!==t.__e||ne(r,null,e)),(r=t.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(o){d.__e(o,e)}r.base=r.__P=null}if(r=t.__k)for(_=0;_<r.length;_++)r[_]&&He(r[_],e,n||typeof t.type!="function");n||ee(t.__e),t.__c=t.__=t.__e=void 0}function it(t,e,n){return this.constructor(t,n)}function U(t,e,n){var r,_,o,a;e===document&&(e=document.documentElement),d.__&&d.__(t,e),_=(r=typeof n=="function")?null:n&&n.__k||e.__k,o=[],a=[],te(e,t=(!r&&n||e).__k=E(F,null,[t]),_||A,A,e.namespaceURI,!r&&n?[n]:_?null:e.firstChild?L.call(e.childNodes):null,o,!r&&n?n:_?_.__e:e.firstChild,r,a),Fe(o,t,a)}function re(t,e){U(t,e,re)}function oe(t,e,n){var r,_,o,a,u=C({},t.props);for(o in t.type&&t.type.defaultProps&&(a=t.type.defaultProps),e)o=="key"?r=e[o]:o=="ref"?_=e[o]:u[o]=e[o]===void 0&&a!==void 0?a[o]:e[o];return arguments.length>2&&(u.children=arguments.length>3?L.call(arguments,2):n),D(t.type,u,r||t.key,_||t.ref,null)}L=Ce.slice,d={__e:function(t,e,n,r){for(var _,o,a;e=e.__;)if((_=e.__c)&&!_.__)try{if((o=_.constructor)&&o.getDerivedStateFromError!=null&&(_.setState(o.getDerivedStateFromError(t)),a=_.__d),_.componentDidCatch!=null&&(_.componentDidCatch(t,r||{}),a=_.__d),a)return _.__E=_}catch(u){t=u}throw t}},be=0,et=function(t){return t!=null&&t.constructor==null},O.prototype.setState=function(t,e){var n;n=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=C({},this.state),typeof t=="function"&&(t=t(C({},n),this.props)),t&&C(n,t),t!=null&&this.__v&&(e&&this._sb.push(e),ve(this))},O.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),ve(this))},O.prototype.render=F,S=[],we=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,J=function(t,e){return t.__v.__b-e.__v.__b},I.__r=0,ke=/(PointerCapture)$|Capture$/i,X=0,Z=ge(!1),Q=ge(!0),tt=0;function _e(){return(_e=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}).apply(this,arguments)}var at=["context","children"];function ut(t){this.getChildContext=function(){return t.context};var e=t.children,n=function(r,_){if(r==null)return{};var o,a,u={},l=Object.keys(r);for(a=0;a<l.length;a++)_.indexOf(o=l[a])>=0||(u[o]=r[o]);return u}(t,at);return oe(e,n)}function lt(){var t=new CustomEvent("_preact",{detail:{},bubbles:!0,cancelable:!0});this.dispatchEvent(t),this._vdom=E(ut,_e({},this._props,{context:t.detail.context}),function e(n,r){if(n.nodeType===3)return n.data;if(n.nodeType!==1)return null;var _=[],o={},a=0,u=n.attributes,l=n.childNodes;for(a=u.length;a--;)u[a].name!=="slot"&&(o[u[a].name]=u[a].value,o[Ne(u[a].name)]=u[a].value);for(a=l.length;a--;){var s=e(l[a],null),f=l[a].slot;f?o[f]=E(Pe,{name:f},s):_[a]=s}var i=r?E(Pe,null,_):_;return E(r||n.nodeName.toLowerCase(),o,i)}(this,this._vdomComponent)),(this.hasAttribute("hydrate")?re:U)(this._vdom,this._root)}function Ne(t){return t.replace(/-(\w)/g,function(e,n){return n?n.toUpperCase():""})}function st(t,e,n){if(this._vdom){var r={};r[t]=n=n??void 0,r[Ne(t)]=n,this._vdom=oe(this._vdom,r),U(this._vdom,this._root)}}function ct(){U(this._vdom=null,this._root)}function Pe(t,e){var n=this;return E("slot",_e({},t,{ref:function(r){r?(n.ref=r,n._listener||(n._listener=function(_){_.stopPropagation(),_.detail.context=e},r.addEventListener("_preact",n._listener))):n.ref.removeEventListener("_preact",n._listener)}}))}function Te(t,e,n,r){function _(){var o=Reflect.construct(HTMLElement,[],_);return o._vdomComponent=t,o._root=r&&r.shadow?o.attachShadow({mode:r.mode||"open"}):o,o}return(_.prototype=Object.create(HTMLElement.prototype)).constructor=_,_.prototype.connectedCallback=lt,_.prototype.attributeChangedCallback=st,_.prototype.disconnectedCallback=ct,n=n||t.observedAttributes||Object.keys(t.propTypes||{}),_.observedAttributes=n,n.forEach(function(o){Object.defineProperty(_.prototype,o,{get:function(){return this._vdom.props[o]},set:function(a){this._vdom?this.attributeChangedCallback(o,null,a):(this._props||(this._props={}),this._props[o]=a,this.connectedCallback());var u=typeof a;a!=null&&u!=="string"&&u!=="boolean"&&u!=="number"||this.setAttribute(o,a)}})}),customElements.define(e||t.tagName||t.displayName||t.name,_)}var M,v,ie,De,$=0,Oe=[],y=d,Ae=y.__b,Le=y.__r,Ue=y.diffed,Me=y.__c,je=y.unmount,Be=y.__;function ue(t,e){y.__h&&y.__h(v,t,$||e),$=0;var n=v.__H||(v.__H={__:[],__h:[]});return t>=n.__.length&&n.__.push({}),n.__[t]}function Ie(t){return $=1,ft(qe,t)}function ft(t,e,n){var r=ue(M++,2);if(r.t=t,!r.__c&&(r.__=[n?n(e):qe(void 0,e),function(u){var l=r.__N?r.__N[0]:r.__[0],s=r.t(l,u);l!==s&&(r.__N=[s,r.__[1]],r.__c.setState({}))}],r.__c=v,!v.u)){var _=function(u,l,s){if(!r.__c.__H)return!0;var f=r.__c.__H.__.filter(function(p){return!!p.__c});if(f.every(function(p){return!p.__N}))return!o||o.call(this,u,l,s);var i=r.__c.props!==u;return f.forEach(function(p){if(p.__N){var c=p.__[0];p.__=p.__N,p.__N=void 0,c!==p.__[0]&&(i=!0)}}),o&&o.call(this,u,l,s)||i};v.u=!0;var o=v.shouldComponentUpdate,a=v.componentWillUpdate;v.componentWillUpdate=function(u,l,s){if(this.__e){var f=o;o=void 0,_(u,l,s),o=f}a&&a.call(this,u,l,s)},v.shouldComponentUpdate=_}return r.__N||r.__}function We(t,e){var n=ue(M++,3);!y.__s&&Ve(n.__H,e)&&(n.__=t,n.i=e,v.__H.__h.push(n))}function pt(t,e){var n=ue(M++,7);return Ve(n.__H,e)&&(n.__=t(),n.__H=e,n.__h=t),n.__}function $e(t,e){return $=8,pt(function(){return t},e)}function dt(){for(var t;t=Oe.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(W),t.__H.__h.forEach(ae),t.__H.__h=[]}catch(e){t.__H.__h=[],y.__e(e,t.__v)}}y.__b=function(t){v=null,Ae&&Ae(t)},y.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),Be&&Be(t,e)},y.__r=function(t){Le&&Le(t),M=0;var e=(v=t.__c).__H;e&&(ie===v?(e.__h=[],v.__h=[],e.__.forEach(function(n){n.__N&&(n.__=n.__N),n.i=n.__N=void 0})):(e.__h.forEach(W),e.__h.forEach(ae),e.__h=[],M=0)),ie=v},y.diffed=function(t){Ue&&Ue(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(Oe.push(e)!==1&&De===y.requestAnimationFrame||((De=y.requestAnimationFrame)||ht)(dt)),e.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.i=void 0})),ie=v=null},y.__c=function(t,e){e.some(function(n){try{n.__h.forEach(W),n.__h=n.__h.filter(function(r){return!r.__||ae(r)})}catch(r){e.some(function(_){_.__h&&(_.__h=[])}),e=[],y.__e(r,n.__v)}}),Me&&Me(t,e)},y.unmount=function(t){je&&je(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.forEach(function(r){try{W(r)}catch(_){e=_}}),n.__H=void 0,e&&y.__e(e,n.__v))};var Re=typeof requestAnimationFrame=="function";function ht(t){var e,n=function(){clearTimeout(r),Re&&cancelAnimationFrame(e),setTimeout(t)},r=setTimeout(n,100);Re&&(e=requestAnimationFrame(n))}function W(t){var e=v,n=t.__c;typeof n=="function"&&(t.__c=void 0,n()),v=e}function ae(t){var e=v;t.__c=t.__(),v=e}function Ve(t,e){return!t||t.length!==e.length||e.some(function(n,r){return n!==t[r]})}function qe(t,e){return typeof e=="function"?e(t):e}var mt=0,Nt=Array.isArray;function ze(t,e,n,r,_,o){e||(e={});var a,u,l=e;"ref"in e&&(a=e.ref,delete e.ref);var s={type:t,props:l,key:n,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--mt,__i:-1,__u:0,__source:_,__self:o};if(typeof t=="function"&&(a=t.defaultProps))for(u in a)l[u]===void 0&&(l[u]=a[u]);return d.vnode&&d.vnode(s),s}function vt(){if(!window.FrakSetup.modalShareConfig){console.error("window.FrakSetup.modalShareConfig not found");return}window.FrakSetup.modalBuilderSteps.sharing(window.FrakSetup.modalShareConfig).display()}function V({text:t="Share and earn!",classname:e=""}){let[n,r]=Ie(!0),_=$e(()=>{r(!1)},[]);return We(()=>(G("add",_),()=>G("remove",_)),[_]),ze("button",{type:"button",class:e,disabled:n,onClick:vt,children:t})}customElements.get("frak-button-share")||Te(V,"frak-button-share",["text"],{shadow:!1});var yt=se("frak-sdk","https://cdn.jsdelivr.net/npm/@frak-labs/nexus-sdk@latest/dist/bundle/bundle.js");ce(async function(){await yt;let e=await pe();if(!e){console.error("Failed to create Frak client");return}de(e),he(e)});return Xe(gt);})();
|
|
1
|
+
"use strict";var FrakComponents=(()=>{var K=Object.defineProperty;var Ke=Object.getOwnPropertyDescriptor;var Ge=Object.getOwnPropertyNames;var Je=Object.prototype.hasOwnProperty;var Ze=(t,e)=>{for(var n in e)K(t,n,{get:e[n],enumerable:!0})},Qe=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let _ of Ge(e))!Je.call(t,_)&&_!==n&&K(t,_,{get:()=>e[_],enumerable:!(r=Ke(e,_))||r.enumerable});return t};var Xe=t=>Qe(K({},"__esModule",{value:!0}),t);var gt={};Ze(gt,{ButtonShare:()=>V});async function se(t,e){return document.getElementById(t)?Promise.resolve(!0):new Promise((n,r)=>{let _=document.createElement("script");_.id=t,_.src=e,_.async=!0,_.onload=()=>n(!0),_.onerror=()=>r(new Error(`Script load error for ${e}`)),document.head.appendChild(_)})}function ce(t){document.readyState==="complete"||document.readyState==="interactive"?setTimeout(t,1):document.addEventListener?document.addEventListener("DOMContentLoaded",t):document.attachEvent("onreadystatechange",()=>{document.readyState==="complete"&&t()})}var fe="frakClientReady";function Ye(){let t=new CustomEvent(fe);window.dispatchEvent(t)}function G(t,e){(t==="add"?window.addEventListener:window.removeEventListener)(fe,e,!1)}async function pe(){if(!window?.FrakSetup.config){console.error("window.FrakSetup.config not found");return}let t=await window.NexusSDK.createIframe({walletBaseUrl:window.FrakSetup.config.walletUrl??"https://wallet.frak.id"});if(!t){console.error("Failed to create iframe");return}let e=window.NexusSDK.createIFrameNexusClient({config:window.FrakSetup.config,iframe:t});if(!await e.waitForConnection){console.error("Failed to connect to Frak client");return}return window.FrakSetup.client=e,Ye(),e}function de(t){if(!window.FrakSetup.modalConfig){console.error("window.FrakSetup.modalConfig not found");return}window.FrakSetup.modalBuilderSteps=window.NexusSDK.modalBuilder(t,window.FrakSetup.modalConfig)}async function he(t){let e=await window.NexusSDK.referralInteraction(t,{modalConfig:window.FrakSetup.modalBuilderSteps?.reward().params,options:{alwaysAppendUrl:!0}});console.log("referral",e)}var L,d,we,et,S,me,be,J,ke,X,Z,Q,tt,A={},Ce=[],nt=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Y=Array.isArray;function C(t,e){for(var n in e)t[n]=e[n];return t}function ee(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function E(t,e,n){var r,_,o,a={};for(o in e)o=="key"?r=e[o]:o=="ref"?_=e[o]:a[o]=e[o];if(arguments.length>2&&(a.children=arguments.length>3?L.call(arguments,2):n),typeof t=="function"&&t.defaultProps!=null)for(o in t.defaultProps)a[o]===void 0&&(a[o]=t.defaultProps[o]);return D(t,a,r,_,null)}function D(t,e,n,r,_){var o={type:t,props:e,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:_??++we,__i:-1,__u:0};return _==null&&d.vnode!=null&&d.vnode(o),o}function F(t){return t.children}function O(t,e){this.props=t,this.context=e}function H(t,e){if(e==null)return t.__?H(t.__,t.__i+1):null;for(var n;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null)return n.__e;return typeof t.type=="function"?H(t):null}function xe(t){var e,n;if((t=t.__)!=null&&t.__c!=null){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null){t.__e=t.__c.base=n.__e;break}return xe(t)}}function ve(t){(!t.__d&&(t.__d=!0)&&S.push(t)&&!I.__r++||me!==d.debounceRendering)&&((me=d.debounceRendering)||be)(I)}function I(){var t,e,n,r,_,o,a,u;for(S.sort(J);t=S.shift();)t.__d&&(e=S.length,r=void 0,o=(_=(n=t).__v).__e,a=[],u=[],n.__P&&((r=C({},_)).__v=_.__v+1,d.vnode&&d.vnode(r),te(n.__P,r,_,n.__n,n.__P.namespaceURI,32&_.__u?[o]:null,a,o??H(_),!!(32&_.__u),u),r.__v=_.__v,r.__.__k[r.__i]=r,Fe(a,r,u),r.__e!=o&&xe(r)),S.length>e&&S.sort(J));I.__r=0}function Se(t,e,n,r,_,o,a,u,l,s,f){var i,p,c,g,b,w,h=r&&r.__k||Ce,m=e.length;for(l=rt(n,e,h,l),i=0;i<m;i++)(c=n.__k[i])!=null&&(p=c.__i===-1?A:h[c.__i]||A,c.__i=i,w=te(t,c,p,_,o,a,u,l,s,f),g=c.__e,c.ref&&p.ref!=c.ref&&(p.ref&&ne(p.ref,null,c),f.push(c.ref,c.__c||g,c)),b==null&&g!=null&&(b=g),4&c.__u||p.__k===c.__k?l=Ee(c,l,t):typeof c.type=="function"&&w!==void 0?l=w:g&&(l=g.nextSibling),c.__u&=-7);return n.__e=b,l}function rt(t,e,n,r){var _,o,a,u,l,s=e.length,f=n.length,i=f,p=0;for(t.__k=[],_=0;_<s;_++)(o=e[_])!=null&&typeof o!="boolean"&&typeof o!="function"?(u=_+p,(o=t.__k[_]=typeof o=="string"||typeof o=="number"||typeof o=="bigint"||o.constructor==String?D(null,o,null,null,null):Y(o)?D(F,{children:o},null,null,null):o.constructor===void 0&&o.__b>0?D(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o).__=t,o.__b=t.__b+1,a=null,(l=o.__i=ot(o,n,u,i))!==-1&&(i--,(a=n[l])&&(a.__u|=2)),a==null||a.__v===null?(l==-1&&p--,typeof o.type!="function"&&(o.__u|=4)):l!==u&&(l==u-1?p--:l==u+1?p++:(l>u?p--:p++,o.__u|=4))):o=t.__k[_]=null;if(i)for(_=0;_<f;_++)(a=n[_])!=null&&!(2&a.__u)&&(a.__e==r&&(r=H(a)),He(a,a));return r}function Ee(t,e,n){var r,_;if(typeof t.type=="function"){for(r=t.__k,_=0;r&&_<r.length;_++)r[_]&&(r[_].__=t,e=Ee(r[_],e,n));return e}t.__e!=e&&(e&&t.type&&!n.contains(e)&&(e=H(t)),n.insertBefore(t.__e,e||null),e=t.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType===8);return e}function ot(t,e,n,r){var _=t.key,o=t.type,a=n-1,u=n+1,l=e[n];if(l===null||l&&_==l.key&&o===l.type&&!(2&l.__u))return n;if((typeof o!="function"||o===F||_)&&r>(l!=null&&!(2&l.__u)?1:0))for(;a>=0||u<e.length;){if(a>=0){if((l=e[a])&&!(2&l.__u)&&_==l.key&&o===l.type)return a;a--}if(u<e.length){if((l=e[u])&&!(2&l.__u)&&_==l.key&&o===l.type)return u;u++}}return-1}function ye(t,e,n){e[0]==="-"?t.setProperty(e,n??""):t[e]=n==null?"":typeof n!="number"||nt.test(e)?n:n+"px"}function R(t,e,n,r,_){var o;e:if(e==="style")if(typeof n=="string")t.style.cssText=n;else{if(typeof r=="string"&&(t.style.cssText=r=""),r)for(e in r)n&&e in n||ye(t.style,e,"");if(n)for(e in n)r&&n[e]===r[e]||ye(t.style,e,n[e])}else if(e[0]==="o"&&e[1]==="n")o=e!==(e=e.replace(ke,"$1")),e=e.toLowerCase()in t||e==="onFocusOut"||e==="onFocusIn"?e.toLowerCase().slice(2):e.slice(2),t.l||(t.l={}),t.l[e+o]=n,n?r?n.u=r.u:(n.u=X,t.addEventListener(e,o?Q:Z,o)):t.removeEventListener(e,o?Q:Z,o);else{if(_=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in t)try{t[e]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&e[4]!=="-"?t.removeAttribute(e):t.setAttribute(e,e=="popover"&&n==1?"":n))}}function ge(t){return function(e){if(this.l){var n=this.l[e.type+t];if(e.t==null)e.t=X++;else if(e.t<n.u)return;return n(d.event?d.event(e):e)}}}function te(t,e,n,r,_,o,a,u,l,s){var f,i,p,c,g,b,w,h,m,P,x,j,N,le,B,q,z,k=e.type;if(e.constructor!==void 0)return null;128&n.__u&&(l=!!(32&n.__u),o=[u=e.__e=n.__e]),(f=d.__b)&&f(e);e:if(typeof k=="function")try{if(h=e.props,m="prototype"in k&&k.prototype.render,P=(f=k.contextType)&&r[f.__c],x=f?P?P.props.value:f.__:r,n.__c?w=(i=e.__c=n.__c).__=i.__E:(m?e.__c=i=new k(h,x):(e.__c=i=new O(h,x),i.constructor=k,i.render=it),P&&P.sub(i),i.props=h,i.state||(i.state={}),i.context=x,i.__n=r,p=i.__d=!0,i.__h=[],i._sb=[]),m&&i.__s==null&&(i.__s=i.state),m&&k.getDerivedStateFromProps!=null&&(i.__s==i.state&&(i.__s=C({},i.__s)),C(i.__s,k.getDerivedStateFromProps(h,i.__s))),c=i.props,g=i.state,i.__v=e,p)m&&k.getDerivedStateFromProps==null&&i.componentWillMount!=null&&i.componentWillMount(),m&&i.componentDidMount!=null&&i.__h.push(i.componentDidMount);else{if(m&&k.getDerivedStateFromProps==null&&h!==c&&i.componentWillReceiveProps!=null&&i.componentWillReceiveProps(h,x),!i.__e&&(i.shouldComponentUpdate!=null&&i.shouldComponentUpdate(h,i.__s,x)===!1||e.__v===n.__v)){for(e.__v!==n.__v&&(i.props=h,i.state=i.__s,i.__d=!1),e.__e=n.__e,e.__k=n.__k,e.__k.some(function(T){T&&(T.__=e)}),j=0;j<i._sb.length;j++)i.__h.push(i._sb[j]);i._sb=[],i.__h.length&&a.push(i);break e}i.componentWillUpdate!=null&&i.componentWillUpdate(h,i.__s,x),m&&i.componentDidUpdate!=null&&i.__h.push(function(){i.componentDidUpdate(c,g,b)})}if(i.context=x,i.props=h,i.__P=t,i.__e=!1,N=d.__r,le=0,m){for(i.state=i.__s,i.__d=!1,N&&N(e),f=i.render(i.props,i.state,i.context),B=0;B<i._sb.length;B++)i.__h.push(i._sb[B]);i._sb=[]}else do i.__d=!1,N&&N(e),f=i.render(i.props,i.state,i.context),i.state=i.__s;while(i.__d&&++le<25);i.state=i.__s,i.getChildContext!=null&&(r=C(C({},r),i.getChildContext())),m&&!p&&i.getSnapshotBeforeUpdate!=null&&(b=i.getSnapshotBeforeUpdate(c,g)),u=Se(t,Y(q=f!=null&&f.type===F&&f.key==null?f.props.children:f)?q:[q],e,n,r,_,o,a,u,l,s),i.base=e.__e,e.__u&=-161,i.__h.length&&a.push(i),w&&(i.__E=i.__=null)}catch(T){if(e.__v=null,l||o!=null)if(T.then){for(e.__u|=l?160:128;u&&u.nodeType===8&&u.nextSibling;)u=u.nextSibling;o[o.indexOf(u)]=null,e.__e=u}else for(z=o.length;z--;)ee(o[z]);else e.__e=n.__e,e.__k=n.__k;d.__e(T,e,n)}else o==null&&e.__v===n.__v?(e.__k=n.__k,e.__e=n.__e):u=e.__e=_t(n.__e,e,n,r,_,o,a,l,s);return(f=d.diffed)&&f(e),128&e.__u?void 0:u}function Fe(t,e,n){for(var r=0;r<n.length;r++)ne(n[r],n[++r],n[++r]);d.__c&&d.__c(e,t),t.some(function(_){try{t=_.__h,_.__h=[],t.some(function(o){o.call(_)})}catch(o){d.__e(o,_.__v)}})}function _t(t,e,n,r,_,o,a,u,l){var s,f,i,p,c,g,b,w=n.props,h=e.props,m=e.type;if(m==="svg"?_="http://www.w3.org/2000/svg":m==="math"?_="http://www.w3.org/1998/Math/MathML":_||(_="http://www.w3.org/1999/xhtml"),o!=null){for(s=0;s<o.length;s++)if((c=o[s])&&"setAttribute"in c==!!m&&(m?c.localName===m:c.nodeType===3)){t=c,o[s]=null;break}}if(t==null){if(m===null)return document.createTextNode(h);t=document.createElementNS(_,m,h.is&&h),u&&(d.__m&&d.__m(e,o),u=!1),o=null}if(m===null)w===h||u&&t.data===h||(t.data=h);else{if(o=o&&L.call(t.childNodes),w=n.props||A,!u&&o!=null)for(w={},s=0;s<t.attributes.length;s++)w[(c=t.attributes[s]).name]=c.value;for(s in w)if(c=w[s],s!="children"){if(s=="dangerouslySetInnerHTML")i=c;else if(!(s in h)){if(s=="value"&&"defaultValue"in h||s=="checked"&&"defaultChecked"in h)continue;R(t,s,null,c,_)}}for(s in h)c=h[s],s=="children"?p=c:s=="dangerouslySetInnerHTML"?f=c:s=="value"?g=c:s=="checked"?b=c:u&&typeof c!="function"||w[s]===c||R(t,s,c,w[s],_);if(f)u||i&&(f.__html===i.__html||f.__html===t.innerHTML)||(t.innerHTML=f.__html),e.__k=[];else if(i&&(t.innerHTML=""),Se(t,Y(p)?p:[p],e,n,r,m==="foreignObject"?"http://www.w3.org/1999/xhtml":_,o,a,o?o[0]:n.__k&&H(n,0),u,l),o!=null)for(s=o.length;s--;)ee(o[s]);u||(s="value",m==="progress"&&g==null?t.removeAttribute("value"):g!==void 0&&(g!==t[s]||m==="progress"&&!g||m==="option"&&g!==w[s])&&R(t,s,g,w[s],_),s="checked",b!==void 0&&b!==t[s]&&R(t,s,b,w[s],_))}return t}function ne(t,e,n){try{if(typeof t=="function"){var r=typeof t.__u=="function";r&&t.__u(),r&&e==null||(t.__u=t(e))}else t.current=e}catch(_){d.__e(_,n)}}function He(t,e,n){var r,_;if(d.unmount&&d.unmount(t),(r=t.ref)&&(r.current&&r.current!==t.__e||ne(r,null,e)),(r=t.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(o){d.__e(o,e)}r.base=r.__P=null}if(r=t.__k)for(_=0;_<r.length;_++)r[_]&&He(r[_],e,n||typeof t.type!="function");n||ee(t.__e),t.__c=t.__=t.__e=void 0}function it(t,e,n){return this.constructor(t,n)}function U(t,e,n){var r,_,o,a;e===document&&(e=document.documentElement),d.__&&d.__(t,e),_=(r=typeof n=="function")?null:n&&n.__k||e.__k,o=[],a=[],te(e,t=(!r&&n||e).__k=E(F,null,[t]),_||A,A,e.namespaceURI,!r&&n?[n]:_?null:e.firstChild?L.call(e.childNodes):null,o,!r&&n?n:_?_.__e:e.firstChild,r,a),Fe(o,t,a)}function re(t,e){U(t,e,re)}function oe(t,e,n){var r,_,o,a,u=C({},t.props);for(o in t.type&&t.type.defaultProps&&(a=t.type.defaultProps),e)o=="key"?r=e[o]:o=="ref"?_=e[o]:u[o]=e[o]===void 0&&a!==void 0?a[o]:e[o];return arguments.length>2&&(u.children=arguments.length>3?L.call(arguments,2):n),D(t.type,u,r||t.key,_||t.ref,null)}L=Ce.slice,d={__e:function(t,e,n,r){for(var _,o,a;e=e.__;)if((_=e.__c)&&!_.__)try{if((o=_.constructor)&&o.getDerivedStateFromError!=null&&(_.setState(o.getDerivedStateFromError(t)),a=_.__d),_.componentDidCatch!=null&&(_.componentDidCatch(t,r||{}),a=_.__d),a)return _.__E=_}catch(u){t=u}throw t}},we=0,et=function(t){return t!=null&&t.constructor==null},O.prototype.setState=function(t,e){var n;n=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=C({},this.state),typeof t=="function"&&(t=t(C({},n),this.props)),t&&C(n,t),t!=null&&this.__v&&(e&&this._sb.push(e),ve(this))},O.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),ve(this))},O.prototype.render=F,S=[],be=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,J=function(t,e){return t.__v.__b-e.__v.__b},I.__r=0,ke=/(PointerCapture)$|Capture$/i,X=0,Z=ge(!1),Q=ge(!0),tt=0;function _e(){return(_e=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}).apply(this,arguments)}var at=["context","children"];function ut(t){this.getChildContext=function(){return t.context};var e=t.children,n=function(r,_){if(r==null)return{};var o,a,u={},l=Object.keys(r);for(a=0;a<l.length;a++)_.indexOf(o=l[a])>=0||(u[o]=r[o]);return u}(t,at);return oe(e,n)}function lt(){var t=new CustomEvent("_preact",{detail:{},bubbles:!0,cancelable:!0});this.dispatchEvent(t),this._vdom=E(ut,_e({},this._props,{context:t.detail.context}),function e(n,r){if(n.nodeType===3)return n.data;if(n.nodeType!==1)return null;var _=[],o={},a=0,u=n.attributes,l=n.childNodes;for(a=u.length;a--;)u[a].name!=="slot"&&(o[u[a].name]=u[a].value,o[Ne(u[a].name)]=u[a].value);for(a=l.length;a--;){var s=e(l[a],null),f=l[a].slot;f?o[f]=E(Pe,{name:f},s):_[a]=s}var i=r?E(Pe,null,_):_;return E(r||n.nodeName.toLowerCase(),o,i)}(this,this._vdomComponent)),(this.hasAttribute("hydrate")?re:U)(this._vdom,this._root)}function Ne(t){return t.replace(/-(\w)/g,function(e,n){return n?n.toUpperCase():""})}function st(t,e,n){if(this._vdom){var r={};r[t]=n=n??void 0,r[Ne(t)]=n,this._vdom=oe(this._vdom,r),U(this._vdom,this._root)}}function ct(){U(this._vdom=null,this._root)}function Pe(t,e){var n=this;return E("slot",_e({},t,{ref:function(r){r?(n.ref=r,n._listener||(n._listener=function(_){_.stopPropagation(),_.detail.context=e},r.addEventListener("_preact",n._listener))):n.ref.removeEventListener("_preact",n._listener)}}))}function Te(t,e,n,r){function _(){var o=Reflect.construct(HTMLElement,[],_);return o._vdomComponent=t,o._root=r&&r.shadow?o.attachShadow({mode:r.mode||"open"}):o,o}return(_.prototype=Object.create(HTMLElement.prototype)).constructor=_,_.prototype.connectedCallback=lt,_.prototype.attributeChangedCallback=st,_.prototype.disconnectedCallback=ct,n=n||t.observedAttributes||Object.keys(t.propTypes||{}),_.observedAttributes=n,n.forEach(function(o){Object.defineProperty(_.prototype,o,{get:function(){return this._vdom.props[o]},set:function(a){this._vdom?this.attributeChangedCallback(o,null,a):(this._props||(this._props={}),this._props[o]=a,this.connectedCallback());var u=typeof a;a!=null&&u!=="string"&&u!=="boolean"&&u!=="number"||this.setAttribute(o,a)}})}),customElements.define(e||t.tagName||t.displayName||t.name,_)}var M,v,ie,De,$=0,Oe=[],y=d,Ae=y.__b,Le=y.__r,Ue=y.diffed,Me=y.__c,je=y.unmount,Be=y.__;function ue(t,e){y.__h&&y.__h(v,t,$||e),$=0;var n=v.__H||(v.__H={__:[],__h:[]});return t>=n.__.length&&n.__.push({}),n.__[t]}function Ie(t){return $=1,ft(qe,t)}function ft(t,e,n){var r=ue(M++,2);if(r.t=t,!r.__c&&(r.__=[n?n(e):qe(void 0,e),function(u){var l=r.__N?r.__N[0]:r.__[0],s=r.t(l,u);l!==s&&(r.__N=[s,r.__[1]],r.__c.setState({}))}],r.__c=v,!v.u)){var _=function(u,l,s){if(!r.__c.__H)return!0;var f=r.__c.__H.__.filter(function(p){return!!p.__c});if(f.every(function(p){return!p.__N}))return!o||o.call(this,u,l,s);var i=r.__c.props!==u;return f.forEach(function(p){if(p.__N){var c=p.__[0];p.__=p.__N,p.__N=void 0,c!==p.__[0]&&(i=!0)}}),o&&o.call(this,u,l,s)||i};v.u=!0;var o=v.shouldComponentUpdate,a=v.componentWillUpdate;v.componentWillUpdate=function(u,l,s){if(this.__e){var f=o;o=void 0,_(u,l,s),o=f}a&&a.call(this,u,l,s)},v.shouldComponentUpdate=_}return r.__N||r.__}function We(t,e){var n=ue(M++,3);!y.__s&&Ve(n.__H,e)&&(n.__=t,n.i=e,v.__H.__h.push(n))}function pt(t,e){var n=ue(M++,7);return Ve(n.__H,e)&&(n.__=t(),n.__H=e,n.__h=t),n.__}function $e(t,e){return $=8,pt(function(){return t},e)}function dt(){for(var t;t=Oe.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(W),t.__H.__h.forEach(ae),t.__H.__h=[]}catch(e){t.__H.__h=[],y.__e(e,t.__v)}}y.__b=function(t){v=null,Ae&&Ae(t)},y.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),Be&&Be(t,e)},y.__r=function(t){Le&&Le(t),M=0;var e=(v=t.__c).__H;e&&(ie===v?(e.__h=[],v.__h=[],e.__.forEach(function(n){n.__N&&(n.__=n.__N),n.i=n.__N=void 0})):(e.__h.forEach(W),e.__h.forEach(ae),e.__h=[],M=0)),ie=v},y.diffed=function(t){Ue&&Ue(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(Oe.push(e)!==1&&De===y.requestAnimationFrame||((De=y.requestAnimationFrame)||ht)(dt)),e.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.i=void 0})),ie=v=null},y.__c=function(t,e){e.some(function(n){try{n.__h.forEach(W),n.__h=n.__h.filter(function(r){return!r.__||ae(r)})}catch(r){e.some(function(_){_.__h&&(_.__h=[])}),e=[],y.__e(r,n.__v)}}),Me&&Me(t,e)},y.unmount=function(t){je&&je(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.forEach(function(r){try{W(r)}catch(_){e=_}}),n.__H=void 0,e&&y.__e(e,n.__v))};var Re=typeof requestAnimationFrame=="function";function ht(t){var e,n=function(){clearTimeout(r),Re&&cancelAnimationFrame(e),setTimeout(t)},r=setTimeout(n,100);Re&&(e=requestAnimationFrame(n))}function W(t){var e=v,n=t.__c;typeof n=="function"&&(t.__c=void 0,n()),v=e}function ae(t){var e=v;t.__c=t.__(),v=e}function Ve(t,e){return!t||t.length!==e.length||e.some(function(n,r){return n!==t[r]})}function qe(t,e){return typeof e=="function"?e(t):e}var mt=0,Nt=Array.isArray;function ze(t,e,n,r,_,o){e||(e={});var a,u,l=e;"ref"in e&&(a=e.ref,delete e.ref);var s={type:t,props:l,key:n,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--mt,__i:-1,__u:0,__source:_,__self:o};if(typeof t=="function"&&(a=t.defaultProps))for(u in a)l[u]===void 0&&(l[u]=a[u]);return d.vnode&&d.vnode(s),s}function vt(){if(!window.FrakSetup.modalShareConfig){console.error("window.FrakSetup.modalShareConfig not found");return}window.FrakSetup.modalBuilderSteps.sharing(window.FrakSetup.modalShareConfig).display()}function V({text:t="Share and earn!",classname:e=""}){let[n,r]=Ie(!0),_=$e(()=>{r(!1)},[]);return We(()=>(G("add",_),()=>G("remove",_)),[_]),ze("button",{type:"button",class:e,disabled:n,onClick:vt,children:t})}customElements.get("frak-button-share")||Te(V,"frak-button-share",["text"],{shadow:!1});var yt=se("frak-sdk","https://cdn.jsdelivr.net/npm/@frak-labs/nexus-sdk@latest/dist/bundle/bundle.js");ce(async function(){await yt;let e=await pe();if(!e){console.error("Failed to create Frak client");return}de(e),he(e)});return Xe(gt);})();
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"url": "https://twitter.com/QNivelais"
|
|
12
12
|
}
|
|
13
13
|
],
|
|
14
|
-
"version": "0.0.
|
|
14
|
+
"version": "0.0.3",
|
|
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",
|
|
@@ -44,12 +44,10 @@
|
|
|
44
44
|
"build:watch": "tsup --watch"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@frak-labs/shared": "workspace:*",
|
|
48
47
|
"preact": "^10.25.0",
|
|
49
48
|
"preact-custom-element": "^4.3.0"
|
|
50
49
|
},
|
|
51
50
|
"devDependencies": {
|
|
52
|
-
"@frak-labs/nexus-sdk": "workspace:*",
|
|
53
51
|
"@total-typescript/tsconfig": "^1.0.4",
|
|
54
52
|
"@types/node": "^22",
|
|
55
53
|
"@types/preact-custom-element": "^4.0.4",
|