Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@moneyhash/js-sdk

Package Overview
Dependencies
Maintainers
0
Versions
62
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@moneyhash/js-sdk - npm Package Compare versions

Comparing version 1.5.2-beta.1 to 1.5.2-beta.2

dist/warnIf-94e30d35.js

2

dist/headless.cjs.js

@@ -1,2 +0,2 @@

"use strict";var de=Object.defineProperty,ce=Object.defineProperties;var le=Object.getOwnPropertyDescriptors;var G=Object.getOwnPropertySymbols;var ue=Object.prototype.hasOwnProperty,he=Object.prototype.propertyIsEnumerable;var q=(s,e,t)=>e in s?de(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,k=(s,e)=>{for(var t in e||(e={}))ue.call(e,t)&&q(s,t,e[t]);if(G)for(var t of G(e))he.call(e,t)&&q(s,t,e[t]);return s},Q=(s,e)=>ce(s,le(e));var v=(s,e,t)=>(q(s,typeof e!="symbol"?e+"":e,t),t),pe=(s,e,t)=>{if(!e.has(s))throw TypeError("Cannot "+t)};var b=(s,e,t)=>{if(e.has(s))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(s):e.set(s,t)};var E=(s,e,t)=>(pe(s,e,"access private method"),t);var w=(s,e,t)=>new Promise((o,r)=>{var a=n=>{try{i(t.next(n))}catch(l){r(l)}},c=n=>{try{i(t.throw(n))}catch(l){r(l)}},i=n=>n.done?o(n.value):Promise.resolve(n.value).then(a,c);i((t=t.apply(s,e)).next())});const p=require("./warnIf-604ca43b.cjs");function me(){return typeof window!="undefined"}const y=class{constructor(){me()&&this.initSDKCommunicationIframe()}initSDKCommunicationIframe(){if(document.getElementById("moneyhash-headless-sdk"))return;const e=p.getIframeUrl(),t=new URL(`${e}/embed/headless-sdk`);t.searchParams.set("sdk","true"),t.searchParams.set("parent",window.location.origin),t.searchParams.set("version","js@1.5.2-beta.1");const o=document.createElement("iframe");o.id="moneyhash-headless-sdk",o.src=t.toString(),o.hidden=!0,document.body.appendChild(o),y.messagingService=new p.MessagingService({target:o.contentWindow,targetOrigin:e}),y.isCommunicationReady=new Promise(r=>{var c;const a=i=>{var n;i.data.type==="headlessSDK:init"&&(r(),(n=y.messagingService)==null||n.removeListener(a))};(c=y.messagingService)==null||c.onReceive(a)})}request(o){return w(this,arguments,function*({api:e,payload:t}){return yield y.isCommunicationReady,new Promise((r,a)=>{var i,n;(i=y.messagingService)==null||i.send({type:e,data:t});const c=l=>{var h;const{type:d,data:u}=l.data;d===e&&(u.status==="resolved"?r(u.payload):a(u.payload),(h=y.messagingService)==null||h.removeListener(c))};(n=y.messagingService)==null||n.onReceive(c)})})}postMessage(e){var t;(t=y.messagingService)==null||t.send({type:e})}};let L=y;v(L,"messagingService",null),v(L,"isCommunicationReady");class X{constructor(){v(this,"promise");v(this,"resolve");v(this,"reject");this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}}function ge(){var e;return(e=window.MONEYHASH_VAULT_API_URL)!=null?e:"https://vault.moneyhash.io"}function S(){var e;return(e=window.MONEYHASH_VAULT_INPUT_IFRAME_URL)!=null?e:"https://vault-form.moneyhash.io"}function Z(){var e;return(e=window.API_URL)!=null?e:"https://web.moneyhash.io"}function fe(s){const e=["cardNumber","cardCvv","cardExpiryMonth","cardExpiryYear"];for(const t of e)if(!s.includes(t))return t;return null}function we(s){return(Array.isArray(s)?s.length:Object.keys(s).length)===0}function ve(s,e){return new Promise((t,o)=>{if(document.getElementById(e)){t(void 0);return}const a=document.createElement("script");a.src=s,a.id=e,a.addEventListener("load",()=>{t(void 0)}),a.addEventListener("error",()=>{o(new Error("Script failed to load"))}),document.body.appendChild(a)})}function ye(s){return new Promise(e=>{setTimeout(()=>{e("done")},s*1e3)})}const ee=new Set(["method","customerBalance","savedCard"]);var C,te,U,re,R,ne,A,N,$,ae,M,ie,_,se,F,oe;class Pe{constructor(e){b(this,C);b(this,U);b(this,R);b(this,A);b(this,$);b(this,M);b(this,_);b(this,F);v(this,"options");v(this,"sdkApiHandler",new L);v(this,"sdkEmbed");v(this,"vaultSubmitListener",{current:null});v(this,"mountedCardElements",[]);this.options=e,this.sdkEmbed=new p.SDKEmbed(Q(k({},e),{headless:!0})),E(this,M,ie).call(this,this.vaultSubmitListener)}getIntentDetails(e){return this.sdkApiHandler.request({api:"sdk:getIntentDetails",payload:{intentType:this.options.type,intentId:e,lang:this.sdkEmbed.lang}})}getIntentMethods(e){return this.sdkApiHandler.request({api:"sdk:getIntentMethods",payload:{intentType:this.options.type,intentId:e,lang:this.sdkEmbed.lang}})}proceedWith({intentId:e,type:t,id:o,metaData:r}){return p.throwIf(!ee.has(t),`type must be a valid one (${[...ee].join(" | ")})`),this.sdkApiHandler.request({api:"sdk:proceedWith",payload:{proceedWith:t,intentType:this.options.type,intentId:e,id:o,lang:this.sdkEmbed.lang,metaData:r}})}resetSelectedMethod(e){return this.sdkApiHandler.request({api:"sdk:resetSelectedMethod",payload:{intentType:this.options.type,intentId:e,lang:this.sdkEmbed.lang}})}deleteCard({cardId:e,intentSecret:t}){return p.throwIf(this.options.type==="payout","deleteCard is allowed only for payment intent!"),this.sdkApiHandler.request({api:"sdk:deleteCard",payload:{cardId:e,intentSecret:t,lang:this.sdkEmbed.lang}})}payWithApplePay(l){return w(this,arguments,function*({intentId:e,currency:t,amount:o,countryCode:r,onCancel:a=()=>{},onError:c,onComplete:i,billingData:n={}}){if(yield ve("https://applepay.cdn-apple.com/jsapi/v1/apple-pay-sdk.js","moneyHash-apple-pay-sdk"),!ApplePaySession)return;const d=new ApplePaySession(3,{countryCode:r,currencyCode:t,supportedNetworks:["visa","masterCard","amex","discover","mada"],merchantCapabilities:["supports3DS"],total:{label:"Apple Pay",type:"final",amount:`${o}`}}),{state:u,intent:h}=yield this.proceedWith({intentId:e,type:"method",id:"APPLE_PAY"});try{if(u==="INTENT_FORM"){if(we(n))throw new Error("Billing data is missing while calling payWithApplePay");yield this.sdkApiHandler.request({api:"sdk:submitNativeForm",payload:{intentId:e,paymentMethod:"APPLE_PAY",lang:this.sdkEmbed.lang,billingData:n}})}}catch(m){throw yield this.resetSelectedMethod(e),m}d.onvalidatemerchant=m=>{fetch(`${Z()}/api/v1/providers/applepay/session/`,{method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify({secret:h.secret,validation_url:m.validationURL})}).then(f=>f.ok?f.json():Promise.reject()).then(f=>d.completeMerchantValidation(f)).catch(c)},d.onpaymentauthorized=m=>{fetch(`${Z()}/api/v1/providers/applepay/token/`,{method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify({token_data:m.payment.token,secret:h.secret})}).then(f=>f.ok?f.json():Promise.reject()).then(()=>{d.completePayment(ApplePaySession.STATUS_SUCCESS),i()}).catch(()=>{d.completePayment(ApplePaySession.STATUS_FAILURE),c()})},d.oncancel=a,d.begin()})}renderForm({selector:e,intentId:t}){return p.throwIf(!e,"selector is required for renderForm"),p.throwIf(!t,"intentId is required for renderForm"),this.sdkEmbed.render({selector:e,intentId:t})}setLocale(e){p.warnIf(!!e&&!p.supportedLanguages.has(e),`Invalid locale. Supported languages (${[...p.supportedLanguages].join(" | ")})`);const t=p.supportedLanguages.has(e)?e:"en";return this.sdkEmbed.setLocale(t)}removeEventListeners(){return this.sdkEmbed.abortService()}updateIntentDiscount({intentId:e,discount:t}){return p.throwIf(!t.title.en,"English discount title is required!"),this.sdkApiHandler.request({api:"sdk:updateIntentDiscount",payload:{intentId:e,discount:t,lang:this.sdkEmbed.lang}})}updateIntentFees({intentId:e,fees:t}){return t.forEach(o=>{p.throwIf(!o.title.en,"English fee title is required!")}),this.sdkApiHandler.request({api:"sdk:updateIntentFees",payload:{intentId:e,fees:t,lang:this.sdkEmbed.lang}})}elements({styles:e,classes:t,fontSourceCss:o}){const r=[],a={},c=new Map;let i=!1;return E(this,$,ae).call(this,r),{create:({elementType:n,elementOptions:l})=>{var D,W;const d=new Map;let u=null,h;const m=k(k({},t),l.classes),f=((D=m==null?void 0:m.focus)==null?void 0:D.split(" "))||["MoneyHashElement--focus"],H=((W=m==null?void 0:m.error)==null?void 0:W.split(" "))||["MoneyHashElement--error"];return{mount:()=>{h=document.querySelector(l.selector),p.throwIf(!h,`Couldn't find an element with selector ${l.selector}!`),h.classList.add("MoneyHashElement"),r.push(g=>{var j,x,B,T,Y,O,z,J,K;const{type:P,data:I}=g.data;if(P===`${n}@mount`&&(a[n]=I.isValid,(j=d.get(`${n}@mount`))==null||j()),P===`${n}@focus`){h.classList.add(...f),(x=d.get(`${n}@focus`))==null||x();return}if(P===`${n}@blur`){h.classList.remove(...f),(B=d.get(`${n}@blur`))==null||B();return}if(P===`${n}@error`){I.isValid?h.classList.remove(...H):h.classList.add(...H),(T=d.get(`${n}@error`))==null||T(I);return}if(P===`${n}@changeInput`){if((Y=d.get(`${n}@changeInput`))==null||Y({isValid:I.isValid,length:I.length}),a[n]=I.isValid,c.get("validityChange")){const V=Object.values(a).every(Boolean);V!==i&&((O=c.get("validityChange"))==null||O(V),i=V)}return}if(P===`${n}@cardNumberChange`){(z=d.get(`${n}@cardNumberChange`))==null||z(I);return}if(P===`${n}@key:Backspace`){(J=d.get(`${n}@key:Backspace`))==null||J();return}P===`${n}@key:Enter`&&((K=d.get(`${n}@key:Enter`))==null||K())}),u=E(this,_,se).call(this,{container:h,elementType:n,elementOptions:l,styles:k(k({},e),l.styles),fontSourceCss:o}),this.mountedCardElements.push(n)},on:(g,P)=>{d.set(`${n}@${g}`,P)},off:g=>d.delete(`${n}@${g}`),focus:()=>{var g;(g=u==null?void 0:u.contentWindow)==null||g.postMessage({type:"focus"},S())},blur:()=>{var g;(g=u==null?void 0:u.contentWindow)==null||g.postMessage({type:"blur"},S())},clear:()=>{var g;(g=u==null?void 0:u.contentWindow)==null||g.postMessage({type:"clear"},S())}}},on:(n,l)=>{c.set(n,l)}}}submitForm(c){return w(this,arguments,function*({intentId:e,accessToken:t,billingData:o,shippingData:r,saveCard:a}){const i=fe(this.mountedCardElements);p.throwIf(!!i,`You must mount ${i} element!`);const n=new X;let l,d;t&&(this.vaultSubmitListener.current=h=>{const{type:m,data:f}=h.data;m==="vaultSubmit:success"&&n.resolve(f),m==="vaultSubmit:error"&&n.reject(f)},d=E(this,F,oe).call(this,{accessToken:t,saveCard:a}),l=yield n.promise);const u=yield this.sdkApiHandler.request({api:"sdk:submitNativeForm",payload:{intentId:e,paymentMethod:"CARD",lang:this.sdkEmbed.lang,billingData:o,shippingData:r,cardEmbed:l}});return d&&d.remove(),u})}submitCvv(o){return w(this,arguments,function*({intentId:e,cvv:t}){return this.sdkApiHandler.request({api:"sdk:submitCardCvv",payload:{intentId:e,cvv:t,lang:this.sdkEmbed.lang}})})}renderUrl(a){return w(this,arguments,function*({intentId:e,url:t,renderStrategy:o,options:r}){switch(o){case"IFRAME":return E(this,C,te).call(this,{url:t,intentId:e});case"POPUP_IFRAME":return E(this,U,re).call(this,{url:t,intentId:e,options:r});case"REDIRECT":return E(this,R,ne).call(this,{url:t,options:r});default:return null}})}onExpiration(e,t){if(!e)return p.warnIf(!0,`No expiration date provided!, make sure to check for it before usage
"use strict";var de=Object.defineProperty,ce=Object.defineProperties;var le=Object.getOwnPropertyDescriptors;var G=Object.getOwnPropertySymbols;var ue=Object.prototype.hasOwnProperty,he=Object.prototype.propertyIsEnumerable;var q=(s,e,t)=>e in s?de(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,k=(s,e)=>{for(var t in e||(e={}))ue.call(e,t)&&q(s,t,e[t]);if(G)for(var t of G(e))he.call(e,t)&&q(s,t,e[t]);return s},Q=(s,e)=>ce(s,le(e));var v=(s,e,t)=>(q(s,typeof e!="symbol"?e+"":e,t),t),pe=(s,e,t)=>{if(!e.has(s))throw TypeError("Cannot "+t)};var b=(s,e,t)=>{if(e.has(s))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(s):e.set(s,t)};var E=(s,e,t)=>(pe(s,e,"access private method"),t);var w=(s,e,t)=>new Promise((o,r)=>{var a=n=>{try{i(t.next(n))}catch(l){r(l)}},c=n=>{try{i(t.throw(n))}catch(l){r(l)}},i=n=>n.done?o(n.value):Promise.resolve(n.value).then(a,c);i((t=t.apply(s,e)).next())});const p=require("./warnIf-cc60367b.cjs");function me(){return typeof window!="undefined"}const y=class{constructor(){me()&&this.initSDKCommunicationIframe()}initSDKCommunicationIframe(){if(document.getElementById("moneyhash-headless-sdk"))return;const e=p.getIframeUrl(),t=new URL(`${e}/embed/headless-sdk`);t.searchParams.set("sdk","true"),t.searchParams.set("parent",window.location.origin),t.searchParams.set("version","js@1.5.2-beta.2");const o=document.createElement("iframe");o.id="moneyhash-headless-sdk",o.src=t.toString(),o.hidden=!0,document.body.appendChild(o),y.messagingService=new p.MessagingService({target:o.contentWindow,targetOrigin:e}),y.isCommunicationReady=new Promise(r=>{var c;const a=i=>{var n;i.data.type==="headlessSDK:init"&&(r(),(n=y.messagingService)==null||n.removeListener(a))};(c=y.messagingService)==null||c.onReceive(a)})}request(o){return w(this,arguments,function*({api:e,payload:t}){return yield y.isCommunicationReady,new Promise((r,a)=>{var i,n;(i=y.messagingService)==null||i.send({type:e,data:t});const c=l=>{var h;const{type:d,data:u}=l.data;d===e&&(u.status==="resolved"?r(u.payload):a(u.payload),(h=y.messagingService)==null||h.removeListener(c))};(n=y.messagingService)==null||n.onReceive(c)})})}postMessage(e){var t;(t=y.messagingService)==null||t.send({type:e})}};let L=y;v(L,"messagingService",null),v(L,"isCommunicationReady");class X{constructor(){v(this,"promise");v(this,"resolve");v(this,"reject");this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}}function ge(){var e;return(e=window.MONEYHASH_VAULT_API_URL)!=null?e:"https://vault.moneyhash.io"}function S(){var e;return(e=window.MONEYHASH_VAULT_INPUT_IFRAME_URL)!=null?e:"https://vault-form.moneyhash.io"}function Z(){var e;return(e=window.API_URL)!=null?e:"https://web.moneyhash.io"}function fe(s){const e=["cardNumber","cardCvv","cardExpiryMonth","cardExpiryYear"];for(const t of e)if(!s.includes(t))return t;return null}function we(s){return(Array.isArray(s)?s.length:Object.keys(s).length)===0}function ve(s,e){return new Promise((t,o)=>{if(document.getElementById(e)){t(void 0);return}const a=document.createElement("script");a.src=s,a.id=e,a.addEventListener("load",()=>{t(void 0)}),a.addEventListener("error",()=>{o(new Error("Script failed to load"))}),document.body.appendChild(a)})}function ye(s){return new Promise(e=>{setTimeout(()=>{e("done")},s*1e3)})}const ee=new Set(["method","customerBalance","savedCard"]);var C,te,U,re,R,ne,A,N,$,ae,M,ie,_,se,F,oe;class Pe{constructor(e){b(this,C);b(this,U);b(this,R);b(this,A);b(this,$);b(this,M);b(this,_);b(this,F);v(this,"options");v(this,"sdkApiHandler",new L);v(this,"sdkEmbed");v(this,"vaultSubmitListener",{current:null});v(this,"mountedCardElements",[]);this.options=e,this.sdkEmbed=new p.SDKEmbed(Q(k({},e),{headless:!0})),E(this,M,ie).call(this,this.vaultSubmitListener)}getIntentDetails(e){return this.sdkApiHandler.request({api:"sdk:getIntentDetails",payload:{intentType:this.options.type,intentId:e,lang:this.sdkEmbed.lang}})}getIntentMethods(e){return this.sdkApiHandler.request({api:"sdk:getIntentMethods",payload:{intentType:this.options.type,intentId:e,lang:this.sdkEmbed.lang}})}proceedWith({intentId:e,type:t,id:o,metaData:r}){return p.throwIf(!ee.has(t),`type must be a valid one (${[...ee].join(" | ")})`),this.sdkApiHandler.request({api:"sdk:proceedWith",payload:{proceedWith:t,intentType:this.options.type,intentId:e,id:o,lang:this.sdkEmbed.lang,metaData:r}})}resetSelectedMethod(e){return this.sdkApiHandler.request({api:"sdk:resetSelectedMethod",payload:{intentType:this.options.type,intentId:e,lang:this.sdkEmbed.lang}})}deleteCard({cardId:e,intentSecret:t}){return p.throwIf(this.options.type==="payout","deleteCard is allowed only for payment intent!"),this.sdkApiHandler.request({api:"sdk:deleteCard",payload:{cardId:e,intentSecret:t,lang:this.sdkEmbed.lang}})}payWithApplePay(l){return w(this,arguments,function*({intentId:e,currency:t,amount:o,countryCode:r,onCancel:a=()=>{},onError:c,onComplete:i,billingData:n={}}){if(yield ve("https://applepay.cdn-apple.com/jsapi/v1/apple-pay-sdk.js","moneyHash-apple-pay-sdk"),!ApplePaySession)return;const d=new ApplePaySession(3,{countryCode:r,currencyCode:t,supportedNetworks:["visa","masterCard","amex","discover","mada"],merchantCapabilities:["supports3DS"],total:{label:"Apple Pay",type:"final",amount:`${o}`}}),{state:u,intent:h}=yield this.proceedWith({intentId:e,type:"method",id:"APPLE_PAY"});try{if(u==="INTENT_FORM"){if(we(n))throw new Error("Billing data is missing while calling payWithApplePay");yield this.sdkApiHandler.request({api:"sdk:submitNativeForm",payload:{intentId:e,paymentMethod:"APPLE_PAY",lang:this.sdkEmbed.lang,billingData:n}})}}catch(m){throw yield this.resetSelectedMethod(e),m}d.onvalidatemerchant=m=>{fetch(`${Z()}/api/v1/providers/applepay/session/`,{method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify({secret:h.secret,validation_url:m.validationURL})}).then(f=>f.ok?f.json():Promise.reject()).then(f=>d.completeMerchantValidation(f)).catch(c)},d.onpaymentauthorized=m=>{fetch(`${Z()}/api/v1/providers/applepay/token/`,{method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify({token_data:m.payment.token,secret:h.secret})}).then(f=>f.ok?f.json():Promise.reject()).then(()=>{d.completePayment(ApplePaySession.STATUS_SUCCESS),i()}).catch(()=>{d.completePayment(ApplePaySession.STATUS_FAILURE),c()})},d.oncancel=a,d.begin()})}renderForm({selector:e,intentId:t}){return p.throwIf(!e,"selector is required for renderForm"),p.throwIf(!t,"intentId is required for renderForm"),this.sdkEmbed.render({selector:e,intentId:t})}setLocale(e){p.warnIf(!!e&&!p.supportedLanguages.has(e),`Invalid locale. Supported languages (${[...p.supportedLanguages].join(" | ")})`);const t=p.supportedLanguages.has(e)?e:"en";return this.sdkEmbed.setLocale(t)}removeEventListeners(){return this.sdkEmbed.abortService()}updateIntentDiscount({intentId:e,discount:t}){return p.throwIf(!t.title.en,"English discount title is required!"),this.sdkApiHandler.request({api:"sdk:updateIntentDiscount",payload:{intentId:e,discount:t,lang:this.sdkEmbed.lang}})}updateIntentFees({intentId:e,fees:t}){return t.forEach(o=>{p.throwIf(!o.title.en,"English fee title is required!")}),this.sdkApiHandler.request({api:"sdk:updateIntentFees",payload:{intentId:e,fees:t,lang:this.sdkEmbed.lang}})}elements({styles:e,classes:t,fontSourceCss:o}){const r=[],a={},c=new Map;let i=!1;return E(this,$,ae).call(this,r),{create:({elementType:n,elementOptions:l})=>{var D,W;const d=new Map;let u=null,h;const m=k(k({},t),l.classes),f=((D=m==null?void 0:m.focus)==null?void 0:D.split(" "))||["MoneyHashElement--focus"],H=((W=m==null?void 0:m.error)==null?void 0:W.split(" "))||["MoneyHashElement--error"];return{mount:()=>{h=document.querySelector(l.selector),p.throwIf(!h,`Couldn't find an element with selector ${l.selector}!`),h.classList.add("MoneyHashElement"),r.push(g=>{var j,x,B,T,Y,O,z,J,K;const{type:P,data:I}=g.data;if(P===`${n}@mount`&&(a[n]=I.isValid,(j=d.get(`${n}@mount`))==null||j()),P===`${n}@focus`){h.classList.add(...f),(x=d.get(`${n}@focus`))==null||x();return}if(P===`${n}@blur`){h.classList.remove(...f),(B=d.get(`${n}@blur`))==null||B();return}if(P===`${n}@error`){I.isValid?h.classList.remove(...H):h.classList.add(...H),(T=d.get(`${n}@error`))==null||T(I);return}if(P===`${n}@changeInput`){if((Y=d.get(`${n}@changeInput`))==null||Y({isValid:I.isValid,length:I.length}),a[n]=I.isValid,c.get("validityChange")){const V=Object.values(a).every(Boolean);V!==i&&((O=c.get("validityChange"))==null||O(V),i=V)}return}if(P===`${n}@cardNumberChange`){(z=d.get(`${n}@cardNumberChange`))==null||z(I);return}if(P===`${n}@key:Backspace`){(J=d.get(`${n}@key:Backspace`))==null||J();return}P===`${n}@key:Enter`&&((K=d.get(`${n}@key:Enter`))==null||K())}),u=E(this,_,se).call(this,{container:h,elementType:n,elementOptions:l,styles:k(k({},e),l.styles),fontSourceCss:o}),this.mountedCardElements.push(n)},on:(g,P)=>{d.set(`${n}@${g}`,P)},off:g=>d.delete(`${n}@${g}`),focus:()=>{var g;(g=u==null?void 0:u.contentWindow)==null||g.postMessage({type:"focus"},S())},blur:()=>{var g;(g=u==null?void 0:u.contentWindow)==null||g.postMessage({type:"blur"},S())},clear:()=>{var g;(g=u==null?void 0:u.contentWindow)==null||g.postMessage({type:"clear"},S())}}},on:(n,l)=>{c.set(n,l)}}}submitForm(c){return w(this,arguments,function*({intentId:e,accessToken:t,billingData:o,shippingData:r,saveCard:a}){const i=fe(this.mountedCardElements);p.throwIf(!!i,`You must mount ${i} element!`);const n=new X;let l,d;t&&(this.vaultSubmitListener.current=h=>{const{type:m,data:f}=h.data;m==="vaultSubmit:success"&&n.resolve(f),m==="vaultSubmit:error"&&n.reject(f)},d=E(this,F,oe).call(this,{accessToken:t,saveCard:a}),l=yield n.promise);const u=yield this.sdkApiHandler.request({api:"sdk:submitNativeForm",payload:{intentId:e,paymentMethod:"CARD",lang:this.sdkEmbed.lang,billingData:o,shippingData:r,cardEmbed:l}});return d&&d.remove(),u})}submitCvv(o){return w(this,arguments,function*({intentId:e,cvv:t}){return this.sdkApiHandler.request({api:"sdk:submitCardCvv",payload:{intentId:e,cvv:t,lang:this.sdkEmbed.lang}})})}renderUrl(a){return w(this,arguments,function*({intentId:e,url:t,renderStrategy:o,options:r}){switch(o){case"IFRAME":return E(this,C,te).call(this,{url:t,intentId:e});case"POPUP_IFRAME":return E(this,U,re).call(this,{url:t,intentId:e,options:r});case"REDIRECT":return E(this,R,ne).call(this,{url:t,options:r});default:return null}})}onExpiration(e,t){if(!e)return p.warnIf(!0,`No expiration date provided!, make sure to check for it before usage

@@ -3,0 +3,0 @@ if (intentDetails.intent.expirationDate) {

@@ -134,5 +134,3 @@ export declare interface AbstractIntent {

create: (elementProps: ElementProps) => Element_2;
on: (event: FormEvents, callback: (data: {
isValid: boolean;
}) => void) => void;
on: (event: FormEvents, callback: (isValid: boolean) => void) => void;
};

@@ -139,0 +137,0 @@

@@ -39,3 +39,3 @@ var ue = Object.defineProperty, pe = Object.defineProperties;

});
import { M as ve, g as ae, S as we, t as E, w as Z, s as q } from "./warnIf-f9a95079.js";
import { M as ve, g as ae, S as we, t as E, w as Z, s as q } from "./warnIf-94e30d35.js";
function ye() {

@@ -52,3 +52,3 @@ return typeof window != "undefined";

const e = ae(), t = new URL(`${e}/embed/headless-sdk`);
t.searchParams.set("sdk", "true"), t.searchParams.set("parent", window.location.origin), t.searchParams.set("version", "js@1.5.2-beta.1");
t.searchParams.set("sdk", "true"), t.searchParams.set("parent", window.location.origin), t.searchParams.set("version", "js@1.5.2-beta.2");
const o = document.createElement("iframe");

@@ -55,0 +55,0 @@ o.id = "moneyhash-headless-sdk", o.src = t.toString(), o.hidden = !0, document.body.appendChild(o), w.messagingService = new ve({

@@ -1,2 +0,2 @@

(function(l,o){typeof exports=="object"&&typeof module!="undefined"?module.exports=o():typeof define=="function"&&define.amd?define(o):(l=typeof globalThis!="undefined"?globalThis:l||self,l.MoneyHash=o())})(this,function(){var q,ce,j,le,D,he,F,z,W,me,x,ue,B,pe,O,ge;"use strict";var Ee=Object.defineProperty,Pe=Object.defineProperties;var ke=Object.getOwnPropertyDescriptors;var oe=Object.getOwnPropertySymbols;var Se=Object.prototype.hasOwnProperty,Le=Object.prototype.propertyIsEnumerable;var Y=(l,o,p)=>o in l?Ee(l,o,{enumerable:!0,configurable:!0,writable:!0,value:p}):l[o]=p,L=(l,o)=>{for(var p in o||(o={}))Se.call(o,p)&&Y(l,p,o[p]);if(oe)for(var p of oe(o))Le.call(o,p)&&Y(l,p,o[p]);return l},de=(l,o)=>Pe(l,ke(o));var y=(l,o,p)=>(Y(l,typeof o!="symbol"?o+"":o,p),p),Ae=(l,o,p)=>{if(!o.has(l))throw TypeError("Cannot "+p)};var R=(l,o,p)=>{if(o.has(l))throw TypeError("Cannot add the same private member more than once");o instanceof WeakSet?o.add(l):o.set(l,p)};var A=(l,o,p)=>(Ae(l,o,"access private method"),p);var E=(l,o,p)=>new Promise((I,w)=>{var V=k=>{try{$(p.next(k))}catch(_){w(_)}},M=k=>{try{$(p.throw(k))}catch(_){w(_)}},$=k=>k.done?I(k.value):Promise.resolve(k.value).then(V,M);$((p=p.apply(l,o)).next())});class l{constructor(e){y(this,"target");y(this,"targetOrigin");y(this,"listeners");y(this,"onIncomingMessageBind",this.onIncomingMessage.bind(this));this.target=e.target,this.targetOrigin=e.targetOrigin,this.listeners=[],window.addEventListener("message",this.onIncomingMessageBind)}send(e){this.target.postMessage(e,this.targetOrigin)}onReceive(e){this.listeners.push(e)}removeListener(e){this.listeners=this.listeners.filter(t=>t!==e)}onIncomingMessage(e){e.origin===this.targetOrigin&&this.listeners.forEach(t=>{t(e,this.send.bind(this))})}abortService(){window.removeEventListener("message",this.onIncomingMessageBind)}}function o(){var e;return(e=window.MONEYHASH_IFRAME_URL)!=null?e:"https://embed.moneyhash.io"}function p(){return typeof window!="undefined"}const P=class{constructor(){p()&&this.initSDKCommunicationIframe()}initSDKCommunicationIframe(){if(document.getElementById("moneyhash-headless-sdk"))return;const e=o(),t=new URL(`${e}/embed/headless-sdk`);t.searchParams.set("sdk","true"),t.searchParams.set("parent",window.location.origin),t.searchParams.set("version","js@1.5.2-beta.1");const r=document.createElement("iframe");r.id="moneyhash-headless-sdk",r.src=t.toString(),r.hidden=!0,document.body.appendChild(r),P.messagingService=new l({target:r.contentWindow,targetOrigin:e}),P.isCommunicationReady=new Promise(i=>{var h;const s=a=>{var n;a.data.type==="headlessSDK:init"&&(i(),(n=P.messagingService)==null||n.removeListener(s))};(h=P.messagingService)==null||h.onReceive(s)})}request(r){return E(this,arguments,function*({api:e,payload:t}){return yield P.isCommunicationReady,new Promise((i,s)=>{var a,n;(a=P.messagingService)==null||a.send({type:e,data:t});const h=u=>{var m;const{type:d,data:c}=u.data;d===e&&(c.status==="resolved"?i(c.payload):s(c.payload),(m=P.messagingService)==null||m.removeListener(h))};(n=P.messagingService)==null||n.onReceive(h)})})}postMessage(e){var t;(t=P.messagingService)==null||t.send({type:e})}};let I=P;y(I,"messagingService",null),y(I,"isCommunicationReady");function w(f,e){if(f)throw new Error(e)}const V=new Set(["payment","payout"]),M=new Set(["en","fr","ar"]);class ${constructor(e){y(this,"options");y(this,"messagingService",null);y(this,"iframe",null);y(this,"isCommunicationReady",null);w(!V.has(e.type),`MoneyHash constructor must be called with valid type (${[...V].join(" | ")})!`),this.options=e}get lang(){var t;return((t=this.options.locale)==null?void 0:t.split("-")[0])||"en"}render({selector:e,intentId:t}){var a,n;(a=this.messagingService)==null||a.abortService();const r=o(),i=new URL(`${r}/embed/${this.options.type}/${t}`);i.searchParams.set("sdk","true"),i.searchParams.set("parent",window.location.origin),i.searchParams.set("version","js@1.5.2-beta.1");const s=(n=this.options.locale)==null?void 0:n.split("-")[0];s&&i.searchParams.set("lang",s),this.iframe=document.createElement("iframe"),this.iframe.src=i.toString(),this.iframe.style.height="100%",this.iframe.style.width="100%",this.iframe.style.border="0";const h=document.querySelector(e);return w(!h,`Couldn't find an element with selector ${e}!`),h.replaceChildren(this.iframe),this.messagingService=new l({target:this.iframe.contentWindow,targetOrigin:r}),this.isCommunicationReady=new Promise(u=>{var c;const d=m=>{var g;m.data.type==="sdk:init"&&(u(),(g=this.messagingService)==null||g.removeListener(d))};(c=this.messagingService)==null||c.onReceive(d)}),this.messagingService.onReceive((u,d)=>{var g,v,H,N;const{type:c,data:m}=u.data;switch(c){case"sdk:init":{d({type:"sdk:init",data:{headless:Boolean(this.options.headless),styles:this.options.styles}});break}case"onComplete":{(v=(g=this.options).onComplete)==null||v.call(g,L({type:this.options.type},m)),this.options.headless&&this.iframe&&(this.iframe.hidden=!0);break}case"onFail":{(N=(H=this.options).onFail)==null||N.call(H,L({type:this.options.type},m)),this.options.headless&&this.iframe&&(this.iframe.hidden=!0);break}}}),this.isCommunicationReady}setLocale(e){return E(this,null,function*(){var t;yield this==null?void 0:this.isCommunicationReady,this.options.locale=e,(t=this.messagingService)==null||t.send({type:"changeLanguage",data:{locale:e}})})}abortService(){return E(this,null,function*(){var e;yield this==null?void 0:this.isCommunicationReady,(e=this.messagingService)==null||e.abortService()})}}class k{constructor(){y(this,"promise");y(this,"resolve");y(this,"reject");this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}}function _(){var e;return(e=window.MONEYHASH_VAULT_API_URL)!=null?e:"https://vault.moneyhash.io"}function U(){var e;return(e=window.MONEYHASH_VAULT_INPUT_IFRAME_URL)!=null?e:"https://vault-form.moneyhash.io"}function J(){var e;return(e=window.API_URL)!=null?e:"https://web.moneyhash.io"}function fe(f){const e=["cardNumber","cardCvv","cardExpiryMonth","cardExpiryYear"];for(const t of e)if(!f.includes(t))return t;return null}function ye(f){return(Array.isArray(f)?f.length:Object.keys(f).length)===0}function ve(f,e){return new Promise((t,r)=>{if(document.getElementById(e)){t(void 0);return}const s=document.createElement("script");s.src=f,s.id=e,s.addEventListener("load",()=>{t(void 0)}),s.addEventListener("error",()=>{r(new Error("Script failed to load"))}),document.body.appendChild(s)})}function we(f){return new Promise(e=>{setTimeout(()=>{e("done")},f*1e3)})}function K(f,e){f&&console.warn(e)}const G=new Set(["method","customerBalance","savedCard"]);class be{constructor(e){R(this,q);R(this,j);R(this,D);R(this,F);R(this,W);R(this,x);R(this,B);R(this,O);y(this,"options");y(this,"sdkApiHandler",new I);y(this,"sdkEmbed");y(this,"vaultSubmitListener",{current:null});y(this,"mountedCardElements",[]);this.options=e,this.sdkEmbed=new $(de(L({},e),{headless:!0})),A(this,x,ue).call(this,this.vaultSubmitListener)}getIntentDetails(e){return this.sdkApiHandler.request({api:"sdk:getIntentDetails",payload:{intentType:this.options.type,intentId:e,lang:this.sdkEmbed.lang}})}getIntentMethods(e){return this.sdkApiHandler.request({api:"sdk:getIntentMethods",payload:{intentType:this.options.type,intentId:e,lang:this.sdkEmbed.lang}})}proceedWith({intentId:e,type:t,id:r,metaData:i}){return w(!G.has(t),`type must be a valid one (${[...G].join(" | ")})`),this.sdkApiHandler.request({api:"sdk:proceedWith",payload:{proceedWith:t,intentType:this.options.type,intentId:e,id:r,lang:this.sdkEmbed.lang,metaData:i}})}resetSelectedMethod(e){return this.sdkApiHandler.request({api:"sdk:resetSelectedMethod",payload:{intentType:this.options.type,intentId:e,lang:this.sdkEmbed.lang}})}deleteCard({cardId:e,intentSecret:t}){return w(this.options.type==="payout","deleteCard is allowed only for payment intent!"),this.sdkApiHandler.request({api:"sdk:deleteCard",payload:{cardId:e,intentSecret:t,lang:this.sdkEmbed.lang}})}payWithApplePay(u){return E(this,arguments,function*({intentId:e,currency:t,amount:r,countryCode:i,onCancel:s=()=>{},onError:h,onComplete:a,billingData:n={}}){if(yield ve("https://applepay.cdn-apple.com/jsapi/v1/apple-pay-sdk.js","moneyHash-apple-pay-sdk"),!ApplePaySession)return;const d=new ApplePaySession(3,{countryCode:i,currencyCode:t,supportedNetworks:["visa","masterCard","amex","discover","mada"],merchantCapabilities:["supports3DS"],total:{label:"Apple Pay",type:"final",amount:`${r}`}}),{state:c,intent:m}=yield this.proceedWith({intentId:e,type:"method",id:"APPLE_PAY"});try{if(c==="INTENT_FORM"){if(ye(n))throw new Error("Billing data is missing while calling payWithApplePay");yield this.sdkApiHandler.request({api:"sdk:submitNativeForm",payload:{intentId:e,paymentMethod:"APPLE_PAY",lang:this.sdkEmbed.lang,billingData:n}})}}catch(g){throw yield this.resetSelectedMethod(e),g}d.onvalidatemerchant=g=>{fetch(`${J()}/api/v1/providers/applepay/session/`,{method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify({secret:m.secret,validation_url:g.validationURL})}).then(v=>v.ok?v.json():Promise.reject()).then(v=>d.completeMerchantValidation(v)).catch(h)},d.onpaymentauthorized=g=>{fetch(`${J()}/api/v1/providers/applepay/token/`,{method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify({token_data:g.payment.token,secret:m.secret})}).then(v=>v.ok?v.json():Promise.reject()).then(()=>{d.completePayment(ApplePaySession.STATUS_SUCCESS),a()}).catch(()=>{d.completePayment(ApplePaySession.STATUS_FAILURE),h()})},d.oncancel=s,d.begin()})}renderForm({selector:e,intentId:t}){return w(!e,"selector is required for renderForm"),w(!t,"intentId is required for renderForm"),this.sdkEmbed.render({selector:e,intentId:t})}setLocale(e){K(!!e&&!M.has(e),`Invalid locale. Supported languages (${[...M].join(" | ")})`);const t=M.has(e)?e:"en";return this.sdkEmbed.setLocale(t)}removeEventListeners(){return this.sdkEmbed.abortService()}updateIntentDiscount({intentId:e,discount:t}){return w(!t.title.en,"English discount title is required!"),this.sdkApiHandler.request({api:"sdk:updateIntentDiscount",payload:{intentId:e,discount:t,lang:this.sdkEmbed.lang}})}updateIntentFees({intentId:e,fees:t}){return t.forEach(r=>{w(!r.title.en,"English fee title is required!")}),this.sdkApiHandler.request({api:"sdk:updateIntentFees",payload:{intentId:e,fees:t,lang:this.sdkEmbed.lang}})}elements({styles:e,classes:t,fontSourceCss:r}){const i=[],s={},h=new Map;let a=!1;return A(this,W,me).call(this,i),{create:({elementType:n,elementOptions:u})=>{var N,Q;const d=new Map;let c=null,m;const g=L(L({},t),u.classes),v=((N=g==null?void 0:g.focus)==null?void 0:N.split(" "))||["MoneyHashElement--focus"],H=((Q=g==null?void 0:g.error)==null?void 0:Q.split(" "))||["MoneyHashElement--error"];return{mount:()=>{m=document.querySelector(u.selector),w(!m,`Couldn't find an element with selector ${u.selector}!`),m.classList.add("MoneyHashElement"),i.push(b=>{var X,Z,ee,te,ie,ne,se,re,ae;const{type:S,data:C}=b.data;if(S===`${n}@mount`&&(s[n]=C.isValid,(X=d.get(`${n}@mount`))==null||X()),S===`${n}@focus`){m.classList.add(...v),(Z=d.get(`${n}@focus`))==null||Z();return}if(S===`${n}@blur`){m.classList.remove(...v),(ee=d.get(`${n}@blur`))==null||ee();return}if(S===`${n}@error`){C.isValid?m.classList.remove(...H):m.classList.add(...H),(te=d.get(`${n}@error`))==null||te(C);return}if(S===`${n}@changeInput`){if((ie=d.get(`${n}@changeInput`))==null||ie({isValid:C.isValid,length:C.length}),s[n]=C.isValid,h.get("validityChange")){const T=Object.values(s).every(Boolean);T!==a&&((ne=h.get("validityChange"))==null||ne(T),a=T)}return}if(S===`${n}@cardNumberChange`){(se=d.get(`${n}@cardNumberChange`))==null||se(C);return}if(S===`${n}@key:Backspace`){(re=d.get(`${n}@key:Backspace`))==null||re();return}S===`${n}@key:Enter`&&((ae=d.get(`${n}@key:Enter`))==null||ae())}),c=A(this,B,pe).call(this,{container:m,elementType:n,elementOptions:u,styles:L(L({},e),u.styles),fontSourceCss:r}),this.mountedCardElements.push(n)},on:(b,S)=>{d.set(`${n}@${b}`,S)},off:b=>d.delete(`${n}@${b}`),focus:()=>{var b;(b=c==null?void 0:c.contentWindow)==null||b.postMessage({type:"focus"},U())},blur:()=>{var b;(b=c==null?void 0:c.contentWindow)==null||b.postMessage({type:"blur"},U())},clear:()=>{var b;(b=c==null?void 0:c.contentWindow)==null||b.postMessage({type:"clear"},U())}}},on:(n,u)=>{h.set(n,u)}}}submitForm(h){return E(this,arguments,function*({intentId:e,accessToken:t,billingData:r,shippingData:i,saveCard:s}){const a=fe(this.mountedCardElements);w(!!a,`You must mount ${a} element!`);const n=new k;let u,d;t&&(this.vaultSubmitListener.current=m=>{const{type:g,data:v}=m.data;g==="vaultSubmit:success"&&n.resolve(v),g==="vaultSubmit:error"&&n.reject(v)},d=A(this,O,ge).call(this,{accessToken:t,saveCard:s}),u=yield n.promise);const c=yield this.sdkApiHandler.request({api:"sdk:submitNativeForm",payload:{intentId:e,paymentMethod:"CARD",lang:this.sdkEmbed.lang,billingData:r,shippingData:i,cardEmbed:u}});return d&&d.remove(),c})}submitCvv(r){return E(this,arguments,function*({intentId:e,cvv:t}){return this.sdkApiHandler.request({api:"sdk:submitCardCvv",payload:{intentId:e,cvv:t,lang:this.sdkEmbed.lang}})})}renderUrl(s){return E(this,arguments,function*({intentId:e,url:t,renderStrategy:r,options:i}){switch(r){case"IFRAME":return A(this,q,ce).call(this,{url:t,intentId:e});case"POPUP_IFRAME":return A(this,j,le).call(this,{url:t,intentId:e,options:i});case"REDIRECT":return A(this,D,he).call(this,{url:t,options:i});default:return null}})}onExpiration(e,t){if(!e)return K(!0,`No expiration date provided!, make sure to check for it before usage
(function(l,o){typeof exports=="object"&&typeof module!="undefined"?module.exports=o():typeof define=="function"&&define.amd?define(o):(l=typeof globalThis!="undefined"?globalThis:l||self,l.MoneyHash=o())})(this,function(){var q,ce,j,le,D,he,F,z,W,me,x,ue,B,pe,O,ge;"use strict";var Ee=Object.defineProperty,Pe=Object.defineProperties;var ke=Object.getOwnPropertyDescriptors;var oe=Object.getOwnPropertySymbols;var Se=Object.prototype.hasOwnProperty,Le=Object.prototype.propertyIsEnumerable;var Y=(l,o,p)=>o in l?Ee(l,o,{enumerable:!0,configurable:!0,writable:!0,value:p}):l[o]=p,L=(l,o)=>{for(var p in o||(o={}))Se.call(o,p)&&Y(l,p,o[p]);if(oe)for(var p of oe(o))Le.call(o,p)&&Y(l,p,o[p]);return l},de=(l,o)=>Pe(l,ke(o));var y=(l,o,p)=>(Y(l,typeof o!="symbol"?o+"":o,p),p),Ae=(l,o,p)=>{if(!o.has(l))throw TypeError("Cannot "+p)};var R=(l,o,p)=>{if(o.has(l))throw TypeError("Cannot add the same private member more than once");o instanceof WeakSet?o.add(l):o.set(l,p)};var A=(l,o,p)=>(Ae(l,o,"access private method"),p);var E=(l,o,p)=>new Promise((I,w)=>{var V=k=>{try{$(p.next(k))}catch(_){w(_)}},M=k=>{try{$(p.throw(k))}catch(_){w(_)}},$=k=>k.done?I(k.value):Promise.resolve(k.value).then(V,M);$((p=p.apply(l,o)).next())});class l{constructor(e){y(this,"target");y(this,"targetOrigin");y(this,"listeners");y(this,"onIncomingMessageBind",this.onIncomingMessage.bind(this));this.target=e.target,this.targetOrigin=e.targetOrigin,this.listeners=[],window.addEventListener("message",this.onIncomingMessageBind)}send(e){this.target.postMessage(e,this.targetOrigin)}onReceive(e){this.listeners.push(e)}removeListener(e){this.listeners=this.listeners.filter(t=>t!==e)}onIncomingMessage(e){e.origin===this.targetOrigin&&this.listeners.forEach(t=>{t(e,this.send.bind(this))})}abortService(){window.removeEventListener("message",this.onIncomingMessageBind)}}function o(){var e;return(e=window.MONEYHASH_IFRAME_URL)!=null?e:"https://embed.moneyhash.io"}function p(){return typeof window!="undefined"}const P=class{constructor(){p()&&this.initSDKCommunicationIframe()}initSDKCommunicationIframe(){if(document.getElementById("moneyhash-headless-sdk"))return;const e=o(),t=new URL(`${e}/embed/headless-sdk`);t.searchParams.set("sdk","true"),t.searchParams.set("parent",window.location.origin),t.searchParams.set("version","js@1.5.2-beta.2");const r=document.createElement("iframe");r.id="moneyhash-headless-sdk",r.src=t.toString(),r.hidden=!0,document.body.appendChild(r),P.messagingService=new l({target:r.contentWindow,targetOrigin:e}),P.isCommunicationReady=new Promise(i=>{var h;const s=a=>{var n;a.data.type==="headlessSDK:init"&&(i(),(n=P.messagingService)==null||n.removeListener(s))};(h=P.messagingService)==null||h.onReceive(s)})}request(r){return E(this,arguments,function*({api:e,payload:t}){return yield P.isCommunicationReady,new Promise((i,s)=>{var a,n;(a=P.messagingService)==null||a.send({type:e,data:t});const h=u=>{var m;const{type:d,data:c}=u.data;d===e&&(c.status==="resolved"?i(c.payload):s(c.payload),(m=P.messagingService)==null||m.removeListener(h))};(n=P.messagingService)==null||n.onReceive(h)})})}postMessage(e){var t;(t=P.messagingService)==null||t.send({type:e})}};let I=P;y(I,"messagingService",null),y(I,"isCommunicationReady");function w(f,e){if(f)throw new Error(e)}const V=new Set(["payment","payout"]),M=new Set(["en","fr","ar"]);class ${constructor(e){y(this,"options");y(this,"messagingService",null);y(this,"iframe",null);y(this,"isCommunicationReady",null);w(!V.has(e.type),`MoneyHash constructor must be called with valid type (${[...V].join(" | ")})!`),this.options=e}get lang(){var t;return((t=this.options.locale)==null?void 0:t.split("-")[0])||"en"}render({selector:e,intentId:t}){var a,n;(a=this.messagingService)==null||a.abortService();const r=o(),i=new URL(`${r}/embed/${this.options.type}/${t}`);i.searchParams.set("sdk","true"),i.searchParams.set("parent",window.location.origin),i.searchParams.set("version","js@1.5.2-beta.2");const s=(n=this.options.locale)==null?void 0:n.split("-")[0];s&&i.searchParams.set("lang",s),this.iframe=document.createElement("iframe"),this.iframe.src=i.toString(),this.iframe.style.height="100%",this.iframe.style.width="100%",this.iframe.style.border="0";const h=document.querySelector(e);return w(!h,`Couldn't find an element with selector ${e}!`),h.replaceChildren(this.iframe),this.messagingService=new l({target:this.iframe.contentWindow,targetOrigin:r}),this.isCommunicationReady=new Promise(u=>{var c;const d=m=>{var g;m.data.type==="sdk:init"&&(u(),(g=this.messagingService)==null||g.removeListener(d))};(c=this.messagingService)==null||c.onReceive(d)}),this.messagingService.onReceive((u,d)=>{var g,v,H,N;const{type:c,data:m}=u.data;switch(c){case"sdk:init":{d({type:"sdk:init",data:{headless:Boolean(this.options.headless),styles:this.options.styles}});break}case"onComplete":{(v=(g=this.options).onComplete)==null||v.call(g,L({type:this.options.type},m)),this.options.headless&&this.iframe&&(this.iframe.hidden=!0);break}case"onFail":{(N=(H=this.options).onFail)==null||N.call(H,L({type:this.options.type},m)),this.options.headless&&this.iframe&&(this.iframe.hidden=!0);break}}}),this.isCommunicationReady}setLocale(e){return E(this,null,function*(){var t;yield this==null?void 0:this.isCommunicationReady,this.options.locale=e,(t=this.messagingService)==null||t.send({type:"changeLanguage",data:{locale:e}})})}abortService(){return E(this,null,function*(){var e;yield this==null?void 0:this.isCommunicationReady,(e=this.messagingService)==null||e.abortService()})}}class k{constructor(){y(this,"promise");y(this,"resolve");y(this,"reject");this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}}function _(){var e;return(e=window.MONEYHASH_VAULT_API_URL)!=null?e:"https://vault.moneyhash.io"}function U(){var e;return(e=window.MONEYHASH_VAULT_INPUT_IFRAME_URL)!=null?e:"https://vault-form.moneyhash.io"}function J(){var e;return(e=window.API_URL)!=null?e:"https://web.moneyhash.io"}function fe(f){const e=["cardNumber","cardCvv","cardExpiryMonth","cardExpiryYear"];for(const t of e)if(!f.includes(t))return t;return null}function ye(f){return(Array.isArray(f)?f.length:Object.keys(f).length)===0}function ve(f,e){return new Promise((t,r)=>{if(document.getElementById(e)){t(void 0);return}const s=document.createElement("script");s.src=f,s.id=e,s.addEventListener("load",()=>{t(void 0)}),s.addEventListener("error",()=>{r(new Error("Script failed to load"))}),document.body.appendChild(s)})}function we(f){return new Promise(e=>{setTimeout(()=>{e("done")},f*1e3)})}function K(f,e){f&&console.warn(e)}const G=new Set(["method","customerBalance","savedCard"]);class be{constructor(e){R(this,q);R(this,j);R(this,D);R(this,F);R(this,W);R(this,x);R(this,B);R(this,O);y(this,"options");y(this,"sdkApiHandler",new I);y(this,"sdkEmbed");y(this,"vaultSubmitListener",{current:null});y(this,"mountedCardElements",[]);this.options=e,this.sdkEmbed=new $(de(L({},e),{headless:!0})),A(this,x,ue).call(this,this.vaultSubmitListener)}getIntentDetails(e){return this.sdkApiHandler.request({api:"sdk:getIntentDetails",payload:{intentType:this.options.type,intentId:e,lang:this.sdkEmbed.lang}})}getIntentMethods(e){return this.sdkApiHandler.request({api:"sdk:getIntentMethods",payload:{intentType:this.options.type,intentId:e,lang:this.sdkEmbed.lang}})}proceedWith({intentId:e,type:t,id:r,metaData:i}){return w(!G.has(t),`type must be a valid one (${[...G].join(" | ")})`),this.sdkApiHandler.request({api:"sdk:proceedWith",payload:{proceedWith:t,intentType:this.options.type,intentId:e,id:r,lang:this.sdkEmbed.lang,metaData:i}})}resetSelectedMethod(e){return this.sdkApiHandler.request({api:"sdk:resetSelectedMethod",payload:{intentType:this.options.type,intentId:e,lang:this.sdkEmbed.lang}})}deleteCard({cardId:e,intentSecret:t}){return w(this.options.type==="payout","deleteCard is allowed only for payment intent!"),this.sdkApiHandler.request({api:"sdk:deleteCard",payload:{cardId:e,intentSecret:t,lang:this.sdkEmbed.lang}})}payWithApplePay(u){return E(this,arguments,function*({intentId:e,currency:t,amount:r,countryCode:i,onCancel:s=()=>{},onError:h,onComplete:a,billingData:n={}}){if(yield ve("https://applepay.cdn-apple.com/jsapi/v1/apple-pay-sdk.js","moneyHash-apple-pay-sdk"),!ApplePaySession)return;const d=new ApplePaySession(3,{countryCode:i,currencyCode:t,supportedNetworks:["visa","masterCard","amex","discover","mada"],merchantCapabilities:["supports3DS"],total:{label:"Apple Pay",type:"final",amount:`${r}`}}),{state:c,intent:m}=yield this.proceedWith({intentId:e,type:"method",id:"APPLE_PAY"});try{if(c==="INTENT_FORM"){if(ye(n))throw new Error("Billing data is missing while calling payWithApplePay");yield this.sdkApiHandler.request({api:"sdk:submitNativeForm",payload:{intentId:e,paymentMethod:"APPLE_PAY",lang:this.sdkEmbed.lang,billingData:n}})}}catch(g){throw yield this.resetSelectedMethod(e),g}d.onvalidatemerchant=g=>{fetch(`${J()}/api/v1/providers/applepay/session/`,{method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify({secret:m.secret,validation_url:g.validationURL})}).then(v=>v.ok?v.json():Promise.reject()).then(v=>d.completeMerchantValidation(v)).catch(h)},d.onpaymentauthorized=g=>{fetch(`${J()}/api/v1/providers/applepay/token/`,{method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify({token_data:g.payment.token,secret:m.secret})}).then(v=>v.ok?v.json():Promise.reject()).then(()=>{d.completePayment(ApplePaySession.STATUS_SUCCESS),a()}).catch(()=>{d.completePayment(ApplePaySession.STATUS_FAILURE),h()})},d.oncancel=s,d.begin()})}renderForm({selector:e,intentId:t}){return w(!e,"selector is required for renderForm"),w(!t,"intentId is required for renderForm"),this.sdkEmbed.render({selector:e,intentId:t})}setLocale(e){K(!!e&&!M.has(e),`Invalid locale. Supported languages (${[...M].join(" | ")})`);const t=M.has(e)?e:"en";return this.sdkEmbed.setLocale(t)}removeEventListeners(){return this.sdkEmbed.abortService()}updateIntentDiscount({intentId:e,discount:t}){return w(!t.title.en,"English discount title is required!"),this.sdkApiHandler.request({api:"sdk:updateIntentDiscount",payload:{intentId:e,discount:t,lang:this.sdkEmbed.lang}})}updateIntentFees({intentId:e,fees:t}){return t.forEach(r=>{w(!r.title.en,"English fee title is required!")}),this.sdkApiHandler.request({api:"sdk:updateIntentFees",payload:{intentId:e,fees:t,lang:this.sdkEmbed.lang}})}elements({styles:e,classes:t,fontSourceCss:r}){const i=[],s={},h=new Map;let a=!1;return A(this,W,me).call(this,i),{create:({elementType:n,elementOptions:u})=>{var N,Q;const d=new Map;let c=null,m;const g=L(L({},t),u.classes),v=((N=g==null?void 0:g.focus)==null?void 0:N.split(" "))||["MoneyHashElement--focus"],H=((Q=g==null?void 0:g.error)==null?void 0:Q.split(" "))||["MoneyHashElement--error"];return{mount:()=>{m=document.querySelector(u.selector),w(!m,`Couldn't find an element with selector ${u.selector}!`),m.classList.add("MoneyHashElement"),i.push(b=>{var X,Z,ee,te,ie,ne,se,re,ae;const{type:S,data:C}=b.data;if(S===`${n}@mount`&&(s[n]=C.isValid,(X=d.get(`${n}@mount`))==null||X()),S===`${n}@focus`){m.classList.add(...v),(Z=d.get(`${n}@focus`))==null||Z();return}if(S===`${n}@blur`){m.classList.remove(...v),(ee=d.get(`${n}@blur`))==null||ee();return}if(S===`${n}@error`){C.isValid?m.classList.remove(...H):m.classList.add(...H),(te=d.get(`${n}@error`))==null||te(C);return}if(S===`${n}@changeInput`){if((ie=d.get(`${n}@changeInput`))==null||ie({isValid:C.isValid,length:C.length}),s[n]=C.isValid,h.get("validityChange")){const T=Object.values(s).every(Boolean);T!==a&&((ne=h.get("validityChange"))==null||ne(T),a=T)}return}if(S===`${n}@cardNumberChange`){(se=d.get(`${n}@cardNumberChange`))==null||se(C);return}if(S===`${n}@key:Backspace`){(re=d.get(`${n}@key:Backspace`))==null||re();return}S===`${n}@key:Enter`&&((ae=d.get(`${n}@key:Enter`))==null||ae())}),c=A(this,B,pe).call(this,{container:m,elementType:n,elementOptions:u,styles:L(L({},e),u.styles),fontSourceCss:r}),this.mountedCardElements.push(n)},on:(b,S)=>{d.set(`${n}@${b}`,S)},off:b=>d.delete(`${n}@${b}`),focus:()=>{var b;(b=c==null?void 0:c.contentWindow)==null||b.postMessage({type:"focus"},U())},blur:()=>{var b;(b=c==null?void 0:c.contentWindow)==null||b.postMessage({type:"blur"},U())},clear:()=>{var b;(b=c==null?void 0:c.contentWindow)==null||b.postMessage({type:"clear"},U())}}},on:(n,u)=>{h.set(n,u)}}}submitForm(h){return E(this,arguments,function*({intentId:e,accessToken:t,billingData:r,shippingData:i,saveCard:s}){const a=fe(this.mountedCardElements);w(!!a,`You must mount ${a} element!`);const n=new k;let u,d;t&&(this.vaultSubmitListener.current=m=>{const{type:g,data:v}=m.data;g==="vaultSubmit:success"&&n.resolve(v),g==="vaultSubmit:error"&&n.reject(v)},d=A(this,O,ge).call(this,{accessToken:t,saveCard:s}),u=yield n.promise);const c=yield this.sdkApiHandler.request({api:"sdk:submitNativeForm",payload:{intentId:e,paymentMethod:"CARD",lang:this.sdkEmbed.lang,billingData:r,shippingData:i,cardEmbed:u}});return d&&d.remove(),c})}submitCvv(r){return E(this,arguments,function*({intentId:e,cvv:t}){return this.sdkApiHandler.request({api:"sdk:submitCardCvv",payload:{intentId:e,cvv:t,lang:this.sdkEmbed.lang}})})}renderUrl(s){return E(this,arguments,function*({intentId:e,url:t,renderStrategy:r,options:i}){switch(r){case"IFRAME":return A(this,q,ce).call(this,{url:t,intentId:e});case"POPUP_IFRAME":return A(this,j,le).call(this,{url:t,intentId:e,options:i});case"REDIRECT":return A(this,D,he).call(this,{url:t,options:i});default:return null}})}onExpiration(e,t){if(!e)return K(!0,`No expiration date provided!, make sure to check for it before usage

@@ -3,0 +3,0 @@ if (intentDetails.intent.expirationDate) {

@@ -1,1 +0,1 @@

"use strict";var n=Object.defineProperty;var d=(t,e,s)=>e in t?n(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s;var a=(t,e,s)=>(d(t,typeof e!="symbol"?e+"":e,s),s);const r=require("./warnIf-604ca43b.cjs");class o{constructor(e){a(this,"options");a(this,"sdkEmbed");this.options=e,this.sdkEmbed=new r.SDKEmbed(e)}start({selector:e,intentId:s}){return r.throwIf(!e,"selector is required for start"),r.throwIf(!s,"intentId is required for start"),this.sdkEmbed.render({selector:e,intentId:s})}setLocale(e){r.warnIf(!!e&&!r.supportedLanguages.has(e),`Invalid locale. Supported languages (${[...r.supportedLanguages].join(" | ")})`);const s=r.supportedLanguages.has(e)?e:"en";return this.sdkEmbed.setLocale(s)}removeEventListeners(){return this.sdkEmbed.abortService()}}module.exports=o;
"use strict";var n=Object.defineProperty;var d=(t,e,s)=>e in t?n(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s;var a=(t,e,s)=>(d(t,typeof e!="symbol"?e+"":e,s),s);const r=require("./warnIf-cc60367b.cjs");class o{constructor(e){a(this,"options");a(this,"sdkEmbed");this.options=e,this.sdkEmbed=new r.SDKEmbed(e)}start({selector:e,intentId:s}){return r.throwIf(!e,"selector is required for start"),r.throwIf(!s,"intentId is required for start"),this.sdkEmbed.render({selector:e,intentId:s})}setLocale(e){r.warnIf(!!e&&!r.supportedLanguages.has(e),`Invalid locale. Supported languages (${[...r.supportedLanguages].join(" | ")})`);const s=r.supportedLanguages.has(e)?e:"en";return this.sdkEmbed.setLocale(s)}removeEventListeners(){return this.sdkEmbed.abortService()}}module.exports=o;

@@ -113,5 +113,3 @@ export declare interface AbstractIntent {

create: (elementProps: ElementProps) => Element_2;
on: (event: FormEvents, callback: (data: {
isValid: boolean;
}) => void) => void;
on: (event: FormEvents, callback: (isValid: boolean) => void) => void;
};

@@ -118,0 +116,0 @@

var o = Object.defineProperty;
var n = (r, s, e) => s in r ? o(r, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[s] = e;
var t = (r, s, e) => (n(r, typeof s != "symbol" ? s + "" : s, e), e);
import { S as i, t as d, w as u, s as a } from "./warnIf-f9a95079.js";
import { S as i, t as d, w as u, s as a } from "./warnIf-94e30d35.js";
class b {

@@ -6,0 +6,0 @@ constructor(s) {

@@ -1,1 +0,1 @@

(function(i,s){typeof exports=="object"&&typeof module!="undefined"?module.exports=s():typeof define=="function"&&define.amd?define(s):(i=typeof globalThis!="undefined"?globalThis:i||self,i.MoneyHash=s())})(this,function(){"use strict";var F=Object.defineProperty;var O=Object.getOwnPropertySymbols;var U=Object.prototype.hasOwnProperty,$=Object.prototype.propertyIsEnumerable;var v=(i,s,t)=>s in i?F(i,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[s]=t,w=(i,s)=>{for(var t in s||(s={}))U.call(s,t)&&v(i,t,s[t]);if(O)for(var t of O(s))$.call(s,t)&&v(i,t,s[t]);return i};var a=(i,s,t)=>(v(i,typeof s!="symbol"?s+"":s,t),t);var b=(i,s,t)=>new Promise((g,o)=>{var p=r=>{try{h(t.next(r))}catch(e){o(e)}},f=r=>{try{h(t.throw(r))}catch(e){o(e)}},h=r=>r.done?g(r.value):Promise.resolve(r.value).then(p,f);h((t=t.apply(i,s)).next())});class i{constructor(e){a(this,"target");a(this,"targetOrigin");a(this,"listeners");a(this,"onIncomingMessageBind",this.onIncomingMessage.bind(this));this.target=e.target,this.targetOrigin=e.targetOrigin,this.listeners=[],window.addEventListener("message",this.onIncomingMessageBind)}send(e){this.target.postMessage(e,this.targetOrigin)}onReceive(e){this.listeners.push(e)}removeListener(e){this.listeners=this.listeners.filter(n=>n!==e)}onIncomingMessage(e){e.origin===this.targetOrigin&&this.listeners.forEach(n=>{n(e,this.send.bind(this))})}abortService(){window.removeEventListener("message",this.onIncomingMessageBind)}}function s(){var e;return(e=window.MONEYHASH_IFRAME_URL)!=null?e:"https://embed.moneyhash.io"}function t(r,e){if(r)throw new Error(e)}const g=new Set(["payment","payout"]),o=new Set(["en","fr","ar"]);class p{constructor(e){a(this,"options");a(this,"messagingService",null);a(this,"iframe",null);a(this,"isCommunicationReady",null);t(!g.has(e.type),`MoneyHash constructor must be called with valid type (${[...g].join(" | ")})!`),this.options=e}get lang(){var n;return((n=this.options.locale)==null?void 0:n.split("-")[0])||"en"}render({selector:e,intentId:n}){var L,M;(L=this.messagingService)==null||L.abortService();const S=s(),c=new URL(`${S}/embed/${this.options.type}/${n}`);c.searchParams.set("sdk","true"),c.searchParams.set("parent",window.location.origin),c.searchParams.set("version","js@1.5.2-beta.1");const R=(M=this.options.locale)==null?void 0:M.split("-")[0];R&&c.searchParams.set("lang",R),this.iframe=document.createElement("iframe"),this.iframe.src=c.toString(),this.iframe.style.height="100%",this.iframe.style.width="100%",this.iframe.style.border="0";const E=document.querySelector(e);return t(!E,`Couldn't find an element with selector ${e}!`),E.replaceChildren(this.iframe),this.messagingService=new i({target:this.iframe.contentWindow,targetOrigin:S}),this.isCommunicationReady=new Promise(y=>{var l;const m=u=>{var d;u.data.type==="sdk:init"&&(y(),(d=this.messagingService)==null||d.removeListener(m))};(l=this.messagingService)==null||l.onReceive(m)}),this.messagingService.onReceive((y,m)=>{var d,I,k,C;const{type:l,data:u}=y.data;switch(l){case"sdk:init":{m({type:"sdk:init",data:{headless:Boolean(this.options.headless),styles:this.options.styles}});break}case"onComplete":{(I=(d=this.options).onComplete)==null||I.call(d,w({type:this.options.type},u)),this.options.headless&&this.iframe&&(this.iframe.hidden=!0);break}case"onFail":{(C=(k=this.options).onFail)==null||C.call(k,w({type:this.options.type},u)),this.options.headless&&this.iframe&&(this.iframe.hidden=!0);break}}}),this.isCommunicationReady}setLocale(e){return b(this,null,function*(){var n;yield this==null?void 0:this.isCommunicationReady,this.options.locale=e,(n=this.messagingService)==null||n.send({type:"changeLanguage",data:{locale:e}})})}abortService(){return b(this,null,function*(){var e;yield this==null?void 0:this.isCommunicationReady,(e=this.messagingService)==null||e.abortService()})}}function f(r,e){r&&console.warn(e)}class h{constructor(e){a(this,"options");a(this,"sdkEmbed");this.options=e,this.sdkEmbed=new p(e)}start({selector:e,intentId:n}){return t(!e,"selector is required for start"),t(!n,"intentId is required for start"),this.sdkEmbed.render({selector:e,intentId:n})}setLocale(e){f(!!e&&!o.has(e),`Invalid locale. Supported languages (${[...o].join(" | ")})`);const n=o.has(e)?e:"en";return this.sdkEmbed.setLocale(n)}removeEventListeners(){return this.sdkEmbed.abortService()}}return h});
(function(i,s){typeof exports=="object"&&typeof module!="undefined"?module.exports=s():typeof define=="function"&&define.amd?define(s):(i=typeof globalThis!="undefined"?globalThis:i||self,i.MoneyHash=s())})(this,function(){"use strict";var F=Object.defineProperty;var O=Object.getOwnPropertySymbols;var U=Object.prototype.hasOwnProperty,$=Object.prototype.propertyIsEnumerable;var v=(i,s,t)=>s in i?F(i,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[s]=t,w=(i,s)=>{for(var t in s||(s={}))U.call(s,t)&&v(i,t,s[t]);if(O)for(var t of O(s))$.call(s,t)&&v(i,t,s[t]);return i};var a=(i,s,t)=>(v(i,typeof s!="symbol"?s+"":s,t),t);var b=(i,s,t)=>new Promise((g,o)=>{var p=r=>{try{h(t.next(r))}catch(e){o(e)}},f=r=>{try{h(t.throw(r))}catch(e){o(e)}},h=r=>r.done?g(r.value):Promise.resolve(r.value).then(p,f);h((t=t.apply(i,s)).next())});class i{constructor(e){a(this,"target");a(this,"targetOrigin");a(this,"listeners");a(this,"onIncomingMessageBind",this.onIncomingMessage.bind(this));this.target=e.target,this.targetOrigin=e.targetOrigin,this.listeners=[],window.addEventListener("message",this.onIncomingMessageBind)}send(e){this.target.postMessage(e,this.targetOrigin)}onReceive(e){this.listeners.push(e)}removeListener(e){this.listeners=this.listeners.filter(n=>n!==e)}onIncomingMessage(e){e.origin===this.targetOrigin&&this.listeners.forEach(n=>{n(e,this.send.bind(this))})}abortService(){window.removeEventListener("message",this.onIncomingMessageBind)}}function s(){var e;return(e=window.MONEYHASH_IFRAME_URL)!=null?e:"https://embed.moneyhash.io"}function t(r,e){if(r)throw new Error(e)}const g=new Set(["payment","payout"]),o=new Set(["en","fr","ar"]);class p{constructor(e){a(this,"options");a(this,"messagingService",null);a(this,"iframe",null);a(this,"isCommunicationReady",null);t(!g.has(e.type),`MoneyHash constructor must be called with valid type (${[...g].join(" | ")})!`),this.options=e}get lang(){var n;return((n=this.options.locale)==null?void 0:n.split("-")[0])||"en"}render({selector:e,intentId:n}){var L,M;(L=this.messagingService)==null||L.abortService();const S=s(),c=new URL(`${S}/embed/${this.options.type}/${n}`);c.searchParams.set("sdk","true"),c.searchParams.set("parent",window.location.origin),c.searchParams.set("version","js@1.5.2-beta.2");const R=(M=this.options.locale)==null?void 0:M.split("-")[0];R&&c.searchParams.set("lang",R),this.iframe=document.createElement("iframe"),this.iframe.src=c.toString(),this.iframe.style.height="100%",this.iframe.style.width="100%",this.iframe.style.border="0";const E=document.querySelector(e);return t(!E,`Couldn't find an element with selector ${e}!`),E.replaceChildren(this.iframe),this.messagingService=new i({target:this.iframe.contentWindow,targetOrigin:S}),this.isCommunicationReady=new Promise(y=>{var l;const m=u=>{var d;u.data.type==="sdk:init"&&(y(),(d=this.messagingService)==null||d.removeListener(m))};(l=this.messagingService)==null||l.onReceive(m)}),this.messagingService.onReceive((y,m)=>{var d,I,k,C;const{type:l,data:u}=y.data;switch(l){case"sdk:init":{m({type:"sdk:init",data:{headless:Boolean(this.options.headless),styles:this.options.styles}});break}case"onComplete":{(I=(d=this.options).onComplete)==null||I.call(d,w({type:this.options.type},u)),this.options.headless&&this.iframe&&(this.iframe.hidden=!0);break}case"onFail":{(C=(k=this.options).onFail)==null||C.call(k,w({type:this.options.type},u)),this.options.headless&&this.iframe&&(this.iframe.hidden=!0);break}}}),this.isCommunicationReady}setLocale(e){return b(this,null,function*(){var n;yield this==null?void 0:this.isCommunicationReady,this.options.locale=e,(n=this.messagingService)==null||n.send({type:"changeLanguage",data:{locale:e}})})}abortService(){return b(this,null,function*(){var e;yield this==null?void 0:this.isCommunicationReady,(e=this.messagingService)==null||e.abortService()})}}function f(r,e){r&&console.warn(e)}class h{constructor(e){a(this,"options");a(this,"sdkEmbed");this.options=e,this.sdkEmbed=new p(e)}start({selector:e,intentId:n}){return t(!e,"selector is required for start"),t(!n,"intentId is required for start"),this.sdkEmbed.render({selector:e,intentId:n})}setLocale(e){f(!!e&&!o.has(e),`Invalid locale. Supported languages (${[...o].join(" | ")})`);const n=o.has(e)?e:"en";return this.sdkEmbed.setLocale(n)}removeEventListeners(){return this.sdkEmbed.abortService()}}return h});
{
"name": "@moneyhash/js-sdk",
"version": "1.5.2-beta.1",
"version": "1.5.2-beta.2",
"description": "MoneyHash JavaScript SDK",

@@ -5,0 +5,0 @@ "type": "module",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc