@capitalos/react 1.2.1-rc.1 → 1.2.1-rc.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/_tsup-dts-rollup.d.mts +50 -2
- package/dist/_tsup-dts-rollup.d.ts +50 -2
- package/dist/esm/index.js +2 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/src/index.d.mts +2 -0
- package/dist/src/index.d.ts +2 -0
- package/package.json +1 -1
|
@@ -458,15 +458,46 @@ declare const cardApiDtoSchema: z_2.ZodObject<{
|
|
|
458
458
|
*/
|
|
459
459
|
export declare function CardDetails(props: CardDetailsProps): JSX.Element;
|
|
460
460
|
|
|
461
|
+
declare type CardDetailsConditionalProps = {
|
|
462
|
+
/**
|
|
463
|
+
* Whether to render only the card component, without the surrounding UI.
|
|
464
|
+
* @default false
|
|
465
|
+
*/
|
|
466
|
+
cardOnly?: false;
|
|
467
|
+
/** This prop can only be used when `cardOnly` is true. */
|
|
468
|
+
backOnly?: never;
|
|
469
|
+
} | {
|
|
470
|
+
/**
|
|
471
|
+
* Whether to render only the card component, without the surrounding UI.
|
|
472
|
+
* @default false
|
|
473
|
+
*/
|
|
474
|
+
cardOnly: true;
|
|
475
|
+
/**
|
|
476
|
+
* Whether to render only the back of the card.
|
|
477
|
+
* This is only applicable when `cardOnly` is true.
|
|
478
|
+
* @default false
|
|
479
|
+
*/
|
|
480
|
+
backOnly?: boolean;
|
|
481
|
+
};
|
|
482
|
+
|
|
461
483
|
export declare type CardDetailsProps = CommonProps & {
|
|
462
484
|
/**
|
|
463
485
|
* The ID of the card to manage.
|
|
464
486
|
*/
|
|
465
487
|
cardId: string;
|
|
466
|
-
|
|
488
|
+
/**
|
|
489
|
+
* Whether to hide the address on the back of the card.
|
|
490
|
+
*/
|
|
467
491
|
hideAddress?: boolean | undefined;
|
|
492
|
+
/**
|
|
493
|
+
* Callback to invoke when the card has been successfully canceled.
|
|
494
|
+
*/
|
|
468
495
|
onCardCanceled?: () => void;
|
|
469
|
-
|
|
496
|
+
/**
|
|
497
|
+
* Callback to invoke when the user requests to hide sensitive details.
|
|
498
|
+
*/
|
|
499
|
+
onHideSensitiveDetails?: () => void;
|
|
500
|
+
} & CardDetailsConditionalProps;
|
|
470
501
|
|
|
471
502
|
/**
|
|
472
503
|
* Renders the CapitalOS CardsApp.
|
|
@@ -801,6 +832,7 @@ export declare type ParentFunctions = {
|
|
|
801
832
|
onTokenExpired?: () => void;
|
|
802
833
|
cardDetails?: {
|
|
803
834
|
onCardCanceled?: () => void;
|
|
835
|
+
onHideSensitiveDetails?: () => void;
|
|
804
836
|
};
|
|
805
837
|
contactSupport?: {
|
|
806
838
|
onDone?: () => void;
|
|
@@ -925,16 +957,19 @@ declare const renderingContextSchema: z.ZodIntersection<z.ZodDiscriminatedUnion<
|
|
|
925
957
|
cardId: z.ZodString;
|
|
926
958
|
cardOnly: z.ZodOptional<z.ZodBoolean>;
|
|
927
959
|
hideAddress: z.ZodOptional<z.ZodBoolean>;
|
|
960
|
+
backOnly: z.ZodOptional<z.ZodBoolean>;
|
|
928
961
|
}, "strip", z.ZodTypeAny, {
|
|
929
962
|
cardId: string;
|
|
930
963
|
entryPoint: "cardDetails";
|
|
931
964
|
cardOnly?: boolean | undefined;
|
|
932
965
|
hideAddress?: boolean | undefined;
|
|
966
|
+
backOnly?: boolean | undefined;
|
|
933
967
|
}, {
|
|
934
968
|
cardId: string;
|
|
935
969
|
entryPoint: "cardDetails";
|
|
936
970
|
cardOnly?: boolean | undefined;
|
|
937
971
|
hideAddress?: boolean | undefined;
|
|
972
|
+
backOnly?: boolean | undefined;
|
|
938
973
|
}>, z.ZodObject<{
|
|
939
974
|
entryPoint: z.ZodLiteral<"accountDetails">;
|
|
940
975
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -1070,6 +1105,12 @@ declare const renderingContextSchema: z.ZodIntersection<z.ZodDiscriminatedUnion<
|
|
|
1070
1105
|
codeLength: number;
|
|
1071
1106
|
canResendAfter: string;
|
|
1072
1107
|
operationName?: string | undefined;
|
|
1108
|
+
}>, z.ZodObject<{
|
|
1109
|
+
entryPoint: z.ZodLiteral<"transactions">;
|
|
1110
|
+
}, "strip", z.ZodTypeAny, {
|
|
1111
|
+
entryPoint: "transactions";
|
|
1112
|
+
}, {
|
|
1113
|
+
entryPoint: "transactions";
|
|
1073
1114
|
}>]>, z.ZodObject<{
|
|
1074
1115
|
referer: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1075
1116
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -1156,6 +1197,13 @@ export declare enum TokenType {
|
|
|
1156
1197
|
longLived = "longLived"
|
|
1157
1198
|
}
|
|
1158
1199
|
|
|
1200
|
+
/**
|
|
1201
|
+
* Renders the CapitalOS Transactions experience.
|
|
1202
|
+
*/
|
|
1203
|
+
export declare function Transactions(props: TransactionsProps): JSX.Element;
|
|
1204
|
+
|
|
1205
|
+
export declare type TransactionsProps = CommonProps;
|
|
1206
|
+
|
|
1159
1207
|
/**
|
|
1160
1208
|
* Hook to access the actions iframe functions.
|
|
1161
1209
|
*
|
|
@@ -458,15 +458,46 @@ declare const cardApiDtoSchema: z_2.ZodObject<{
|
|
|
458
458
|
*/
|
|
459
459
|
export declare function CardDetails(props: CardDetailsProps): JSX.Element;
|
|
460
460
|
|
|
461
|
+
declare type CardDetailsConditionalProps = {
|
|
462
|
+
/**
|
|
463
|
+
* Whether to render only the card component, without the surrounding UI.
|
|
464
|
+
* @default false
|
|
465
|
+
*/
|
|
466
|
+
cardOnly?: false;
|
|
467
|
+
/** This prop can only be used when `cardOnly` is true. */
|
|
468
|
+
backOnly?: never;
|
|
469
|
+
} | {
|
|
470
|
+
/**
|
|
471
|
+
* Whether to render only the card component, without the surrounding UI.
|
|
472
|
+
* @default false
|
|
473
|
+
*/
|
|
474
|
+
cardOnly: true;
|
|
475
|
+
/**
|
|
476
|
+
* Whether to render only the back of the card.
|
|
477
|
+
* This is only applicable when `cardOnly` is true.
|
|
478
|
+
* @default false
|
|
479
|
+
*/
|
|
480
|
+
backOnly?: boolean;
|
|
481
|
+
};
|
|
482
|
+
|
|
461
483
|
export declare type CardDetailsProps = CommonProps & {
|
|
462
484
|
/**
|
|
463
485
|
* The ID of the card to manage.
|
|
464
486
|
*/
|
|
465
487
|
cardId: string;
|
|
466
|
-
|
|
488
|
+
/**
|
|
489
|
+
* Whether to hide the address on the back of the card.
|
|
490
|
+
*/
|
|
467
491
|
hideAddress?: boolean | undefined;
|
|
492
|
+
/**
|
|
493
|
+
* Callback to invoke when the card has been successfully canceled.
|
|
494
|
+
*/
|
|
468
495
|
onCardCanceled?: () => void;
|
|
469
|
-
|
|
496
|
+
/**
|
|
497
|
+
* Callback to invoke when the user requests to hide sensitive details.
|
|
498
|
+
*/
|
|
499
|
+
onHideSensitiveDetails?: () => void;
|
|
500
|
+
} & CardDetailsConditionalProps;
|
|
470
501
|
|
|
471
502
|
/**
|
|
472
503
|
* Renders the CapitalOS CardsApp.
|
|
@@ -801,6 +832,7 @@ export declare type ParentFunctions = {
|
|
|
801
832
|
onTokenExpired?: () => void;
|
|
802
833
|
cardDetails?: {
|
|
803
834
|
onCardCanceled?: () => void;
|
|
835
|
+
onHideSensitiveDetails?: () => void;
|
|
804
836
|
};
|
|
805
837
|
contactSupport?: {
|
|
806
838
|
onDone?: () => void;
|
|
@@ -925,16 +957,19 @@ declare const renderingContextSchema: z.ZodIntersection<z.ZodDiscriminatedUnion<
|
|
|
925
957
|
cardId: z.ZodString;
|
|
926
958
|
cardOnly: z.ZodOptional<z.ZodBoolean>;
|
|
927
959
|
hideAddress: z.ZodOptional<z.ZodBoolean>;
|
|
960
|
+
backOnly: z.ZodOptional<z.ZodBoolean>;
|
|
928
961
|
}, "strip", z.ZodTypeAny, {
|
|
929
962
|
cardId: string;
|
|
930
963
|
entryPoint: "cardDetails";
|
|
931
964
|
cardOnly?: boolean | undefined;
|
|
932
965
|
hideAddress?: boolean | undefined;
|
|
966
|
+
backOnly?: boolean | undefined;
|
|
933
967
|
}, {
|
|
934
968
|
cardId: string;
|
|
935
969
|
entryPoint: "cardDetails";
|
|
936
970
|
cardOnly?: boolean | undefined;
|
|
937
971
|
hideAddress?: boolean | undefined;
|
|
972
|
+
backOnly?: boolean | undefined;
|
|
938
973
|
}>, z.ZodObject<{
|
|
939
974
|
entryPoint: z.ZodLiteral<"accountDetails">;
|
|
940
975
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -1070,6 +1105,12 @@ declare const renderingContextSchema: z.ZodIntersection<z.ZodDiscriminatedUnion<
|
|
|
1070
1105
|
codeLength: number;
|
|
1071
1106
|
canResendAfter: string;
|
|
1072
1107
|
operationName?: string | undefined;
|
|
1108
|
+
}>, z.ZodObject<{
|
|
1109
|
+
entryPoint: z.ZodLiteral<"transactions">;
|
|
1110
|
+
}, "strip", z.ZodTypeAny, {
|
|
1111
|
+
entryPoint: "transactions";
|
|
1112
|
+
}, {
|
|
1113
|
+
entryPoint: "transactions";
|
|
1073
1114
|
}>]>, z.ZodObject<{
|
|
1074
1115
|
referer: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1075
1116
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -1156,6 +1197,13 @@ export declare enum TokenType {
|
|
|
1156
1197
|
longLived = "longLived"
|
|
1157
1198
|
}
|
|
1158
1199
|
|
|
1200
|
+
/**
|
|
1201
|
+
* Renders the CapitalOS Transactions experience.
|
|
1202
|
+
*/
|
|
1203
|
+
export declare function Transactions(props: TransactionsProps): JSX.Element;
|
|
1204
|
+
|
|
1205
|
+
export declare type TransactionsProps = CommonProps;
|
|
1206
|
+
|
|
1159
1207
|
/**
|
|
1160
1208
|
* Hook to access the actions iframe functions.
|
|
1161
1209
|
*
|
package/dist/esm/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use client";var be=Object.defineProperty,ke=Object.defineProperties;var Te=Object.getOwnPropertyDescriptors;var U=Object.getOwnPropertySymbols;var oe=Object.prototype.hasOwnProperty,re=Object.prototype.propertyIsEnumerable;var ne=(e,t,n)=>t in e?be(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,c=(e,t)=>{for(var n in t||(t={}))oe.call(t,n)&&ne(e,n,t[n]);if(U)for(var n of U(t))re.call(t,n)&&ne(e,n,t[n]);return e},l=(e,t)=>ke(e,Te(t));var v=(e,t)=>{var n={};for(var o in e)oe.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(e!=null&&U)for(var o of U(e))t.indexOf(o)<0&&re.call(e,o)&&(n[o]=e[o]);return n};var A=(e,t,n)=>new Promise((o,i)=>{var r=d=>{try{a(n.next(d))}catch(u){i(u)}},s=d=>{try{a(n.throw(d))}catch(u){i(u)}},a=d=>d.done?o(d.value):Promise.resolve(d.value).then(r,s);a((n=n.apply(e,t)).next())});import x,{useMemo as h,useContext as ct}from"react";import B from"react";import z,{createContext as et,useContext as tt,useState as H,useMemo as xe,useCallback as S,useEffect as nt}from"react";import je,{useMemo as $e,useRef as Ke}from"react";var C=class extends Error{constructor({message:t,code:n}){super(t),this.name="CapitalOSError",this.code=n}},b={unauthorized:"unauthorized",invalid_account_status:"invalid_account_status",unsupported_entry_point:"unsupported_entry_point",internal_error:"internal_error"},D=class extends C{constructor(t){super({message:`Invalid token ${t!=null?t:""}`,code:b.unauthorized}),this.name="CapitalOSInvalidTokenError"}};import{connectToChild as De}from"penpal";import{useCallback as we,useEffect as J,useMemo as ae,useRef as W,useState as ce}from"react";var ie="1.2.1-rc.1";function Oe(e){let t=JSON.stringify(e),n=btoa(t);return encodeURIComponent(n)}function V(e){try{let t=decodeURIComponent(e),n=atob(t);return JSON.parse(n)}catch(t){throw new D}}function Ae(e){try{return decodeURIComponent(e)}catch(t){return e}}function se({tokenData:e,renderingContext:t,theme:n,onError:o}){try{let i=t?l(c({},t),{referer:window.location.href}):null,r=i?Oe(i):null,s=new URL(e.baseUrl),a=Ae(e.token);return e.paramLocation==="search"?s.searchParams.set(e.paramKey,a):e.paramLocation==="hash"&&(s.hash=e.paramKey+"="+encodeURIComponent(a)),s.searchParams.set("sdkVersion",ie),r&&s.searchParams.set("renderingContext",r),n&&s.searchParams.set("theme",n),s.toString()}catch(i){o==null||o(new D);return}}function q(e){let n=V(e).path;if(!n||typeof n!="string")throw new D;return{token:e,tokenType:"oneTime",baseUrl:n,paramKey:"token",paramLocation:"search"}}var Se=1e4;function X({iframeRef:e,token:t,onError:n,methods:o}){let[i,r]=ce(null);return J(()=>{if(!e.current)return;let s=De({iframe:e.current,childOrigin:"*",debug:!0,timeout:Se,methods:o});return s.promise.then(()=>{r(s)}).catch(a=>{n==null||n(a),r(null)}),()=>{s.destroy(),r(null)}},[t,e]),i}function Z({tokenData:e,renderingContext:t,theme:n,onError:o}){let i=W(o),r=W(t);return ae(()=>{if(e)return se({tokenData:e,renderingContext:r.current,theme:n,onError:i.current})},[e,n,i,r])}function j(e){let{oneTimeToken:t,enableLogging:n,onError:o,renderingContext:i,theme:r,methods:s}=e,{tokenData:a,error:d,invalidateToken:u}=G(),{log:f,warn:y}=w(n),[P,k]=ce(!1),T=W(null);Re(d,o);let E=ae(()=>t?q(t):a,[t,a]),I=we(()=>{if(f("Token expired, invalidating..."),t){o==null||o(new C({message:"Token expired. Cannot automatically refresh when using token prop.",code:b.unauthorized}));return}u(),k(!1)},[t,u,f,o]);J(()=>{t&&a&&y("token was provided both from provider and from the token prop. the prop will take precedence")},[t,a,y]);let g=Z({tokenData:E,renderingContext:i,theme:r,onError:o}),p=X({iframeRef:T,token:E==null?void 0:E.token,onError:O=>{o==null||o(O),k(!0)},methods:c({onLoad:()=>{k(!0)},onError:O=>{let ve=new C(O);o==null||o(ve)},onTokenExpired:I},s)});return{isLoaded:P,url:g,tokenData:E,iframeRef:T,connection:p}}function Re(e,t){let n=W(!1);J(()=>{e&&!n.current&&(t==null||t(e),n.current=!0)},[e,t])}import{iframeResizer as Fe}from"iframe-resizer";import ze,{forwardRef as He,useEffect as Be,useImperativeHandle as Ne,useRef as _e}from"react";var M=He((e,t)=>{let n=e.title||"iframe",{iframeHTMLAttributes:o,resizerOptions:i}=We(e),r=_e(null);return Be(()=>{let s=r.current;return Fe(c({},i),s),()=>s.iFrameResizer&&s.iFrameResizer.removeListeners()}),Ne(t,()=>r.current),ze.createElement("iframe",l(c({},o),{title:n,ref:r}))});M.displayName="IframeResizer";var Ue=["autoResize","bodyBackground","bodyMargin","bodyPadding","checkOrigin","inPageLinks","heightCalculationMethod","interval","log","maxHeight","maxWidth","minHeight","minWidth","resizeFrom","scrolling","sizeHeight","sizeWidth","warningTimeout","tolerance","widthCalculationMethod","onClosed","onInit","onMessage","onResized","onScroll"],qe=new Set(Ue);function We(e){return Object.keys(e).reduce((n,o)=>{let i=e[o];return qe.has(o)?i!==void 0&&(n.resizerOptions[o]=e[o]):n.iframeHTMLAttributes[o]=e[o],n},{resizerOptions:{},iframeHTMLAttributes:{}})}function de(e){let{oneTimeToken:t,enableLogging:n,onExchangeComplete:o,onExchangeError:i}=e,r=R(n),s=Ke(null),a=$e(()=>q(t),[t]),u=Z({tokenData:a,onError:i,renderingContext:{entryPoint:"tokenExchange"}});return X({iframeRef:s,token:t,onError:i,methods:{onLoad:()=>{},onError:f=>{i==null||i(new C(f))},tokenExchange:{onLongLivedToken:o}}}),je.createElement(M,{src:u,checkOrigin:!1,style:{display:"none"},log:r,ref:s})}var Q={enableLogging:!1},Y="[CapitalOS] ",$={log:(e,t=Q)=>{t.enableLogging&&console.log(`${Y}${e}`)},warn:(e,t=Q)=>{t.enableLogging&&console.warn(`${Y}${e}`)},error:(e,t=Q)=>{t.enableLogging&&console.error(`${Y}${e}`)}};import F,{createContext as Ge,useState as Qe,useMemo as ge,useCallback as Ye}from"react";import Ve from"react";import{useMemo as Je}from"react";function le(d){var u=d,{onDone:e,onCancel:t,mfaId:n,destination:o,codeLength:i,canResendAfter:r,operationName:s}=u,a=v(u,["onDone","onCancel","mfaId","destination","codeLength","canResendAfter","operationName"]);let f="mfa",y=Je(()=>({entryPoint:f,mfaId:n,destination:o,codeLength:i,canResendAfter:r,operationName:s}),[f,n,o,i,r,s]);return Ve.createElement(m,l(c({},a),{renderingContext:y,methods:{mfa:{onDone:e,onCancel:t}}}))}import pe,{useEffect as Xe}from"react";var ue={backdrop:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.4)",backdropFilter:"blur(2px)",zIndex:1e3,display:"flex",alignItems:"center",justifyContent:"center",padding:"20px"},container:{backgroundColor:"white",borderRadius:"8px",boxShadow:"0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -2px rgb(0 0 0 / 0.05)",maxWidth:"600px",width:"100%",maxHeight:"90vh",overflow:"hidden",position:"relative"}};function me({onClose:e,children:t,ariaLabel:n="Modal dialog"}){Xe(()=>{let i=r=>{r.key==="Escape"&&e()};return document.addEventListener("keydown",i),()=>{document.removeEventListener("keydown",i)}},[e]);let o=i=>{i.target===i.currentTarget&&e()};return pe.createElement("div",{style:ue.backdrop,onClick:o,role:"dialog","aria-modal":"true","aria-label":n},pe.createElement("div",{style:ue.container},t))}import{useState as Ze,useCallback as K}from"react";function fe(){var u;let[e,t]=Ze(null),{log:n}=w(),o=K(f=>(n("MFA requested"),new Promise((y,P)=>{t({context:f,resolve:y,reject:P})})),[n]),i=K(()=>{e&&(n("MFA completed successfully"),e.resolve({success:!0,canceled:!1,data:void 0}),t(null))},[e,n]),r=K(()=>{e&&(n("MFA canceled"),e.resolve({success:!1,canceled:!0}),t(null))},[e,n]),s=K(f=>{e&&(n("MFA error: "+f.message),e.resolve({success:!1,canceled:!1,error:f}),t(null))},[e,n]),a=!!e,d=(u=e==null?void 0:e.context)!=null?u:null;return{activeMfaRequest:e,isMfaActive:a,mfaContext:d,requestMfa:o,handleMfaDone:i,handleMfaCancel:r,handleMfaError:s}}var ee=Ge(null);function Ce({children:e}){let[t,n]=Qe(null),{log:o}=w(),{requestMfa:i,handleMfaDone:r,handleMfaCancel:s,isMfaActive:a,mfaContext:d}=fe(),u=Ye(g=>A(this,null,function*(){let p=yield i(g);return p.success?{success:!0}:p.canceled?{success:!1,canceled:!0}:{success:!1,error:p.error.message}}),[i]),f=ge(()=>t?{freezeCard:g=>A(this,null,function*(){try{let p=yield t.freezeCard(g);return p.success?{success:!0,canceled:!1,data:p.data}:p.canceled?{success:!1,canceled:!0}:{success:!1,canceled:!1,error:new C({code:b.internal_error,message:p.error})}}catch(p){return{success:!1,canceled:!1,error:new C({code:b.internal_error,message:p instanceof Error?p.message:"Communication error with iframe"})}}}),unfreezeCard:g=>A(this,null,function*(){try{let p=yield t.unfreezeCard(g);return p.success?{success:!0,canceled:!1,data:p.data}:p.canceled?{success:!1,canceled:!0}:{success:!1,canceled:!1,error:new C({code:b.internal_error,message:p.error})}}catch(p){return{success:!1,canceled:!1,error:new C({code:b.internal_error,message:p instanceof Error?p.message:"Communication error with iframe"})}}})}:null,[t]),y=ge(()=>({"system-messages":{requestMfa:u},mfa:{onDone:r,onCancel:s}}),[u,r,s]),{isLoaded:P,url:k,connection:T,iframeRef:E}=j({renderingContext:{entryPoint:"actions"},methods:y});F.useEffect(()=>{let g=!0;return T&&T.promise.then(p=>{g&&(n(p),o("Actions iframe child functions loaded"))}),()=>{g=!1}},[T,o]);let I=!P||!t;return F.createElement(ee.Provider,{value:{childFunctions:t,actions:f,isLoading:I}},e,k&&F.createElement(M,{src:k,style:{display:"none"},checkOrigin:!1,ref:E}),a&&d&&F.createElement(me,{onClose:s,ariaLabel:"Multi-factor authentication"},F.createElement(le,l(c({mfaId:d.mfaId,destination:d.destination,codeLength:d.codeLength,canResendAfter:d.canResendAfter},d.operationName&&{operationName:d.operationName}),{onDone:r,onCancel:s}))))}var he=et({isLoading:!1,invalidateToken:()=>{},enableLogging:!1}),ot=({getToken:e,enableLogging:t,children:n})=>{let[o,i]=H(void 0),[r,s]=H(void 0),[a,d]=H(void 0),[u,f]=H(!1),[y,P]=H(void 0),k=S(()=>A(void 0,null,function*(){f(!0);try{let g=yield e();i(g),P(void 0);let p=V(g),O=new URL(p.path);O.pathname="",s(O.toString())}catch(g){P(g)}finally{f(!1)}}),[e]),T=S(()=>{d(void 0)},[]);nt(()=>{a||k()},[a,k]);let E=S(g=>{d(g),i(void 0),P(void 0)},[]),I=xe(()=>{if(a&&!r)throw new C({message:"baseUrl is required for long lived tokens",code:b.unauthorized});return{tokenData:a?{token:a,tokenType:"longLived",baseUrl:r,paramKey:"access_token",paramLocation:"hash"}:void 0,isLoading:u,error:y,invalidateToken:T,enableLogging:t!=null?t:!1}},[a,u,y,T,r,t]);return z.createElement(z.Fragment,null,z.createElement(he.Provider,{value:I},z.createElement(Ce,null,n)),o&&!a&&z.createElement(de,{oneTimeToken:o,onExchangeComplete:E,enableLogging:t,onExchangeError:P}))},G=()=>tt(he);function R(e){let{enableLogging:t}=G();return e!==void 0?e:t}function w(e){let t=R(e),n=S(r=>{$.log(r,{enableLogging:t})},[t]),o=S(r=>{$.warn(r,{enableLogging:t})},[t]),i=S(r=>{$.error(r,{enableLogging:t})},[t]);return xe(()=>({log:n,warn:o,error:i}),[n,o,i])}function m(e){let{token:t,className:n,enableLogging:o,onError:i,loadingComponent:r,renderingContext:s,methods:a,theme:d,sizeWidth:u}=e,f=R(o),{isLoaded:y,url:P,tokenData:k,iframeRef:T}=j({oneTimeToken:t,enableLogging:f,onError:i,renderingContext:s,theme:d,methods:a});if(!k||!P)return B.createElement(B.Fragment,null,r||null);let E=s.entryPoint!=="insightsWidget";return B.createElement(B.Fragment,null,!y&&r,B.createElement(M,{src:P,allow:"clipboard-write",checkOrigin:!1,style:{width:"1px",height:"0px",minWidth:"100%"},className:n,log:f,ref:T,hidden:!y,onResized:I=>{if(!E)return;let g=`${parseInt(I.height)+12}px`;I.iframe.style.height=g},sizeWidth:u}))}import _,{useMemo as rt}from"react";import{useState as it}from"react";import L,{useState as ye}from"react";var N={bugButton:{position:"fixed",left:"12px",bottom:"12px",margin:"12px",padding:"4px",display:"inline-flex",alignItems:"center",borderRadius:"9999px",border:"1px solid transparent",backgroundColor:"#2563eb",color:"white",opacity:.4,boxShadow:"0 1px 3px 0 rgb(0 0 0 / 0.1)",cursor:"pointer",zIndex:50,transition:"opacity 0.3s ease-in-out"},bugButtonHover:{backgroundColor:"#1d4ed8",opacity:1},bugButtonFocus:{outline:"none",boxShadow:"0 0 0 2px white, 0 0 0 4px #3b82f6"},bugIcon:{width:"20px",height:"20px"},loadingButton:{cursor:"default",opacity:1,animation:"pulse 1s cubic-bezier(0.4, 0, 0.6, 1) infinite"}},Pe=()=>L.createElement("svg",{style:N.bugIcon,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor"},L.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 12.75c1.148 0 2.278.08 3.383.237 1.037.146 1.866.966 1.866 2.013 0 3.728-2.35 6.75-5.25 6.75S6.75 18.728 6.75 15c0-1.046.83-1.867 1.866-2.013A24.204 24.204 0 0 1 12 12.75Zm0 0c2.883 0 5.647.508 8.207 1.44a23.91 23.91 0 0 1-1.152 6.06M12 12.75c-2.883 0-5.647.508-8.208 1.44.125 2.104.52 4.136 1.153 6.06M12 12.75a2.25 2.25 0 0 0 2.248-2.354M12 12.75a2.25 2.25 0 0 1-2.248-2.354M12 8.25c.995 0 1.971-.08 2.922-.236.403-.066.74-.358.795-.762a3.778 3.778 0 0 0-.399-2.25M12 8.25c-.995 0-1.97-.08-2.922-.236-.402-.066-.74-.358-.795-.762a3.734 3.734 0 0 1 .4-2.253M12 8.25a2.25 2.25 0 0 0-2.248 2.146M12 8.25a2.25 2.25 0 0 1 2.248 2.146M8.683 5a6.032 6.032 0 0 1-1.155-1.002c.07-.63.27-1.222.574-1.747m.581 2.749A3.75 3.75 0 0 1 15.318 5m0 0c.427-.283.815-.62 1.155-.999a4.471 4.471 0 0 0-.575-1.752M4.921 6a24.048 24.048 0 0 0-.392 3.314c1.668.546 3.416.914 5.223 1.082M19.08 6c.205 1.08.337 2.187.392 3.314a23.882 23.882 0 0 1-5.223 1.082"}));function te({onClick:e,isLoading:t=!1}){let[n,o]=ye(!1),[i,r]=ye(!1),s=c(c(c(c({},N.bugButton),t&&N.loadingButton),!t&&n&&N.bugButtonHover),!t&&i&&N.bugButtonFocus);return t?L.createElement("div",{style:s},L.createElement("style",null,`
|
|
1
|
+
"use client";var be=Object.defineProperty,ke=Object.defineProperties;var Te=Object.getOwnPropertyDescriptors;var U=Object.getOwnPropertySymbols;var oe=Object.prototype.hasOwnProperty,re=Object.prototype.propertyIsEnumerable;var ne=(e,t,n)=>t in e?be(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,c=(e,t)=>{for(var n in t||(t={}))oe.call(t,n)&&ne(e,n,t[n]);if(U)for(var n of U(t))re.call(t,n)&&ne(e,n,t[n]);return e},d=(e,t)=>ke(e,Te(t));var v=(e,t)=>{var n={};for(var o in e)oe.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(e!=null&&U)for(var o of U(e))t.indexOf(o)<0&&re.call(e,o)&&(n[o]=e[o]);return n};var D=(e,t,n)=>new Promise((o,i)=>{var r=l=>{try{a(n.next(l))}catch(u){i(u)}},s=l=>{try{a(n.throw(l))}catch(u){i(u)}},a=l=>l.done?o(l.value):Promise.resolve(l.value).then(r,s);a((n=n.apply(e,t)).next())});import x,{useMemo as h,useContext as ct}from"react";import B from"react";import z,{createContext as et,useContext as tt,useState as H,useMemo as xe,useCallback as S,useEffect as nt}from"react";import je,{useMemo as $e,useRef as Ke}from"react";var C=class extends Error{constructor({message:t,code:n}){super(t),this.name="CapitalOSError",this.code=n}},b={unauthorized:"unauthorized",invalid_account_status:"invalid_account_status",unsupported_entry_point:"unsupported_entry_point",internal_error:"internal_error"},A=class extends C{constructor(t){super({message:`Invalid token ${t!=null?t:""}`,code:b.unauthorized}),this.name="CapitalOSInvalidTokenError"}};import{connectToChild as Ae}from"penpal";import{useCallback as we,useEffect as J,useMemo as ae,useRef as W,useState as ce}from"react";var ie="1.2.1-rc.3";function Le(e){let t=JSON.stringify(e),n=btoa(t);return encodeURIComponent(n)}function V(e){try{let t=decodeURIComponent(e),n=atob(t);return JSON.parse(n)}catch(t){throw new A}}function De(e){try{return decodeURIComponent(e)}catch(t){return e}}function se({tokenData:e,renderingContext:t,theme:n,onError:o}){try{let i=t?d(c({},t),{referer:window.location.href}):null,r=i?Le(i):null,s=new URL(e.baseUrl),a=De(e.token);return e.paramLocation==="search"?s.searchParams.set(e.paramKey,a):e.paramLocation==="hash"&&(s.hash=e.paramKey+"="+encodeURIComponent(a)),s.searchParams.set("sdkVersion",ie),r&&s.searchParams.set("renderingContext",r),n&&s.searchParams.set("theme",n),s.toString()}catch(i){o==null||o(new A);return}}function q(e){let n=V(e).path;if(!n||typeof n!="string")throw new A;return{token:e,tokenType:"oneTime",baseUrl:n,paramKey:"token",paramLocation:"search"}}var Se=1e4;function X({iframeRef:e,token:t,onError:n,methods:o}){let[i,r]=ce(null);return J(()=>{if(!e.current)return;let s=Ae({iframe:e.current,childOrigin:"*",debug:!0,timeout:Se,methods:o});return s.promise.then(()=>{r(s)}).catch(a=>{n==null||n(a),r(null)}),()=>{s.destroy(),r(null)}},[t,e]),i}function Z({tokenData:e,renderingContext:t,theme:n,onError:o}){let i=W(o),r=W(t);return ae(()=>{if(e)return se({tokenData:e,renderingContext:r.current,theme:n,onError:i.current})},[e,n,i,r])}function j(e){let{oneTimeToken:t,enableLogging:n,onError:o,renderingContext:i,theme:r,methods:s}=e,{tokenData:a,error:l,invalidateToken:u}=G(),{log:f,warn:y}=w(n),[P,k]=ce(!1),T=W(null);Re(l,o);let E=ae(()=>t?q(t):a,[t,a]),I=we(()=>{if(f("Token expired, invalidating..."),t){o==null||o(new C({message:"Token expired. Cannot automatically refresh when using token prop.",code:b.unauthorized}));return}u(),k(!1)},[t,u,f,o]);J(()=>{t&&a&&y("token was provided both from provider and from the token prop. the prop will take precedence")},[t,a,y]);let g=Z({tokenData:E,renderingContext:i,theme:r,onError:o}),p=X({iframeRef:T,token:E==null?void 0:E.token,onError:L=>{o==null||o(L),k(!0)},methods:c({onLoad:()=>{k(!0)},onError:L=>{let ve=new C(L);o==null||o(ve)},onTokenExpired:I},s)});return{isLoaded:P,url:g,tokenData:E,iframeRef:T,connection:p}}function Re(e,t){let n=W(!1);J(()=>{e&&!n.current&&(t==null||t(e),n.current=!0)},[e,t])}import{iframeResizer as Fe}from"iframe-resizer";import ze,{forwardRef as He,useEffect as Be,useImperativeHandle as Ne,useRef as _e}from"react";var M=He((e,t)=>{let n=e.title||"iframe",{iframeHTMLAttributes:o,resizerOptions:i}=We(e),r=_e(null);return Be(()=>{let s=r.current;return Fe(c({},i),s),()=>s.iFrameResizer&&s.iFrameResizer.removeListeners()}),Ne(t,()=>r.current),ze.createElement("iframe",d(c({},o),{title:n,ref:r}))});M.displayName="IframeResizer";var Ue=["autoResize","bodyBackground","bodyMargin","bodyPadding","checkOrigin","inPageLinks","heightCalculationMethod","interval","log","maxHeight","maxWidth","minHeight","minWidth","resizeFrom","scrolling","sizeHeight","sizeWidth","warningTimeout","tolerance","widthCalculationMethod","onClosed","onInit","onMessage","onResized","onScroll"],qe=new Set(Ue);function We(e){return Object.keys(e).reduce((n,o)=>{let i=e[o];return qe.has(o)?i!==void 0&&(n.resizerOptions[o]=e[o]):n.iframeHTMLAttributes[o]=e[o],n},{resizerOptions:{},iframeHTMLAttributes:{}})}function de(e){let{oneTimeToken:t,enableLogging:n,onExchangeComplete:o,onExchangeError:i}=e,r=R(n),s=Ke(null),a=$e(()=>q(t),[t]),u=Z({tokenData:a,onError:i,renderingContext:{entryPoint:"tokenExchange"}});return X({iframeRef:s,token:t,onError:i,methods:{onLoad:()=>{},onError:f=>{i==null||i(new C(f))},tokenExchange:{onLongLivedToken:o}}}),je.createElement(M,{src:u,checkOrigin:!1,style:{display:"none"},log:r,ref:s})}var Q={enableLogging:!1},Y="[CapitalOS] ",$={log:(e,t=Q)=>{t.enableLogging&&console.log(`${Y}${e}`)},warn:(e,t=Q)=>{t.enableLogging&&console.warn(`${Y}${e}`)},error:(e,t=Q)=>{t.enableLogging&&console.error(`${Y}${e}`)}};import F,{createContext as Ge,useState as Qe,useMemo as ge,useCallback as Ye}from"react";import Ve from"react";import{useMemo as Je}from"react";function le(l){var u=l,{onDone:e,onCancel:t,mfaId:n,destination:o,codeLength:i,canResendAfter:r,operationName:s}=u,a=v(u,["onDone","onCancel","mfaId","destination","codeLength","canResendAfter","operationName"]);let f="mfa",y=Je(()=>({entryPoint:f,mfaId:n,destination:o,codeLength:i,canResendAfter:r,operationName:s}),[f,n,o,i,r,s]);return Ve.createElement(m,d(c({},a),{renderingContext:y,methods:{mfa:{onDone:e,onCancel:t}}}))}import pe,{useEffect as Xe}from"react";var ue={backdrop:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.4)",backdropFilter:"blur(2px)",zIndex:1e3,display:"flex",alignItems:"center",justifyContent:"center",padding:"20px"},container:{backgroundColor:"white",borderRadius:"8px",boxShadow:"0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -2px rgb(0 0 0 / 0.05)",maxWidth:"600px",width:"100%",maxHeight:"90vh",overflow:"hidden",position:"relative"}};function me({onClose:e,children:t,ariaLabel:n="Modal dialog"}){Xe(()=>{let i=r=>{r.key==="Escape"&&e()};return document.addEventListener("keydown",i),()=>{document.removeEventListener("keydown",i)}},[e]);let o=i=>{i.target===i.currentTarget&&e()};return pe.createElement("div",{style:ue.backdrop,onClick:o,role:"dialog","aria-modal":"true","aria-label":n},pe.createElement("div",{style:ue.container},t))}import{useState as Ze,useCallback as K}from"react";function fe(){var u;let[e,t]=Ze(null),{log:n}=w(),o=K(f=>(n("MFA requested"),new Promise((y,P)=>{t({context:f,resolve:y,reject:P})})),[n]),i=K(()=>{e&&(n("MFA completed successfully"),e.resolve({success:!0,canceled:!1,data:void 0}),t(null))},[e,n]),r=K(()=>{e&&(n("MFA canceled"),e.resolve({success:!1,canceled:!0}),t(null))},[e,n]),s=K(f=>{e&&(n("MFA error: "+f.message),e.resolve({success:!1,canceled:!1,error:f}),t(null))},[e,n]),a=!!e,l=(u=e==null?void 0:e.context)!=null?u:null;return{activeMfaRequest:e,isMfaActive:a,mfaContext:l,requestMfa:o,handleMfaDone:i,handleMfaCancel:r,handleMfaError:s}}var ee=Ge(null);function Ce({children:e}){let[t,n]=Qe(null),{log:o}=w(),{requestMfa:i,handleMfaDone:r,handleMfaCancel:s,isMfaActive:a,mfaContext:l}=fe(),u=Ye(g=>D(this,null,function*(){let p=yield i(g);return p.success?{success:!0}:p.canceled?{success:!1,canceled:!0}:{success:!1,error:p.error.message}}),[i]),f=ge(()=>t?{freezeCard:g=>D(this,null,function*(){try{let p=yield t.freezeCard(g);return p.success?{success:!0,canceled:!1,data:p.data}:p.canceled?{success:!1,canceled:!0}:{success:!1,canceled:!1,error:new C({code:b.internal_error,message:p.error})}}catch(p){return{success:!1,canceled:!1,error:new C({code:b.internal_error,message:p instanceof Error?p.message:"Communication error with iframe"})}}}),unfreezeCard:g=>D(this,null,function*(){try{let p=yield t.unfreezeCard(g);return p.success?{success:!0,canceled:!1,data:p.data}:p.canceled?{success:!1,canceled:!0}:{success:!1,canceled:!1,error:new C({code:b.internal_error,message:p.error})}}catch(p){return{success:!1,canceled:!1,error:new C({code:b.internal_error,message:p instanceof Error?p.message:"Communication error with iframe"})}}})}:null,[t]),y=ge(()=>({"system-messages":{requestMfa:u},mfa:{onDone:r,onCancel:s}}),[u,r,s]),{isLoaded:P,url:k,connection:T,iframeRef:E}=j({renderingContext:{entryPoint:"actions"},methods:y});F.useEffect(()=>{let g=!0;return T&&T.promise.then(p=>{g&&(n(p),o("Actions iframe child functions loaded"))}),()=>{g=!1}},[T,o]);let I=!P||!t;return F.createElement(ee.Provider,{value:{childFunctions:t,actions:f,isLoading:I}},e,k&&F.createElement(M,{src:k,style:{display:"none"},checkOrigin:!1,ref:E}),a&&l&&F.createElement(me,{onClose:s,ariaLabel:"Multi-factor authentication"},F.createElement(le,d(c({mfaId:l.mfaId,destination:l.destination,codeLength:l.codeLength,canResendAfter:l.canResendAfter},l.operationName&&{operationName:l.operationName}),{onDone:r,onCancel:s}))))}var he=et({isLoading:!1,invalidateToken:()=>{},enableLogging:!1}),ot=({getToken:e,enableLogging:t,children:n})=>{let[o,i]=H(void 0),[r,s]=H(void 0),[a,l]=H(void 0),[u,f]=H(!1),[y,P]=H(void 0),k=S(()=>D(void 0,null,function*(){f(!0);try{let g=yield e();i(g),P(void 0);let p=V(g),L=new URL(p.path);L.pathname="",s(L.toString())}catch(g){P(g)}finally{f(!1)}}),[e]),T=S(()=>{l(void 0)},[]);nt(()=>{a||k()},[a,k]);let E=S(g=>{l(g),i(void 0),P(void 0)},[]),I=xe(()=>{if(a&&!r)throw new C({message:"baseUrl is required for long lived tokens",code:b.unauthorized});return{tokenData:a?{token:a,tokenType:"longLived",baseUrl:r,paramKey:"access_token",paramLocation:"hash"}:void 0,isLoading:u,error:y,invalidateToken:T,enableLogging:t!=null?t:!1}},[a,u,y,T,r,t]);return z.createElement(z.Fragment,null,z.createElement(he.Provider,{value:I},z.createElement(Ce,null,n)),o&&!a&&z.createElement(de,{oneTimeToken:o,onExchangeComplete:E,enableLogging:t,onExchangeError:P}))},G=()=>tt(he);function R(e){let{enableLogging:t}=G();return e!==void 0?e:t}function w(e){let t=R(e),n=S(r=>{$.log(r,{enableLogging:t})},[t]),o=S(r=>{$.warn(r,{enableLogging:t})},[t]),i=S(r=>{$.error(r,{enableLogging:t})},[t]);return xe(()=>({log:n,warn:o,error:i}),[n,o,i])}function m(e){let{token:t,className:n,enableLogging:o,onError:i,loadingComponent:r,renderingContext:s,methods:a,theme:l,sizeWidth:u}=e,f=R(o),{isLoaded:y,url:P,tokenData:k,iframeRef:T}=j({oneTimeToken:t,enableLogging:f,onError:i,renderingContext:s,theme:l,methods:a});if(!k||!P)return B.createElement(B.Fragment,null,r||null);let E=s.entryPoint!=="insightsWidget";return B.createElement(B.Fragment,null,!y&&r,B.createElement(M,{src:P,allow:"clipboard-write",checkOrigin:!1,style:{width:"1px",height:"0px",minWidth:"100%"},className:n,log:f,ref:T,hidden:!y,onResized:I=>{if(!E)return;let g=`${parseInt(I.height)+12}px`;I.iframe.style.height=g},sizeWidth:u}))}import _,{useMemo as rt}from"react";import{useState as it}from"react";import O,{useState as ye}from"react";var N={bugButton:{position:"fixed",left:"12px",bottom:"12px",margin:"12px",padding:"4px",display:"inline-flex",alignItems:"center",borderRadius:"9999px",border:"1px solid transparent",backgroundColor:"#2563eb",color:"white",opacity:.4,boxShadow:"0 1px 3px 0 rgb(0 0 0 / 0.1)",cursor:"pointer",zIndex:50,transition:"opacity 0.3s ease-in-out"},bugButtonHover:{backgroundColor:"#1d4ed8",opacity:1},bugButtonFocus:{outline:"none",boxShadow:"0 0 0 2px white, 0 0 0 4px #3b82f6"},bugIcon:{width:"20px",height:"20px"},loadingButton:{cursor:"default",opacity:1,animation:"pulse 1s cubic-bezier(0.4, 0, 0.6, 1) infinite"}},Pe=()=>O.createElement("svg",{style:N.bugIcon,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor"},O.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 12.75c1.148 0 2.278.08 3.383.237 1.037.146 1.866.966 1.866 2.013 0 3.728-2.35 6.75-5.25 6.75S6.75 18.728 6.75 15c0-1.046.83-1.867 1.866-2.013A24.204 24.204 0 0 1 12 12.75Zm0 0c2.883 0 5.647.508 8.207 1.44a23.91 23.91 0 0 1-1.152 6.06M12 12.75c-2.883 0-5.647.508-8.208 1.44.125 2.104.52 4.136 1.153 6.06M12 12.75a2.25 2.25 0 0 0 2.248-2.354M12 12.75a2.25 2.25 0 0 1-2.248-2.354M12 8.25c.995 0 1.971-.08 2.922-.236.403-.066.74-.358.795-.762a3.778 3.778 0 0 0-.399-2.25M12 8.25c-.995 0-1.97-.08-2.922-.236-.402-.066-.74-.358-.795-.762a3.734 3.734 0 0 1 .4-2.253M12 8.25a2.25 2.25 0 0 0-2.248 2.146M12 8.25a2.25 2.25 0 0 1 2.248 2.146M8.683 5a6.032 6.032 0 0 1-1.155-1.002c.07-.63.27-1.222.574-1.747m.581 2.749A3.75 3.75 0 0 1 15.318 5m0 0c.427-.283.815-.62 1.155-.999a4.471 4.471 0 0 0-.575-1.752M4.921 6a24.048 24.048 0 0 0-.392 3.314c1.668.546 3.416.914 5.223 1.082M19.08 6c.205 1.08.337 2.187.392 3.314a23.882 23.882 0 0 1-5.223 1.082"}));function te({onClick:e,isLoading:t=!1}){let[n,o]=ye(!1),[i,r]=ye(!1),s=c(c(c(c({},N.bugButton),t&&N.loadingButton),!t&&n&&N.bugButtonHover),!t&&i&&N.bugButtonFocus);return t?O.createElement("div",{style:s},O.createElement("style",null,`
|
|
2
2
|
@keyframes pulse {
|
|
3
3
|
0%, 100% {
|
|
4
4
|
opacity: 1;
|
|
@@ -7,5 +7,5 @@
|
|
|
7
7
|
opacity: 0.4;
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
|
-
`),
|
|
10
|
+
`),O.createElement(Pe,null)):O.createElement("button",{id:"dev-tools-button",onClick:e,type:"button",style:s,onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),onFocus:()=>r(!0),onBlur:()=>r(!1)},O.createElement(Pe,null))}var st={panel:{position:"fixed",bottom:"20px",left:"20px",zIndex:50}};function at(e){let t="devTools",n=rt(()=>({entryPoint:t}),[t]),[o,i]=it(!1);return _.createElement("aside",{"aria-label":"CapitalOS dev tools"},!o&&_.createElement(te,{onClick:()=>i(!o)}),o&&_.createElement("div",{style:st.panel},_.createElement(m,d(c({},e),{renderingContext:n,methods:{devTools:{onClose:()=>i(!1)}},enableLogging:!0,sizeWidth:!0,loadingComponent:_.createElement(te,{isLoading:!0})}))))}function dt(e){let t="cardsApp",n=h(()=>({entryPoint:t}),[t]);return x.createElement(m,d(c({},e),{renderingContext:n}))}var Xn=dt;function Zn(i){var r=i,{cardholder:e,onDone:t,onCancel:n}=r,o=v(r,["cardholder","onDone","onCancel"]);let s="createCard",a=h(()=>({entryPoint:s,cardholder:e}),[e]);return x.createElement(m,d(c({},o),{renderingContext:a,methods:{createCard:{onDone:t,onCancel:n}}}))}function Gn(i){var r=i,{transactionId:e,onDone:t,onCancel:n}=r,o=v(r,["transactionId","onDone","onCancel"]);let s="createDispute",a=h(()=>({entryPoint:s,transactionId:e}),[e]);return x.createElement(m,d(c({},o),{renderingContext:a,methods:{createDispute:{onDone:t,onCancel:n}}}))}function Qn(e){let t="billPayApp",n=h(()=>({entryPoint:t}),[t]);return x.createElement(m,d(c({},e),{renderingContext:n}))}function Yn(e){let s=e,{onCardCanceled:t,onHideSensitiveDetails:n}=s,o=v(s,["onCardCanceled","onHideSensitiveDetails"]),i="cardDetails",r=h(()=>({entryPoint:i,cardId:e.cardId,cardOnly:e.cardOnly,backOnly:e.backOnly,hideAddress:e.hideAddress}),[i,e.cardId,e.cardOnly,e.backOnly,e.hideAddress]);return x.createElement(m,d(c({},o),{renderingContext:r,methods:{cardDetails:{onCardCanceled:t!=null?t:()=>{},onHideSensitiveDetails:n!=null?n:()=>{}}}}))}function eo(e){let t="accountDetails",n=h(()=>({entryPoint:t}),[t]);return x.createElement(m,d(c({},e),{renderingContext:n}))}function to(e){let t="accountActions",n=h(()=>({entryPoint:t}),[t]);return x.createElement(m,d(c({},e),{renderingContext:n}))}function no(e){let t="insightsDashboard",n=h(()=>({entryPoint:t}),[t]);return x.createElement(m,d(c({},e),{renderingContext:n}))}function oo(e){let t="insightsWidget",{widget:n,hideTitle:o,height:i,width:r}=e,s=h(()=>({entryPoint:t,widget:n,hideTitle:o,height:i,width:r}),[t,n,o,i,r]);return x.createElement(m,d(c({},e),{renderingContext:s}))}function ro(i){var r=i,{onDone:e,entryPoint:t,exitPoint:n}=r,o=v(r,["onDone","entryPoint","exitPoint"]);let s="onboarding",a=h(()=>({entryPoint:s,onboardingEntryPoint:t,onboardingExitPoint:n}),[s,t,n]);return x.createElement(m,d(c({},o),{renderingContext:a,methods:{onboarding:{onDone:e}}}))}function io(n){var o=n,{onDone:e}=o,t=v(o,["onDone"]);let i="makePayment",r=h(()=>({entryPoint:i}),[i]);return x.createElement(m,d(c({},t),{renderingContext:r,methods:{makePayment:{onDone:e}}}))}function so(o){var i=o,{onDone:e,onCancel:t}=i,n=v(i,["onDone","onCancel"]);let r="contactSupport",s=h(()=>({entryPoint:r}),[r]);return x.createElement(m,d(c({},n),{renderingContext:s,methods:{contactSupport:{onDone:e,onCancel:t}}}))}function ao(n){var o=n,{onDone:e}=o,t=v(o,["onDone"]);let i="statements",r=h(()=>({entryPoint:i}),[i]);return x.createElement(m,d(c({},t),{renderingContext:r,methods:{statements:{onDone:e}}}))}function co(n){var o=n,{onDone:e}=o,t=v(o,["onDone"]);let i="legalDocuments",r=h(()=>({entryPoint:i}),[i]);return x.createElement(m,d(c({},t),{renderingContext:r,methods:{legalDocuments:{onDone:e}}}))}function lo(i){var r=i,{cardId:e,onDone:t,onClose:n}=r,o=v(r,["cardId","onDone","onClose"]);let s="replaceCard",a=h(()=>({entryPoint:s,cardId:e}),[e]);return x.createElement(m,d(c({},o),{renderingContext:a,methods:{replaceCard:{onDone:t,onClose:n}}}))}function po(i){var r=i,{cardId:e,onDone:t,onClose:n}=r,o=v(r,["cardId","onDone","onClose"]);let s="terminateCard",a=h(()=>({entryPoint:s,cardId:e}),[e]);return x.createElement(m,d(c({},o),{renderingContext:a,methods:{terminateCard:{onDone:t,onClose:n}}}))}function uo(e){let t="transactions",n=h(()=>({entryPoint:t}),[t]);return x.createElement(m,d(c({},e),{renderingContext:n}))}function mo(){let e=ct(ee);if(!e)throw new C({message:"useActions must be used within a CapitalOsAuthenticationProvider",code:b.internal_error});let{childFunctions:t,isLoading:n}=e;return{actions:t,isLoading:n}}export{to as AccountActions,eo as AccountDetails,Xn as App,Qn as BillPayApp,ot as CapitalOsAuthenticationProvider,Yn as CardDetails,dt as CardsApp,so as ContactSupport,at as DevTools,Gn as DisputeTransaction,no as InsightsDashboard,oo as InsightsWidget,Zn as IssueCard,co as LegalDocuments,io as MakePayment,ro as Onboarding,lo as ReplaceCard,ao as Statements,po as TerminateCard,uo as Transactions,mo as useActions};
|
|
11
11
|
//# sourceMappingURL=index.js.map
|