@monei-js/components 2.1.1 → 2.1.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/index.cjs CHANGED
@@ -182,8 +182,8 @@ const validateComponentProps = ({ props }) => {
182
182
  };
183
183
  //#endregion
184
184
  //#region src/config.ts
185
- const stage = {}.env?.STAGE || "prod";
186
- const version = {}.env?.VERSION || "v1";
185
+ const stage = "prod";
186
+ const version = "v3";
187
187
  const sc = {
188
188
  local: {
189
189
  domain: "http://card-input.localhost:1355",
@@ -225,13 +225,13 @@ const sc = {
225
225
  rootDomain: "monei.com"
226
226
  },
227
227
  dev: {
228
- domain: {}.env?.DOMAIN || "https://js.monei-dev.com",
228
+ domain: "https://js.monei-dev.com",
229
229
  apiUrl: "https://api.monei-dev.com/v1",
230
230
  secureDomain: "https://secure.monei-dev.com",
231
231
  rootDomain: "monei-dev.com"
232
232
  },
233
233
  prod: {
234
- domain: {}.env?.DOMAIN || "https://js.monei.com",
234
+ domain: "https://js.monei.com",
235
235
  apiUrl: "https://api.monei.com/v1",
236
236
  secureDomain: "https://secure.monei.com",
237
237
  rootDomain: "monei.com"
@@ -862,12 +862,15 @@ function attachRenderMethods(instance, options) {
862
862
  throw err;
863
863
  }
864
864
  renderState.frame = frame;
865
+ const targetOrigin = new URL(options.url).origin;
865
866
  const sendInitialProps = () => {
866
- if (frame.contentWindow) frame.contentWindow.postMessage({
867
- type: BRIDGE_INIT_MSG,
868
- props: dataProps,
869
- functionNames
870
- }, new URL(options.url).origin);
867
+ try {
868
+ frame.contentWindow?.postMessage({
869
+ type: BRIDGE_INIT_MSG,
870
+ props: dataProps,
871
+ functionNames
872
+ }, targetOrigin);
873
+ } catch {}
871
874
  };
872
875
  try {
873
876
  if (containerNode) {
package/dist/index.js CHANGED
@@ -170,8 +170,8 @@ const validateComponentProps = ({ props }) => {
170
170
  };
171
171
  //#endregion
172
172
  //#region src/config.ts
173
- const stage = import.meta.env?.STAGE || "prod";
174
- const version = import.meta.env?.VERSION || "v1";
173
+ const stage = "prod";
174
+ const version = "v3";
175
175
  const sc = {
176
176
  local: {
177
177
  domain: "http://card-input.localhost:1355",
@@ -213,13 +213,13 @@ const sc = {
213
213
  rootDomain: "monei.com"
214
214
  },
215
215
  dev: {
216
- domain: import.meta.env?.DOMAIN || "https://js.monei-dev.com",
216
+ domain: "https://js.monei-dev.com",
217
217
  apiUrl: "https://api.monei-dev.com/v1",
218
218
  secureDomain: "https://secure.monei-dev.com",
219
219
  rootDomain: "monei-dev.com"
220
220
  },
221
221
  prod: {
222
- domain: import.meta.env?.DOMAIN || "https://js.monei.com",
222
+ domain: "https://js.monei.com",
223
223
  apiUrl: "https://api.monei.com/v1",
224
224
  secureDomain: "https://secure.monei.com",
225
225
  rootDomain: "monei.com"
@@ -850,12 +850,15 @@ function attachRenderMethods(instance, options) {
850
850
  throw err;
851
851
  }
852
852
  renderState.frame = frame;
853
+ const targetOrigin = new URL(options.url).origin;
853
854
  const sendInitialProps = () => {
854
- if (frame.contentWindow) frame.contentWindow.postMessage({
855
- type: BRIDGE_INIT_MSG,
856
- props: dataProps,
857
- functionNames
858
- }, new URL(options.url).origin);
855
+ try {
856
+ frame.contentWindow?.postMessage({
857
+ type: BRIDGE_INIT_MSG,
858
+ props: dataProps,
859
+ functionNames
860
+ }, targetOrigin);
861
+ } catch {}
859
862
  };
860
863
  try {
861
864
  if (containerNode) {
@@ -1,14 +1,14 @@
1
- (function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports):typeof define==`function`&&define.amd?define([`exports`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.monei={}))})(this,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=Object.defineProperty,n=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r};let r=2592e5,i=`thumbmark`,a=`https://api.thumbmarkjs.com`,o={exclude:[],include:[],stabilize:[`private`,`iframe`],logging:!0,timeout:5e3,cache_api_call:!0,cache_lifetime_in_ms:0,performance:!1,experimental:!1,property_name_factory:e=>`${i}_${e}`};({...o});let s={private:[{exclude:[`canvas`],browsers:[`firefox`,`safari>=17`,`brave`]},{exclude:[`audio`],browsers:[`samsungbrowser`,`safari`]},{exclude:[`fonts`],browsers:[`firefox`]},{exclude:[`audio.sampleHash`,`hardware.deviceMemory`,`header.acceptLanguage.q`,`system.hardwareConcurrency`,`plugins`],browsers:[`brave`]},{exclude:[`tls.extensions`],browsers:[`firefox`,`chrome`,`safari`]},{exclude:[`header.acceptLanguage`],browsers:[`edge`,`chrome`]}],iframe:[{exclude:[`system.applePayVersion`,`system.cookieEnabled`],browsers:[`safari`]},{exclude:[`permissions`]}],vpn:[{exclude:[`ip`]}],always:[{exclude:[`speech`],browsers:[`brave`,`firefox`]}]},c=typeof window<`u`?window.OfflineAudioContext||window.webkitOfflineAudioContext:null;function l(e){let t=0;for(let n=0;n<e.length;++n)t+=Math.abs(e[n]);return t}function u(e,t,n){let r=[];for(let t=0;t<e[0].data.length;t++){let n=[];for(let r=0;r<e.length;r++)n.push(e[r].data[t]);r.push(d(n))}let i=new Uint8ClampedArray(r);return new ImageData(i,t,n)}function d(e){if(e.length===0)return 0;let t={};for(let n of e)t[n]=(t[n]||0)+1;let n=e[0];for(let e in t)t[e]>t[n]&&(n=parseInt(e,10));return n}function f(e){return e^=e>>>16,e=Math.imul(e,2246822507),e^=e>>>13,e=Math.imul(e,3266489909),(e^=e>>>16)>>>0}let p=new Uint32Array([597399067,2869860233,951274213,2716044179]);function m(e,t){return e<<t|e>>>32-t}function h(e,t=0){if(t=t?0|t:0,typeof e==`string`&&(e=function(e){if(typeof TextEncoder<`u`)return new TextEncoder().encode(e).buffer;let t=[];for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);r<128?t.push(r):r<2048?t.push(192|r>>6,128|63&r):r<55296||r>=57344?t.push(224|r>>12,128|r>>6&63,128|63&r):(n++,r=65536+((1023&r)<<10|1023&e.charCodeAt(n)),t.push(240|r>>18,128|r>>12&63,128|r>>6&63,128|63&r))}return new Uint8Array(t).buffer}(e)),!(e instanceof ArrayBuffer))throw TypeError(`Expected key to be ArrayBuffer or string`);let n=new Uint32Array([t,t,t,t]);(function(e,t){let n=e.byteLength/16|0,r=new Uint32Array(e,0,4*n);for(let e=0;e<n;e++){let n=r.subarray(4*e,4*(e+1));n[0]=Math.imul(n[0],p[0]),n[0]=m(n[0],15),n[0]=Math.imul(n[0],p[1]),t[0]^=n[0],t[0]=m(t[0],19),t[0]+=t[1],t[0]=Math.imul(t[0],5)+1444728091,n[1]=Math.imul(n[1],p[1]),n[1]=m(n[1],16),n[1]=Math.imul(n[1],p[2]),t[1]^=n[1],t[1]=m(t[1],17),t[1]+=t[2],t[1]=Math.imul(t[1],5)+197830471,n[2]=Math.imul(n[2],p[2]),n[2]=m(n[2],17),n[2]=Math.imul(n[2],p[3]),t[2]^=n[2],t[2]=m(t[2],15),t[2]+=t[3],t[2]=Math.imul(t[2],5)+2530024501,n[3]=Math.imul(n[3],p[3]),n[3]=m(n[3],18),n[3]=Math.imul(n[3],p[0]),t[3]^=n[3],t[3]=m(t[3],13),t[3]+=t[0],t[3]=Math.imul(t[3],5)+850148119}})(e,n),function(e,t){let n=e.byteLength/16|0,r=e.byteLength%16,i=new Uint32Array(4),a=new Uint8Array(e,16*n,r);switch(r){case 15:i[3]^=a[14]<<16;case 14:i[3]^=a[13]<<8;case 13:i[3]^=a[12],i[3]=Math.imul(i[3],p[3]),i[3]=m(i[3],18),i[3]=Math.imul(i[3],p[0]),t[3]^=i[3];case 12:i[2]^=a[11]<<24;case 11:i[2]^=a[10]<<16;case 10:i[2]^=a[9]<<8;case 9:i[2]^=a[8],i[2]=Math.imul(i[2],p[2]),i[2]=m(i[2],17),i[2]=Math.imul(i[2],p[3]),t[2]^=i[2];case 8:i[1]^=a[7]<<24;case 7:i[1]^=a[6]<<16;case 6:i[1]^=a[5]<<8;case 5:i[1]^=a[4],i[1]=Math.imul(i[1],p[1]),i[1]=m(i[1],16),i[1]=Math.imul(i[1],p[2]),t[1]^=i[1];case 4:i[0]^=a[3]<<24;case 3:i[0]^=a[2]<<16;case 2:i[0]^=a[1]<<8;case 1:i[0]^=a[0],i[0]=Math.imul(i[0],p[0]),i[0]=m(i[0],15),i[0]=Math.imul(i[0],p[1]),t[0]^=i[0]}}(e,n),function(e,t){t[0]^=e.byteLength,t[1]^=e.byteLength,t[2]^=e.byteLength,t[3]^=e.byteLength,t[0]=t[0]+t[1]|0,t[0]=t[0]+t[2]|0,t[0]=t[0]+t[3]|0,t[1]=t[1]+t[0]|0,t[2]=t[2]+t[0]|0,t[3]=t[3]+t[0]|0,t[0]=f(t[0]),t[1]=f(t[1]),t[2]=f(t[2]),t[3]=f(t[3]),t[0]=t[0]+t[1]|0,t[0]=t[0]+t[2]|0,t[0]=t[0]+t[3]|0,t[1]=t[1]+t[0]|0,t[2]=t[2]+t[0]|0,t[3]=t[3]+t[0]|0}(e,n);let r=new Uint8Array(n.buffer);return Array.from(r).map((e=>e.toString(16).padStart(2,`0`))).join(``)}async function g(e){for(;!document.body;)await _(50);let t=document.createElement(`iframe`);t.setAttribute(`frameBorder`,`0`);let n=t.style;n.setProperty(`position`,`fixed`),n.setProperty(`display`,`block`,`important`),n.setProperty(`visibility`,`visible`),n.setProperty(`border`,`0`),n.setProperty(`opacity`,`0`),t.src=`about:blank`,document.body.appendChild(t);let r=t.contentDocument||t.contentWindow?.document;if(!r)throw Error(`Iframe document is not accessible`);e({iframe:r}),setTimeout((()=>{document.body.removeChild(t)}),0)}function _(e,t){return new Promise((n=>setTimeout(n,e,t)))}let ee=`Arial.Arial Black.Arial Narrow.Arial Rounded MT.Arimo.Archivo.Barlow.Bebas Neue.Bitter.Bookman.Calibri.Cabin.Candara.Century.Century Gothic.Comic Sans MS.Constantia.Courier.Courier New.Crimson Text.DM Mono.DM Sans.DM Serif Display.DM Serif Text.Dosis.Droid Sans.Exo.Fira Code.Fira Sans.Franklin Gothic Medium.Garamond.Geneva.Georgia.Gill Sans.Helvetica.Impact.Inconsolata.Indie Flower.Inter.Josefin Sans.Karla.Lato.Lexend.Lucida Bright.Lucida Console.Lucida Sans Unicode.Manrope.Merriweather.Merriweather Sans.Montserrat.Myriad.Noto Sans.Nunito.Nunito Sans.Open Sans.Optima.Orbitron.Oswald.Pacifico.Palatino.Perpetua.PT Sans.PT Serif.Poppins.Prompt.Public Sans.Quicksand.Rajdhani.Recursive.Roboto.Roboto Condensed.Rockwell.Rubik.Segoe Print.Segoe Script.Segoe UI.Sora.Source Sans Pro.Space Mono.Tahoma.Taviraj.Times.Times New Roman.Titillium Web.Trebuchet MS.Ubuntu.Varela Round.Verdana.Work Sans`.split(`.`),v=[`monospace`,`sans-serif`,`serif`];function y(e,t){return e.font=`72px ${t}`,e.measureText(`WwMmLli0Oo`).width}function te(){let e=document.createElement(`canvas`),t=e.getContext(`webgl`)??e.getContext(`experimental-webgl`);if(t&&`getParameter`in t)try{let e=(t.getParameter(t.VENDOR)||``).toString(),n=(t.getParameter(t.RENDERER)||``).toString(),r={vendor:e,renderer:n,version:(t.getParameter(t.VERSION)||``).toString(),shadingLanguageVersion:(t.getParameter(t.SHADING_LANGUAGE_VERSION)||``).toString()};if(!n.length||!e.length){let e=t.getExtension(`WEBGL_debug_renderer_info`);if(e){let n=(t.getParameter(e.UNMASKED_VENDOR_WEBGL)||``).toString(),i=(t.getParameter(e.UNMASKED_RENDERER_WEBGL)||``).toString();n&&(r.vendorUnmasked=n),i&&(r.rendererUnmasked=i)}}return r}catch{}return`undefined`}function ne(){let e=new Float32Array(1),t=new Uint8Array(e.buffer);return e[0]=1/0,e[0]-=e[0],t[3]}let b=(e,t,n,r)=>{let i=(n-t)/r,a=0;for(let n=0;n<r;n++)a+=e(t+(n+.5)*i);return a*i};function re(e,t){let n={};return t.forEach((t=>{let r=function(e){if(e.length===0)return null;let t={};e.forEach((e=>{let n=String(e);t[n]=(t[n]||0)+1}));let n=e[0],r=1;return Object.keys(t).forEach((e=>{t[e]>r&&(n=e,r=t[e])})),n}(e.map((e=>t in e?e[t]:void 0)).filter((e=>e!==void 0)));r&&(n[t]=r)})),n}let ie=`accelerometer.accessibility.accessibility-events.ambient-light-sensor.background-fetch.background-sync.bluetooth.camera.clipboard-read.clipboard-write.device-info.display-capture.gyroscope.geolocation.local-fonts.magnetometer.microphone.midi.nfc.notifications.payment-handler.persistent-storage.push.speaker.storage-access.top-level-storage-access.window-management.query`.split(`.`);function ae(){if(typeof navigator>`u`)return{name:`unknown`,version:`unknown`};let e=[{name:`Brave`,detect:()=>!!navigator.brave}];for(let t of e)if(t.detect()){let e=oe(navigator.userAgent);return{name:t.name,version:e.version}}return oe(navigator.userAgent)}function oe(e){let t=[/(?<name>SamsungBrowser)\/(?<version>\d+(?:\.\d+)+)/,/(?<name>EdgA|EdgiOS|Edg)\/(?<version>\d+(?:\.\d+)+)/,/(?<name>OPR|OPX)\/(?<version>\d+(?:\.\d+)+)/,/Opera[\s\/](?<version>\d+(?:\.\d+)+)/,/Opera Mini\/(?<version>\d+(?:\.\d+)+)/,/Opera Mobi\/(?<version>\d+(?:\.\d+)+)/,/(?<name>Vivaldi)\/(?<version>\d+(?:\.\d+)+)/,/(?<name>CriOS)\/(?<version>\d+(?:\.\d+)+)/,/(?<name>FxiOS)\/(?<version>\d+(?:\.\d+)+)/,/(?<name>Chrome|Chromium)\/(?<version>\d+(?:\.\d+)+)/,/(?<name>Firefox|Waterfox|Iceweasel|IceCat)\/(?<version>\d+(?:\.\d+)+)/,/Version\/(?<version1>[\d.]+).*Safari\/[\d.]+|(?<name>Safari)\/(?<version2>[\d.]+)/,/(?<name>MSIE|Trident|IEMobile).+?(?<version>\d+(?:\.\d+)+)/,/(?<name>[A-Za-z]+)\/(?<version>\d+(?:\.\d+)+)/],n={edg:`Edge`,edga:`Edge`,edgios:`Edge`,opr:`Opera`,opx:`Opera`,crios:`Chrome`,fxios:`Firefox`,samsung:`SamsungBrowser`,vivaldi:`Vivaldi`};for(let r of t){let t=e.match(r);if(t){let e=t.groups?.name,i=t.groups?.version||t.groups?.version1||t.groups?.version2;if(e||!t.groups?.version1&&!t.groups?.version2||(e=`Safari`),!e&&r.source.includes(`Opera Mini`)&&(e=`Opera Mini`),!e&&r.source.includes(`Opera Mobi`)&&(e=`Opera Mobi`),!e&&r.source.includes(`Opera`)&&(e=`Opera`),!e&&t[1]&&(e=t[1]),!i&&t[2]&&(i=t[2]),e)return{name:n[e.toLowerCase()]||e,version:i||`unknown`}}}return{name:`unknown`,version:`unknown`}}function se(){if(typeof navigator>`u`||!navigator.userAgent)return!1;let e=navigator.userAgent;return/Mobi|Android|iPhone|iPod|IEMobile|Opera Mini|Opera Mobi|webOS|BlackBerry|Windows Phone/i.test(e)&&!/iPad/i.test(e)}function ce(){let e=[],t={"prefers-contrast":[`high`,`more`,`low`,`less`,`forced`,`no-preference`],"any-hover":[`hover`,`none`],"any-pointer":[`none`,`coarse`,`fine`],pointer:[`none`,`coarse`,`fine`],hover:[`hover`,`none`],update:[`fast`,`slow`],"inverted-colors":[`inverted`,`none`],"prefers-reduced-motion":[`reduce`,`no-preference`],"prefers-reduced-transparency":[`reduce`,`no-preference`],scripting:[`none`,`initial-only`,`enabled`],"forced-colors":[`active`,`none`]};return Object.keys(t).forEach((n=>{t[n].forEach((t=>{matchMedia(`(${n}: ${t})`).matches&&e.push(`${n}: ${t}`)}))})),e}function le(){if(window.location.protocol===`https:`&&typeof window.ApplePaySession==`function`)try{let e=window.ApplePaySession.supportsVersion;for(let t=15;t>0;t--)if(e(t))return t}catch{return 0}return 0}let ue=ae().name===`SamsungBrowser`?3:1,x,S=null;function C(e){let t=[];return function e(n){if(n&&n.toJSON&&typeof n.toJSON==`function`&&(n=n.toJSON()),n===void 0)return;if(typeof n==`number`)return isFinite(n)?``+n:`null`;if(typeof n!=`object`)return JSON.stringify(n);let r,i;if(Array.isArray(n)){for(i=`[`,r=0;r<n.length;r++)r&&(i+=`,`),i+=e(n[r])||`null`;return i+`]`}if(n===null)return`null`;if(t.indexOf(n)!==-1)throw TypeError(`Converting circular structure to JSON`);let a=t.push(n)-1,o=Object.keys(n).sort();for(i=``,r=0;r<o.length;r++){let t=o[r],a=e(n[t]);a&&(i&&(i+=`,`),i+=JSON.stringify(t)+`:`+a)}return t.splice(a,1),`{`+i+`}`}(e)||``}let de=[`𝔄`,`𝔅`,`ℭ`,`𝔇`,`𝔈`,`𝔉`,`𝔸`,`𝔹`,`ℂ`,`𝔻`,`𝔼`,`𝔽`],fe=[`β`,`ψ`,`λ`,`ε`,`ζ`,`α`,`ξ`,`μ`,`ρ`,`φ`,`κ`,`τ`,`η`,`σ`,`ι`,`ω`,`γ`,`ν`,`χ`,`δ`,`θ`,`π`,`υ`,`ο`];function w(e,t){return`<math><mrow>${t}</mrow></math>`}function pe(){let e=`<mo>∏</mo>`;return de.forEach(((t,n)=>{let r=2*n,i=fe.slice(r,r+2);i.length===2&&(e+=`<mmultiscripts><mi>${t}</mi><none/><mi>${i[1]}</mi><mprescripts></mprescripts><mi>${i[0]}</mi><none/></mmultiscripts>`)})),w(0,`<munderover><mmultiscripts>${e}</mmultiscripts></munderover>`)}function me(){let e=[];return de.forEach(((t,n)=>{let r=2*n,i=fe.slice(r,r+2);i.length===2&&e.push(w(0,`<mmultiscripts><mi>${t}</mi><none/><mi>${i[1]}</mi><mprescripts></mprescripts><mi>${i[0]}</mi><none/></mmultiscripts>`))})),e}let he={audio:async function(){return c?async function(){return new Promise(((e,t)=>{try{let t=new c(1,5e3,44100),n=t.createBufferSource(),r=t.createOscillator();r.frequency.value=1e3;let i=t.createDynamicsCompressor(),a;i.threshold.value=-50,i.knee.value=40,i.ratio.value=12,i.attack.value=0,i.release.value=.2,r.connect(i),i.connect(t.destination),r.start(),t.oncomplete=r=>{a=r.renderedBuffer.getChannelData(0),e({sampleHash:l(a),maxChannels:t.destination.maxChannelCount,channelCountMode:n.channelCountMode})},t.startRendering()}catch(e){console.error(`Error creating audio fingerprint:`,e),t(e)}}))}():null},canvas:async function(){return new Promise((e=>{let t=Array.from({length:3},(()=>function(){let e=document.createElement(`canvas`),t=e.getContext(`2d`);if(!t)return null;e.width=280,e.height=20;let n=t.createLinearGradient(0,0,e.width,e.height);n.addColorStop(0,`red`),n.addColorStop(1/6,`orange`),n.addColorStop(2/6,`yellow`),n.addColorStop(.5,`green`),n.addColorStop(4/6,`blue`),n.addColorStop(5/6,`indigo`),n.addColorStop(1,`violet`),t.fillStyle=n,t.fillRect(0,0,e.width,e.height);let r=`Random Text WMwmil10Oo`;return t.font=`23.123px Arial`,t.fillStyle=`black`,t.fillText(r,-5,15),t.fillStyle=`rgba(0, 0, 255, 0.5)`,t.fillText(r,-3.3,17.7),t.beginPath(),t.moveTo(0,0),t.lineTo(2*e.width/7,e.height),t.strokeStyle=`white`,t.lineWidth=2,t.stroke(),t.getImageData(0,0,e.width,e.height)}())).filter((e=>e!==null));t.length===0?e(null):e({commonPixelsHash:h(u(t,280,20).data.toString()).toString()})}))},fonts:async function(e){return new Promise((e=>{try{g((async({iframe:t})=>{let n=t.createElement(`canvas`).getContext(`2d`);if(!n)return void e(null);let r=v.map((e=>y(n,e))),i={};ee.forEach((e=>{let t=y(n,e);r.includes(t)||(i[e]=t)})),e(i)}))}catch{e(null)}}))},hardware:function(){return new Promise(((e,t)=>{let n=navigator.deviceMemory===void 0?0:navigator.deviceMemory,r=window.performance&&window.performance.memory?window.performance.memory:0;e({videocard:te(),architecture:ne(),deviceMemory:n.toString()||`undefined`,jsHeapSizeLimit:r.jsHeapSizeLimit||0})}))},locales:function(){return new Promise((e=>{e({languages:navigator.language,timezone:Intl.DateTimeFormat().resolvedOptions().timeZone})}))},math:function(){return new Promise((e=>{e({acos:Math.acos(.5),asin:b(Math.asin,-1,1,97),cos:b(Math.cos,0,Math.PI,97),largeCos:Math.cos(0x56bc75e2d63100000),largeSin:Math.sin(0x56bc75e2d63100000),largeTan:Math.tan(0x56bc75e2d63100000),sin:b(Math.sin,-Math.PI,Math.PI,97),tan:b(Math.tan,0,2*Math.PI,97)})}))},permissions:async function(e){let t=e?.permissions_to_check||ie;return re(await Promise.all(Array.from({length:3},(()=>async function(e){let t={};for(let n of e)try{t[n]=(await navigator.permissions.query({name:n})).state.toString()}catch{}return t}(t)))),t)},plugins:async function(){let e=[];if(navigator.plugins)for(let t=0;t<navigator.plugins.length;t++){let n=navigator.plugins[t];e.push([n.name,n.filename,n.description].join(`|`))}return new Promise((t=>{t({plugins:e})}))},screen:function(){return new Promise((e=>{if(typeof matchMedia>`u`||typeof screen>`u`)return void e(null);let t={is_touchscreen:navigator.maxTouchPoints>0,maxTouchPoints:navigator.maxTouchPoints,colorDepth:screen.colorDepth,mediaMatches:ce()};se()&&navigator.maxTouchPoints>0&&(t.resolution=function(){let e=window.screen.width,t=window.screen.height;return`${Math.max(e,t).toString()}x${Math.min(e,t).toString()}`}()),e(t)}))},system:function(){return new Promise((e=>{let t=ae();e({platform:window.navigator.platform,productSub:navigator.productSub,product:navigator.product,useragent:navigator.userAgent,hardwareConcurrency:navigator.hardwareConcurrency,browser:{name:t.name,version:t.version},mobile:se(),applePayVersion:le(),cookieEnabled:window.navigator.cookieEnabled})}))},webgl:async function(){typeof document<`u`&&(x=document.createElement(`canvas`),x.width=200,x.height=100,S=x.getContext(`webgl`));try{if(!S)throw Error(`WebGL not supported`);return{commonPixelsHash:h(u(Array.from({length:ue},(()=>function(){try{if(!S)throw Error(`WebGL not supported`);let e=S.createShader(S.VERTEX_SHADER),t=S.createShader(S.FRAGMENT_SHADER);if(!e||!t)throw Error(`Failed to create shaders`);if(S.shaderSource(e,`
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports):typeof define==`function`&&define.amd?define([`exports`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.monei={}))})(this,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=Object.defineProperty,n=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r};let r=2592e5,i=`thumbmark`,a=`https://api.thumbmarkjs.com`,o={exclude:[],include:[],stabilize:[`private`,`iframe`],logging:!0,timeout:5e3,cache_api_call:!0,cache_lifetime_in_ms:0,performance:!1,experimental:!1,property_name_factory:e=>`${i}_${e}`};({...o});let s={private:[{exclude:[`canvas`],browsers:[`firefox`,`safari>=17`,`brave`]},{exclude:[`audio`],browsers:[`samsungbrowser`,`safari`]},{exclude:[`fonts`],browsers:[`firefox`]},{exclude:[`audio.sampleHash`,`hardware.deviceMemory`,`header.acceptLanguage.q`,`system.hardwareConcurrency`,`plugins`],browsers:[`brave`]},{exclude:[`tls.extensions`],browsers:[`firefox`,`chrome`,`safari`]},{exclude:[`header.acceptLanguage`],browsers:[`edge`,`chrome`]}],iframe:[{exclude:[`system.applePayVersion`,`system.cookieEnabled`],browsers:[`safari`]},{exclude:[`permissions`]}],vpn:[{exclude:[`ip`]}],always:[{exclude:[`speech`],browsers:[`brave`,`firefox`]}]},c=typeof window<`u`?window.OfflineAudioContext||window.webkitOfflineAudioContext:null;function l(e){let t=0;for(let n=0;n<e.length;++n)t+=Math.abs(e[n]);return t}function u(e,t,n){let r=[];for(let t=0;t<e[0].data.length;t++){let n=[];for(let r=0;r<e.length;r++)n.push(e[r].data[t]);r.push(d(n))}let i=new Uint8ClampedArray(r);return new ImageData(i,t,n)}function d(e){if(e.length===0)return 0;let t={};for(let n of e)t[n]=(t[n]||0)+1;let n=e[0];for(let e in t)t[e]>t[n]&&(n=parseInt(e,10));return n}function f(e){return e^=e>>>16,e=Math.imul(e,2246822507),e^=e>>>13,e=Math.imul(e,3266489909),(e^=e>>>16)>>>0}let p=new Uint32Array([597399067,2869860233,951274213,2716044179]);function m(e,t){return e<<t|e>>>32-t}function h(e,t=0){if(t=t?0|t:0,typeof e==`string`&&(e=function(e){if(typeof TextEncoder<`u`)return new TextEncoder().encode(e).buffer;let t=[];for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);r<128?t.push(r):r<2048?t.push(192|r>>6,128|63&r):r<55296||r>=57344?t.push(224|r>>12,128|r>>6&63,128|63&r):(n++,r=65536+((1023&r)<<10|1023&e.charCodeAt(n)),t.push(240|r>>18,128|r>>12&63,128|r>>6&63,128|63&r))}return new Uint8Array(t).buffer}(e)),!(e instanceof ArrayBuffer))throw TypeError(`Expected key to be ArrayBuffer or string`);let n=new Uint32Array([t,t,t,t]);(function(e,t){let n=e.byteLength/16|0,r=new Uint32Array(e,0,4*n);for(let e=0;e<n;e++){let n=r.subarray(4*e,4*(e+1));n[0]=Math.imul(n[0],p[0]),n[0]=m(n[0],15),n[0]=Math.imul(n[0],p[1]),t[0]^=n[0],t[0]=m(t[0],19),t[0]+=t[1],t[0]=Math.imul(t[0],5)+1444728091,n[1]=Math.imul(n[1],p[1]),n[1]=m(n[1],16),n[1]=Math.imul(n[1],p[2]),t[1]^=n[1],t[1]=m(t[1],17),t[1]+=t[2],t[1]=Math.imul(t[1],5)+197830471,n[2]=Math.imul(n[2],p[2]),n[2]=m(n[2],17),n[2]=Math.imul(n[2],p[3]),t[2]^=n[2],t[2]=m(t[2],15),t[2]+=t[3],t[2]=Math.imul(t[2],5)+2530024501,n[3]=Math.imul(n[3],p[3]),n[3]=m(n[3],18),n[3]=Math.imul(n[3],p[0]),t[3]^=n[3],t[3]=m(t[3],13),t[3]+=t[0],t[3]=Math.imul(t[3],5)+850148119}})(e,n),function(e,t){let n=e.byteLength/16|0,r=e.byteLength%16,i=new Uint32Array(4),a=new Uint8Array(e,16*n,r);switch(r){case 15:i[3]^=a[14]<<16;case 14:i[3]^=a[13]<<8;case 13:i[3]^=a[12],i[3]=Math.imul(i[3],p[3]),i[3]=m(i[3],18),i[3]=Math.imul(i[3],p[0]),t[3]^=i[3];case 12:i[2]^=a[11]<<24;case 11:i[2]^=a[10]<<16;case 10:i[2]^=a[9]<<8;case 9:i[2]^=a[8],i[2]=Math.imul(i[2],p[2]),i[2]=m(i[2],17),i[2]=Math.imul(i[2],p[3]),t[2]^=i[2];case 8:i[1]^=a[7]<<24;case 7:i[1]^=a[6]<<16;case 6:i[1]^=a[5]<<8;case 5:i[1]^=a[4],i[1]=Math.imul(i[1],p[1]),i[1]=m(i[1],16),i[1]=Math.imul(i[1],p[2]),t[1]^=i[1];case 4:i[0]^=a[3]<<24;case 3:i[0]^=a[2]<<16;case 2:i[0]^=a[1]<<8;case 1:i[0]^=a[0],i[0]=Math.imul(i[0],p[0]),i[0]=m(i[0],15),i[0]=Math.imul(i[0],p[1]),t[0]^=i[0]}}(e,n),function(e,t){t[0]^=e.byteLength,t[1]^=e.byteLength,t[2]^=e.byteLength,t[3]^=e.byteLength,t[0]=t[0]+t[1]|0,t[0]=t[0]+t[2]|0,t[0]=t[0]+t[3]|0,t[1]=t[1]+t[0]|0,t[2]=t[2]+t[0]|0,t[3]=t[3]+t[0]|0,t[0]=f(t[0]),t[1]=f(t[1]),t[2]=f(t[2]),t[3]=f(t[3]),t[0]=t[0]+t[1]|0,t[0]=t[0]+t[2]|0,t[0]=t[0]+t[3]|0,t[1]=t[1]+t[0]|0,t[2]=t[2]+t[0]|0,t[3]=t[3]+t[0]|0}(e,n);let r=new Uint8Array(n.buffer);return Array.from(r).map((e=>e.toString(16).padStart(2,`0`))).join(``)}async function g(e){for(;!document.body;)await _(50);let t=document.createElement(`iframe`);t.setAttribute(`frameBorder`,`0`);let n=t.style;n.setProperty(`position`,`fixed`),n.setProperty(`display`,`block`,`important`),n.setProperty(`visibility`,`visible`),n.setProperty(`border`,`0`),n.setProperty(`opacity`,`0`),t.src=`about:blank`,document.body.appendChild(t);let r=t.contentDocument||t.contentWindow?.document;if(!r)throw Error(`Iframe document is not accessible`);e({iframe:r}),setTimeout((()=>{document.body.removeChild(t)}),0)}function _(e,t){return new Promise((n=>setTimeout(n,e,t)))}let v=`Arial.Arial Black.Arial Narrow.Arial Rounded MT.Arimo.Archivo.Barlow.Bebas Neue.Bitter.Bookman.Calibri.Cabin.Candara.Century.Century Gothic.Comic Sans MS.Constantia.Courier.Courier New.Crimson Text.DM Mono.DM Sans.DM Serif Display.DM Serif Text.Dosis.Droid Sans.Exo.Fira Code.Fira Sans.Franklin Gothic Medium.Garamond.Geneva.Georgia.Gill Sans.Helvetica.Impact.Inconsolata.Indie Flower.Inter.Josefin Sans.Karla.Lato.Lexend.Lucida Bright.Lucida Console.Lucida Sans Unicode.Manrope.Merriweather.Merriweather Sans.Montserrat.Myriad.Noto Sans.Nunito.Nunito Sans.Open Sans.Optima.Orbitron.Oswald.Pacifico.Palatino.Perpetua.PT Sans.PT Serif.Poppins.Prompt.Public Sans.Quicksand.Rajdhani.Recursive.Roboto.Roboto Condensed.Rockwell.Rubik.Segoe Print.Segoe Script.Segoe UI.Sora.Source Sans Pro.Space Mono.Tahoma.Taviraj.Times.Times New Roman.Titillium Web.Trebuchet MS.Ubuntu.Varela Round.Verdana.Work Sans`.split(`.`),y=[`monospace`,`sans-serif`,`serif`];function b(e,t){return e.font=`72px ${t}`,e.measureText(`WwMmLli0Oo`).width}function ee(){let e=document.createElement(`canvas`),t=e.getContext(`webgl`)??e.getContext(`experimental-webgl`);if(t&&`getParameter`in t)try{let e=(t.getParameter(t.VENDOR)||``).toString(),n=(t.getParameter(t.RENDERER)||``).toString(),r={vendor:e,renderer:n,version:(t.getParameter(t.VERSION)||``).toString(),shadingLanguageVersion:(t.getParameter(t.SHADING_LANGUAGE_VERSION)||``).toString()};if(!n.length||!e.length){let e=t.getExtension(`WEBGL_debug_renderer_info`);if(e){let n=(t.getParameter(e.UNMASKED_VENDOR_WEBGL)||``).toString(),i=(t.getParameter(e.UNMASKED_RENDERER_WEBGL)||``).toString();n&&(r.vendorUnmasked=n),i&&(r.rendererUnmasked=i)}}return r}catch{}return`undefined`}function te(){let e=new Float32Array(1),t=new Uint8Array(e.buffer);return e[0]=1/0,e[0]-=e[0],t[3]}let x=(e,t,n,r)=>{let i=(n-t)/r,a=0;for(let n=0;n<r;n++)a+=e(t+(n+.5)*i);return a*i};function ne(e,t){let n={};return t.forEach((t=>{let r=function(e){if(e.length===0)return null;let t={};e.forEach((e=>{let n=String(e);t[n]=(t[n]||0)+1}));let n=e[0],r=1;return Object.keys(t).forEach((e=>{t[e]>r&&(n=e,r=t[e])})),n}(e.map((e=>t in e?e[t]:void 0)).filter((e=>e!==void 0)));r&&(n[t]=r)})),n}let re=`accelerometer.accessibility.accessibility-events.ambient-light-sensor.background-fetch.background-sync.bluetooth.camera.clipboard-read.clipboard-write.device-info.display-capture.gyroscope.geolocation.local-fonts.magnetometer.microphone.midi.nfc.notifications.payment-handler.persistent-storage.push.speaker.storage-access.top-level-storage-access.window-management.query`.split(`.`);function ie(){if(typeof navigator>`u`)return{name:`unknown`,version:`unknown`};let e=[{name:`Brave`,detect:()=>!!navigator.brave}];for(let t of e)if(t.detect()){let e=ae(navigator.userAgent);return{name:t.name,version:e.version}}return ae(navigator.userAgent)}function ae(e){let t=[/(?<name>SamsungBrowser)\/(?<version>\d+(?:\.\d+)+)/,/(?<name>EdgA|EdgiOS|Edg)\/(?<version>\d+(?:\.\d+)+)/,/(?<name>OPR|OPX)\/(?<version>\d+(?:\.\d+)+)/,/Opera[\s\/](?<version>\d+(?:\.\d+)+)/,/Opera Mini\/(?<version>\d+(?:\.\d+)+)/,/Opera Mobi\/(?<version>\d+(?:\.\d+)+)/,/(?<name>Vivaldi)\/(?<version>\d+(?:\.\d+)+)/,/(?<name>CriOS)\/(?<version>\d+(?:\.\d+)+)/,/(?<name>FxiOS)\/(?<version>\d+(?:\.\d+)+)/,/(?<name>Chrome|Chromium)\/(?<version>\d+(?:\.\d+)+)/,/(?<name>Firefox|Waterfox|Iceweasel|IceCat)\/(?<version>\d+(?:\.\d+)+)/,/Version\/(?<version1>[\d.]+).*Safari\/[\d.]+|(?<name>Safari)\/(?<version2>[\d.]+)/,/(?<name>MSIE|Trident|IEMobile).+?(?<version>\d+(?:\.\d+)+)/,/(?<name>[A-Za-z]+)\/(?<version>\d+(?:\.\d+)+)/],n={edg:`Edge`,edga:`Edge`,edgios:`Edge`,opr:`Opera`,opx:`Opera`,crios:`Chrome`,fxios:`Firefox`,samsung:`SamsungBrowser`,vivaldi:`Vivaldi`};for(let r of t){let t=e.match(r);if(t){let e=t.groups?.name,i=t.groups?.version||t.groups?.version1||t.groups?.version2;if(e||!t.groups?.version1&&!t.groups?.version2||(e=`Safari`),!e&&r.source.includes(`Opera Mini`)&&(e=`Opera Mini`),!e&&r.source.includes(`Opera Mobi`)&&(e=`Opera Mobi`),!e&&r.source.includes(`Opera`)&&(e=`Opera`),!e&&t[1]&&(e=t[1]),!i&&t[2]&&(i=t[2]),e)return{name:n[e.toLowerCase()]||e,version:i||`unknown`}}}return{name:`unknown`,version:`unknown`}}function oe(){if(typeof navigator>`u`||!navigator.userAgent)return!1;let e=navigator.userAgent;return/Mobi|Android|iPhone|iPod|IEMobile|Opera Mini|Opera Mobi|webOS|BlackBerry|Windows Phone/i.test(e)&&!/iPad/i.test(e)}function se(){let e=[],t={"prefers-contrast":[`high`,`more`,`low`,`less`,`forced`,`no-preference`],"any-hover":[`hover`,`none`],"any-pointer":[`none`,`coarse`,`fine`],pointer:[`none`,`coarse`,`fine`],hover:[`hover`,`none`],update:[`fast`,`slow`],"inverted-colors":[`inverted`,`none`],"prefers-reduced-motion":[`reduce`,`no-preference`],"prefers-reduced-transparency":[`reduce`,`no-preference`],scripting:[`none`,`initial-only`,`enabled`],"forced-colors":[`active`,`none`]};return Object.keys(t).forEach((n=>{t[n].forEach((t=>{matchMedia(`(${n}: ${t})`).matches&&e.push(`${n}: ${t}`)}))})),e}function ce(){if(window.location.protocol===`https:`&&typeof window.ApplePaySession==`function`)try{let e=window.ApplePaySession.supportsVersion;for(let t=15;t>0;t--)if(e(t))return t}catch{return 0}return 0}let le=ie().name===`SamsungBrowser`?3:1,S,C=null;function w(e){let t=[];return function e(n){if(n&&n.toJSON&&typeof n.toJSON==`function`&&(n=n.toJSON()),n===void 0)return;if(typeof n==`number`)return isFinite(n)?``+n:`null`;if(typeof n!=`object`)return JSON.stringify(n);let r,i;if(Array.isArray(n)){for(i=`[`,r=0;r<n.length;r++)r&&(i+=`,`),i+=e(n[r])||`null`;return i+`]`}if(n===null)return`null`;if(t.indexOf(n)!==-1)throw TypeError(`Converting circular structure to JSON`);let a=t.push(n)-1,o=Object.keys(n).sort();for(i=``,r=0;r<o.length;r++){let t=o[r],a=e(n[t]);a&&(i&&(i+=`,`),i+=JSON.stringify(t)+`:`+a)}return t.splice(a,1),`{`+i+`}`}(e)||``}let ue=[`𝔄`,`𝔅`,`ℭ`,`𝔇`,`𝔈`,`𝔉`,`𝔸`,`𝔹`,`ℂ`,`𝔻`,`𝔼`,`𝔽`],de=[`β`,`ψ`,`λ`,`ε`,`ζ`,`α`,`ξ`,`μ`,`ρ`,`φ`,`κ`,`τ`,`η`,`σ`,`ι`,`ω`,`γ`,`ν`,`χ`,`δ`,`θ`,`π`,`υ`,`ο`];function T(e,t){return`<math><mrow>${t}</mrow></math>`}function fe(){let e=`<mo>∏</mo>`;return ue.forEach(((t,n)=>{let r=2*n,i=de.slice(r,r+2);i.length===2&&(e+=`<mmultiscripts><mi>${t}</mi><none/><mi>${i[1]}</mi><mprescripts></mprescripts><mi>${i[0]}</mi><none/></mmultiscripts>`)})),T(0,`<munderover><mmultiscripts>${e}</mmultiscripts></munderover>`)}function pe(){let e=[];return ue.forEach(((t,n)=>{let r=2*n,i=de.slice(r,r+2);i.length===2&&e.push(T(0,`<mmultiscripts><mi>${t}</mi><none/><mi>${i[1]}</mi><mprescripts></mprescripts><mi>${i[0]}</mi><none/></mmultiscripts>`))})),e}let me={audio:async function(){return c?async function(){return new Promise(((e,t)=>{try{let t=new c(1,5e3,44100),n=t.createBufferSource(),r=t.createOscillator();r.frequency.value=1e3;let i=t.createDynamicsCompressor(),a;i.threshold.value=-50,i.knee.value=40,i.ratio.value=12,i.attack.value=0,i.release.value=.2,r.connect(i),i.connect(t.destination),r.start(),t.oncomplete=r=>{a=r.renderedBuffer.getChannelData(0),e({sampleHash:l(a),maxChannels:t.destination.maxChannelCount,channelCountMode:n.channelCountMode})},t.startRendering()}catch(e){console.error(`Error creating audio fingerprint:`,e),t(e)}}))}():null},canvas:async function(){return new Promise((e=>{let t=Array.from({length:3},(()=>function(){let e=document.createElement(`canvas`),t=e.getContext(`2d`);if(!t)return null;e.width=280,e.height=20;let n=t.createLinearGradient(0,0,e.width,e.height);n.addColorStop(0,`red`),n.addColorStop(1/6,`orange`),n.addColorStop(2/6,`yellow`),n.addColorStop(.5,`green`),n.addColorStop(4/6,`blue`),n.addColorStop(5/6,`indigo`),n.addColorStop(1,`violet`),t.fillStyle=n,t.fillRect(0,0,e.width,e.height);let r=`Random Text WMwmil10Oo`;return t.font=`23.123px Arial`,t.fillStyle=`black`,t.fillText(r,-5,15),t.fillStyle=`rgba(0, 0, 255, 0.5)`,t.fillText(r,-3.3,17.7),t.beginPath(),t.moveTo(0,0),t.lineTo(2*e.width/7,e.height),t.strokeStyle=`white`,t.lineWidth=2,t.stroke(),t.getImageData(0,0,e.width,e.height)}())).filter((e=>e!==null));t.length===0?e(null):e({commonPixelsHash:h(u(t,280,20).data.toString()).toString()})}))},fonts:async function(e){return new Promise((e=>{try{g((async({iframe:t})=>{let n=t.createElement(`canvas`).getContext(`2d`);if(!n)return void e(null);let r=y.map((e=>b(n,e))),i={};v.forEach((e=>{let t=b(n,e);r.includes(t)||(i[e]=t)})),e(i)}))}catch{e(null)}}))},hardware:function(){return new Promise(((e,t)=>{let n=navigator.deviceMemory===void 0?0:navigator.deviceMemory,r=window.performance&&window.performance.memory?window.performance.memory:0;e({videocard:ee(),architecture:te(),deviceMemory:n.toString()||`undefined`,jsHeapSizeLimit:r.jsHeapSizeLimit||0})}))},locales:function(){return new Promise((e=>{e({languages:navigator.language,timezone:Intl.DateTimeFormat().resolvedOptions().timeZone})}))},math:function(){return new Promise((e=>{e({acos:Math.acos(.5),asin:x(Math.asin,-1,1,97),cos:x(Math.cos,0,Math.PI,97),largeCos:Math.cos(0x56bc75e2d63100000),largeSin:Math.sin(0x56bc75e2d63100000),largeTan:Math.tan(0x56bc75e2d63100000),sin:x(Math.sin,-Math.PI,Math.PI,97),tan:x(Math.tan,0,2*Math.PI,97)})}))},permissions:async function(e){let t=e?.permissions_to_check||re;return ne(await Promise.all(Array.from({length:3},(()=>async function(e){let t={};for(let n of e)try{t[n]=(await navigator.permissions.query({name:n})).state.toString()}catch{}return t}(t)))),t)},plugins:async function(){let e=[];if(navigator.plugins)for(let t=0;t<navigator.plugins.length;t++){let n=navigator.plugins[t];e.push([n.name,n.filename,n.description].join(`|`))}return new Promise((t=>{t({plugins:e})}))},screen:function(){return new Promise((e=>{if(typeof matchMedia>`u`||typeof screen>`u`)return void e(null);let t={is_touchscreen:navigator.maxTouchPoints>0,maxTouchPoints:navigator.maxTouchPoints,colorDepth:screen.colorDepth,mediaMatches:se()};oe()&&navigator.maxTouchPoints>0&&(t.resolution=function(){let e=window.screen.width,t=window.screen.height;return`${Math.max(e,t).toString()}x${Math.min(e,t).toString()}`}()),e(t)}))},system:function(){return new Promise((e=>{let t=ie();e({platform:window.navigator.platform,productSub:navigator.productSub,product:navigator.product,useragent:navigator.userAgent,hardwareConcurrency:navigator.hardwareConcurrency,browser:{name:t.name,version:t.version},mobile:oe(),applePayVersion:ce(),cookieEnabled:window.navigator.cookieEnabled})}))},webgl:async function(){typeof document<`u`&&(S=document.createElement(`canvas`),S.width=200,S.height=100,C=S.getContext(`webgl`));try{if(!C)throw Error(`WebGL not supported`);return{commonPixelsHash:h(u(Array.from({length:le},(()=>function(){try{if(!C)throw Error(`WebGL not supported`);let e=C.createShader(C.VERTEX_SHADER),t=C.createShader(C.FRAGMENT_SHADER);if(!e||!t)throw Error(`Failed to create shaders`);if(C.shaderSource(e,`
2
2
  attribute vec2 position;
3
3
  void main() {
4
4
  gl_Position = vec4(position, 0.0, 1.0);
5
5
  }
6
- `),S.shaderSource(t,`
6
+ `),C.shaderSource(t,`
7
7
  precision mediump float;
8
8
  void main() {
9
9
  gl_FragColor = vec4(0.812, 0.195, 0.553, 0.921); // Set line color
10
10
  }
11
- `),S.compileShader(e),!S.getShaderParameter(e,S.COMPILE_STATUS))throw Error(`Vertex shader compilation failed: `+S.getShaderInfoLog(e));if(S.compileShader(t),!S.getShaderParameter(t,S.COMPILE_STATUS))throw Error(`Fragment shader compilation failed: `+S.getShaderInfoLog(t));let n=S.createProgram();if(!n)throw Error(`Failed to create shader program`);if(S.attachShader(n,e),S.attachShader(n,t),S.linkProgram(n),!S.getProgramParameter(n,S.LINK_STATUS))throw Error(`Shader program linking failed: `+S.getProgramInfoLog(n));S.useProgram(n);let r=new Float32Array(548),i=2*Math.PI/137;for(let e=0;e<137;e++){let t=e*i;r[4*e]=0,r[4*e+1]=0,r[4*e+2]=Math.cos(t)*(x.width/2),r[4*e+3]=Math.sin(t)*(x.height/2)}let a=S.createBuffer();S.bindBuffer(S.ARRAY_BUFFER,a),S.bufferData(S.ARRAY_BUFFER,r,S.STATIC_DRAW);let o=S.getAttribLocation(n,`position`);S.enableVertexAttribArray(o),S.vertexAttribPointer(o,2,S.FLOAT,!1,0,0),S.viewport(0,0,x.width,x.height),S.clearColor(0,0,0,1),S.clear(S.COLOR_BUFFER_BIT),S.drawArrays(S.LINES,0,274);let s=new Uint8ClampedArray(x.width*x.height*4);return S.readPixels(0,0,x.width,x.height,S.RGBA,S.UNSIGNED_BYTE,s),new ImageData(s,x.width,x.height)}catch{return new ImageData(1,1)}finally{S&&(S.bindBuffer(S.ARRAY_BUFFER,null),S.useProgram(null),S.viewport(0,0,S.drawingBufferWidth,S.drawingBufferHeight),S.clearColor(0,0,0,0))}}())),x.width,x.height).data.toString()).toString()}}catch{return{webgl:`unsupported`}}},webrtc:async function(e){return new Promise((t=>{try{let n=window.RTCPeerConnection||window.webkitRTCPeerConnection||window.mozRTCPeerConnection;if(!n)return void t({supported:!1,error:`WebRTC not supported`});let r=new n({iceCandidatePoolSize:1,iceServers:[]});r.createDataChannel(``),(async()=>{try{let n=await r.createOffer({offerToReceiveAudio:!0,offerToReceiveVideo:!0});await r.setLocalDescription(n);let i=n.sdp||``,a=[...new Set((i.match(/extmap:\d+ [^\n\r]+/g)||[]).map((e=>e.replace(/extmap:\d+ /,``))))].sort(),o=e=>{let t=i.match(RegExp(`m=${e} [^\\s]+ [^\\s]+ ([^\\n\\r]+)`));return t?t[1].split(` `):[]},s=(e,t)=>t.map((t=>{let n=RegExp(`(rtpmap|fmtp|rtcp-fb):${t} (.+)`,`g`),r=[...i.matchAll(n)];if(!r.length)return null;let a={};return r.forEach((t=>{let[n,r,i]=t,o=i.split(`/`);r===`rtpmap`?(a.mimeType=`${e}/${o[0]}`,a.clockRate=+o[1],e===`audio`&&(a.channels=+o[2]||1)):r===`rtcp-fb`?(a.feedbackSupport=a.feedbackSupport||[],a.feedbackSupport.push(i)):r===`fmtp`&&(a.sdpFmtpLine=i)})),a})).filter(Boolean),c=s(`audio`,o(`audio`)),l=s(`video`,o(`video`)),u={audio:{count:c.length,hash:h(C(c))},video:{count:l.length,hash:h(C(l))},extensionsHash:h(C(a))},d=e?.timeout||5e3,f=Math.floor(.9*d),p=await new Promise((e=>{let t=setTimeout((()=>{r.removeEventListener(`icecandidate`,n),r.close(),e({supported:!0,...u,timeout:!0})}),f),n=i=>{let a=i.candidate;a&&a.candidate&&(clearTimeout(t),r.removeEventListener(`icecandidate`,n),r.close(),e({supported:!0,...u,candidateType:a.type||``}))};r.addEventListener(`icecandidate`,n)}));t({details:p,hash:h(C(p))})}catch(e){r.close(),t({supported:!0,error:`WebRTC offer failed: ${e.message}`})}})()}catch(e){t({supported:!1,error:`WebRTC error: ${e.message}`})}}))},speech:async function(){return new Promise((e=>{try{if(typeof window>`u`||!window.speechSynthesis||typeof window.speechSynthesis.getVoices!=`function`)return void e({supported:!1,error:`Speech Synthesis API not supported`});let t=!1,n=null,r=r=>{if(!t){t=!0,n&&clearTimeout(n);try{let t=r.map((e=>{let t=e=>e.replace(/\\/g,`\\\\`).replace(/,/g,`\\,`);return[t(e.voiceURI||``),t(e.name||``),t(e.lang||``),e.localService?`1`:`0`,e.default?`1`:`0`].join(`,`)}));t.sort();let n={voiceCount:r.length,voicesHash:h(C(t))};e({details:n,hash:h(C(n))})}catch(t){e({supported:!0,error:`Voice processing failed: ${t.message}`})}}},i=window.speechSynthesis.getVoices();if(i.length>0)return void r(i);n=setTimeout((()=>{r(window.speechSynthesis.getVoices())}),800);let a=()=>{window.speechSynthesis.removeEventListener(`voiceschanged`,a),r(window.speechSynthesis.getVoices())};window.speechSynthesis.addEventListener(`voiceschanged`,a)}catch(t){e({supported:!1,error:`Speech Synthesis error: ${t.message}`})}}))}},ge={mathml:async function(){return new Promise((e=>{try{g((async({iframe:t})=>{try{if(!function(e){try{let t=e.createElement(`math`);t.innerHTML=`<mrow><mi>x</mi></mrow>`,t.style.position=`absolute`,t.style.visibility=`hidden`,e.body.appendChild(t);let n=t.getBoundingClientRect();return e.body.removeChild(t),n.width>0&&n.height>0}catch{return!1}}(t))return void e({supported:!1,error:`MathML not supported`});let n=[w(`integral`,`<msubsup><mo>∫</mo><mi>a</mi><mi>b</mi></msubsup><mfrac><mrow><mi>f</mi><mo>(</mo><mi>x</mi><mo>)</mo></mrow><mrow><mi>g</mi><mo>(</mo><mi>x</mi><mo>)</mo></mrow></mfrac><mi>dx</mi>`),w(`fraction`,`<mfrac><mrow><mi>π</mi><mo>×</mo><msup><mi>r</mi><mn>2</mn></msup></mrow><mrow><mn>2</mn><mi>σ</mi></mrow></mfrac>`),w(`matrix`,`<mo>[</mo><mtable><mtr><mtd><mi>α</mi></mtd><mtd><mi>β</mi></mtd></mtr><mtr><mtd><mi>γ</mi></mtd><mtd><mi>δ</mi></mtd></mtr></mtable><mo>]</mo>`),pe(),...me()],r=[],i=``;n.forEach(((e,n)=>{let a=function(e,t){try{let n=t.createElement(`math`);n.innerHTML=e.replace(/<\/?math>/g,``),n.style.whiteSpace=`nowrap`,n.style.position=`absolute`,n.style.visibility=`hidden`,n.style.top=`-9999px`,t.body.appendChild(n);let r=n.getBoundingClientRect(),i=(t.defaultView||window).getComputedStyle(n),a={dimensions:{width:r.width,height:r.height},fontInfo:{fontFamily:i.fontFamily,fontSize:i.fontSize,fontWeight:i.fontWeight,fontStyle:i.fontStyle,lineHeight:i.lineHeight,fontVariant:i.fontVariant||`normal`,fontStretch:i.fontStretch||`normal`,fontSizeAdjust:i.fontSizeAdjust||`none`,textRendering:i.textRendering||`auto`,fontFeatureSettings:i.fontFeatureSettings||`normal`,fontVariantNumeric:i.fontVariantNumeric||`normal`,fontKerning:i.fontKerning||`auto`}};return t.body.removeChild(n),a}catch(e){return{error:e.message}}}(e,t);r.push({width:a.dimensions.width,height:a.dimensions.height}),n===0&&a.fontInfo&&(i=h(C(a.fontInfo)))}));let a={fontStyleHash:i,dimensions:r};e({details:a,hash:h(C(a))})}catch(t){e({supported:!1,error:`MathML error: ${t.message}`})}}))}catch(t){e({supported:!1,error:`MathML error: ${t.message}`})}}))}},_e={},ve={timeout:`true`};function ye(e,t){let n=ae();if(n.name===`unknown`&&t){let e=t.system?.browser;e!=null&&e.name&&(n={name:String(e.name),version:String(e.version||`unknown`)})}let r=n.name.toLowerCase(),i=parseInt(n.version.split(`.`)[0]||`0`,10),a=[...e?.exclude||[]],o=[...new Set([...e?.stabilize||[],`always`])];for(let e of o){let t=s[e];if(t)for(let e of t)`browsers`in e&&!e.browsers?.some((e=>{let t=e.match(/(.+?)(>=)(\d+)/);return t?r===t[1]&&i>=+t[3]:r===e}))||a.push(...e.exclude)}return a}function be(e,t){let n=ye(t,e),r=t?.include||[];return function e(t,i=``){let a={};for(let[o,s]of Object.entries(t)){let t=i?`${i}.${o}`:o;if(typeof s!=`object`||Array.isArray(s)||s===null){let e=n.some((e=>t.startsWith(e))),i=r.some((e=>t.startsWith(e)));e&&!i||(a[o]=s)}else{let n=e(s,t);Object.keys(n).length>0&&(a[o]=n)}}return a}(e)}let xe=`visitor_id`;function Se(e){return e.storage_property_name?e.storage_property_name:e.property_name_factory(xe)}let Ce=`${i}_${xe}`;function we(e,t){try{localStorage.setItem(Se(t),e)}catch{}}let Te=`cache`;function T(e){try{let t=localStorage.getItem(e.property_name_factory(Te));return JSON.parse(t)||{}}catch{}return{}}function Ee(e){return e.cache_lifetime_in_ms>r?Date.now()+r:Date.now()+e.cache_lifetime_in_ms}var E=class extends Error{constructor(e){super(`HTTP error! status: ${e}`),this.status=e}};let D=null,O=null;async function De(e,t,n,r){let i=await fetch(e,{method:`POST`,headers:{"x-api-key":n.api_key,Authorization:`custom-authorized`,"Content-Type":`application/json`},body:JSON.stringify(t)});if(!i.ok)throw new E(i.status);let a=await i.json();return a.visitorId&&a.visitorId!==r&&we(a.visitorId,n),O=a,function(e,t){!e.cache_api_call||!e.cache_lifetime_in_ms||(function(e,t){let n={...T(e),...t};try{localStorage.setItem(e.property_name_factory(Te),JSON.stringify(n))}catch{}})(e,{apiResponseExpiry:Ee(e),apiResponse:t})}(n,a),a}let Oe=(e,t)=>{if(e.cache_api_call){if(O)return Promise.resolve(O);let t=function(e){let t=T(e);if(t&&t.apiResponse&&t.apiResponseExpiry&&Date.now()<=t.apiResponseExpiry)return t.apiResponse}(e);if(t)return Promise.resolve(t);if(D)return D}let n=`${e.api_endpoint||a}/thumbmark`,r=function(e){try{let t=Se(e),n=localStorage.getItem(t);return n||t===Ce||(n=localStorage.getItem(Ce),n&&we(n,e)),n}catch{return null}}(e),i={components:t,options:e,clientHash:h(C(t)),version:`1.7.6`};if(r&&(i.visitorId=r),e.metadata){let t=typeof e.metadata==`function`?e.metadata():e.metadata;t&&((typeof t==`string`?t.length:JSON.stringify(t).length)>1e3?console.error(`ThumbmarkJS: Metadata exceeds 1000 characters. Skipping metadata.`):i.metadata=t)}let o=e.timeout||5e3,s=async function(e,t,n,r){for(let i=0;i<3;i++){i>0&&await new Promise((e=>setTimeout(e,200*i)));try{return await De(e,t,n,r)}catch(e){if(e instanceof E||i===2)throw e}}throw Error(`Unreachable`)}(n,i,e,r).finally((()=>{D=null})),c=new Promise((t=>{setTimeout((()=>{t(T(e)?.apiResponse||{info:{timed_out:!0},...r&&{visitorId:r}})}),o)}));return D=Promise.race([s,c]),D};async function ke(e,t={}){var n;if(typeof document>`u`||typeof window>`u`)return{thumbmark:``,components:{},info:{},version:`1.7.6`,error:[{type:`fatal`,message:`Browser environment required`}]};try{let r={...o,...e},i=[],s=r.logging&&!sessionStorage.getItem(`_tmjs_l`)&&Math.random()<1e-4,{elapsed:c,resolvedComponents:l,errors:u}=await Ae({...he,..._e,...t},r);i.push(...u);let d={},f={};if(s||r.experimental){let{elapsed:e,resolvedComponents:t,errors:n}=await Ae(ge,r);d=t,f=e,i.push(...n)}let p=r.api_key?Oe(r,l):null,m=null;if(p)try{m=await p}catch(e){if(e instanceof E&&e.status===403)return{error:[{type:`api_unauthorized`,message:`Invalid API key or quota exceeded`}],components:{},info:{},version:`1.7.6`,thumbmark:``};i.push({type:e instanceof E?`api_error`:`network_error`,message:e instanceof Error?e.message:String(e)})}(n=m?.info)!=null&&n.timed_out&&i.push({type:`api_timeout`,message:`API request timed out`});let g={...c,...f},_=r.performance?{elapsed:g}:{},ee=be(m?.components||{},r),v={...l,...ee},y=m?.info||{uniqueness:{score:`api only`}},te=m?.thumbmark??h(C(v));return s&&async function(e,t,n,r={},i=[]){let o=`${a}/log`,s={thumbmark:e,components:t,experimental:r,version:`1.7.6`,options:n,path:(window==null?void 0:window.location)?.pathname,...i.length>0&&{errors:i}};sessionStorage.setItem(`_tmjs_l`,`1`);try{await fetch(o,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(s)})}catch{}}(te,v,r,d,i).catch((()=>{})),{...m?.visitorId&&{visitorId:m.visitorId},thumbmark:te,components:v,info:y,version:`1.7.6`,..._,...i.length>0&&{error:i},...Object.keys(d).length>0&&r.experimental&&{experimental:d},...m?.requestId&&{requestId:m.requestId},...m?.metadata&&{metadata:m.metadata}}}catch(e){return{thumbmark:``,components:{},info:{},version:`1.7.6`,error:[{type:`fatal`,message:e instanceof Error?e.message:String(e)}]}}}async function Ae(e,t){let n={...o,...t},r=ye(n).filter((e=>!e.includes(`.`))),i=Object.entries(e).filter((([e])=>!(n?.exclude)?.includes(e))).filter((([e])=>!r.includes(e))).filter((([e])=>(n?.include)?.some((e=>e.includes(`.`)))?(n?.include)?.some((t=>t.startsWith(e))):n?.include?.length===0||(n?.include)?.includes(e))),a=i.map((([e])=>e)),s=await function(e,t,n){return Promise.all(e.map((e=>{let r=performance.now();return Promise.race([e.then((e=>({value:e,elapsed:performance.now()-r}))).catch((e=>({value:n,elapsed:performance.now()-r,error:e instanceof Error?e.message:String(e)}))),(i=t,a=n,new Promise((e=>{setTimeout((()=>e(a)),i)}))).then((e=>({value:e,elapsed:performance.now()-r,error:`timeout`})))]);var i,a})))}(i.map((([e,n])=>n(t))),n?.timeout||5e3,ve),c={},l={},u=[];return s.forEach(((e,t)=>{let n=a[t];c[n]=e.elapsed??0,e.error===`timeout`?u.push({type:`component_timeout`,message:`Component '${n}' timed out`,component:n}):e.error&&u.push({type:`component_error`,message:e.error,component:n}),e.value!=null&&(l[n]=e.value)})),{elapsed:c,resolvedComponents:be(l,n),errors:u}}var je=class{constructor(e){this.options={...o,...e},this.customComponents={}}async get(e){return ke({...this.options,...e},this.customComponents)}getVersion(){return`1.7.6`}includeComponent(e,t){this.customComponents[e]=t}};let k=(e,t)=>{if(e==null)return t;if(typeof e==`number`)return e;let n=parseInt(e);return isNaN(n)?t:n},Me=(e,t)=>e==null?t:typeof e==`number`?`${e}px`:e||t;var Ne=n({fixLocalstorage:()=>Le,getClientEnv:()=>j,getClientFingerprint:()=>N,isMethodSupported:()=>We,loadScript:()=>Fe,parsePx:()=>k,stringify:()=>Ie,toCssPx:()=>Me,transformStyle:()=>Pe,validateComponentProps:()=>P,withError:()=>Ue});let Pe=e=>Object.keys(e).reduce((t,n)=>(typeof e[n]==`string`?t[n]=e[n]:t[n]=`${e[n]}px`,t),{}),Fe=(e,t,n,r)=>new Promise((i,a)=>{let o=Array.from(document.scripts).find(t=>t.src===e);if(o)if(r)o.remove();else{i(o);return}let s=document.createElement(`script`);s.src=e,s.onload=()=>i(s),s.onerror=e=>a(e),t&&s.setAttribute(`nonce`,t),n&&Object.keys(n).forEach(e=>{n[e]&&(s.dataset[e]=n[e])}),document.head.appendChild(s)}),Ie=e=>Object.keys(e).reduce((t,n)=>(e[n]!==void 0&&t.push(`${encodeURIComponent(n)}=${encodeURIComponent(e[n])}`),t),[]).join(`&`),Le=()=>{let e;try{({localStorage:e}=window)}catch{let t=(()=>{let e=new Map;return{getItem(t){return e.get(t)},setItem:function(t,n){e.set(t,n)},clear:function(){e=new Map},removeItem:function(t){e.delete(t)}}})();Object.defineProperty(window,`localStorage`,{value:t}),e=t}return e},Re=()=>{let e,t=Le();try{e=t.getItem(`i18nextLng`)}catch{}return e?e.split(`-`)[0]:``},A=e=>{try{return String(e()??``)}catch{return``}},j=()=>{let e=[window.screen.colorDepth,window.screen.height,window.screen.width,new Date().getTimezoneOffset(),Re(),A(()=>Intl.DateTimeFormat().resolvedOptions().timeZone),A(()=>window.devicePixelRatio),A(()=>navigator.hardwareConcurrency),A(()=>navigator.deviceMemory),A(()=>navigator.maxTouchPoints),A(()=>navigator.platform),A(()=>navigator.languages?.join(`,`))].join(`|`);return window.btoa(e)},ze=`_monei_fp`,Be=e=>{if(typeof crypto<`u`&&typeof crypto.getRandomValues==`function`){let t=new Uint8Array(e);return crypto.getRandomValues(t),Array.from(t,e=>(e%16).toString(16)).join(``)}return Array.from({length:e},()=>Math.floor(Math.random()*16).toString(16)).join(``)},M=null,Ve=async()=>{if(M)return{seed:M};try{let e=Le();if(M=e.getItem(ze),!M){M=Be(32);try{e.setItem(ze,M)}catch{}}}catch{M=Be(32)}return{seed:M}},He=new je({logging:!1});He.includeComponent(`persistent_seed`,Ve);let N=async()=>{let[,e]=await Ue(He.get());return e?.thumbmark??``},Ue=async e=>{try{return[void 0,await e]}catch(e){return[e,void 0]}},We=(e,t)=>e.paymentMethods&&e.paymentMethods.includes(t),P=({props:e})=>{if(!e.paymentId&&!(e.accountId&&e.amount&&e.currency))throw Error(`You need to provide paymentId or accountId amount and currency`)},Ge={}.env?.STAGE||`prod`,F={}.env?.VERSION||`v1`,I={local:{domain:`http://card-input.localhost:1355`,paymentPageUrl:`http://payment-page.localhost:1355/`,cardInputUrl:`http://card-input.localhost:1355/`,paymentModalUrl:`http://payment-modal.localhost:1355/`,paypalUrl:`http://paypal.localhost:1355/`,bizumUrl:`http://bizum.localhost:1355/`,bizumButtonUrl:`http://bizum-button.localhost:1355/`,paymentRequestUrl:`http://payment-request.localhost:1355/`,apiUrl:`https://api.monei-dev.com/v1`,secureDomain:`https://secure.monei-dev.com`,rootDomain:`monei-dev.com`},"local-prod":{domain:`http://card-input.localhost:1355`,paymentPageUrl:`http://payment-page.localhost:1355/`,cardInputUrl:`http://card-input.localhost:1355/`,paymentModalUrl:`http://payment-modal.localhost:1355/`,paypalUrl:`http://paypal.localhost:1355/`,bizumUrl:`http://bizum.localhost:1355/`,bizumButtonUrl:`http://bizum-button.localhost:1355/`,paymentRequestUrl:`http://payment-request.localhost:1355/`,apiUrl:`https://api.monei.com/v1`,secureDomain:`https://secure.monei.com`,rootDomain:`monei.com`},tunnel:{domain:`https://card-input.monei-dev-tunnel.com`,paymentPageUrl:`https://payment-page.monei-dev-tunnel.com/`,cardInputUrl:`https://card-input.monei-dev-tunnel.com/`,paymentModalUrl:`https://payment-modal.monei-dev-tunnel.com/`,paypalUrl:`https://paypal.monei-dev-tunnel.com/`,bizumUrl:`https://bizum.monei-dev-tunnel.com/`,bizumButtonUrl:`https://bizum-button.monei-dev-tunnel.com/`,paymentRequestUrl:`https://payment-request.monei-dev-tunnel.com/`,apiUrl:`https://api.monei.com/v1`,secureDomain:`https://secure.monei.com`,rootDomain:`monei.com`},dev:{domain:{}.env?.DOMAIN||`https://js.monei-dev.com`,apiUrl:`https://api.monei-dev.com/v1`,secureDomain:`https://secure.monei-dev.com`,rootDomain:`monei-dev.com`},prod:{domain:{}.env?.DOMAIN||`https://js.monei.com`,apiUrl:`https://api.monei.com/v1`,secureDomain:`https://secure.monei.com`,rootDomain:`monei.com`}}[Ge],L=I.domain,R={domain:L,version:F,stage:Ge,isProduction:Ge===`prod`,paymentPageUrl:I.paymentPageUrl||`${L}/${F}/payment-page/`,cardInputUrl:I.cardInputUrl||`${L}/${F}/inner-card-input/`,paymentModalUrl:I.paymentModalUrl||`${L}/${F}/inner-payment-modal/`,paypalUrl:I.paypalUrl||`${L}/${F}/inner-paypal/`,bizumUrl:I.bizumUrl||`${L}/${F}/inner-bizum/`,bizumButtonUrl:I.bizumButtonUrl||`${L}/${F}/inner-bizum-button/`,paymentRequestUrl:I.paymentRequestUrl||`${L}/${F}/inner-payment-request/`,...I};var Ke=n({confirmPayment:()=>Ye,createApplePaySession:()=>Qe,createPayment:()=>Xe,createToken:()=>qe,getPayment:()=>Je,getPaymentMethods:()=>V,sendPaymentReceipt:()=>Ze,validateBizumPhone:()=>$e});let z=async(e,{method:t=`GET`,headers:n,body:r}={})=>{t===`POST`&&(n={"Content-Type":`application/json`,...n});let i=await fetch(`${R.apiUrl}${e}`,{method:t,headers:n,body:r?JSON.stringify(r):void 0}),[,a]=await Ue(i.json());if(!i.ok)throw a||Error(i.statusText);return a},B={},V=async({accountId:e,paymentId:t})=>{let n;if(t)n={paymentId:t};else if(e)n={accountId:e};else throw Error(`You need to provide paymentId or accountId`);let r=Ie(n);if(r in B)return B[r];let i=z(`/client-payment-methods?${r}`);return B[r]=i,i.catch(()=>delete B[r]),i},qe=async({paymentMethod:e,paymentId:t,sessionId:n,amount:r,currency:i,accountId:a,transactionType:o})=>{let s;if(t)s={paymentId:t,paymentMethod:e};else if(a)s={accountId:a,paymentMethod:e,sessionId:n,amount:r,currency:i,transactionType:o};else throw Error(`You need to provide paymentId or accountId`);let c=await z(`/tokens`,{method:`POST`,headers:{"X-Client-Env":j(),"X-Client-Fingerprint":await N()},body:s});return c.paymentToken&&!c.token&&(c.token=c.paymentToken),c},Je=async e=>z(`/payments/${e}/client-get`),Ye=async({paymentId:e,...t})=>z(`/payments/${e}/client-confirm`,{method:`POST`,headers:{"X-Client-Env":j(),"X-Client-Fingerprint":await N()},body:t}),Xe=async({signature:e,...t})=>z(`/client-payments`,{method:`POST`,headers:{"X-Client-Env":j(),"X-Client-Fingerprint":await N(),"Client-Signature":e},body:t}),Ze=async({paymentId:e,customerEmail:t,signature:n,language:r})=>z(`/payments/${e}/client-receipt`,{method:`POST`,body:{customerEmail:t,signature:n,language:r}}),Qe=async e=>z(`/apple-pay/sessions`,{method:`POST`,body:e}),$e=async e=>z(`/bizum/validate-phone`,{method:`POST`,body:e});var et=class{constructor(){this.listeners=new Map,this.destroyed=!1}on(e,t){if(this.destroyed)return{cancel:()=>{}};let n=this.listeners.get(e);return n||(n=new Set,this.listeners.set(e,n)),n.add(t),{cancel:()=>{n.delete(t)}}}once(e,t){let n=(...r)=>{this.off(e,n),t(...r)};return this.on(e,n)}trigger(e,...t){if(this.destroyed)return;let n=this.listeners.get(e);if(n)for(let e of n)try{e(...t)}catch(e){console.error(e)}}off(e,t){let n=this.listeners.get(e);n&&n.delete(t)}destroy(){this.destroyed=!0,this.listeners.clear()}};function tt(e){return({React:t})=>t.forwardRef(function(n,r){let i=t.useRef(null),a=t.useRef(null),o=t.useRef(!1),s=t.useRef({});return t.useLayoutEffect(()=>{let t=i.current;if(!t)return;let s=!1,c=new e({...n});return a.current=c,c.render(t).then(()=>{s||(nt(r,c),o.current=!0)}).catch(e=>{s||console.error(e)}),()=>{s=!0,c.destroy(),a.current=null,o.current=!1,nt(r,null)}},[]),t.useEffect(()=>{!o.current||!a.current||rt(s.current,n)||(s.current={...n},a.current.updateProps({...n}).catch(it))}),t.createElement(`div`,{ref:i})})}function nt(e,t){typeof e==`function`?e(t):e&&(e.current=t)}function rt(e,t){let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(e[r]!==t[r])return!1;return!0}function it(){}function at(e){return()=>({template:`<div></div>`,inheritAttrs:!1,mounted(){let t=this.$el;this.__bridgeInstance=new e({...this.$attrs}),this.__bridgeInstance.render(t).catch(console.error)},watch:{$attrs:{handler(){this.__bridgeInstance&&this.__bridgeInstance.updateProps({...this.$attrs}).catch(()=>{})},deep:!0}},unmounted(){this.__bridgeInstance&&=(this.__bridgeInstance.destroy(),null)}})}function ot(e){return({Component:t,NgModule:n,ElementRef:r,NgZone:i,Inject:a})=>{class o{constructor(e,t){this.props={},this.__bridgeInstance=null,this._prevProps={},this.elementRef=e,this.zone=t}getProps(){let e={...this.props},{zone:t}=this;for(let[n,r]of Object.entries(e))typeof r==`function`&&(e[n]=function(...e){return t.run(()=>r.apply(this,e))});return e}ngOnInit(){let t=this.elementRef.nativeElement;this.__bridgeInstance=new e(this.getProps()),this.__bridgeInstance.render(t).catch(console.error)}ngDoCheck(){this.__bridgeInstance&&!st(this._prevProps,this.props)&&(this._prevProps={...this.props},this.__bridgeInstance.updateProps(this.getProps()).catch(()=>{}))}ngOnDestroy(){this.__bridgeInstance&&=(this.__bridgeInstance.destroy(),null)}}o.parameters=[[new a(r)],[new a(i)]],o.annotations=[new t({selector:e.prototype.__options?.tag||`bridge-component`,template:`<div></div>`,inputs:[`props`]})];class s{}return s.annotations=[new n({declarations:[o],exports:[o]})],s}}function st(e,t){let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(e[r]!==t[r])return!1;return!0}let ct={react:tt,vue3:at,angular:ot};function lt(e,t,n){let r=ct[e];if(!r)throw Error(`Unknown driver: ${e}. Available: ${Object.keys(ct).join(`, `)}`);return r(t)(n)}var H=class extends Error{code;constructor(e,t){super(t),this.name=`PenpalError`,this.code=e}},ut=e=>({name:e.name,message:e.message,stack:e.stack,penpalCode:e instanceof H?e.code:void 0}),dt=({name:e,message:t,stack:n,penpalCode:r})=>{let i=r?new H(r,t):Error(t);return i.name=e,i.stack=n,i},ft=class{value;transferables;constructor(e,t){this.value=e,this.transferables=t?.transferables}},U=`penpal`,W=e=>typeof e==`object`&&!!e,pt=e=>typeof e==`function`,mt=e=>W(e)&&e.namespace===U,G=e=>e.type===`SYN`,ht=e=>e.type===`ACK1`,gt=e=>e.type===`ACK2`,_t=e=>e.type===`CALL`,vt=e=>e.type===`REPLY`,yt=e=>e.type===`DESTROY`,bt=(e,t=[])=>{let n=[];for(let r of Object.keys(e)){let i=e[r];pt(i)?n.push([...t,r]):W(i)&&n.push(...bt(i,[...t,r]))}return n},xt=(e,t)=>{let n=e.reduce((e,t)=>W(e)?e[t]:void 0,t);return pt(n)?n:void 0},K=e=>e.join(`.`),St=(e,t,n)=>({namespace:U,channel:e,type:`REPLY`,callId:t,isError:!0,...n instanceof Error?{value:ut(n),isSerializedErrorInstance:!0}:{value:n}}),Ct=(e,t,n,r)=>{let i=!1,a=async a=>{if(i||!_t(a))return;r?.(`Received ${K(a.methodPath)}() call`,a);let{methodPath:o,args:s,id:c}=a,l,u;try{let e=xt(o,t);if(!e)throw new H(`METHOD_NOT_FOUND`,`Method \`${K(o)}\` is not found.`);let r=await e(...s);r instanceof ft&&(u=r.transferables,r=await r.value),l={namespace:U,channel:n,type:`REPLY`,callId:c,value:r}}catch(e){l=St(n,c,e)}if(!i)try{r?.(`Sending ${K(o)}() reply`,l),e.sendMessage(l,u)}catch(t){throw t.name===`DataCloneError`&&(l=St(n,c,t),r?.(`Sending ${K(o)}() reply`,l),e.sendMessage(l)),t}};return e.addMessageHandler(a),()=>{i=!0,e.removeMessageHandler(a)}},wt=crypto.randomUUID?.bind(crypto)??(()=>[,,,,].fill(0).map(()=>Math.floor(Math.random()*(2**53-1)).toString(16)).join(`-`)),Tt=class{transferables;timeout;constructor(e){this.transferables=e?.transferables,this.timeout=e?.timeout}},Et=new Set([`apply`,`call`,`bind`]),Dt=(e,t,n=[])=>new Proxy(n.length?()=>{}:Object.create(null),{get(r,i){if(i!==`then`)return n.length&&Et.has(i)?Reflect.get(r,i):Dt(e,t,[...n,i])},apply(t,r,i){return e(n,i)}}),Ot=e=>new H(`CONNECTION_DESTROYED`,`Method call ${K(e)}() failed due to destroyed connection`),kt=(e,t,n)=>{let r=!1,i=new Map,a=e=>{if(!vt(e))return;let{callId:t,value:r,isError:a,isSerializedErrorInstance:o}=e,s=i.get(t);s&&(i.delete(t),n?.(`Received ${K(s.methodPath)}() call`,e),a?s.reject(o?dt(r):r):s.resolve(r))};return e.addMessageHandler(a),{remoteProxy:Dt((a,o)=>{if(r)throw Ot(a);let s=wt(),c=o[o.length-1],l=c instanceof Tt,{timeout:u,transferables:d}=l?c:{},f=l?o.slice(0,-1):o;return new Promise((r,o)=>{let c=u===void 0?void 0:window.setTimeout(()=>{i.delete(s),o(new H(`METHOD_CALL_TIMEOUT`,`Method call ${K(a)}() timed out after ${u}ms`))},u);i.set(s,{methodPath:a,resolve:r,reject:o,timeoutId:c});try{let r={namespace:U,channel:t,type:`CALL`,id:s,methodPath:a,args:f};n?.(`Sending ${K(a)}() call`,r),e.sendMessage(r,d)}catch(e){o(new H(`TRANSMISSION_FAILED`,e.message))}})},n),destroy:()=>{r=!0,e.removeMessageHandler(a);for(let{methodPath:e,reject:t,timeoutId:n}of i.values())clearTimeout(n),t(Ot(e));i.clear()}}},At=()=>{let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}},jt=`deprecated-penpal`,Mt=e=>W(e)&&`penpal`in e,Nt=e=>e.split(`.`),Pt=e=>e.join(`.`),Ft=e=>{try{return JSON.stringify(e)}catch{return String(e)}},It=e=>new H(`TRANSMISSION_FAILED`,`Unexpected message to translate: ${Ft(e)}`),Lt=e=>{if(e.penpal===`syn`)return{namespace:U,channel:void 0,type:`SYN`,participantId:jt};if(e.penpal===`ack`)return{namespace:U,channel:void 0,type:`ACK2`};if(e.penpal===`call`)return{namespace:U,channel:void 0,type:`CALL`,id:e.id,methodPath:Nt(e.methodName),args:e.args};if(e.penpal===`reply`)return e.resolution===`fulfilled`?{namespace:U,channel:void 0,type:`REPLY`,callId:e.id,value:e.returnValue}:{namespace:U,channel:void 0,type:`REPLY`,callId:e.id,isError:!0,...e.returnValueIsError?{value:e.returnValue,isSerializedErrorInstance:!0}:{value:e.returnValue}};throw It(e)},Rt=e=>{if(ht(e))return{penpal:`synAck`,methodNames:e.methodPaths.map(Pt)};if(_t(e))return{penpal:`call`,id:e.id,methodName:Pt(e.methodPath),args:e.args};if(vt(e))return e.isError?{penpal:`reply`,id:e.callId,resolution:`rejected`,...e.isSerializedErrorInstance?{returnValue:e.value,returnValueIsError:!0}:{returnValue:e.value}}:{penpal:`reply`,id:e.callId,resolution:`fulfilled`,returnValue:e.value};throw It(e)},zt=({messenger:e,methods:t,timeout:n,channel:r,log:i})=>{let a=wt(),o,s=[],c=!1,l=bt(t),{promise:u,resolve:d,reject:f}=At(),p=n===void 0?void 0:setTimeout(()=>{f(new H(`CONNECTION_TIMEOUT`,`Connection timed out after ${n}ms`))},n),m=()=>{for(let e of s)e()},h=()=>{if(c)return;s.push(Ct(e,t,r,i));let{remoteProxy:n,destroy:a}=kt(e,r,i);s.push(a),clearTimeout(p),c=!0,d({remoteProxy:n,destroy:m})},g=()=>{let t={namespace:U,type:`SYN`,channel:r,participantId:a};i?.(`Sending handshake SYN`,t);try{e.sendMessage(t)}catch(e){f(new H(`TRANSMISSION_FAILED`,e.message))}},_=t=>{if(i?.(`Received handshake SYN`,t),t.participantId===o&&o!==jt||(o=t.participantId,g(),!(a>o||o===jt)))return;let n={namespace:U,channel:r,type:`ACK1`,methodPaths:l};i?.(`Sending handshake ACK1`,n);try{e.sendMessage(n)}catch(e){f(new H(`TRANSMISSION_FAILED`,e.message));return}},ee=t=>{i?.(`Received handshake ACK1`,t);let n={namespace:U,channel:r,type:`ACK2`};i?.(`Sending handshake ACK2`,n);try{e.sendMessage(n)}catch(e){f(new H(`TRANSMISSION_FAILED`,e.message));return}h()},v=e=>{i?.(`Received handshake ACK2`,e),h()},y=e=>{G(e)&&_(e),ht(e)&&ee(e),gt(e)&&v(e)};return e.addMessageHandler(y),s.push(()=>e.removeMessageHandler(y)),g(),u},Bt=e=>{let t=!1,n;return(...r)=>(t||(t=!0,n=e(...r)),n)},Vt=new WeakSet,Ht=({messenger:e,methods:t={},timeout:n,channel:r,log:i})=>{if(!e)throw new H(`INVALID_ARGUMENT`,`messenger must be defined`);if(Vt.has(e))throw new H(`INVALID_ARGUMENT`,`A messenger can only be used for a single connection`);Vt.add(e);let a=[e.destroy],o=Bt(t=>{if(t){let t={namespace:U,channel:r,type:`DESTROY`};try{e.sendMessage(t)}catch{}}for(let e of a)e();i?.(`Connection destroyed`)}),s=e=>mt(e)&&e.channel===r;return{promise:(async()=>{try{e.initialize({log:i,validateReceivedMessage:s}),e.addMessageHandler(e=>{yt(e)&&o(!1)});let{remoteProxy:c,destroy:l}=await zt({messenger:e,methods:t,timeout:n,channel:r,log:i});return a.push(l),c}catch(e){throw o(!0),e}})(),destroy:()=>{o(!0)}}},Ut=class{#e;#t;#n;#r;#i;#a=new Set;#o;#s=!1;constructor({remoteWindow:e,allowedOrigins:t}){if(!e)throw new H(`INVALID_ARGUMENT`,`remoteWindow must be defined`);this.#e=e,this.#t=t?.length?t:[window.origin]}initialize=({log:e,validateReceivedMessage:t})=>{this.#n=e,this.#r=t,window.addEventListener(`message`,this.#d)};sendMessage=(e,t)=>{if(G(e)){let n=this.#l(e);this.#e.postMessage(e,{targetOrigin:n,transfer:t});return}if(ht(e)||this.#s){let n=this.#s?Rt(e):e,r=this.#l(e);this.#e.postMessage(n,{targetOrigin:r,transfer:t});return}if(gt(e)){let{port1:n,port2:r}=new MessageChannel;this.#o=n,n.addEventListener(`message`,this.#f),n.start();let i=[r,...t||[]],a=this.#l(e);this.#e.postMessage(e,{targetOrigin:a,transfer:i});return}if(this.#o){this.#o.postMessage(e,{transfer:t});return}throw new H(`TRANSMISSION_FAILED`,`Cannot send message because the MessagePort is not connected`)};addMessageHandler=e=>{this.#a.add(e)};removeMessageHandler=e=>{this.#a.delete(e)};destroy=()=>{window.removeEventListener(`message`,this.#d),this.#u(),this.#a.clear()};#c=e=>this.#t.some(t=>t instanceof RegExp?t.test(e):t===e||t===`*`);#l=e=>{if(G(e))return`*`;if(!this.#i)throw new H(`TRANSMISSION_FAILED`,`Cannot send message because the remote origin is not established`);return this.#i===`null`&&this.#t.includes(`*`)?`*`:this.#i};#u=()=>{this.#o?.removeEventListener(`message`,this.#f),this.#o?.close(),this.#o=void 0};#d=({source:e,origin:t,ports:n,data:r})=>{if(e===this.#e){if(Mt(r)){this.#n?.(`Please upgrade the child window to the latest version of Penpal.`),this.#s=!0;try{r=Lt(r)}catch(e){this.#n?.(`Failed to translate deprecated message: ${e.message}`);return}}if(this.#r?.(r)){if(!this.#c(t)){this.#n?.(`Received a message from origin \`${t}\` which did not match allowed origins \`[${this.#t.join(`, `)}]\``);return}if(G(r)&&(this.#u(),this.#i=t),gt(r)&&!this.#s){if(this.#o=n[0],!this.#o){this.#n?.(`Ignoring ACK2 because it did not include a MessagePort`);return}this.#o.addEventListener(`message`,this.#f),this.#o.start()}for(let e of this.#a)e(r)}}};#f=({data:e})=>{if(this.#r?.(e))for(let t of this.#a)t(e)}};let q={RENDERED:`RENDERED`,RESIZE:`RESIZE`,DESTROY:`DESTROY`,BEFORE_CLOSE:`BEFORE_CLOSE`,DISPLAY:`DISPLAY`},Wt=new Set([`onClose`,`onDestroy`,`onRendered`,`onRender`,`onDisplay`,`onResize`,`onProps`]);function J(e){e&&e.remove()}function Y(e){return typeof e==`number`?`${e}px`:e}let Gt={"monei-card-input":`allow-scripts allow-forms allow-same-origin`,"monei-bizum":`allow-scripts allow-forms allow-same-origin allow-popups allow-popups-to-escape-sandbox`,"monei-bizum-button":`allow-scripts allow-forms allow-same-origin allow-popups allow-popups-to-escape-sandbox`,"monei-paypal":`allow-scripts allow-forms allow-same-origin allow-popups allow-popups-to-escape-sandbox`,"monei-payment-request":`allow-scripts allow-forms allow-same-origin allow-popups`,"monei-payment-modal":`allow-scripts allow-forms allow-same-origin allow-popups allow-popups-to-escape-sandbox`,"monei-google-pay":`allow-scripts allow-forms allow-same-origin allow-popups`};function Kt(e){if(!e)throw Error(`render() requires a container element or selector`);if(typeof e==`string`){let t=document.querySelector(e);if(!t)throw Error(`Container not found: ${e}`);return t}return e}function qt(e){return`${e}-${Math.random().toString(36).slice(2,9)}`}function Jt(e,t){let n=[[`onClose`,q.DESTROY],[`onDestroy`,q.DESTROY],[`onRendered`,q.RENDERED],[`onResize`,q.RESIZE]];for(let[r,i]of n)t.on(i,(...t)=>{let n=e[r];typeof n==`function`&&n(...t)})}function Yt(e){let{props:t,options:n,state:r,dispatchMap:i}=e,a={},o=new Set(n.computedProps?Object.keys(n.computedProps):[]);if(n.computedProps)for(let[e,o]of Object.entries(n.computedProps)){let n=o.factory({props:t,state:r});o.type===`function`?i.set(e,n):a[e]=n}for(let[e,n]of Object.entries(t))Wt.has(e)||o.has(e)||(typeof n==`function`?i.set(e,n):a[e]=n);let s=new Set([`close`,`resize`,`show`,`hide`,`getParentDomain`,`focus`]);return{dataProps:a,functionNames:[...i.keys()].filter(e=>!s.has(e))}}function Xt(e,t){let n={dispatchMap:new Map,connection:null,remote:null,containerEl:null,frame:null,destroyed:!1,ownsContainer:!1,pendingPropsUpdate:null,pendingRemovals:new Set},r=!1,i=!1;n.dispatchMap.set(`resize`,i=>{let{autoResize:a}=t,o={};i.width!==void 0&&(!a||a.width===!0)&&(o.width=i.width),i.height!==void 0&&(!a||a.height===!0)&&(o.height=i.height),n.frame&&(o.width!==void 0&&(n.frame.style.width=Y(o.width)),o.height!==void 0&&(n.frame.style.height=Y(o.height))),r||(r=!0,e.event.trigger(q.RENDERED)),e.event.trigger(q.RESIZE,o)}),n.dispatchMap.set(`close`,()=>e.close()),n.dispatchMap.set(`show`,()=>{n.frame&&(n.frame.style.display=``)}),n.dispatchMap.set(`hide`,()=>{n.frame&&(n.frame.style.display=`none`)}),n.dispatchMap.set(`getParentDomain`,()=>window.location.origin),n.dispatchMap.set(`focus`,()=>{n.frame&&n.frame.focus()}),e.render=async a=>{if(n.destroyed)throw Error(`Component is destroyed`);if(n.frame)throw Error(`Component already rendered`);let o=Kt(a),s=qt(t.tag),c=o.ownerDocument,l=c.createElement(`iframe`);l.src=t.url,l.setAttribute(`title`,t.tag.replace(/-/g,`_`)),l.setAttribute(`allowpaymentrequest`,`true`),l.setAttribute(`allow`,`payment`),l.style.border=`none`;let u=Gt[t.tag]??`allow-scripts allow-forms allow-same-origin`;l.setAttribute(`sandbox`,u),i||=(Jt(e.props,e.event),!0);let d=[],f={on(t,n){let r=e.event.on(t,n);return d.push(r),r},once(t,n){let r=e.event.once(t,n);return d.push(r),r},trigger(t,...n){e.event.trigger(t,...n)},off(t,n){e.event.off(t,n)},destroy(){e.event.destroy()}},p,m,h={},g=[];try{t.prerenderTemplate&&(p=t.prerenderTemplate({uid:s,frame:l,placeholder:void 0,doc:c,props:e.props,event:f,dimensions:t.dimensions??{width:`100%`,height:`auto`},state:e.state,container:o})),t.containerTemplate&&(m=t.containerTemplate({uid:s,frame:l,placeholder:p,doc:c,props:e.props,event:f,dimensions:t.dimensions??{width:`100%`,height:`auto`},state:e.state,container:o})),{dataProps:h,functionNames:g}=Yt({props:e.props,options:t,state:e.state,dispatchMap:n.dispatchMap})}catch(e){for(let e of d)e.cancel();let t=new Set([`close`,`resize`,`show`,`hide`,`getParentDomain`,`focus`]);for(let e of n.dispatchMap.keys())t.has(e)||n.dispatchMap.delete(e);throw e}n.frame=l;let _=()=>{l.contentWindow&&l.contentWindow.postMessage({type:`__monei_bridge_init__`,props:h,functionNames:g},new URL(t.url).origin)};try{if(m?(o.appendChild(m),n.containerEl=m,n.ownsContainer=!0):(o.appendChild(l),n.containerEl=o),e.event.trigger(q.DISPLAY),l.addEventListener(`load`,_),l.contentWindow&&_(),!l.contentWindow)throw Error(`iframe contentWindow is not available — frame may not be in the DOM`);let i=Ht({messenger:new Ut({remoteWindow:l.contentWindow,allowedOrigins:[new URL(t.url).origin]}),methods:{callParent:(e,t)=>{let r=n.dispatchMap.get(e);if(!r)throw Error(`Unknown parent method: ${e}`);return r(...t)}}});n.connection=i;let a;try{a=await i.promise}catch(e){if(n.destroyed)return;throw e}if(n.destroyed||(n.remote=a,e.state.__callChild=a.callChild,await a.updateProps(h,g),n.destroyed))return;if(n.pendingPropsUpdate){let e=n.pendingPropsUpdate;n.pendingPropsUpdate=null;let t=new Set(e.functionNames??[]),r=new Map;for(let i of Object.keys(e.dataProps))n.dispatchMap.has(i)&&!t.has(i)&&(r.set(i,n.dispatchMap.get(i)),n.pendingRemovals.add(i));if(await n.remote.updateProps(e.dataProps,e.functionNames),n.destroyed)return;for(let[e,t]of r)n.pendingRemovals.delete(e),n.dispatchMap.get(e)===t&&n.dispatchMap.delete(e)}r||(r=!0,e.event.trigger(q.RENDERED)),l.removeEventListener(`load`,_)}catch(t){l.removeEventListener(`load`,_);for(let e of d)e.cancel();delete e.state.__callChild,n.connection&&=(n.connection.destroy(),null),n.remote=null,n.frame=null,n.ownsContainer&&n.containerEl?n.containerEl.remove():l.parentNode&&l.remove(),n.containerEl=null,n.ownsContainer=!1,n.pendingPropsUpdate=null,n.pendingRemovals.clear();let i=new Set([`close`,`resize`,`show`,`hide`,`getParentDomain`,`focus`]);for(let e of n.dispatchMap.keys())i.has(e)||n.dispatchMap.delete(e);throw r=!1,t}},e.updateProps=async r=>{if(n.destroyed)throw Error(`Component is destroyed`);let i=$t(r,t.aliases);if(Object.assign(e.props,i),!n.frame)return;let a={},o=[],s=new Set(t.computedProps?Object.keys(t.computedProps):[]),c=new Map;for(let[e,t]of Object.entries(i))if(!(Wt.has(e)||s.has(e)))if(typeof t==`function`){let r=n.pendingPropsUpdate!=null&&e in n.pendingPropsUpdate.dataProps,i=n.pendingRemovals.has(e);(!n.dispatchMap.has(e)||r||i)&&o.push(e),n.dispatchMap.set(e,t)}else n.dispatchMap.has(e)&&n.remote&&(c.set(e,n.dispatchMap.get(e)),n.pendingRemovals.add(e)),a[e]=t;let l=o.length>0?o:void 0;if(n.remote){await n.remote.updateProps(a,l);for(let[e,t]of c)n.pendingRemovals.delete(e),n.dispatchMap.get(e)===t&&n.dispatchMap.delete(e)}else{if(n.pendingPropsUpdate||={dataProps:{},functionNames:void 0},Object.assign(n.pendingPropsUpdate.dataProps,a),n.pendingPropsUpdate.functionNames){let e=Object.keys(a);if(e.length>0){let t=new Set(e);n.pendingPropsUpdate.functionNames=n.pendingPropsUpdate.functionNames.filter(e=>!t.has(e)),n.pendingPropsUpdate.functionNames.length===0&&(n.pendingPropsUpdate.functionNames=void 0)}}if(l){for(let e of l)delete n.pendingPropsUpdate.dataProps[e];n.pendingPropsUpdate.functionNames=[...n.pendingPropsUpdate.functionNames??[],...l]}}},e.destroy=async()=>{n.destroyed||(n.destroyed=!0,e.event.trigger(q.DESTROY),n.connection&&=(n.connection.destroy(),null),n.remote=null,n.frame&&=(n.frame.remove(),null),n.ownsContainer&&n.containerEl&&n.containerEl.remove(),e.event.destroy(),n.dispatchMap.clear())},e.close=async()=>{await e.destroy()},e.__renderState=n}let Zt={react:`@monei-js/react-components`,vue3:`@monei-js/vue-components`,angular:`@monei-js/angular-components`};function Qt(e){let t=Zt[e],n=t?`Use ${t} instead.`:``;console.warn(`[MONEI] .driver('${e}') is deprecated. ${n}`.trim())}function $t(e,t){if(!t)return e;let n=new Map;for(let[e,r]of Object.entries(t))n.set(r,e);let r={};for(let[t,i]of Object.entries(e)){let e=n.get(t)??t;r[e]=i}return r}function X(e){class t{constructor(t){this.state={},this.event=new et;let n=$t(t,e.aliases);e.defaultProps?this.props={...e.defaultProps({event:this.event}),...n}:this.props={...n},e.validate&&e.validate({props:this.props}),Xt(this,e),e.submit&&(this.submit=e.submit(this))}async render(e){throw Error(`render() not attached`)}async updateProps(e){throw Error(`updateProps() not attached — call render() first`)}async close(){throw Error(`close() not attached`)}async destroy(){throw Error(`destroy() not attached`)}driver(e,n){return Qt(e),lt(e,t,n)}}function n(e){return this instanceof n?new t(e):new n(e)}return n.prototype=t.prototype,n.driver=function(e,t){return Qt(e),lt(e,n,t)},t.prototype.__options=e,n}let Z=function(e){return e.VISIBLE=`is-visible`,e.INVISIBLE=`is-invisible`,e}({});function en(e={}){let{background:t=`#fff`,overflow:n,borderRadius:r,fadeOnRender:i=!0,allowTransparency:a=!1,modal:o=!1}=e;return function({uid:e,frame:s,placeholder:c,doc:l,props:u,event:d,dimensions:{width:f,height:p}}){if(!s)return;a&&(s.setAttribute(`allowtransparency`,`true`),s.style.background=`transparent`);let m=l.createElement(`div`);m.setAttribute(`id`,e);let h=l.createElement(`style`);if(u?.cspNonce&&h.setAttribute(`nonce`,u.cspNonce),o){let t=l.createElement(`div`);t.classList.add(`backdrop`),h.appendChild(l.createTextNode(`
11
+ `),C.compileShader(e),!C.getShaderParameter(e,C.COMPILE_STATUS))throw Error(`Vertex shader compilation failed: `+C.getShaderInfoLog(e));if(C.compileShader(t),!C.getShaderParameter(t,C.COMPILE_STATUS))throw Error(`Fragment shader compilation failed: `+C.getShaderInfoLog(t));let n=C.createProgram();if(!n)throw Error(`Failed to create shader program`);if(C.attachShader(n,e),C.attachShader(n,t),C.linkProgram(n),!C.getProgramParameter(n,C.LINK_STATUS))throw Error(`Shader program linking failed: `+C.getProgramInfoLog(n));C.useProgram(n);let r=new Float32Array(548),i=2*Math.PI/137;for(let e=0;e<137;e++){let t=e*i;r[4*e]=0,r[4*e+1]=0,r[4*e+2]=Math.cos(t)*(S.width/2),r[4*e+3]=Math.sin(t)*(S.height/2)}let a=C.createBuffer();C.bindBuffer(C.ARRAY_BUFFER,a),C.bufferData(C.ARRAY_BUFFER,r,C.STATIC_DRAW);let o=C.getAttribLocation(n,`position`);C.enableVertexAttribArray(o),C.vertexAttribPointer(o,2,C.FLOAT,!1,0,0),C.viewport(0,0,S.width,S.height),C.clearColor(0,0,0,1),C.clear(C.COLOR_BUFFER_BIT),C.drawArrays(C.LINES,0,274);let s=new Uint8ClampedArray(S.width*S.height*4);return C.readPixels(0,0,S.width,S.height,C.RGBA,C.UNSIGNED_BYTE,s),new ImageData(s,S.width,S.height)}catch{return new ImageData(1,1)}finally{C&&(C.bindBuffer(C.ARRAY_BUFFER,null),C.useProgram(null),C.viewport(0,0,C.drawingBufferWidth,C.drawingBufferHeight),C.clearColor(0,0,0,0))}}())),S.width,S.height).data.toString()).toString()}}catch{return{webgl:`unsupported`}}},webrtc:async function(e){return new Promise((t=>{try{let n=window.RTCPeerConnection||window.webkitRTCPeerConnection||window.mozRTCPeerConnection;if(!n)return void t({supported:!1,error:`WebRTC not supported`});let r=new n({iceCandidatePoolSize:1,iceServers:[]});r.createDataChannel(``),(async()=>{try{let n=await r.createOffer({offerToReceiveAudio:!0,offerToReceiveVideo:!0});await r.setLocalDescription(n);let i=n.sdp||``,a=[...new Set((i.match(/extmap:\d+ [^\n\r]+/g)||[]).map((e=>e.replace(/extmap:\d+ /,``))))].sort(),o=e=>{let t=i.match(RegExp(`m=${e} [^\\s]+ [^\\s]+ ([^\\n\\r]+)`));return t?t[1].split(` `):[]},s=(e,t)=>t.map((t=>{let n=RegExp(`(rtpmap|fmtp|rtcp-fb):${t} (.+)`,`g`),r=[...i.matchAll(n)];if(!r.length)return null;let a={};return r.forEach((t=>{let[n,r,i]=t,o=i.split(`/`);r===`rtpmap`?(a.mimeType=`${e}/${o[0]}`,a.clockRate=+o[1],e===`audio`&&(a.channels=+o[2]||1)):r===`rtcp-fb`?(a.feedbackSupport=a.feedbackSupport||[],a.feedbackSupport.push(i)):r===`fmtp`&&(a.sdpFmtpLine=i)})),a})).filter(Boolean),c=s(`audio`,o(`audio`)),l=s(`video`,o(`video`)),u={audio:{count:c.length,hash:h(w(c))},video:{count:l.length,hash:h(w(l))},extensionsHash:h(w(a))},d=e?.timeout||5e3,f=Math.floor(.9*d),p=await new Promise((e=>{let t=setTimeout((()=>{r.removeEventListener(`icecandidate`,n),r.close(),e({supported:!0,...u,timeout:!0})}),f),n=i=>{let a=i.candidate;a&&a.candidate&&(clearTimeout(t),r.removeEventListener(`icecandidate`,n),r.close(),e({supported:!0,...u,candidateType:a.type||``}))};r.addEventListener(`icecandidate`,n)}));t({details:p,hash:h(w(p))})}catch(e){r.close(),t({supported:!0,error:`WebRTC offer failed: ${e.message}`})}})()}catch(e){t({supported:!1,error:`WebRTC error: ${e.message}`})}}))},speech:async function(){return new Promise((e=>{try{if(typeof window>`u`||!window.speechSynthesis||typeof window.speechSynthesis.getVoices!=`function`)return void e({supported:!1,error:`Speech Synthesis API not supported`});let t=!1,n=null,r=r=>{if(!t){t=!0,n&&clearTimeout(n);try{let t=r.map((e=>{let t=e=>e.replace(/\\/g,`\\\\`).replace(/,/g,`\\,`);return[t(e.voiceURI||``),t(e.name||``),t(e.lang||``),e.localService?`1`:`0`,e.default?`1`:`0`].join(`,`)}));t.sort();let n={voiceCount:r.length,voicesHash:h(w(t))};e({details:n,hash:h(w(n))})}catch(t){e({supported:!0,error:`Voice processing failed: ${t.message}`})}}},i=window.speechSynthesis.getVoices();if(i.length>0)return void r(i);n=setTimeout((()=>{r(window.speechSynthesis.getVoices())}),800);let a=()=>{window.speechSynthesis.removeEventListener(`voiceschanged`,a),r(window.speechSynthesis.getVoices())};window.speechSynthesis.addEventListener(`voiceschanged`,a)}catch(t){e({supported:!1,error:`Speech Synthesis error: ${t.message}`})}}))}},he={mathml:async function(){return new Promise((e=>{try{g((async({iframe:t})=>{try{if(!function(e){try{let t=e.createElement(`math`);t.innerHTML=`<mrow><mi>x</mi></mrow>`,t.style.position=`absolute`,t.style.visibility=`hidden`,e.body.appendChild(t);let n=t.getBoundingClientRect();return e.body.removeChild(t),n.width>0&&n.height>0}catch{return!1}}(t))return void e({supported:!1,error:`MathML not supported`});let n=[T(`integral`,`<msubsup><mo>∫</mo><mi>a</mi><mi>b</mi></msubsup><mfrac><mrow><mi>f</mi><mo>(</mo><mi>x</mi><mo>)</mo></mrow><mrow><mi>g</mi><mo>(</mo><mi>x</mi><mo>)</mo></mrow></mfrac><mi>dx</mi>`),T(`fraction`,`<mfrac><mrow><mi>π</mi><mo>×</mo><msup><mi>r</mi><mn>2</mn></msup></mrow><mrow><mn>2</mn><mi>σ</mi></mrow></mfrac>`),T(`matrix`,`<mo>[</mo><mtable><mtr><mtd><mi>α</mi></mtd><mtd><mi>β</mi></mtd></mtr><mtr><mtd><mi>γ</mi></mtd><mtd><mi>δ</mi></mtd></mtr></mtable><mo>]</mo>`),fe(),...pe()],r=[],i=``;n.forEach(((e,n)=>{let a=function(e,t){try{let n=t.createElement(`math`);n.innerHTML=e.replace(/<\/?math>/g,``),n.style.whiteSpace=`nowrap`,n.style.position=`absolute`,n.style.visibility=`hidden`,n.style.top=`-9999px`,t.body.appendChild(n);let r=n.getBoundingClientRect(),i=(t.defaultView||window).getComputedStyle(n),a={dimensions:{width:r.width,height:r.height},fontInfo:{fontFamily:i.fontFamily,fontSize:i.fontSize,fontWeight:i.fontWeight,fontStyle:i.fontStyle,lineHeight:i.lineHeight,fontVariant:i.fontVariant||`normal`,fontStretch:i.fontStretch||`normal`,fontSizeAdjust:i.fontSizeAdjust||`none`,textRendering:i.textRendering||`auto`,fontFeatureSettings:i.fontFeatureSettings||`normal`,fontVariantNumeric:i.fontVariantNumeric||`normal`,fontKerning:i.fontKerning||`auto`}};return t.body.removeChild(n),a}catch(e){return{error:e.message}}}(e,t);r.push({width:a.dimensions.width,height:a.dimensions.height}),n===0&&a.fontInfo&&(i=h(w(a.fontInfo)))}));let a={fontStyleHash:i,dimensions:r};e({details:a,hash:h(w(a))})}catch(t){e({supported:!1,error:`MathML error: ${t.message}`})}}))}catch(t){e({supported:!1,error:`MathML error: ${t.message}`})}}))}},ge={},_e={timeout:`true`};function ve(e,t){let n=ie();if(n.name===`unknown`&&t){let e=t.system?.browser;e!=null&&e.name&&(n={name:String(e.name),version:String(e.version||`unknown`)})}let r=n.name.toLowerCase(),i=parseInt(n.version.split(`.`)[0]||`0`,10),a=[...e?.exclude||[]],o=[...new Set([...e?.stabilize||[],`always`])];for(let e of o){let t=s[e];if(t)for(let e of t)`browsers`in e&&!e.browsers?.some((e=>{let t=e.match(/(.+?)(>=)(\d+)/);return t?r===t[1]&&i>=+t[3]:r===e}))||a.push(...e.exclude)}return a}function ye(e,t){let n=ve(t,e),r=t?.include||[];return function e(t,i=``){let a={};for(let[o,s]of Object.entries(t)){let t=i?`${i}.${o}`:o;if(typeof s!=`object`||Array.isArray(s)||s===null){let e=n.some((e=>t.startsWith(e))),i=r.some((e=>t.startsWith(e)));e&&!i||(a[o]=s)}else{let n=e(s,t);Object.keys(n).length>0&&(a[o]=n)}}return a}(e)}let be=`visitor_id`;function xe(e){return e.storage_property_name?e.storage_property_name:e.property_name_factory(be)}let Se=`${i}_${be}`;function Ce(e,t){try{localStorage.setItem(xe(t),e)}catch{}}let we=`cache`;function E(e){try{let t=localStorage.getItem(e.property_name_factory(we));return JSON.parse(t)||{}}catch{}return{}}function Te(e){return e.cache_lifetime_in_ms>r?Date.now()+r:Date.now()+e.cache_lifetime_in_ms}var D=class extends Error{constructor(e){super(`HTTP error! status: ${e}`),this.status=e}};let O=null,k=null;async function Ee(e,t,n,r){let i=await fetch(e,{method:`POST`,headers:{"x-api-key":n.api_key,Authorization:`custom-authorized`,"Content-Type":`application/json`},body:JSON.stringify(t)});if(!i.ok)throw new D(i.status);let a=await i.json();return a.visitorId&&a.visitorId!==r&&Ce(a.visitorId,n),k=a,function(e,t){!e.cache_api_call||!e.cache_lifetime_in_ms||(function(e,t){let n={...E(e),...t};try{localStorage.setItem(e.property_name_factory(we),JSON.stringify(n))}catch{}})(e,{apiResponseExpiry:Te(e),apiResponse:t})}(n,a),a}let De=(e,t)=>{if(e.cache_api_call){if(k)return Promise.resolve(k);let t=function(e){let t=E(e);if(t&&t.apiResponse&&t.apiResponseExpiry&&Date.now()<=t.apiResponseExpiry)return t.apiResponse}(e);if(t)return Promise.resolve(t);if(O)return O}let n=`${e.api_endpoint||a}/thumbmark`,r=function(e){try{let t=xe(e),n=localStorage.getItem(t);return n||t===Se||(n=localStorage.getItem(Se),n&&Ce(n,e)),n}catch{return null}}(e),i={components:t,options:e,clientHash:h(w(t)),version:`1.7.6`};if(r&&(i.visitorId=r),e.metadata){let t=typeof e.metadata==`function`?e.metadata():e.metadata;t&&((typeof t==`string`?t.length:JSON.stringify(t).length)>1e3?console.error(`ThumbmarkJS: Metadata exceeds 1000 characters. Skipping metadata.`):i.metadata=t)}let o=e.timeout||5e3,s=async function(e,t,n,r){for(let i=0;i<3;i++){i>0&&await new Promise((e=>setTimeout(e,200*i)));try{return await Ee(e,t,n,r)}catch(e){if(e instanceof D||i===2)throw e}}throw Error(`Unreachable`)}(n,i,e,r).finally((()=>{O=null})),c=new Promise((t=>{setTimeout((()=>{t(E(e)?.apiResponse||{info:{timed_out:!0},...r&&{visitorId:r}})}),o)}));return O=Promise.race([s,c]),O};async function Oe(e,t={}){var n;if(typeof document>`u`||typeof window>`u`)return{thumbmark:``,components:{},info:{},version:`1.7.6`,error:[{type:`fatal`,message:`Browser environment required`}]};try{let r={...o,...e},i=[],s=r.logging&&!sessionStorage.getItem(`_tmjs_l`)&&Math.random()<1e-4,{elapsed:c,resolvedComponents:l,errors:u}=await ke({...me,...ge,...t},r);i.push(...u);let d={},f={};if(s||r.experimental){let{elapsed:e,resolvedComponents:t,errors:n}=await ke(he,r);d=t,f=e,i.push(...n)}let p=r.api_key?De(r,l):null,m=null;if(p)try{m=await p}catch(e){if(e instanceof D&&e.status===403)return{error:[{type:`api_unauthorized`,message:`Invalid API key or quota exceeded`}],components:{},info:{},version:`1.7.6`,thumbmark:``};i.push({type:e instanceof D?`api_error`:`network_error`,message:e instanceof Error?e.message:String(e)})}(n=m?.info)!=null&&n.timed_out&&i.push({type:`api_timeout`,message:`API request timed out`});let g={...c,...f},_=r.performance?{elapsed:g}:{},v=ye(m?.components||{},r),y={...l,...v},b=m?.info||{uniqueness:{score:`api only`}},ee=m?.thumbmark??h(w(y));return s&&async function(e,t,n,r={},i=[]){let o=`${a}/log`,s={thumbmark:e,components:t,experimental:r,version:`1.7.6`,options:n,path:(window==null?void 0:window.location)?.pathname,...i.length>0&&{errors:i}};sessionStorage.setItem(`_tmjs_l`,`1`);try{await fetch(o,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(s)})}catch{}}(ee,y,r,d,i).catch((()=>{})),{...m?.visitorId&&{visitorId:m.visitorId},thumbmark:ee,components:y,info:b,version:`1.7.6`,..._,...i.length>0&&{error:i},...Object.keys(d).length>0&&r.experimental&&{experimental:d},...m?.requestId&&{requestId:m.requestId},...m?.metadata&&{metadata:m.metadata}}}catch(e){return{thumbmark:``,components:{},info:{},version:`1.7.6`,error:[{type:`fatal`,message:e instanceof Error?e.message:String(e)}]}}}async function ke(e,t){let n={...o,...t},r=ve(n).filter((e=>!e.includes(`.`))),i=Object.entries(e).filter((([e])=>!(n?.exclude)?.includes(e))).filter((([e])=>!r.includes(e))).filter((([e])=>(n?.include)?.some((e=>e.includes(`.`)))?(n?.include)?.some((t=>t.startsWith(e))):n?.include?.length===0||(n?.include)?.includes(e))),a=i.map((([e])=>e)),s=await function(e,t,n){return Promise.all(e.map((e=>{let r=performance.now();return Promise.race([e.then((e=>({value:e,elapsed:performance.now()-r}))).catch((e=>({value:n,elapsed:performance.now()-r,error:e instanceof Error?e.message:String(e)}))),(i=t,a=n,new Promise((e=>{setTimeout((()=>e(a)),i)}))).then((e=>({value:e,elapsed:performance.now()-r,error:`timeout`})))]);var i,a})))}(i.map((([e,n])=>n(t))),n?.timeout||5e3,_e),c={},l={},u=[];return s.forEach(((e,t)=>{let n=a[t];c[n]=e.elapsed??0,e.error===`timeout`?u.push({type:`component_timeout`,message:`Component '${n}' timed out`,component:n}):e.error&&u.push({type:`component_error`,message:e.error,component:n}),e.value!=null&&(l[n]=e.value)})),{elapsed:c,resolvedComponents:ye(l,n),errors:u}}var Ae=class{constructor(e){this.options={...o,...e},this.customComponents={}}async get(e){return Oe({...this.options,...e},this.customComponents)}getVersion(){return`1.7.6`}includeComponent(e,t){this.customComponents[e]=t}};let je=(e,t)=>{if(e==null)return t;if(typeof e==`number`)return e;let n=parseInt(e);return isNaN(n)?t:n},Me=(e,t)=>e==null?t:typeof e==`number`?`${e}px`:e||t;var Ne=n({fixLocalstorage:()=>Le,getClientEnv:()=>j,getClientFingerprint:()=>N,isMethodSupported:()=>We,loadScript:()=>Fe,parsePx:()=>je,stringify:()=>Ie,toCssPx:()=>Me,transformStyle:()=>Pe,validateComponentProps:()=>P,withError:()=>Ue});let Pe=e=>Object.keys(e).reduce((t,n)=>(typeof e[n]==`string`?t[n]=e[n]:t[n]=`${e[n]}px`,t),{}),Fe=(e,t,n,r)=>new Promise((i,a)=>{let o=Array.from(document.scripts).find(t=>t.src===e);if(o)if(r)o.remove();else{i(o);return}let s=document.createElement(`script`);s.src=e,s.onload=()=>i(s),s.onerror=e=>a(e),t&&s.setAttribute(`nonce`,t),n&&Object.keys(n).forEach(e=>{n[e]&&(s.dataset[e]=n[e])}),document.head.appendChild(s)}),Ie=e=>Object.keys(e).reduce((t,n)=>(e[n]!==void 0&&t.push(`${encodeURIComponent(n)}=${encodeURIComponent(e[n])}`),t),[]).join(`&`),Le=()=>{let e;try{({localStorage:e}=window)}catch{let t=(()=>{let e=new Map;return{getItem(t){return e.get(t)},setItem:function(t,n){e.set(t,n)},clear:function(){e=new Map},removeItem:function(t){e.delete(t)}}})();Object.defineProperty(window,`localStorage`,{value:t}),e=t}return e},Re=()=>{let e,t=Le();try{e=t.getItem(`i18nextLng`)}catch{}return e?e.split(`-`)[0]:``},A=e=>{try{return String(e()??``)}catch{return``}},j=()=>{let e=[window.screen.colorDepth,window.screen.height,window.screen.width,new Date().getTimezoneOffset(),Re(),A(()=>Intl.DateTimeFormat().resolvedOptions().timeZone),A(()=>window.devicePixelRatio),A(()=>navigator.hardwareConcurrency),A(()=>navigator.deviceMemory),A(()=>navigator.maxTouchPoints),A(()=>navigator.platform),A(()=>navigator.languages?.join(`,`))].join(`|`);return window.btoa(e)},ze=`_monei_fp`,Be=e=>{if(typeof crypto<`u`&&typeof crypto.getRandomValues==`function`){let t=new Uint8Array(e);return crypto.getRandomValues(t),Array.from(t,e=>(e%16).toString(16)).join(``)}return Array.from({length:e},()=>Math.floor(Math.random()*16).toString(16)).join(``)},M=null,Ve=async()=>{if(M)return{seed:M};try{let e=Le();if(M=e.getItem(ze),!M){M=Be(32);try{e.setItem(ze,M)}catch{}}}catch{M=Be(32)}return{seed:M}},He=new Ae({logging:!1});He.includeComponent(`persistent_seed`,Ve);let N=async()=>{let[,e]=await Ue(He.get());return e?.thumbmark??``},Ue=async e=>{try{return[void 0,await e]}catch(e){return[e,void 0]}},We=(e,t)=>e.paymentMethods&&e.paymentMethods.includes(t),P=({props:e})=>{if(!e.paymentId&&!(e.accountId&&e.amount&&e.currency))throw Error(`You need to provide paymentId or accountId amount and currency`)},F=`prod`,I={local:{domain:`http://card-input.localhost:1355`,paymentPageUrl:`http://payment-page.localhost:1355/`,cardInputUrl:`http://card-input.localhost:1355/`,paymentModalUrl:`http://payment-modal.localhost:1355/`,paypalUrl:`http://paypal.localhost:1355/`,bizumUrl:`http://bizum.localhost:1355/`,bizumButtonUrl:`http://bizum-button.localhost:1355/`,paymentRequestUrl:`http://payment-request.localhost:1355/`,apiUrl:`https://api.monei-dev.com/v1`,secureDomain:`https://secure.monei-dev.com`,rootDomain:`monei-dev.com`},"local-prod":{domain:`http://card-input.localhost:1355`,paymentPageUrl:`http://payment-page.localhost:1355/`,cardInputUrl:`http://card-input.localhost:1355/`,paymentModalUrl:`http://payment-modal.localhost:1355/`,paypalUrl:`http://paypal.localhost:1355/`,bizumUrl:`http://bizum.localhost:1355/`,bizumButtonUrl:`http://bizum-button.localhost:1355/`,paymentRequestUrl:`http://payment-request.localhost:1355/`,apiUrl:`https://api.monei.com/v1`,secureDomain:`https://secure.monei.com`,rootDomain:`monei.com`},tunnel:{domain:`https://card-input.monei-dev-tunnel.com`,paymentPageUrl:`https://payment-page.monei-dev-tunnel.com/`,cardInputUrl:`https://card-input.monei-dev-tunnel.com/`,paymentModalUrl:`https://payment-modal.monei-dev-tunnel.com/`,paypalUrl:`https://paypal.monei-dev-tunnel.com/`,bizumUrl:`https://bizum.monei-dev-tunnel.com/`,bizumButtonUrl:`https://bizum-button.monei-dev-tunnel.com/`,paymentRequestUrl:`https://payment-request.monei-dev-tunnel.com/`,apiUrl:`https://api.monei.com/v1`,secureDomain:`https://secure.monei.com`,rootDomain:`monei.com`},dev:{domain:`https://js.monei-dev.com`,apiUrl:`https://api.monei-dev.com/v1`,secureDomain:`https://secure.monei-dev.com`,rootDomain:`monei-dev.com`},prod:{domain:`https://js.monei.com`,apiUrl:`https://api.monei.com/v1`,secureDomain:`https://secure.monei.com`,rootDomain:`monei.com`}}[F],L=I.domain,R={domain:L,version:`v3`,stage:F,isProduction:F===`prod`,paymentPageUrl:I.paymentPageUrl||`${L}/v3/payment-page/`,cardInputUrl:I.cardInputUrl||`${L}/v3/inner-card-input/`,paymentModalUrl:I.paymentModalUrl||`${L}/v3/inner-payment-modal/`,paypalUrl:I.paypalUrl||`${L}/v3/inner-paypal/`,bizumUrl:I.bizumUrl||`${L}/v3/inner-bizum/`,bizumButtonUrl:I.bizumButtonUrl||`${L}/v3/inner-bizum-button/`,paymentRequestUrl:I.paymentRequestUrl||`${L}/v3/inner-payment-request/`,...I};var Ge=n({confirmPayment:()=>Je,createApplePaySession:()=>Ze,createPayment:()=>Ye,createToken:()=>Ke,getPayment:()=>qe,getPaymentMethods:()=>V,sendPaymentReceipt:()=>Xe,validateBizumPhone:()=>Qe});let z=async(e,{method:t=`GET`,headers:n,body:r}={})=>{t===`POST`&&(n={"Content-Type":`application/json`,...n});let i=await fetch(`${R.apiUrl}${e}`,{method:t,headers:n,body:r?JSON.stringify(r):void 0}),[,a]=await Ue(i.json());if(!i.ok)throw a||Error(i.statusText);return a},B={},V=async({accountId:e,paymentId:t})=>{let n;if(t)n={paymentId:t};else if(e)n={accountId:e};else throw Error(`You need to provide paymentId or accountId`);let r=Ie(n);if(r in B)return B[r];let i=z(`/client-payment-methods?${r}`);return B[r]=i,i.catch(()=>delete B[r]),i},Ke=async({paymentMethod:e,paymentId:t,sessionId:n,amount:r,currency:i,accountId:a,transactionType:o})=>{let s;if(t)s={paymentId:t,paymentMethod:e};else if(a)s={accountId:a,paymentMethod:e,sessionId:n,amount:r,currency:i,transactionType:o};else throw Error(`You need to provide paymentId or accountId`);let c=await z(`/tokens`,{method:`POST`,headers:{"X-Client-Env":j(),"X-Client-Fingerprint":await N()},body:s});return c.paymentToken&&!c.token&&(c.token=c.paymentToken),c},qe=async e=>z(`/payments/${e}/client-get`),Je=async({paymentId:e,...t})=>z(`/payments/${e}/client-confirm`,{method:`POST`,headers:{"X-Client-Env":j(),"X-Client-Fingerprint":await N()},body:t}),Ye=async({signature:e,...t})=>z(`/client-payments`,{method:`POST`,headers:{"X-Client-Env":j(),"X-Client-Fingerprint":await N(),"Client-Signature":e},body:t}),Xe=async({paymentId:e,customerEmail:t,signature:n,language:r})=>z(`/payments/${e}/client-receipt`,{method:`POST`,body:{customerEmail:t,signature:n,language:r}}),Ze=async e=>z(`/apple-pay/sessions`,{method:`POST`,body:e}),Qe=async e=>z(`/bizum/validate-phone`,{method:`POST`,body:e});var $e=class{constructor(){this.listeners=new Map,this.destroyed=!1}on(e,t){if(this.destroyed)return{cancel:()=>{}};let n=this.listeners.get(e);return n||(n=new Set,this.listeners.set(e,n)),n.add(t),{cancel:()=>{n.delete(t)}}}once(e,t){let n=(...r)=>{this.off(e,n),t(...r)};return this.on(e,n)}trigger(e,...t){if(this.destroyed)return;let n=this.listeners.get(e);if(n)for(let e of n)try{e(...t)}catch(e){console.error(e)}}off(e,t){let n=this.listeners.get(e);n&&n.delete(t)}destroy(){this.destroyed=!0,this.listeners.clear()}};function et(e){return({React:t})=>t.forwardRef(function(n,r){let i=t.useRef(null),a=t.useRef(null),o=t.useRef(!1),s=t.useRef({});return t.useLayoutEffect(()=>{let t=i.current;if(!t)return;let s=!1,c=new e({...n});return a.current=c,c.render(t).then(()=>{s||(tt(r,c),o.current=!0)}).catch(e=>{s||console.error(e)}),()=>{s=!0,c.destroy(),a.current=null,o.current=!1,tt(r,null)}},[]),t.useEffect(()=>{!o.current||!a.current||nt(s.current,n)||(s.current={...n},a.current.updateProps({...n}).catch(rt))}),t.createElement(`div`,{ref:i})})}function tt(e,t){typeof e==`function`?e(t):e&&(e.current=t)}function nt(e,t){let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(e[r]!==t[r])return!1;return!0}function rt(){}function it(e){return()=>({template:`<div></div>`,inheritAttrs:!1,mounted(){let t=this.$el;this.__bridgeInstance=new e({...this.$attrs}),this.__bridgeInstance.render(t).catch(console.error)},watch:{$attrs:{handler(){this.__bridgeInstance&&this.__bridgeInstance.updateProps({...this.$attrs}).catch(()=>{})},deep:!0}},unmounted(){this.__bridgeInstance&&=(this.__bridgeInstance.destroy(),null)}})}function at(e){return({Component:t,NgModule:n,ElementRef:r,NgZone:i,Inject:a})=>{class o{constructor(e,t){this.props={},this.__bridgeInstance=null,this._prevProps={},this.elementRef=e,this.zone=t}getProps(){let e={...this.props},{zone:t}=this;for(let[n,r]of Object.entries(e))typeof r==`function`&&(e[n]=function(...e){return t.run(()=>r.apply(this,e))});return e}ngOnInit(){let t=this.elementRef.nativeElement;this.__bridgeInstance=new e(this.getProps()),this.__bridgeInstance.render(t).catch(console.error)}ngDoCheck(){this.__bridgeInstance&&!ot(this._prevProps,this.props)&&(this._prevProps={...this.props},this.__bridgeInstance.updateProps(this.getProps()).catch(()=>{}))}ngOnDestroy(){this.__bridgeInstance&&=(this.__bridgeInstance.destroy(),null)}}o.parameters=[[new a(r)],[new a(i)]],o.annotations=[new t({selector:e.prototype.__options?.tag||`bridge-component`,template:`<div></div>`,inputs:[`props`]})];class s{}return s.annotations=[new n({declarations:[o],exports:[o]})],s}}function ot(e,t){let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(e[r]!==t[r])return!1;return!0}let st={react:et,vue3:it,angular:at};function ct(e,t,n){let r=st[e];if(!r)throw Error(`Unknown driver: ${e}. Available: ${Object.keys(st).join(`, `)}`);return r(t)(n)}var H=class extends Error{code;constructor(e,t){super(t),this.name=`PenpalError`,this.code=e}},lt=e=>({name:e.name,message:e.message,stack:e.stack,penpalCode:e instanceof H?e.code:void 0}),ut=({name:e,message:t,stack:n,penpalCode:r})=>{let i=r?new H(r,t):Error(t);return i.name=e,i.stack=n,i},dt=class{value;transferables;constructor(e,t){this.value=e,this.transferables=t?.transferables}},U=`penpal`,W=e=>typeof e==`object`&&!!e,ft=e=>typeof e==`function`,pt=e=>W(e)&&e.namespace===U,G=e=>e.type===`SYN`,mt=e=>e.type===`ACK1`,ht=e=>e.type===`ACK2`,gt=e=>e.type===`CALL`,_t=e=>e.type===`REPLY`,vt=e=>e.type===`DESTROY`,yt=(e,t=[])=>{let n=[];for(let r of Object.keys(e)){let i=e[r];ft(i)?n.push([...t,r]):W(i)&&n.push(...yt(i,[...t,r]))}return n},bt=(e,t)=>{let n=e.reduce((e,t)=>W(e)?e[t]:void 0,t);return ft(n)?n:void 0},K=e=>e.join(`.`),xt=(e,t,n)=>({namespace:U,channel:e,type:`REPLY`,callId:t,isError:!0,...n instanceof Error?{value:lt(n),isSerializedErrorInstance:!0}:{value:n}}),St=(e,t,n,r)=>{let i=!1,a=async a=>{if(i||!gt(a))return;r?.(`Received ${K(a.methodPath)}() call`,a);let{methodPath:o,args:s,id:c}=a,l,u;try{let e=bt(o,t);if(!e)throw new H(`METHOD_NOT_FOUND`,`Method \`${K(o)}\` is not found.`);let r=await e(...s);r instanceof dt&&(u=r.transferables,r=await r.value),l={namespace:U,channel:n,type:`REPLY`,callId:c,value:r}}catch(e){l=xt(n,c,e)}if(!i)try{r?.(`Sending ${K(o)}() reply`,l),e.sendMessage(l,u)}catch(t){throw t.name===`DataCloneError`&&(l=xt(n,c,t),r?.(`Sending ${K(o)}() reply`,l),e.sendMessage(l)),t}};return e.addMessageHandler(a),()=>{i=!0,e.removeMessageHandler(a)}},Ct=crypto.randomUUID?.bind(crypto)??(()=>[,,,,].fill(0).map(()=>Math.floor(Math.random()*(2**53-1)).toString(16)).join(`-`)),wt=class{transferables;timeout;constructor(e){this.transferables=e?.transferables,this.timeout=e?.timeout}},Tt=new Set([`apply`,`call`,`bind`]),Et=(e,t,n=[])=>new Proxy(n.length?()=>{}:Object.create(null),{get(r,i){if(i!==`then`)return n.length&&Tt.has(i)?Reflect.get(r,i):Et(e,t,[...n,i])},apply(t,r,i){return e(n,i)}}),Dt=e=>new H(`CONNECTION_DESTROYED`,`Method call ${K(e)}() failed due to destroyed connection`),Ot=(e,t,n)=>{let r=!1,i=new Map,a=e=>{if(!_t(e))return;let{callId:t,value:r,isError:a,isSerializedErrorInstance:o}=e,s=i.get(t);s&&(i.delete(t),n?.(`Received ${K(s.methodPath)}() call`,e),a?s.reject(o?ut(r):r):s.resolve(r))};return e.addMessageHandler(a),{remoteProxy:Et((a,o)=>{if(r)throw Dt(a);let s=Ct(),c=o[o.length-1],l=c instanceof wt,{timeout:u,transferables:d}=l?c:{},f=l?o.slice(0,-1):o;return new Promise((r,o)=>{let c=u===void 0?void 0:window.setTimeout(()=>{i.delete(s),o(new H(`METHOD_CALL_TIMEOUT`,`Method call ${K(a)}() timed out after ${u}ms`))},u);i.set(s,{methodPath:a,resolve:r,reject:o,timeoutId:c});try{let r={namespace:U,channel:t,type:`CALL`,id:s,methodPath:a,args:f};n?.(`Sending ${K(a)}() call`,r),e.sendMessage(r,d)}catch(e){o(new H(`TRANSMISSION_FAILED`,e.message))}})},n),destroy:()=>{r=!0,e.removeMessageHandler(a);for(let{methodPath:e,reject:t,timeoutId:n}of i.values())clearTimeout(n),t(Dt(e));i.clear()}}},kt=()=>{let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}},At=`deprecated-penpal`,jt=e=>W(e)&&`penpal`in e,Mt=e=>e.split(`.`),Nt=e=>e.join(`.`),Pt=e=>{try{return JSON.stringify(e)}catch{return String(e)}},Ft=e=>new H(`TRANSMISSION_FAILED`,`Unexpected message to translate: ${Pt(e)}`),It=e=>{if(e.penpal===`syn`)return{namespace:U,channel:void 0,type:`SYN`,participantId:At};if(e.penpal===`ack`)return{namespace:U,channel:void 0,type:`ACK2`};if(e.penpal===`call`)return{namespace:U,channel:void 0,type:`CALL`,id:e.id,methodPath:Mt(e.methodName),args:e.args};if(e.penpal===`reply`)return e.resolution===`fulfilled`?{namespace:U,channel:void 0,type:`REPLY`,callId:e.id,value:e.returnValue}:{namespace:U,channel:void 0,type:`REPLY`,callId:e.id,isError:!0,...e.returnValueIsError?{value:e.returnValue,isSerializedErrorInstance:!0}:{value:e.returnValue}};throw Ft(e)},Lt=e=>{if(mt(e))return{penpal:`synAck`,methodNames:e.methodPaths.map(Nt)};if(gt(e))return{penpal:`call`,id:e.id,methodName:Nt(e.methodPath),args:e.args};if(_t(e))return e.isError?{penpal:`reply`,id:e.callId,resolution:`rejected`,...e.isSerializedErrorInstance?{returnValue:e.value,returnValueIsError:!0}:{returnValue:e.value}}:{penpal:`reply`,id:e.callId,resolution:`fulfilled`,returnValue:e.value};throw Ft(e)},Rt=({messenger:e,methods:t,timeout:n,channel:r,log:i})=>{let a=Ct(),o,s=[],c=!1,l=yt(t),{promise:u,resolve:d,reject:f}=kt(),p=n===void 0?void 0:setTimeout(()=>{f(new H(`CONNECTION_TIMEOUT`,`Connection timed out after ${n}ms`))},n),m=()=>{for(let e of s)e()},h=()=>{if(c)return;s.push(St(e,t,r,i));let{remoteProxy:n,destroy:a}=Ot(e,r,i);s.push(a),clearTimeout(p),c=!0,d({remoteProxy:n,destroy:m})},g=()=>{let t={namespace:U,type:`SYN`,channel:r,participantId:a};i?.(`Sending handshake SYN`,t);try{e.sendMessage(t)}catch(e){f(new H(`TRANSMISSION_FAILED`,e.message))}},_=t=>{if(i?.(`Received handshake SYN`,t),t.participantId===o&&o!==At||(o=t.participantId,g(),!(a>o||o===At)))return;let n={namespace:U,channel:r,type:`ACK1`,methodPaths:l};i?.(`Sending handshake ACK1`,n);try{e.sendMessage(n)}catch(e){f(new H(`TRANSMISSION_FAILED`,e.message));return}},v=t=>{i?.(`Received handshake ACK1`,t);let n={namespace:U,channel:r,type:`ACK2`};i?.(`Sending handshake ACK2`,n);try{e.sendMessage(n)}catch(e){f(new H(`TRANSMISSION_FAILED`,e.message));return}h()},y=e=>{i?.(`Received handshake ACK2`,e),h()},b=e=>{G(e)&&_(e),mt(e)&&v(e),ht(e)&&y(e)};return e.addMessageHandler(b),s.push(()=>e.removeMessageHandler(b)),g(),u},zt=e=>{let t=!1,n;return(...r)=>(t||(t=!0,n=e(...r)),n)},Bt=new WeakSet,Vt=({messenger:e,methods:t={},timeout:n,channel:r,log:i})=>{if(!e)throw new H(`INVALID_ARGUMENT`,`messenger must be defined`);if(Bt.has(e))throw new H(`INVALID_ARGUMENT`,`A messenger can only be used for a single connection`);Bt.add(e);let a=[e.destroy],o=zt(t=>{if(t){let t={namespace:U,channel:r,type:`DESTROY`};try{e.sendMessage(t)}catch{}}for(let e of a)e();i?.(`Connection destroyed`)}),s=e=>pt(e)&&e.channel===r;return{promise:(async()=>{try{e.initialize({log:i,validateReceivedMessage:s}),e.addMessageHandler(e=>{vt(e)&&o(!1)});let{remoteProxy:c,destroy:l}=await Rt({messenger:e,methods:t,timeout:n,channel:r,log:i});return a.push(l),c}catch(e){throw o(!0),e}})(),destroy:()=>{o(!0)}}},Ht=class{#e;#t;#n;#r;#i;#a=new Set;#o;#s=!1;constructor({remoteWindow:e,allowedOrigins:t}){if(!e)throw new H(`INVALID_ARGUMENT`,`remoteWindow must be defined`);this.#e=e,this.#t=t?.length?t:[window.origin]}initialize=({log:e,validateReceivedMessage:t})=>{this.#n=e,this.#r=t,window.addEventListener(`message`,this.#d)};sendMessage=(e,t)=>{if(G(e)){let n=this.#l(e);this.#e.postMessage(e,{targetOrigin:n,transfer:t});return}if(mt(e)||this.#s){let n=this.#s?Lt(e):e,r=this.#l(e);this.#e.postMessage(n,{targetOrigin:r,transfer:t});return}if(ht(e)){let{port1:n,port2:r}=new MessageChannel;this.#o=n,n.addEventListener(`message`,this.#f),n.start();let i=[r,...t||[]],a=this.#l(e);this.#e.postMessage(e,{targetOrigin:a,transfer:i});return}if(this.#o){this.#o.postMessage(e,{transfer:t});return}throw new H(`TRANSMISSION_FAILED`,`Cannot send message because the MessagePort is not connected`)};addMessageHandler=e=>{this.#a.add(e)};removeMessageHandler=e=>{this.#a.delete(e)};destroy=()=>{window.removeEventListener(`message`,this.#d),this.#u(),this.#a.clear()};#c=e=>this.#t.some(t=>t instanceof RegExp?t.test(e):t===e||t===`*`);#l=e=>{if(G(e))return`*`;if(!this.#i)throw new H(`TRANSMISSION_FAILED`,`Cannot send message because the remote origin is not established`);return this.#i===`null`&&this.#t.includes(`*`)?`*`:this.#i};#u=()=>{this.#o?.removeEventListener(`message`,this.#f),this.#o?.close(),this.#o=void 0};#d=({source:e,origin:t,ports:n,data:r})=>{if(e===this.#e){if(jt(r)){this.#n?.(`Please upgrade the child window to the latest version of Penpal.`),this.#s=!0;try{r=It(r)}catch(e){this.#n?.(`Failed to translate deprecated message: ${e.message}`);return}}if(this.#r?.(r)){if(!this.#c(t)){this.#n?.(`Received a message from origin \`${t}\` which did not match allowed origins \`[${this.#t.join(`, `)}]\``);return}if(G(r)&&(this.#u(),this.#i=t),ht(r)&&!this.#s){if(this.#o=n[0],!this.#o){this.#n?.(`Ignoring ACK2 because it did not include a MessagePort`);return}this.#o.addEventListener(`message`,this.#f),this.#o.start()}for(let e of this.#a)e(r)}}};#f=({data:e})=>{if(this.#r?.(e))for(let t of this.#a)t(e)}};let q={RENDERED:`RENDERED`,RESIZE:`RESIZE`,DESTROY:`DESTROY`,BEFORE_CLOSE:`BEFORE_CLOSE`,DISPLAY:`DISPLAY`},Ut=new Set([`onClose`,`onDestroy`,`onRendered`,`onRender`,`onDisplay`,`onResize`,`onProps`]);function J(e){e&&e.remove()}function Y(e){return typeof e==`number`?`${e}px`:e}let Wt={"monei-card-input":`allow-scripts allow-forms allow-same-origin`,"monei-bizum":`allow-scripts allow-forms allow-same-origin allow-popups allow-popups-to-escape-sandbox`,"monei-bizum-button":`allow-scripts allow-forms allow-same-origin allow-popups allow-popups-to-escape-sandbox`,"monei-paypal":`allow-scripts allow-forms allow-same-origin allow-popups allow-popups-to-escape-sandbox`,"monei-payment-request":`allow-scripts allow-forms allow-same-origin allow-popups`,"monei-payment-modal":`allow-scripts allow-forms allow-same-origin allow-popups allow-popups-to-escape-sandbox`,"monei-google-pay":`allow-scripts allow-forms allow-same-origin allow-popups`};function Gt(e){if(!e)throw Error(`render() requires a container element or selector`);if(typeof e==`string`){let t=document.querySelector(e);if(!t)throw Error(`Container not found: ${e}`);return t}return e}function Kt(e){return`${e}-${Math.random().toString(36).slice(2,9)}`}function qt(e,t){let n=[[`onClose`,q.DESTROY],[`onDestroy`,q.DESTROY],[`onRendered`,q.RENDERED],[`onResize`,q.RESIZE]];for(let[r,i]of n)t.on(i,(...t)=>{let n=e[r];typeof n==`function`&&n(...t)})}function Jt(e){let{props:t,options:n,state:r,dispatchMap:i}=e,a={},o=new Set(n.computedProps?Object.keys(n.computedProps):[]);if(n.computedProps)for(let[e,o]of Object.entries(n.computedProps)){let n=o.factory({props:t,state:r});o.type===`function`?i.set(e,n):a[e]=n}for(let[e,n]of Object.entries(t))Ut.has(e)||o.has(e)||(typeof n==`function`?i.set(e,n):a[e]=n);let s=new Set([`close`,`resize`,`show`,`hide`,`getParentDomain`,`focus`]);return{dataProps:a,functionNames:[...i.keys()].filter(e=>!s.has(e))}}function Yt(e,t){let n={dispatchMap:new Map,connection:null,remote:null,containerEl:null,frame:null,destroyed:!1,ownsContainer:!1,pendingPropsUpdate:null,pendingRemovals:new Set},r=!1,i=!1;n.dispatchMap.set(`resize`,i=>{let{autoResize:a}=t,o={};i.width!==void 0&&(!a||a.width===!0)&&(o.width=i.width),i.height!==void 0&&(!a||a.height===!0)&&(o.height=i.height),n.frame&&(o.width!==void 0&&(n.frame.style.width=Y(o.width)),o.height!==void 0&&(n.frame.style.height=Y(o.height))),r||(r=!0,e.event.trigger(q.RENDERED)),e.event.trigger(q.RESIZE,o)}),n.dispatchMap.set(`close`,()=>e.close()),n.dispatchMap.set(`show`,()=>{n.frame&&(n.frame.style.display=``)}),n.dispatchMap.set(`hide`,()=>{n.frame&&(n.frame.style.display=`none`)}),n.dispatchMap.set(`getParentDomain`,()=>window.location.origin),n.dispatchMap.set(`focus`,()=>{n.frame&&n.frame.focus()}),e.render=async a=>{if(n.destroyed)throw Error(`Component is destroyed`);if(n.frame)throw Error(`Component already rendered`);let o=Gt(a),s=Kt(t.tag),c=o.ownerDocument,l=c.createElement(`iframe`);l.src=t.url,l.setAttribute(`title`,t.tag.replace(/-/g,`_`)),l.setAttribute(`allowpaymentrequest`,`true`),l.setAttribute(`allow`,`payment`),l.style.border=`none`;let u=Wt[t.tag]??`allow-scripts allow-forms allow-same-origin`;l.setAttribute(`sandbox`,u),i||=(qt(e.props,e.event),!0);let d=[],f={on(t,n){let r=e.event.on(t,n);return d.push(r),r},once(t,n){let r=e.event.once(t,n);return d.push(r),r},trigger(t,...n){e.event.trigger(t,...n)},off(t,n){e.event.off(t,n)},destroy(){e.event.destroy()}},p,m,h={},g=[];try{t.prerenderTemplate&&(p=t.prerenderTemplate({uid:s,frame:l,placeholder:void 0,doc:c,props:e.props,event:f,dimensions:t.dimensions??{width:`100%`,height:`auto`},state:e.state,container:o})),t.containerTemplate&&(m=t.containerTemplate({uid:s,frame:l,placeholder:p,doc:c,props:e.props,event:f,dimensions:t.dimensions??{width:`100%`,height:`auto`},state:e.state,container:o})),{dataProps:h,functionNames:g}=Jt({props:e.props,options:t,state:e.state,dispatchMap:n.dispatchMap})}catch(e){for(let e of d)e.cancel();let t=new Set([`close`,`resize`,`show`,`hide`,`getParentDomain`,`focus`]);for(let e of n.dispatchMap.keys())t.has(e)||n.dispatchMap.delete(e);throw e}n.frame=l;let _=new URL(t.url).origin,v=()=>{try{l.contentWindow?.postMessage({type:`__monei_bridge_init__`,props:h,functionNames:g},_)}catch{}};try{if(m?(o.appendChild(m),n.containerEl=m,n.ownsContainer=!0):(o.appendChild(l),n.containerEl=o),e.event.trigger(q.DISPLAY),l.addEventListener(`load`,v),l.contentWindow&&v(),!l.contentWindow)throw Error(`iframe contentWindow is not available — frame may not be in the DOM`);let i=Vt({messenger:new Ht({remoteWindow:l.contentWindow,allowedOrigins:[new URL(t.url).origin]}),methods:{callParent:(e,t)=>{let r=n.dispatchMap.get(e);if(!r)throw Error(`Unknown parent method: ${e}`);return r(...t)}}});n.connection=i;let a;try{a=await i.promise}catch(e){if(n.destroyed)return;throw e}if(n.destroyed||(n.remote=a,e.state.__callChild=a.callChild,await a.updateProps(h,g),n.destroyed))return;if(n.pendingPropsUpdate){let e=n.pendingPropsUpdate;n.pendingPropsUpdate=null;let t=new Set(e.functionNames??[]),r=new Map;for(let i of Object.keys(e.dataProps))n.dispatchMap.has(i)&&!t.has(i)&&(r.set(i,n.dispatchMap.get(i)),n.pendingRemovals.add(i));if(await n.remote.updateProps(e.dataProps,e.functionNames),n.destroyed)return;for(let[e,t]of r)n.pendingRemovals.delete(e),n.dispatchMap.get(e)===t&&n.dispatchMap.delete(e)}r||(r=!0,e.event.trigger(q.RENDERED)),l.removeEventListener(`load`,v)}catch(t){l.removeEventListener(`load`,v);for(let e of d)e.cancel();delete e.state.__callChild,n.connection&&=(n.connection.destroy(),null),n.remote=null,n.frame=null,n.ownsContainer&&n.containerEl?n.containerEl.remove():l.parentNode&&l.remove(),n.containerEl=null,n.ownsContainer=!1,n.pendingPropsUpdate=null,n.pendingRemovals.clear();let i=new Set([`close`,`resize`,`show`,`hide`,`getParentDomain`,`focus`]);for(let e of n.dispatchMap.keys())i.has(e)||n.dispatchMap.delete(e);throw r=!1,t}},e.updateProps=async r=>{if(n.destroyed)throw Error(`Component is destroyed`);let i=Qt(r,t.aliases);if(Object.assign(e.props,i),!n.frame)return;let a={},o=[],s=new Set(t.computedProps?Object.keys(t.computedProps):[]),c=new Map;for(let[e,t]of Object.entries(i))if(!(Ut.has(e)||s.has(e)))if(typeof t==`function`){let r=n.pendingPropsUpdate!=null&&e in n.pendingPropsUpdate.dataProps,i=n.pendingRemovals.has(e);(!n.dispatchMap.has(e)||r||i)&&o.push(e),n.dispatchMap.set(e,t)}else n.dispatchMap.has(e)&&n.remote&&(c.set(e,n.dispatchMap.get(e)),n.pendingRemovals.add(e)),a[e]=t;let l=o.length>0?o:void 0;if(n.remote){await n.remote.updateProps(a,l);for(let[e,t]of c)n.pendingRemovals.delete(e),n.dispatchMap.get(e)===t&&n.dispatchMap.delete(e)}else{if(n.pendingPropsUpdate||={dataProps:{},functionNames:void 0},Object.assign(n.pendingPropsUpdate.dataProps,a),n.pendingPropsUpdate.functionNames){let e=Object.keys(a);if(e.length>0){let t=new Set(e);n.pendingPropsUpdate.functionNames=n.pendingPropsUpdate.functionNames.filter(e=>!t.has(e)),n.pendingPropsUpdate.functionNames.length===0&&(n.pendingPropsUpdate.functionNames=void 0)}}if(l){for(let e of l)delete n.pendingPropsUpdate.dataProps[e];n.pendingPropsUpdate.functionNames=[...n.pendingPropsUpdate.functionNames??[],...l]}}},e.destroy=async()=>{n.destroyed||(n.destroyed=!0,e.event.trigger(q.DESTROY),n.connection&&=(n.connection.destroy(),null),n.remote=null,n.frame&&=(n.frame.remove(),null),n.ownsContainer&&n.containerEl&&n.containerEl.remove(),e.event.destroy(),n.dispatchMap.clear())},e.close=async()=>{await e.destroy()},e.__renderState=n}let Xt={react:`@monei-js/react-components`,vue3:`@monei-js/vue-components`,angular:`@monei-js/angular-components`};function Zt(e){let t=Xt[e],n=t?`Use ${t} instead.`:``;console.warn(`[MONEI] .driver('${e}') is deprecated. ${n}`.trim())}function Qt(e,t){if(!t)return e;let n=new Map;for(let[e,r]of Object.entries(t))n.set(r,e);let r={};for(let[t,i]of Object.entries(e)){let e=n.get(t)??t;r[e]=i}return r}function X(e){class t{constructor(t){this.state={},this.event=new $e;let n=Qt(t,e.aliases);e.defaultProps?this.props={...e.defaultProps({event:this.event}),...n}:this.props={...n},e.validate&&e.validate({props:this.props}),Yt(this,e),e.submit&&(this.submit=e.submit(this))}async render(e){throw Error(`render() not attached`)}async updateProps(e){throw Error(`updateProps() not attached — call render() first`)}async close(){throw Error(`close() not attached`)}async destroy(){throw Error(`destroy() not attached`)}driver(e,n){return Zt(e),ct(e,t,n)}}function n(e){return this instanceof n?new t(e):new n(e)}return n.prototype=t.prototype,n.driver=function(e,t){return Zt(e),ct(e,n,t)},t.prototype.__options=e,n}let Z=function(e){return e.VISIBLE=`is-visible`,e.INVISIBLE=`is-invisible`,e}({});function $t(e={}){let{background:t=`#fff`,overflow:n,borderRadius:r,fadeOnRender:i=!0,allowTransparency:a=!1,modal:o=!1}=e;return function({uid:e,frame:s,placeholder:c,doc:l,props:u,event:d,dimensions:{width:f,height:p}}){if(!s)return;a&&(s.setAttribute(`allowtransparency`,`true`),s.style.background=`transparent`);let m=l.createElement(`div`);m.setAttribute(`id`,e);let h=l.createElement(`style`);if(u?.cspNonce&&h.setAttribute(`nonce`,u.cspNonce),o){let t=l.createElement(`div`);t.classList.add(`backdrop`),h.appendChild(l.createTextNode(`
12
12
  #${e} {
13
13
  position: fixed;
14
14
  inset: 0;
@@ -60,5 +60,5 @@
60
60
  #${e} > iframe.${Z.VISIBLE} {
61
61
  opacity: 1;
62
62
  }
63
- `)),m.appendChild(s),c&&m.appendChild(c),m.appendChild(h),d.on(q.RESIZE,({width:e,height:t})=>{typeof e==`number`&&(m.style.width=Y(e)),typeof t==`number`&&(m.style.height=Y(t))}),c&&(s.classList.add(Z.INVISIBLE),i&&c.classList.add(Z.VISIBLE),d.on(q.RENDERED,()=>{i?(c.classList.remove(Z.VISIBLE),c.classList.add(Z.INVISIBLE),s.classList.remove(Z.INVISIBLE),s.classList.add(Z.VISIBLE),setTimeout(()=>J(c),1)):(J(c),s.style.transition=`none`,s.classList.remove(Z.INVISIBLE),s.classList.add(Z.VISIBLE))}))}return m}}let Q=en({overflow:`hidden`,borderRadius:`var(--monei-radius, 4px)`}),tn=en({modal:!0}),nn=e=>{if(e.state?.__createToken)return e.state.__createToken;throw Error(`Index is not registered`)},rn=async(e,t)=>{console.warn(`[MONEI] Standalone createToken() is deprecated. Use cardInput.submit() instead.`);let{data:n}=await nn(e)(t);return n},an=X({tag:`monei-card-input`,url:R.cardInputUrl,dimensions:{width:`100%`,height:`auto`},autoResize:{width:!1,height:!0},aliases:{sessionId:`orderId`,style:`innerStyle`},computedProps:{__getConfig:{factory:({props:e})=>V.bind(null,e),type:`function`}},validate:P,submit:e=>async t=>{let n=e.state?.__createToken;if(!n)throw Error(`CardInput is not rendered or connection is pending — call render() first`);let{data:r}=await n(t);return r},containerTemplate:e=>(e.state.__createToken=async(t={})=>{let n=e.state.__callChild;if(!n)throw Error(`CardInput instance is not registered`);return{data:await n(`createToken`,[t])}},Q(e)),prerenderTemplate:({doc:e,props:t})=>{let n=e.createElement(`html`),r=e.createElement(`body`);r.style.margin=`0`,r.style.background=`#fff`;let i=e.createElement(`div`);i.style.height=`45px`,i.style.boxSizing=`border-box`;let a=t.style||t.innerStyle;return a?.base&&Object.assign(i.style,Pe(a.base)),a?.loading&&Object.assign(i.style,Pe(a.loading)),r.appendChild(i),n.appendChild(r),n}}),on=X({tag:`monei-payment-modal`,url:R.paymentModalUrl,dimensions:{width:`100%`,height:`100%`},autoResize:{width:!1,height:!1},aliases:{style:`innerStyle`},containerTemplate:en({background:`transparent`,fadeOnRender:!1,allowTransparency:!0})}),sn=e=>{let t=document.createElement(`div`),n=document.body.style.overflow;Object.assign(document.body.style,{overflow:`hidden`}),Object.assign(t.style,{position:`fixed`,overflow:`hidden`,display:`block`,top:`0`,bottom:`0`,left:`0`,right:`0`,width:`100%`,height:`100%`,zIndex:`99999`}),document.body.appendChild(t);let r=null,i=()=>{r?.destroy(),r=null,Object.assign(document.body.style,{overflow:n}),t.parentNode&&t.parentNode.removeChild(t)};return new Promise((n,a)=>{r=new on({...e,isOpen:!0,onResult:e=>{n(e),i()},onError:e=>{a(e),i()}}),r.render(t).catch(e=>{i(),a(e)})})},$=`monei-paypal`,cn=async(e,t,n)=>{t.__scriptId=(await Fe(n,e.cspNonce,{namespace:$,cspNonce:e.cspNonce},!0)).dataset.uidAuto;let r={layout:`horizontal`,tagline:!1,height:45},i=k(e.style?.borderRadius??e.borderRadius);i&&(r.borderRadius=i);let a={...r,...e.style};a.height=k(a.height,45),e.onLoad?.(!0);let o;await window[$].Buttons({createOrder:async()=>{try{let t=await qe({paymentId:e.paymentId,accountId:e.accountId,sessionId:e.sessionId,amount:e.amount,currency:e.currency,transactionType:e.transactionType,paymentMethod:{paypal:{}}});return{token:o}=t,t.paypal?.orderId}catch(t){e.onError?.(t);return}},onApprove:function(t){t.orderID?e.onSubmit({token:o}):e.onError?.(t)},onClick:function(t,n){let r=!0;if(e.onBeforeOpen&&(r=e.onBeforeOpen()),!r)return n.reject()},style:a}).render(t.__container)},ln=X({tag:$,url:R.paypalUrl,dimensions:{width:`100%`,height:`0`},autoResize:{width:!1,height:!1},aliases:{style:`innerStyle`},computedProps:{__getConfig:{factory:({props:e})=>V.bind(null,e),type:`function`},__onLoadPayPal:{factory:({props:e,state:t})=>cn.bind(null,e,t),type:`function`}},containerTemplate:e=>{if(e.state.__container=e.container,!e.props.accountId&&!e.props.paymentId)throw Error(`You need to provide paymentId or accountId`);let t=Q(e);return e.event.on(q.DESTROY,()=>{window[$]?.Buttons?.instances?.forEach(e=>{e.close()});let t=e.state.__scriptId;if(t){let e=document.querySelector(`script[data-uid-auto="${t}"]`);e&&e.remove()}}),t}}),un=X({tag:`monei-bizum`,url:R.bizumUrl,autoResize:{width:!1,height:!1},containerTemplate:e=>{if(e.frame){if(e.props.isHidden){let t=e.doc.createElement(`div`);return t.setAttribute(`id`,e.uid),t.style.display=`none`,t.appendChild(e.frame),e.placeholder&&t.appendChild(e.placeholder),t}return tn(e)}},defaultProps:({event:e})=>({onBeforeClose:()=>{e.trigger(q.BEFORE_CLOSE)}})}),dn=X({tag:`monei-bizum-button`,url:R.bizumButtonUrl,dimensions:{width:`100%`,height:`auto`},autoResize:{width:!1,height:!0},aliases:{style:`innerStyle`},computedProps:{__getConfig:{factory:({props:e})=>V.bind(null,e),type:`function`},__onClick:{factory:({props:e,state:t})=>{let n=document.createElement(`div`);return({amount:r,currency:i})=>{if(t.isOpen)return;let a=!0;if(e.onBeforeOpen&&(a=e.onBeforeOpen()),!a)return;t.isOpen=!0,n.parentNode||document.body.appendChild(n);let o=new un({amount:r,currency:i,...e,onClose:()=>{t.isOpen=!1,window.onpopstate=null,document.body.style.overflow=``},isOpen:!0});return window.history.pushState(null,``,window.location.href),window.onpopstate=()=>o.updateProps({isOpen:!1}),Object.assign(document.body.style,{overflow:`hidden`}),o.render(n)}},type:`function`}},validate:P,containerTemplate:Q}),fn=X({tag:`monei-google-pay`,url:R.paymentRequestUrl,dimensions:{width:`100%`,height:`0`},autoResize:{width:!1,height:!0},aliases:{style:`innerStyle`},computedProps:{__getConfig:{factory:({props:e})=>V.bind(null,e),type:`function`}},validate:P,containerTemplate:Q}),pn=X({tag:`monei-payment-request`,url:R.paymentRequestUrl,dimensions:{width:`100%`,height:`auto`},autoResize:{width:!1,height:!0},aliases:{style:`innerStyle`},computedProps:{__getConfig:{factory:({props:e})=>V.bind(null,e),type:`function`}},validate:P,containerTemplate:Q}),mn=function(e){return e.CONFIRM=`CONFIRM`,e.FRICTIONLESS_CHALLENGE=`FRICTIONLESS_CHALLENGE`,e.BIZUM_CHALLENGE=`BIZUM_CHALLENGE`,e.CHALLENGE=`CHALLENGE`,e.COMPLETE=`COMPLETE`,e}({}),hn=function(e){return e.Visa=`visa`,e.Mastercard=`mastercard`,e.Amex=`amex`,e.Discover=`discover`,e.Diners=`diners`,e.JCB=`jcb`,e.Maestro=`maestro`,e.UnionPay=`unionpay`,e.Elo=`elo`,e.Hipercard=`hipercard`,e}({}),gn=function(e){return e.AUTH=`AUTH`,e.SALE=`SALE`,e.PAYOUT=`PAYOUT`,e.VERIF=`VERIF`,e}({}),_n=Ke,vn=Ne;e.Bizum=dn,e.BizumModal=un,e.CardBrand=hn,e.CardInput=an,e.GooglePay=fn,e.NextActionType=mn,e.PayPal=ln,e.PaymentModal=on,e.PaymentRequest=pn,e.TransactionType=gn,e.api=_n,e.config=R,e.confirmPayment=sn,e.createToken=rn,e.utils=vn});
63
+ `)),m.appendChild(s),c&&m.appendChild(c),m.appendChild(h),d.on(q.RESIZE,({width:e,height:t})=>{typeof e==`number`&&(m.style.width=Y(e)),typeof t==`number`&&(m.style.height=Y(t))}),c&&(s.classList.add(Z.INVISIBLE),i&&c.classList.add(Z.VISIBLE),d.on(q.RENDERED,()=>{i?(c.classList.remove(Z.VISIBLE),c.classList.add(Z.INVISIBLE),s.classList.remove(Z.INVISIBLE),s.classList.add(Z.VISIBLE),setTimeout(()=>J(c),1)):(J(c),s.style.transition=`none`,s.classList.remove(Z.INVISIBLE),s.classList.add(Z.VISIBLE))}))}return m}}let Q=$t({overflow:`hidden`,borderRadius:`var(--monei-radius, 4px)`}),en=$t({modal:!0}),tn=e=>{if(e.state?.__createToken)return e.state.__createToken;throw Error(`Index is not registered`)},nn=async(e,t)=>{console.warn(`[MONEI] Standalone createToken() is deprecated. Use cardInput.submit() instead.`);let{data:n}=await tn(e)(t);return n},rn=X({tag:`monei-card-input`,url:R.cardInputUrl,dimensions:{width:`100%`,height:`auto`},autoResize:{width:!1,height:!0},aliases:{sessionId:`orderId`,style:`innerStyle`},computedProps:{__getConfig:{factory:({props:e})=>V.bind(null,e),type:`function`}},validate:P,submit:e=>async t=>{let n=e.state?.__createToken;if(!n)throw Error(`CardInput is not rendered or connection is pending — call render() first`);let{data:r}=await n(t);return r},containerTemplate:e=>(e.state.__createToken=async(t={})=>{let n=e.state.__callChild;if(!n)throw Error(`CardInput instance is not registered`);return{data:await n(`createToken`,[t])}},Q(e)),prerenderTemplate:({doc:e,props:t})=>{let n=e.createElement(`html`),r=e.createElement(`body`);r.style.margin=`0`,r.style.background=`#fff`;let i=e.createElement(`div`);i.style.height=`45px`,i.style.boxSizing=`border-box`;let a=t.style||t.innerStyle;return a?.base&&Object.assign(i.style,Pe(a.base)),a?.loading&&Object.assign(i.style,Pe(a.loading)),r.appendChild(i),n.appendChild(r),n}}),an=X({tag:`monei-payment-modal`,url:R.paymentModalUrl,dimensions:{width:`100%`,height:`100%`},autoResize:{width:!1,height:!1},aliases:{style:`innerStyle`},containerTemplate:$t({background:`transparent`,fadeOnRender:!1,allowTransparency:!0})}),on=e=>{let t=document.createElement(`div`),n=document.body.style.overflow;Object.assign(document.body.style,{overflow:`hidden`}),Object.assign(t.style,{position:`fixed`,overflow:`hidden`,display:`block`,top:`0`,bottom:`0`,left:`0`,right:`0`,width:`100%`,height:`100%`,zIndex:`99999`}),document.body.appendChild(t);let r=null,i=()=>{r?.destroy(),r=null,Object.assign(document.body.style,{overflow:n}),t.parentNode&&t.parentNode.removeChild(t)};return new Promise((n,a)=>{r=new an({...e,isOpen:!0,onResult:e=>{n(e),i()},onError:e=>{a(e),i()}}),r.render(t).catch(e=>{i(),a(e)})})},$=`monei-paypal`,sn=async(e,t,n)=>{t.__scriptId=(await Fe(n,e.cspNonce,{namespace:$,cspNonce:e.cspNonce},!0)).dataset.uidAuto;let r={layout:`horizontal`,tagline:!1,height:45},i=je(e.style?.borderRadius??e.borderRadius);i&&(r.borderRadius=i);let a={...r,...e.style};a.height=je(a.height,45),e.onLoad?.(!0);let o;await window[$].Buttons({createOrder:async()=>{try{let t=await Ke({paymentId:e.paymentId,accountId:e.accountId,sessionId:e.sessionId,amount:e.amount,currency:e.currency,transactionType:e.transactionType,paymentMethod:{paypal:{}}});return{token:o}=t,t.paypal?.orderId}catch(t){e.onError?.(t);return}},onApprove:function(t){t.orderID?e.onSubmit({token:o}):e.onError?.(t)},onClick:function(t,n){let r=!0;if(e.onBeforeOpen&&(r=e.onBeforeOpen()),!r)return n.reject()},style:a}).render(t.__container)},cn=X({tag:$,url:R.paypalUrl,dimensions:{width:`100%`,height:`0`},autoResize:{width:!1,height:!1},aliases:{style:`innerStyle`},computedProps:{__getConfig:{factory:({props:e})=>V.bind(null,e),type:`function`},__onLoadPayPal:{factory:({props:e,state:t})=>sn.bind(null,e,t),type:`function`}},containerTemplate:e=>{if(e.state.__container=e.container,!e.props.accountId&&!e.props.paymentId)throw Error(`You need to provide paymentId or accountId`);let t=Q(e);return e.event.on(q.DESTROY,()=>{window[$]?.Buttons?.instances?.forEach(e=>{e.close()});let t=e.state.__scriptId;if(t){let e=document.querySelector(`script[data-uid-auto="${t}"]`);e&&e.remove()}}),t}}),ln=X({tag:`monei-bizum`,url:R.bizumUrl,autoResize:{width:!1,height:!1},containerTemplate:e=>{if(e.frame){if(e.props.isHidden){let t=e.doc.createElement(`div`);return t.setAttribute(`id`,e.uid),t.style.display=`none`,t.appendChild(e.frame),e.placeholder&&t.appendChild(e.placeholder),t}return en(e)}},defaultProps:({event:e})=>({onBeforeClose:()=>{e.trigger(q.BEFORE_CLOSE)}})}),un=X({tag:`monei-bizum-button`,url:R.bizumButtonUrl,dimensions:{width:`100%`,height:`auto`},autoResize:{width:!1,height:!0},aliases:{style:`innerStyle`},computedProps:{__getConfig:{factory:({props:e})=>V.bind(null,e),type:`function`},__onClick:{factory:({props:e,state:t})=>{let n=document.createElement(`div`);return({amount:r,currency:i})=>{if(t.isOpen)return;let a=!0;if(e.onBeforeOpen&&(a=e.onBeforeOpen()),!a)return;t.isOpen=!0,n.parentNode||document.body.appendChild(n);let o=new ln({amount:r,currency:i,...e,onClose:()=>{t.isOpen=!1,window.onpopstate=null,document.body.style.overflow=``},isOpen:!0});return window.history.pushState(null,``,window.location.href),window.onpopstate=()=>o.updateProps({isOpen:!1}),Object.assign(document.body.style,{overflow:`hidden`}),o.render(n)}},type:`function`}},validate:P,containerTemplate:Q}),dn=X({tag:`monei-google-pay`,url:R.paymentRequestUrl,dimensions:{width:`100%`,height:`0`},autoResize:{width:!1,height:!0},aliases:{style:`innerStyle`},computedProps:{__getConfig:{factory:({props:e})=>V.bind(null,e),type:`function`}},validate:P,containerTemplate:Q}),fn=X({tag:`monei-payment-request`,url:R.paymentRequestUrl,dimensions:{width:`100%`,height:`auto`},autoResize:{width:!1,height:!0},aliases:{style:`innerStyle`},computedProps:{__getConfig:{factory:({props:e})=>V.bind(null,e),type:`function`}},validate:P,containerTemplate:Q}),pn=function(e){return e.CONFIRM=`CONFIRM`,e.FRICTIONLESS_CHALLENGE=`FRICTIONLESS_CHALLENGE`,e.BIZUM_CHALLENGE=`BIZUM_CHALLENGE`,e.CHALLENGE=`CHALLENGE`,e.COMPLETE=`COMPLETE`,e}({}),mn=function(e){return e.Visa=`visa`,e.Mastercard=`mastercard`,e.Amex=`amex`,e.Discover=`discover`,e.Diners=`diners`,e.JCB=`jcb`,e.Maestro=`maestro`,e.UnionPay=`unionpay`,e.Elo=`elo`,e.Hipercard=`hipercard`,e}({}),hn=function(e){return e.AUTH=`AUTH`,e.SALE=`SALE`,e.PAYOUT=`PAYOUT`,e.VERIF=`VERIF`,e}({}),gn=Ge,_n=Ne;e.Bizum=un,e.BizumModal=ln,e.CardBrand=mn,e.CardInput=rn,e.GooglePay=dn,e.NextActionType=pn,e.PayPal=cn,e.PaymentModal=an,e.PaymentRequest=fn,e.TransactionType=hn,e.api=gn,e.config=R,e.confirmPayment=on,e.createToken=nn,e.utils=_n});
64
64
  //# sourceMappingURL=monei.umd.production.min.js.map