@fundly.ai/payment-sdk 1.4.0-beta.7 → 1.4.0-beta.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- "use strict";const Xn=require("./index-C4o820WK.cjs"),pe=require("./index-CGEnN4OB.cjs"),he=require("react"),Tn=require("react-dom");function Qn(e,j){for(var r=0;r<j.length;r++){const n=j[r];if(typeof n!="string"&&!Array.isArray(n)){for(const p in n)if(p!=="default"&&!(p in e)){const R=Object.getOwnPropertyDescriptor(n,p);R&&Object.defineProperty(e,p,R.get?R:{enumerable:!0,get:()=>n[p]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var tt={exports:{}},Fe={},nt={exports:{}},wt={},Dt;function er(){if(Dt)return wt;Dt=1;var e=pe.requireLib();function j(B){var D=Object.create(null);return B&&Object.keys(B).forEach((function(W){if(W!=="default"){var Z=Object.getOwnPropertyDescriptor(B,W);Object.defineProperty(D,W,Z.get?Z:{enumerable:!0,get:function(){return B[W]}})}})),D.default=B,Object.freeze(D)}var r=j(he),n=function(B){var D=B.files,W=r.useRef(),Z=r.useContext(e.LocalizationContext).l10n,H=r.useContext(e.ThemeContext).direction===e.TextDirection.RightToLeft,z=r.useRef([]),L=Z&&Z.attachment?Z.attachment.clickToDownload:"Click to download",y=function(C){var t=W.current,g=[].slice.call(t.getElementsByClassName("rpv-attachment__item"));if(g.length!==0){g.forEach((function(l){return l.setAttribute("tabindex","-1")}));var E=document.activeElement,i=g[Math.min(g.length-1,Math.max(0,C(g,E)))];i.setAttribute("tabindex","0"),i.focus()}};return e.useIsomorphicLayoutEffect((function(){var C=W.current;if(C){var t=[].slice.call(C.getElementsByClassName("rpv-attachment__item"));if(z.current=t,t.length>0){var g=t[0];g.focus(),g.setAttribute("tabindex","0")}}}),[]),r.createElement("div",{"data-testid":"attachment__list",className:e.classNames({"rpv-attachment__list":!0,"rpv-attachment__list--rtl":H}),ref:W,tabIndex:-1,onKeyDown:function(C){switch(C.key){case"ArrowDown":C.preventDefault(),y((function(t,g){return t.indexOf(g)+1}));break;case"ArrowUp":C.preventDefault(),y((function(t,g){return t.indexOf(g)-1}));break;case"End":C.preventDefault(),y((function(t,g){return t.length-1}));break;case"Home":C.preventDefault(),y((function(t,g){return 0}))}}},D.map((function(C){return r.createElement("button",{className:"rpv-attachment__item",key:C.fileName,tabIndex:-1,title:L,type:"button",onClick:function(){return t=C.fileName,g=C.data,E=typeof g=="string"?"":URL.createObjectURL(new Blob([g],{type:""})),(i=document.createElement("a")).style.display="none",i.href=E||t,i.setAttribute("download",(function(l){var a=l.split("/").pop();return a?a.split("#")[0].split("?")[0]:l})(t)),document.body.appendChild(i),i.click(),document.body.removeChild(i),void(E&&URL.revokeObjectURL(E));var t,g,E,i}},C.fileName)})))},p=function(B){var D=B.doc,W=r.useContext(e.LocalizationContext).l10n,Z=r.useContext(e.ThemeContext).direction===e.TextDirection.RightToLeft,H=W&&W.attachment?W.attachment.noAttachment:"There is no attachment",z=r.useState({files:[],isLoaded:!1}),L=z[0],y=z[1];return r.useEffect((function(){D.getAttachments().then((function(C){var t=C?Object.keys(C).map((function(g){return{data:C[g].content,fileName:C[g].filename}})):[];y({files:t,isLoaded:!0})}))}),[D]),L.isLoaded?L.files.length===0?r.createElement("div",{"data-testid":"attachment__empty",className:e.classNames({"rpv-attachment__empty":!0,"rpv-attachment__empty--rtl":Z})},H):r.createElement(n,{files:L.files}):r.createElement(e.Spinner,null)},R=function(B){var D=B.store,W=r.useState(D.get("doc")),Z=W[0],H=W[1],z=function(L){H(L)};return r.useEffect((function(){return D.subscribe("doc",z),function(){D.unsubscribe("doc",z)}}),[]),Z?r.createElement(p,{doc:Z}):r.createElement("div",{className:"rpv-attachment__loader"},r.createElement(e.Spinner,null))};return wt.attachmentPlugin=function(){var B=r.useMemo((function(){return e.createStore({})}),[]);return{onDocumentLoad:function(D){B.update("doc",D.doc)},Attachments:function(){return r.createElement(R,{store:B})}}},wt}var yt={},Ot;function tr(){if(Ot)return yt;Ot=1;var e=pe.requireLib(),j=he;function r(H){var z=Object.create(null);return H&&Object.keys(H).forEach(function(L){if(L!=="default"){var y=Object.getOwnPropertyDescriptor(H,L);Object.defineProperty(z,L,y.get?y:{enumerable:!0,get:function(){return H[L]}})}}),z.default=H,Object.freeze(z)}var n=r(j),p=function(H){var z=H.split("/").pop();return z?z.split("#")[0].split("?")[0]:H},R=function(H,z){var L=typeof z=="string"?"":URL.createObjectURL(new Blob([z],{type:""})),y=document.createElement("a");y.style.display="none",y.href=L||H,y.setAttribute("download",p(H)),document.body.appendChild(y),y.click(),document.body.removeChild(y),L&&URL.revokeObjectURL(L)},B=function(H){var z=H.files,L=n.useRef(),y=n.useContext(e.LocalizationContext).l10n,C=n.useContext(e.ThemeContext).direction,t=C===e.TextDirection.RightToLeft,g=n.useRef([]),E=y&&y.attachment?y.attachment.clickToDownload:"Click to download",i=function(a){switch(a.key){case"ArrowDown":a.preventDefault(),l(function(v,k){return v.indexOf(k)+1});break;case"ArrowUp":a.preventDefault(),l(function(v,k){return v.indexOf(k)-1});break;case"End":a.preventDefault(),l(function(v,k){return v.length-1});break;case"Home":a.preventDefault(),l(function(v,k){return 0});break}},l=function(a){var v=L.current,k=[].slice.call(v.getElementsByClassName("rpv-attachment__item"));if(k.length!==0){k.forEach(function(b){return b.setAttribute("tabindex","-1")});var _=document.activeElement,h=Math.min(k.length-1,Math.max(0,a(k,_))),w=k[h];w.setAttribute("tabindex","0"),w.focus()}};return e.useIsomorphicLayoutEffect(function(){var a=L.current;if(a){var v=[].slice.call(a.getElementsByClassName("rpv-attachment__item"));if(g.current=v,v.length>0){var k=v[0];k.focus(),k.setAttribute("tabindex","0")}}},[]),n.createElement("div",{"data-testid":"attachment__list",className:e.classNames({"rpv-attachment__list":!0,"rpv-attachment__list--rtl":t}),ref:L,tabIndex:-1,onKeyDown:i},z.map(function(a){return n.createElement("button",{className:"rpv-attachment__item",key:a.fileName,tabIndex:-1,title:E,type:"button",onClick:function(){return R(a.fileName,a.data)}},a.fileName)}))},D=function(H){var z=H.doc,L=n.useContext(e.LocalizationContext).l10n,y=n.useContext(e.ThemeContext).direction,C=y===e.TextDirection.RightToLeft,t=L&&L.attachment?L.attachment.noAttachment:"There is no attachment",g=n.useState({files:[],isLoaded:!1}),E=g[0],i=g[1];return n.useEffect(function(){z.getAttachments().then(function(l){var a=l?Object.keys(l).map(function(v){return{data:l[v].content,fileName:l[v].filename}}):[];i({files:a,isLoaded:!0})})},[z]),E.isLoaded?E.files.length===0?n.createElement("div",{"data-testid":"attachment__empty",className:e.classNames({"rpv-attachment__empty":!0,"rpv-attachment__empty--rtl":C})},t):n.createElement(B,{files:E.files}):n.createElement(e.Spinner,null)},W=function(H){var z=H.store,L=n.useState(z.get("doc")),y=L[0],C=L[1],t=function(g){C(g)};return n.useEffect(function(){return z.subscribe("doc",t),function(){z.unsubscribe("doc",t)}},[]),y?n.createElement(D,{doc:y}):n.createElement("div",{className:"rpv-attachment__loader"},n.createElement(e.Spinner,null))},Z=function(){var H=n.useMemo(function(){return e.createStore({})},[]),z=function(){return n.createElement(W,{store:H})};return{onDocumentLoad:function(L){H.update("doc",L.doc)},Attachments:z}};return yt.attachmentPlugin=Z,yt}/**
1
+ "use strict";const Xn=require("./index-SA0sJUwl.cjs"),pe=require("./index-DmCrqrmZ.cjs"),he=require("react"),Tn=require("react-dom");function Qn(e,j){for(var r=0;r<j.length;r++){const n=j[r];if(typeof n!="string"&&!Array.isArray(n)){for(const p in n)if(p!=="default"&&!(p in e)){const R=Object.getOwnPropertyDescriptor(n,p);R&&Object.defineProperty(e,p,R.get?R:{enumerable:!0,get:()=>n[p]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var tt={exports:{}},Fe={},nt={exports:{}},wt={},Dt;function er(){if(Dt)return wt;Dt=1;var e=pe.requireLib();function j(B){var D=Object.create(null);return B&&Object.keys(B).forEach((function(W){if(W!=="default"){var Z=Object.getOwnPropertyDescriptor(B,W);Object.defineProperty(D,W,Z.get?Z:{enumerable:!0,get:function(){return B[W]}})}})),D.default=B,Object.freeze(D)}var r=j(he),n=function(B){var D=B.files,W=r.useRef(),Z=r.useContext(e.LocalizationContext).l10n,H=r.useContext(e.ThemeContext).direction===e.TextDirection.RightToLeft,z=r.useRef([]),L=Z&&Z.attachment?Z.attachment.clickToDownload:"Click to download",y=function(C){var t=W.current,g=[].slice.call(t.getElementsByClassName("rpv-attachment__item"));if(g.length!==0){g.forEach((function(l){return l.setAttribute("tabindex","-1")}));var E=document.activeElement,i=g[Math.min(g.length-1,Math.max(0,C(g,E)))];i.setAttribute("tabindex","0"),i.focus()}};return e.useIsomorphicLayoutEffect((function(){var C=W.current;if(C){var t=[].slice.call(C.getElementsByClassName("rpv-attachment__item"));if(z.current=t,t.length>0){var g=t[0];g.focus(),g.setAttribute("tabindex","0")}}}),[]),r.createElement("div",{"data-testid":"attachment__list",className:e.classNames({"rpv-attachment__list":!0,"rpv-attachment__list--rtl":H}),ref:W,tabIndex:-1,onKeyDown:function(C){switch(C.key){case"ArrowDown":C.preventDefault(),y((function(t,g){return t.indexOf(g)+1}));break;case"ArrowUp":C.preventDefault(),y((function(t,g){return t.indexOf(g)-1}));break;case"End":C.preventDefault(),y((function(t,g){return t.length-1}));break;case"Home":C.preventDefault(),y((function(t,g){return 0}))}}},D.map((function(C){return r.createElement("button",{className:"rpv-attachment__item",key:C.fileName,tabIndex:-1,title:L,type:"button",onClick:function(){return t=C.fileName,g=C.data,E=typeof g=="string"?"":URL.createObjectURL(new Blob([g],{type:""})),(i=document.createElement("a")).style.display="none",i.href=E||t,i.setAttribute("download",(function(l){var a=l.split("/").pop();return a?a.split("#")[0].split("?")[0]:l})(t)),document.body.appendChild(i),i.click(),document.body.removeChild(i),void(E&&URL.revokeObjectURL(E));var t,g,E,i}},C.fileName)})))},p=function(B){var D=B.doc,W=r.useContext(e.LocalizationContext).l10n,Z=r.useContext(e.ThemeContext).direction===e.TextDirection.RightToLeft,H=W&&W.attachment?W.attachment.noAttachment:"There is no attachment",z=r.useState({files:[],isLoaded:!1}),L=z[0],y=z[1];return r.useEffect((function(){D.getAttachments().then((function(C){var t=C?Object.keys(C).map((function(g){return{data:C[g].content,fileName:C[g].filename}})):[];y({files:t,isLoaded:!0})}))}),[D]),L.isLoaded?L.files.length===0?r.createElement("div",{"data-testid":"attachment__empty",className:e.classNames({"rpv-attachment__empty":!0,"rpv-attachment__empty--rtl":Z})},H):r.createElement(n,{files:L.files}):r.createElement(e.Spinner,null)},R=function(B){var D=B.store,W=r.useState(D.get("doc")),Z=W[0],H=W[1],z=function(L){H(L)};return r.useEffect((function(){return D.subscribe("doc",z),function(){D.unsubscribe("doc",z)}}),[]),Z?r.createElement(p,{doc:Z}):r.createElement("div",{className:"rpv-attachment__loader"},r.createElement(e.Spinner,null))};return wt.attachmentPlugin=function(){var B=r.useMemo((function(){return e.createStore({})}),[]);return{onDocumentLoad:function(D){B.update("doc",D.doc)},Attachments:function(){return r.createElement(R,{store:B})}}},wt}var yt={},Ot;function tr(){if(Ot)return yt;Ot=1;var e=pe.requireLib(),j=he;function r(H){var z=Object.create(null);return H&&Object.keys(H).forEach(function(L){if(L!=="default"){var y=Object.getOwnPropertyDescriptor(H,L);Object.defineProperty(z,L,y.get?y:{enumerable:!0,get:function(){return H[L]}})}}),z.default=H,Object.freeze(z)}var n=r(j),p=function(H){var z=H.split("/").pop();return z?z.split("#")[0].split("?")[0]:H},R=function(H,z){var L=typeof z=="string"?"":URL.createObjectURL(new Blob([z],{type:""})),y=document.createElement("a");y.style.display="none",y.href=L||H,y.setAttribute("download",p(H)),document.body.appendChild(y),y.click(),document.body.removeChild(y),L&&URL.revokeObjectURL(L)},B=function(H){var z=H.files,L=n.useRef(),y=n.useContext(e.LocalizationContext).l10n,C=n.useContext(e.ThemeContext).direction,t=C===e.TextDirection.RightToLeft,g=n.useRef([]),E=y&&y.attachment?y.attachment.clickToDownload:"Click to download",i=function(a){switch(a.key){case"ArrowDown":a.preventDefault(),l(function(v,k){return v.indexOf(k)+1});break;case"ArrowUp":a.preventDefault(),l(function(v,k){return v.indexOf(k)-1});break;case"End":a.preventDefault(),l(function(v,k){return v.length-1});break;case"Home":a.preventDefault(),l(function(v,k){return 0});break}},l=function(a){var v=L.current,k=[].slice.call(v.getElementsByClassName("rpv-attachment__item"));if(k.length!==0){k.forEach(function(b){return b.setAttribute("tabindex","-1")});var _=document.activeElement,h=Math.min(k.length-1,Math.max(0,a(k,_))),w=k[h];w.setAttribute("tabindex","0"),w.focus()}};return e.useIsomorphicLayoutEffect(function(){var a=L.current;if(a){var v=[].slice.call(a.getElementsByClassName("rpv-attachment__item"));if(g.current=v,v.length>0){var k=v[0];k.focus(),k.setAttribute("tabindex","0")}}},[]),n.createElement("div",{"data-testid":"attachment__list",className:e.classNames({"rpv-attachment__list":!0,"rpv-attachment__list--rtl":t}),ref:L,tabIndex:-1,onKeyDown:i},z.map(function(a){return n.createElement("button",{className:"rpv-attachment__item",key:a.fileName,tabIndex:-1,title:E,type:"button",onClick:function(){return R(a.fileName,a.data)}},a.fileName)}))},D=function(H){var z=H.doc,L=n.useContext(e.LocalizationContext).l10n,y=n.useContext(e.ThemeContext).direction,C=y===e.TextDirection.RightToLeft,t=L&&L.attachment?L.attachment.noAttachment:"There is no attachment",g=n.useState({files:[],isLoaded:!1}),E=g[0],i=g[1];return n.useEffect(function(){z.getAttachments().then(function(l){var a=l?Object.keys(l).map(function(v){return{data:l[v].content,fileName:l[v].filename}}):[];i({files:a,isLoaded:!0})})},[z]),E.isLoaded?E.files.length===0?n.createElement("div",{"data-testid":"attachment__empty",className:e.classNames({"rpv-attachment__empty":!0,"rpv-attachment__empty--rtl":C})},t):n.createElement(B,{files:E.files}):n.createElement(e.Spinner,null)},W=function(H){var z=H.store,L=n.useState(z.get("doc")),y=L[0],C=L[1],t=function(g){C(g)};return n.useEffect(function(){return z.subscribe("doc",t),function(){z.unsubscribe("doc",t)}},[]),y?n.createElement(D,{doc:y}):n.createElement("div",{className:"rpv-attachment__loader"},n.createElement(e.Spinner,null))},Z=function(){var H=n.useMemo(function(){return e.createStore({})},[]),z=function(){return n.createElement(W,{store:H})};return{onDocumentLoad:function(L){H.update("doc",L.doc)},Attachments:z}};return yt.attachmentPlugin=Z,yt}/**
2
2
  * A React component to view a PDF document
3
3
  *
4
4
  * @see https://react-pdf-viewer.dev