@movmo_app/payments 0.1.0

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/README.md ADDED
@@ -0,0 +1,56 @@
1
+ # @movmo_app/payments
2
+
3
+ PCI-safe card capture for Movmo UIs (`accounts-ui`, `flights-ui`) and airline partner embeds. The package is intentionally vault-neutral on its public surface — the underlying PCI vault (currently Spreedly Hosted Fields) is an implementation detail that consumers do not depend on.
4
+
5
+ ## What's in the box
6
+
7
+ - **`<MovmoCardForm />`** — drop-in form: two PCI-safe card-field iframes (card number + CVV) plus standard inputs for cardholder name and expiry, plus a Save button. Tokenizes the card, then calls the Movmo API to save the vaulted card to the user's profile.
8
+ - **`useMovmoCardFields()`** — lower-level hook for partners who want to compose their own form layout around the two card-field iframes.
9
+ - **`PaymentMethodSummary`** — vault-neutral type returned to consumers (no vault tokens, no customer/vault IDs leak through).
10
+
11
+ ## Backend contract
12
+
13
+ Consumes two existing `monolith-api` endpoints (no backend changes required):
14
+
15
+ | Method | Path | Purpose |
16
+ |---|---|---|
17
+ | `GET` | `/v1/payments/tokenization-session` | Fetch RSA-signed Spreedly session params (`environmentKey`, `certificateToken`, `nonce`, `timestamp`, `signature`). |
18
+ | `POST` | `/v1/users/:userid/payment-methods/from-token` | Save the vaulted card; server derives `last4`/`brand`/`expMonth`/`expYear` from the Spreedly vault, never trusting the client. |
19
+
20
+ Both endpoints sit behind the standard RBAC/session-cookie auth.
21
+
22
+ ## Usage
23
+
24
+ ```tsx
25
+ import { MovmoCardForm } from '@movmo_app/payments';
26
+
27
+ <MovmoCardForm
28
+ userId={user.id}
29
+ isDefault
30
+ defaultCardholderFirstName={user.firstName}
31
+ defaultCardholderLastName={user.lastName}
32
+ onSuccess={(pm) => console.log('saved', pm)}
33
+ onError={(msg) => console.error(msg)}
34
+ />;
35
+ ```
36
+
37
+ Cardholder defaults are editable so users can save a card that isn't in their own name (spouse card, corporate card).
38
+
39
+ Set the API base URL once at app boot (mirrors `@movmo_app/api`):
40
+
41
+ ```ts
42
+ import { setPaymentsConfig } from '@movmo_app/payments';
43
+
44
+ setPaymentsConfig({ baseUrl: import.meta.env.VITE_MOVMO_API_URL });
45
+ ```
46
+
47
+ ## Local development
48
+
49
+ ```bash
50
+ pnpm install # from monorepo root
51
+ pnpm --filter @movmo_app/payments build
52
+ pnpm --filter @movmo_app/payments test
53
+ pnpm --filter @movmo_app/payments storybook # → http://localhost:6007
54
+ ```
55
+
56
+ Storybook is the primary way to exercise the component on a laptop: it mocks both the underlying vault SDK and the `monolith-api` calls, so no vault credentials, no live backend, and no real card data are required. See `src/MovmoCardForm/__docs__/MovmoCardForm.stories.tsx` for the full state matrix.
@@ -0,0 +1,31 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const R=require("react");var ye={exports:{}},q={};/**
2
+ * @license React
3
+ * react-jsx-runtime.production.min.js
4
+ *
5
+ * Copyright (c) Facebook, Inc. and its affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var Ie;function wr(){if(Ie)return q;Ie=1;var n=R,o=Symbol.for("react.element"),c=Symbol.for("react.fragment"),i=Object.prototype.hasOwnProperty,v=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,x={key:!0,ref:!0,__self:!0,__source:!0};function D(k,b,C){var E,y={},N=null,T=null;C!==void 0&&(N=""+C),b.key!==void 0&&(N=""+b.key),b.ref!==void 0&&(T=b.ref);for(E in b)i.call(b,E)&&!x.hasOwnProperty(E)&&(y[E]=b[E]);if(k&&k.defaultProps)for(E in b=k.defaultProps,b)y[E]===void 0&&(y[E]=b[E]);return{$$typeof:o,type:k,key:N,ref:T,props:y,_owner:v.current}}return q.Fragment=c,q.jsx=D,q.jsxs=D,q}var B={};/**
10
+ * @license React
11
+ * react-jsx-runtime.development.js
12
+ *
13
+ * Copyright (c) Facebook, Inc. and its affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var $e;function xr(){return $e||($e=1,process.env.NODE_ENV!=="production"&&function(){var n=R,o=Symbol.for("react.element"),c=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),v=Symbol.for("react.strict_mode"),x=Symbol.for("react.profiler"),D=Symbol.for("react.provider"),k=Symbol.for("react.context"),b=Symbol.for("react.forward_ref"),C=Symbol.for("react.suspense"),E=Symbol.for("react.suspense_list"),y=Symbol.for("react.memo"),N=Symbol.for("react.lazy"),T=Symbol.for("react.offscreen"),h=Symbol.iterator,S="@@iterator";function P(e){if(e===null||typeof e!="object")return null;var r=h&&e[h]||e[S];return typeof r=="function"?r:null}var w=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function p(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),a=1;a<r;a++)t[a-1]=arguments[a];K("error",e,t)}}function K(e,r,t){{var a=w.ReactDebugCurrentFrame,u=a.getStackAddendum();u!==""&&(r+="%s",t=t.concat([u]));var f=t.map(function(l){return String(l)});f.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,f)}}var G=!1,oe=!1,U=!1,ie=!1,se=!1,H;H=Symbol.for("react.module.reference");function Y(e){return!!(typeof e=="string"||typeof e=="function"||e===i||e===x||se||e===v||e===C||e===E||ie||e===T||G||oe||U||typeof e=="object"&&e!==null&&(e.$$typeof===N||e.$$typeof===y||e.$$typeof===D||e.$$typeof===k||e.$$typeof===b||e.$$typeof===H||e.getModuleId!==void 0))}function X(e,r,t){var a=e.displayName;if(a)return a;var u=r.displayName||r.name||"";return u!==""?t+"("+u+")":t}function Z(e){return e.displayName||"Context"}function M(e){if(e==null)return null;if(typeof e.tag=="number"&&p("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case i:return"Fragment";case c:return"Portal";case x:return"Profiler";case v:return"StrictMode";case C:return"Suspense";case E:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case k:var r=e;return Z(r)+".Consumer";case D:var t=e;return Z(t._context)+".Provider";case b:return X(e,e.render,"ForwardRef");case y:var a=e.displayName||null;return a!==null?a:M(e.type)||"Memo";case N:{var u=e,f=u._payload,l=u._init;try{return M(l(f))}catch{return null}}}return null}var d=Object.assign,F=0,L,ge,be,Ee,_e,Re,Se;function we(){}we.__reactDisabledLog=!0;function Xe(){{if(F===0){L=console.log,ge=console.info,be=console.warn,Ee=console.error,_e=console.group,Re=console.groupCollapsed,Se=console.groupEnd;var e={configurable:!0,enumerable:!0,value:we,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}F++}}function Ze(){{if(F--,F===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:d({},e,{value:L}),info:d({},e,{value:ge}),warn:d({},e,{value:be}),error:d({},e,{value:Ee}),group:d({},e,{value:_e}),groupCollapsed:d({},e,{value:Re}),groupEnd:d({},e,{value:Se})})}F<0&&p("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var le=w.ReactCurrentDispatcher,ce;function Q(e,r,t){{if(ce===void 0)try{throw Error()}catch(u){var a=u.stack.trim().match(/\n( *(at )?)/);ce=a&&a[1]||""}return`
18
+ `+ce+e}}var ue=!1,ee;{var Qe=typeof WeakMap=="function"?WeakMap:Map;ee=new Qe}function xe(e,r){if(!e||ue)return"";{var t=ee.get(e);if(t!==void 0)return t}var a;ue=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var f;f=le.current,le.current=null,Xe();try{if(r){var l=function(){throw Error()};if(Object.defineProperty(l.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(l,[])}catch(O){a=O}Reflect.construct(e,[],l)}else{try{l.call()}catch(O){a=O}e.call(l.prototype)}}else{try{throw Error()}catch(O){a=O}e()}}catch(O){if(O&&a&&typeof O.stack=="string"){for(var s=O.stack.split(`
19
+ `),j=a.stack.split(`
20
+ `),g=s.length-1,_=j.length-1;g>=1&&_>=0&&s[g]!==j[_];)_--;for(;g>=1&&_>=0;g--,_--)if(s[g]!==j[_]){if(g!==1||_!==1)do if(g--,_--,_<0||s[g]!==j[_]){var A=`
21
+ `+s[g].replace(" at new "," at ");return e.displayName&&A.includes("<anonymous>")&&(A=A.replace("<anonymous>",e.displayName)),typeof e=="function"&&ee.set(e,A),A}while(g>=1&&_>=0);break}}}finally{ue=!1,le.current=f,Ze(),Error.prepareStackTrace=u}var W=e?e.displayName||e.name:"",I=W?Q(W):"";return typeof e=="function"&&ee.set(e,I),I}function er(e,r,t){return xe(e,!1)}function rr(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function re(e,r,t){if(e==null)return"";if(typeof e=="function")return xe(e,rr(e));if(typeof e=="string")return Q(e);switch(e){case C:return Q("Suspense");case E:return Q("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case b:return er(e.render);case y:return re(e.type,r,t);case N:{var a=e,u=a._payload,f=a._init;try{return re(f(u),r,t)}catch{}}}return""}var z=Object.prototype.hasOwnProperty,Ce={},Te=w.ReactDebugCurrentFrame;function te(e){if(e){var r=e._owner,t=re(e.type,e._source,r?r.type:null);Te.setExtraStackFrame(t)}else Te.setExtraStackFrame(null)}function tr(e,r,t,a,u){{var f=Function.call.bind(z);for(var l in e)if(f(e,l)){var s=void 0;try{if(typeof e[l]!="function"){var j=Error((a||"React class")+": "+t+" type `"+l+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[l]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw j.name="Invariant Violation",j}s=e[l](r,l,a,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(g){s=g}s&&!(s instanceof Error)&&(te(u),p("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",a||"React class",t,l,typeof s),te(null)),s instanceof Error&&!(s.message in Ce)&&(Ce[s.message]=!0,te(u),p("Failed %s type: %s",t,s.message),te(null))}}}var nr=Array.isArray;function de(e){return nr(e)}function ar(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t}}function or(e){try{return je(e),!1}catch{return!0}}function je(e){return""+e}function Pe(e){if(or(e))return p("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",ar(e)),je(e)}var Oe=w.ReactCurrentOwner,ir={key:!0,ref:!0,__self:!0,__source:!0},ke,Fe;function sr(e){if(z.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function lr(e){if(z.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function cr(e,r){typeof e.ref=="string"&&Oe.current}function ur(e,r){{var t=function(){ke||(ke=!0,p("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}}function dr(e,r){{var t=function(){Fe||(Fe=!0,p("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"ref",{get:t,configurable:!0})}}var fr=function(e,r,t,a,u,f,l){var s={$$typeof:o,type:e,key:r,ref:t,props:l,_owner:f};return s._store={},Object.defineProperty(s._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(s,"_self",{configurable:!1,enumerable:!1,writable:!1,value:a}),Object.defineProperty(s,"_source",{configurable:!1,enumerable:!1,writable:!1,value:u}),Object.freeze&&(Object.freeze(s.props),Object.freeze(s)),s};function mr(e,r,t,a,u){{var f,l={},s=null,j=null;t!==void 0&&(Pe(t),s=""+t),lr(r)&&(Pe(r.key),s=""+r.key),sr(r)&&(j=r.ref,cr(r,u));for(f in r)z.call(r,f)&&!ir.hasOwnProperty(f)&&(l[f]=r[f]);if(e&&e.defaultProps){var g=e.defaultProps;for(f in g)l[f]===void 0&&(l[f]=g[f])}if(s||j){var _=typeof e=="function"?e.displayName||e.name||"Unknown":e;s&&ur(l,_),j&&dr(l,_)}return fr(e,s,j,u,a,Oe.current,l)}}var fe=w.ReactCurrentOwner,Ae=w.ReactDebugCurrentFrame;function $(e){if(e){var r=e._owner,t=re(e.type,e._source,r?r.type:null);Ae.setExtraStackFrame(t)}else Ae.setExtraStackFrame(null)}var me;me=!1;function ve(e){return typeof e=="object"&&e!==null&&e.$$typeof===o}function De(){{if(fe.current){var e=M(fe.current.type);if(e)return`
22
+
23
+ Check the render method of \``+e+"`."}return""}}function vr(e){return""}var Ne={};function pr(e){{var r=De();if(!r){var t=typeof e=="string"?e:e.displayName||e.name;t&&(r=`
24
+
25
+ Check the top-level render call using <`+t+">.")}return r}}function Me(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=pr(r);if(Ne[t])return;Ne[t]=!0;var a="";e&&e._owner&&e._owner!==fe.current&&(a=" It was passed a child from "+M(e._owner.type)+"."),$(e),p('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',t,a),$(null)}}function Le(e,r){{if(typeof e!="object")return;if(de(e))for(var t=0;t<e.length;t++){var a=e[t];ve(a)&&Me(a,r)}else if(ve(e))e._store&&(e._store.validated=!0);else if(e){var u=P(e);if(typeof u=="function"&&u!==e.entries)for(var f=u.call(e),l;!(l=f.next()).done;)ve(l.value)&&Me(l.value,r)}}}function yr(e){{var r=e.type;if(r==null||typeof r=="string")return;var t;if(typeof r=="function")t=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===b||r.$$typeof===y))t=r.propTypes;else return;if(t){var a=M(r);tr(t,e.props,"prop",a,e)}else if(r.PropTypes!==void 0&&!me){me=!0;var u=M(r);p("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",u||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&p("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function hr(e){{for(var r=Object.keys(e.props),t=0;t<r.length;t++){var a=r[t];if(a!=="children"&&a!=="key"){$(e),p("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",a),$(null);break}}e.ref!==null&&($(e),p("Invalid attribute `ref` supplied to `React.Fragment`."),$(null))}}var Ue={};function Ye(e,r,t,a,u,f){{var l=Y(e);if(!l){var s="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(s+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var j=vr();j?s+=j:s+=De();var g;e===null?g="null":de(e)?g="array":e!==void 0&&e.$$typeof===o?(g="<"+(M(e.type)||"Unknown")+" />",s=" Did you accidentally export a JSX literal instead of a component?"):g=typeof e,p("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",g,s)}var _=mr(e,r,t,u,f);if(_==null)return _;if(l){var A=r.children;if(A!==void 0)if(a)if(de(A)){for(var W=0;W<A.length;W++)Le(A[W],e);Object.freeze&&Object.freeze(A)}else p("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Le(A,e)}if(z.call(r,"key")){var I=M(e),O=Object.keys(r).filter(function(Sr){return Sr!=="key"}),pe=O.length>0?"{key: someKey, "+O.join(": ..., ")+": ...}":"{key: someKey}";if(!Ue[I+pe]){var Rr=O.length>0?"{"+O.join(": ..., ")+": ...}":"{}";p(`A props object containing a "key" prop is being spread into JSX:
26
+ let props = %s;
27
+ <%s {...props} />
28
+ React keys must be passed directly to JSX without using spread:
29
+ let props = %s;
30
+ <%s key={someKey} {...props} />`,pe,I,Rr,I),Ue[I+pe]=!0}}return e===i?hr(_):yr(_),_}}function gr(e,r,t){return Ye(e,r,t,!0)}function br(e,r,t){return Ye(e,r,t,!1)}var Er=br,_r=gr;B.Fragment=i,B.jsx=Er,B.jsxs=_r}()),B}process.env.NODE_ENV==="production"?ye.exports=wr():ye.exports=xr();var m=ye.exports;function qe(n){var o,c,i="";if(typeof n=="string"||typeof n=="number")i+=n;else if(typeof n=="object")if(Array.isArray(n)){var v=n.length;for(o=0;o<v;o++)n[o]&&(c=qe(n[o]))&&(i&&(i+=" "),i+=c)}else for(c in n)n[c]&&(i&&(i+=" "),i+=c);return i}function We(){for(var n,o,c=0,i="",v=arguments.length;c<v;c++)(n=arguments[c])&&(o=qe(n))&&(i&&(i+=" "),i+=o);return i}const Cr="https://core.spreedly.com/iframe/iframe-v1.min.js";let ae={};const Tr=n=>{ae={...ae,...n}},Ve=n=>{var c;const o=globalThis.process;return(c=o==null?void 0:o.env)==null?void 0:c[n]},he=()=>({baseUrl:ae.baseUrl??Ve("REACT_APP_MOVMO_API_URL")??"",spreedlyScriptUrl:ae.spreedlyScriptUrl??Ve("REACT_APP_SPREEDLY_SCRIPT_URL")??Cr}),Be={Accept:"application/json","Content-Type":"application/json"},Je=n=>{const{baseUrl:o}=he();if(!o)throw new Error("@movmo_app/payments: baseUrl is not configured. Call setPaymentsConfig({ baseUrl }) at app boot, or set REACT_APP_MOVMO_API_URL.");return`${o}${n}`},Ke=async(n,o)=>{try{return(await n.json()).message||o}catch{return o}},jr=async()=>{const n=await fetch(Je("/v1/payments/tokenization-session"),{method:"GET",headers:Be,credentials:"include"});if(!n.ok)throw new Error(await Ke(n,`Failed to fetch tokenization session (${n.status})`));return await n.json()},Pr=async(n,o,c)=>{const i=await fetch(Je(`/v1/users/${encodeURIComponent(n)}/payment-methods/from-token`),{method:"POST",headers:Be,credentials:"include",body:JSON.stringify({tokenizedPaymentMethodId:o,isDefault:c})});if(!i.ok)throw new Error(await Ke(i,`Failed to save payment method (${i.status})`));const v=await i.json();return{id:v.id,last4:v.last4,brand:v.brand,expMonth:v.expMonth,expYear:v.expYear,isDefault:v.isDefault}};let J=null;const Or=()=>{if(typeof window>"u")return Promise.reject(new Error("Spreedly can only be loaded in a browser environment."));if(window.Spreedly)return Promise.resolve(window.Spreedly);if(J)return J;const{spreedlyScriptUrl:n}=he();return J=new Promise((o,c)=>{const i=document.querySelector(`script[src="${n}"]`),v=()=>{window.Spreedly?o(window.Spreedly):c(new Error("Spreedly script loaded but window.Spreedly is undefined."))};if(i){if(window.Spreedly){v();return}i.addEventListener("load",v,{once:!0}),i.addEventListener("error",()=>{i.remove(),c(new Error("Failed to load Spreedly iframe script."))},{once:!0});return}const x=document.createElement("script");x.src=n,x.async=!0,x.onload=v,x.onerror=()=>{x.remove(),c(new Error("Failed to load Spreedly iframe script."))},document.head.appendChild(x)}).catch(o=>{throw J=null,o}),J},kr="movmo-card-number",Fr="movmo-card-cvv",Ar=n=>({first_name:n.firstName,last_name:n.lastName,month:n.month,year:n.year,...n.email?{email:n.email}:{},...n.zip?{zip:n.zip}:{}}),Ge=(n={})=>{const{numberEl:o=kr,cvvEl:c=Fr,onCardTokenized:i,onFieldErrors:v}=n,[x,D]=R.useState("idle"),[k,b]=R.useState(null),C=R.useRef(null),E=R.useRef(i),y=R.useRef(v);R.useEffect(()=>{E.current=i},[i]),R.useEffect(()=>{y.current=v},[v]),R.useEffect(()=>{let T=!1;return D("loading"),b(null),(async()=>{try{const[h,S]=await Promise.all([jr(),Or()]);if(T)return;C.current=S,S.on("ready",()=>{T||D("ready")}),S.on("paymentMethod",P=>{var w;(w=E.current)==null||w.call(E,P)}),S.on("errors",P=>{var w;(w=y.current)==null||w.call(y,P)}),S.on("consoleError",P=>{var p;const w=P instanceof Error?P.message:"An unexpected error occurred while securing your card.";(p=y.current)==null||p.call(y,[{message:w}])}),S.init(h.environmentKey,{numberEl:o,cvvEl:c,nonce:h.nonce,timestamp:String(h.timestamp),certificateToken:h.certificateToken,signature:h.signature})}catch(h){if(T)return;const S=h instanceof Error?h.message:"Failed to initialize card form.";b(S),D("error")}})(),()=>{var h,S;T=!0;try{(S=(h=C.current)==null?void 0:h.removeHandlers)==null||S.call(h)}catch{}C.current=null}},[o,c]);const N=R.useCallback(T=>{var h;(h=C.current)==null||h.tokenizeCreditCard(Ar(T))},[]);return{status:x,error:k,tokenize:N}},ne="h-11 w-full rounded-md border border-grayWarm-300 bg-white px-3 py-2 text-sm text-grayWarm-900 placeholder:text-grayWarm-400 focus:border-brand-500 focus:outline-none focus:ring-1 focus:ring-brand-500",ze="h-11 w-full rounded-md border border-grayWarm-300 bg-white px-3 py-2 focus-within:border-brand-500 focus-within:ring-1 focus-within:ring-brand-500",V="mb-1 block text-xs font-medium text-grayWarm-700",Dr=Array.from({length:12},(n,o)=>String(o+1).padStart(2,"0")),Nr=(()=>{const n=new Date().getFullYear();return Array.from({length:15},(o,c)=>String(n+c))})(),He=({userId:n,onSuccess:o,onError:c,isDefault:i=!1,className:v,defaultCardholderFirstName:x="",defaultCardholderLastName:D=""})=>{const[k,b]=R.useState(x),[C,E]=R.useState(D),[y,N]=R.useState(""),[T,h]=R.useState(""),[S,P]=R.useState("idle"),[w,p]=R.useState(null),K=R.useCallback(async d=>{P("saving");try{const F=await Pr(n,d,i);P("ready"),o(F)}catch(F){const L=F instanceof Error?F.message:"Failed to save payment method.";p(L),P("ready"),c(L)}},[n,i,o,c]),G=R.useCallback(d=>{const F=d.map(L=>L.message).filter(Boolean).join("; ")||"Card validation failed.";p(F),P(L=>L==="tokenizing"?"ready":L),c(F)},[c]),oe=R.useMemo(()=>({onCardTokenized:K,onFieldErrors:G}),[K,G]),{status:U,error:ie,tokenize:se}=Ge(oe),H=!k.trim()||!C.trim()||!y||!T,Y=S==="tokenizing"||S==="saving",X=U==="ready"&&!Y&&!H,Z=d=>{d.preventDefault(),X&&(p(null),P("tokenizing"),se({firstName:k.trim(),lastName:C.trim(),month:y,year:T}))},M=w??ie;return m.jsxs("form",{onSubmit:Z,className:We("flex w-full flex-col gap-4",v),"data-testid":"movmo-card-form",children:[m.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[m.jsxs("div",{children:[m.jsx("label",{htmlFor:"movmo-card-first-name",className:V,children:"First name"}),m.jsx("input",{id:"movmo-card-first-name",type:"text",autoComplete:"cc-given-name",value:k,onChange:d=>b(d.target.value),className:ne,disabled:U!=="ready"||Y,required:!0})]}),m.jsxs("div",{children:[m.jsx("label",{htmlFor:"movmo-card-last-name",className:V,children:"Last name"}),m.jsx("input",{id:"movmo-card-last-name",type:"text",autoComplete:"cc-family-name",value:C,onChange:d=>E(d.target.value),className:ne,disabled:U!=="ready"||Y,required:!0})]})]}),m.jsxs("div",{children:[m.jsx("span",{id:"movmo-card-number-label",className:V,children:"Card number"}),m.jsx("div",{id:"movmo-card-number","aria-labelledby":"movmo-card-number-label",className:ze,"data-testid":"movmo-card-number-mount"})]}),m.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[m.jsxs("div",{children:[m.jsx("label",{htmlFor:"movmo-card-exp-month",className:V,children:"Month"}),m.jsxs("select",{id:"movmo-card-exp-month",value:y,onChange:d=>N(d.target.value),className:ne,disabled:U!=="ready"||Y,required:!0,children:[m.jsx("option",{value:"",children:"MM"}),Dr.map(d=>m.jsx("option",{value:d,children:d},d))]})]}),m.jsxs("div",{children:[m.jsx("label",{htmlFor:"movmo-card-exp-year",className:V,children:"Year"}),m.jsxs("select",{id:"movmo-card-exp-year",value:T,onChange:d=>h(d.target.value),className:ne,disabled:U!=="ready"||Y,required:!0,children:[m.jsx("option",{value:"",children:"YYYY"}),Nr.map(d=>m.jsx("option",{value:d,children:d},d))]})]}),m.jsxs("div",{children:[m.jsx("span",{id:"movmo-card-cvv-label",className:V,children:"CVV"}),m.jsx("div",{id:"movmo-card-cvv","aria-labelledby":"movmo-card-cvv-label",className:ze,"data-testid":"movmo-card-cvv-mount"})]})]}),M?m.jsx("p",{role:"alert",className:"rounded-md bg-error-50 px-3 py-2 text-sm text-error-700","data-testid":"movmo-card-error",children:M}):null,m.jsx("button",{type:"submit",disabled:!X,className:We("inline-flex h-11 items-center justify-center rounded-md bg-brand-500 px-4 text-sm font-semibold text-white transition-colors hover:bg-brand-600","disabled:cursor-not-allowed disabled:bg-grayWarm-300 disabled:text-grayWarm-500"),"data-testid":"movmo-card-save",children:Y?"Saving…":U==="loading"?"Loading…":"Save card"})]})};He.displayName="MovmoCardForm";exports.MovmoCardForm=He;exports.getPaymentsConfig=he;exports.setPaymentsConfig=Tr;exports.useMovmoCardFields=Ge;
31
+ //# sourceMappingURL=index.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs.js","sources":["../../../../node_modules/.pnpm/react@18.3.1/node_modules/react/cjs/react-jsx-runtime.production.min.js","../../../../node_modules/.pnpm/react@18.3.1/node_modules/react/cjs/react-jsx-runtime.development.js","../../../../node_modules/.pnpm/react@18.3.1/node_modules/react/jsx-runtime.js","../../../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs","../src/config.ts","../src/api.ts","../src/loadSpreedlyScript.ts","../src/useMovmoCardFields.ts","../src/MovmoCardForm/MovmoCardForm.tsx"],"sourcesContent":["/**\n * @license React\n * react-jsx-runtime.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';var f=require(\"react\"),k=Symbol.for(\"react.element\"),l=Symbol.for(\"react.fragment\"),m=Object.prototype.hasOwnProperty,n=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:!0,ref:!0,__self:!0,__source:!0};\nfunction q(c,a,g){var b,d={},e=null,h=null;void 0!==g&&(e=\"\"+g);void 0!==a.key&&(e=\"\"+a.key);void 0!==a.ref&&(h=a.ref);for(b in a)m.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a)void 0===d[b]&&(d[b]=a[b]);return{$$typeof:k,type:c,key:e,ref:h,props:d,_owner:n.current}}exports.Fragment=l;exports.jsx=q;exports.jsxs=q;\n","/**\n * @license React\n * react-jsx-runtime.development.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nif (process.env.NODE_ENV !== \"production\") {\n (function() {\n'use strict';\n\nvar React = require('react');\n\n// ATTENTION\n// When adding new symbols to this file,\n// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'\n// The Symbol used to tag the ReactElement-like types.\nvar REACT_ELEMENT_TYPE = Symbol.for('react.element');\nvar REACT_PORTAL_TYPE = Symbol.for('react.portal');\nvar REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');\nvar REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode');\nvar REACT_PROFILER_TYPE = Symbol.for('react.profiler');\nvar REACT_PROVIDER_TYPE = Symbol.for('react.provider');\nvar REACT_CONTEXT_TYPE = Symbol.for('react.context');\nvar REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');\nvar REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');\nvar REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');\nvar REACT_MEMO_TYPE = Symbol.for('react.memo');\nvar REACT_LAZY_TYPE = Symbol.for('react.lazy');\nvar REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');\nvar MAYBE_ITERATOR_SYMBOL = Symbol.iterator;\nvar FAUX_ITERATOR_SYMBOL = '@@iterator';\nfunction getIteratorFn(maybeIterable) {\n if (maybeIterable === null || typeof maybeIterable !== 'object') {\n return null;\n }\n\n var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];\n\n if (typeof maybeIterator === 'function') {\n return maybeIterator;\n }\n\n return null;\n}\n\nvar ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;\n\nfunction error(format) {\n {\n {\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n\n printWarning('error', format, args);\n }\n }\n}\n\nfunction printWarning(level, format, args) {\n // When changing this logic, you might want to also\n // update consoleWithStackDev.www.js as well.\n {\n var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\n var stack = ReactDebugCurrentFrame.getStackAddendum();\n\n if (stack !== '') {\n format += '%s';\n args = args.concat([stack]);\n } // eslint-disable-next-line react-internal/safe-string-coercion\n\n\n var argsWithFormat = args.map(function (item) {\n return String(item);\n }); // Careful: RN currently depends on this prefix\n\n argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it\n // breaks IE9: https://github.com/facebook/react/issues/13610\n // eslint-disable-next-line react-internal/no-production-logging\n\n Function.prototype.apply.call(console[level], console, argsWithFormat);\n }\n}\n\n// -----------------------------------------------------------------------------\n\nvar enableScopeAPI = false; // Experimental Create Event Handle API.\nvar enableCacheElement = false;\nvar enableTransitionTracing = false; // No known bugs, but needs performance testing\n\nvar enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber\n// stuff. Intended to enable React core members to more easily debug scheduling\n// issues in DEV builds.\n\nvar enableDebugTracing = false; // Track which Fiber(s) schedule render work.\n\nvar REACT_MODULE_REFERENCE;\n\n{\n REACT_MODULE_REFERENCE = Symbol.for('react.module.reference');\n}\n\nfunction isValidElementType(type) {\n if (typeof type === 'string' || typeof type === 'function') {\n return true;\n } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).\n\n\n if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing ) {\n return true;\n }\n\n if (typeof type === 'object' && type !== null) {\n if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object\n // types supported by any Flight configuration anywhere since\n // we don't know which Flight build this will end up being used\n // with.\n type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== undefined) {\n return true;\n }\n }\n\n return false;\n}\n\nfunction getWrappedName(outerType, innerType, wrapperName) {\n var displayName = outerType.displayName;\n\n if (displayName) {\n return displayName;\n }\n\n var functionName = innerType.displayName || innerType.name || '';\n return functionName !== '' ? wrapperName + \"(\" + functionName + \")\" : wrapperName;\n} // Keep in sync with react-reconciler/getComponentNameFromFiber\n\n\nfunction getContextName(type) {\n return type.displayName || 'Context';\n} // Note that the reconciler package should generally prefer to use getComponentNameFromFiber() instead.\n\n\nfunction getComponentNameFromType(type) {\n if (type == null) {\n // Host root, text node or just invalid type.\n return null;\n }\n\n {\n if (typeof type.tag === 'number') {\n error('Received an unexpected object in getComponentNameFromType(). ' + 'This is likely a bug in React. Please file an issue.');\n }\n }\n\n if (typeof type === 'function') {\n return type.displayName || type.name || null;\n }\n\n if (typeof type === 'string') {\n return type;\n }\n\n switch (type) {\n case REACT_FRAGMENT_TYPE:\n return 'Fragment';\n\n case REACT_PORTAL_TYPE:\n return 'Portal';\n\n case REACT_PROFILER_TYPE:\n return 'Profiler';\n\n case REACT_STRICT_MODE_TYPE:\n return 'StrictMode';\n\n case REACT_SUSPENSE_TYPE:\n return 'Suspense';\n\n case REACT_SUSPENSE_LIST_TYPE:\n return 'SuspenseList';\n\n }\n\n if (typeof type === 'object') {\n switch (type.$$typeof) {\n case REACT_CONTEXT_TYPE:\n var context = type;\n return getContextName(context) + '.Consumer';\n\n case REACT_PROVIDER_TYPE:\n var provider = type;\n return getContextName(provider._context) + '.Provider';\n\n case REACT_FORWARD_REF_TYPE:\n return getWrappedName(type, type.render, 'ForwardRef');\n\n case REACT_MEMO_TYPE:\n var outerName = type.displayName || null;\n\n if (outerName !== null) {\n return outerName;\n }\n\n return getComponentNameFromType(type.type) || 'Memo';\n\n case REACT_LAZY_TYPE:\n {\n var lazyComponent = type;\n var payload = lazyComponent._payload;\n var init = lazyComponent._init;\n\n try {\n return getComponentNameFromType(init(payload));\n } catch (x) {\n return null;\n }\n }\n\n // eslint-disable-next-line no-fallthrough\n }\n }\n\n return null;\n}\n\nvar assign = Object.assign;\n\n// Helpers to patch console.logs to avoid logging during side-effect free\n// replaying on render function. This currently only patches the object\n// lazily which won't cover if the log function was extracted eagerly.\n// We could also eagerly patch the method.\nvar disabledDepth = 0;\nvar prevLog;\nvar prevInfo;\nvar prevWarn;\nvar prevError;\nvar prevGroup;\nvar prevGroupCollapsed;\nvar prevGroupEnd;\n\nfunction disabledLog() {}\n\ndisabledLog.__reactDisabledLog = true;\nfunction disableLogs() {\n {\n if (disabledDepth === 0) {\n /* eslint-disable react-internal/no-production-logging */\n prevLog = console.log;\n prevInfo = console.info;\n prevWarn = console.warn;\n prevError = console.error;\n prevGroup = console.group;\n prevGroupCollapsed = console.groupCollapsed;\n prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099\n\n var props = {\n configurable: true,\n enumerable: true,\n value: disabledLog,\n writable: true\n }; // $FlowFixMe Flow thinks console is immutable.\n\n Object.defineProperties(console, {\n info: props,\n log: props,\n warn: props,\n error: props,\n group: props,\n groupCollapsed: props,\n groupEnd: props\n });\n /* eslint-enable react-internal/no-production-logging */\n }\n\n disabledDepth++;\n }\n}\nfunction reenableLogs() {\n {\n disabledDepth--;\n\n if (disabledDepth === 0) {\n /* eslint-disable react-internal/no-production-logging */\n var props = {\n configurable: true,\n enumerable: true,\n writable: true\n }; // $FlowFixMe Flow thinks console is immutable.\n\n Object.defineProperties(console, {\n log: assign({}, props, {\n value: prevLog\n }),\n info: assign({}, props, {\n value: prevInfo\n }),\n warn: assign({}, props, {\n value: prevWarn\n }),\n error: assign({}, props, {\n value: prevError\n }),\n group: assign({}, props, {\n value: prevGroup\n }),\n groupCollapsed: assign({}, props, {\n value: prevGroupCollapsed\n }),\n groupEnd: assign({}, props, {\n value: prevGroupEnd\n })\n });\n /* eslint-enable react-internal/no-production-logging */\n }\n\n if (disabledDepth < 0) {\n error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');\n }\n }\n}\n\nvar ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;\nvar prefix;\nfunction describeBuiltInComponentFrame(name, source, ownerFn) {\n {\n if (prefix === undefined) {\n // Extract the VM specific prefix used by each line.\n try {\n throw Error();\n } catch (x) {\n var match = x.stack.trim().match(/\\n( *(at )?)/);\n prefix = match && match[1] || '';\n }\n } // We use the prefix to ensure our stacks line up with native stack frames.\n\n\n return '\\n' + prefix + name;\n }\n}\nvar reentry = false;\nvar componentFrameCache;\n\n{\n var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;\n componentFrameCache = new PossiblyWeakMap();\n}\n\nfunction describeNativeComponentFrame(fn, construct) {\n // If something asked for a stack inside a fake render, it should get ignored.\n if ( !fn || reentry) {\n return '';\n }\n\n {\n var frame = componentFrameCache.get(fn);\n\n if (frame !== undefined) {\n return frame;\n }\n }\n\n var control;\n reentry = true;\n var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined.\n\n Error.prepareStackTrace = undefined;\n var previousDispatcher;\n\n {\n previousDispatcher = ReactCurrentDispatcher.current; // Set the dispatcher in DEV because this might be call in the render function\n // for warnings.\n\n ReactCurrentDispatcher.current = null;\n disableLogs();\n }\n\n try {\n // This should throw.\n if (construct) {\n // Something should be setting the props in the constructor.\n var Fake = function () {\n throw Error();\n }; // $FlowFixMe\n\n\n Object.defineProperty(Fake.prototype, 'props', {\n set: function () {\n // We use a throwing setter instead of frozen or non-writable props\n // because that won't throw in a non-strict mode function.\n throw Error();\n }\n });\n\n if (typeof Reflect === 'object' && Reflect.construct) {\n // We construct a different control for this case to include any extra\n // frames added by the construct call.\n try {\n Reflect.construct(Fake, []);\n } catch (x) {\n control = x;\n }\n\n Reflect.construct(fn, [], Fake);\n } else {\n try {\n Fake.call();\n } catch (x) {\n control = x;\n }\n\n fn.call(Fake.prototype);\n }\n } else {\n try {\n throw Error();\n } catch (x) {\n control = x;\n }\n\n fn();\n }\n } catch (sample) {\n // This is inlined manually because closure doesn't do it for us.\n if (sample && control && typeof sample.stack === 'string') {\n // This extracts the first frame from the sample that isn't also in the control.\n // Skipping one frame that we assume is the frame that calls the two.\n var sampleLines = sample.stack.split('\\n');\n var controlLines = control.stack.split('\\n');\n var s = sampleLines.length - 1;\n var c = controlLines.length - 1;\n\n while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {\n // We expect at least one stack frame to be shared.\n // Typically this will be the root most one. However, stack frames may be\n // cut off due to maximum stack limits. In this case, one maybe cut off\n // earlier than the other. We assume that the sample is longer or the same\n // and there for cut off earlier. So we should find the root most frame in\n // the sample somewhere in the control.\n c--;\n }\n\n for (; s >= 1 && c >= 0; s--, c--) {\n // Next we find the first one that isn't the same which should be the\n // frame that called our sample function and the control.\n if (sampleLines[s] !== controlLines[c]) {\n // In V8, the first line is describing the message but other VMs don't.\n // If we're about to return the first line, and the control is also on the same\n // line, that's a pretty good indicator that our sample threw at same line as\n // the control. I.e. before we entered the sample frame. So we ignore this result.\n // This can happen if you passed a class to function component, or non-function.\n if (s !== 1 || c !== 1) {\n do {\n s--;\n c--; // We may still have similar intermediate frames from the construct call.\n // The next one that isn't the same should be our match though.\n\n if (c < 0 || sampleLines[s] !== controlLines[c]) {\n // V8 adds a \"new\" prefix for native classes. Let's remove it to make it prettier.\n var _frame = '\\n' + sampleLines[s].replace(' at new ', ' at '); // If our component frame is labeled \"<anonymous>\"\n // but we have a user-provided \"displayName\"\n // splice it in to make the stack more readable.\n\n\n if (fn.displayName && _frame.includes('<anonymous>')) {\n _frame = _frame.replace('<anonymous>', fn.displayName);\n }\n\n {\n if (typeof fn === 'function') {\n componentFrameCache.set(fn, _frame);\n }\n } // Return the line we found.\n\n\n return _frame;\n }\n } while (s >= 1 && c >= 0);\n }\n\n break;\n }\n }\n }\n } finally {\n reentry = false;\n\n {\n ReactCurrentDispatcher.current = previousDispatcher;\n reenableLogs();\n }\n\n Error.prepareStackTrace = previousPrepareStackTrace;\n } // Fallback to just using the name if we couldn't make it throw.\n\n\n var name = fn ? fn.displayName || fn.name : '';\n var syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';\n\n {\n if (typeof fn === 'function') {\n componentFrameCache.set(fn, syntheticFrame);\n }\n }\n\n return syntheticFrame;\n}\nfunction describeFunctionComponentFrame(fn, source, ownerFn) {\n {\n return describeNativeComponentFrame(fn, false);\n }\n}\n\nfunction shouldConstruct(Component) {\n var prototype = Component.prototype;\n return !!(prototype && prototype.isReactComponent);\n}\n\nfunction describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {\n\n if (type == null) {\n return '';\n }\n\n if (typeof type === 'function') {\n {\n return describeNativeComponentFrame(type, shouldConstruct(type));\n }\n }\n\n if (typeof type === 'string') {\n return describeBuiltInComponentFrame(type);\n }\n\n switch (type) {\n case REACT_SUSPENSE_TYPE:\n return describeBuiltInComponentFrame('Suspense');\n\n case REACT_SUSPENSE_LIST_TYPE:\n return describeBuiltInComponentFrame('SuspenseList');\n }\n\n if (typeof type === 'object') {\n switch (type.$$typeof) {\n case REACT_FORWARD_REF_TYPE:\n return describeFunctionComponentFrame(type.render);\n\n case REACT_MEMO_TYPE:\n // Memo may contain any component type so we recursively resolve it.\n return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);\n\n case REACT_LAZY_TYPE:\n {\n var lazyComponent = type;\n var payload = lazyComponent._payload;\n var init = lazyComponent._init;\n\n try {\n // Lazy may contain any component type so we recursively resolve it.\n return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);\n } catch (x) {}\n }\n }\n }\n\n return '';\n}\n\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\n\nvar loggedTypeFailures = {};\nvar ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\n\nfunction setCurrentlyValidatingElement(element) {\n {\n if (element) {\n var owner = element._owner;\n var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);\n ReactDebugCurrentFrame.setExtraStackFrame(stack);\n } else {\n ReactDebugCurrentFrame.setExtraStackFrame(null);\n }\n }\n}\n\nfunction checkPropTypes(typeSpecs, values, location, componentName, element) {\n {\n // $FlowFixMe This is okay but Flow doesn't know it.\n var has = Function.call.bind(hasOwnProperty);\n\n for (var typeSpecName in typeSpecs) {\n if (has(typeSpecs, typeSpecName)) {\n var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to\n // fail the render phase where it didn't fail before. So we log it.\n // After these have been cleaned up, we'll let them throw.\n\n try {\n // This is intentionally an invariant that gets caught. It's the same\n // behavior as without this statement except with a better message.\n if (typeof typeSpecs[typeSpecName] !== 'function') {\n // eslint-disable-next-line react-internal/prod-error-codes\n var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.');\n err.name = 'Invariant Violation';\n throw err;\n }\n\n error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');\n } catch (ex) {\n error$1 = ex;\n }\n\n if (error$1 && !(error$1 instanceof Error)) {\n setCurrentlyValidatingElement(element);\n\n error('%s: type specification of %s' + ' `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error$1);\n\n setCurrentlyValidatingElement(null);\n }\n\n if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {\n // Only monitor this failure once because there tends to be a lot of the\n // same error.\n loggedTypeFailures[error$1.message] = true;\n setCurrentlyValidatingElement(element);\n\n error('Failed %s type: %s', location, error$1.message);\n\n setCurrentlyValidatingElement(null);\n }\n }\n }\n }\n}\n\nvar isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare\n\nfunction isArray(a) {\n return isArrayImpl(a);\n}\n\n/*\n * The `'' + value` pattern (used in in perf-sensitive code) throws for Symbol\n * and Temporal.* types. See https://github.com/facebook/react/pull/22064.\n *\n * The functions in this module will throw an easier-to-understand,\n * easier-to-debug exception with a clear errors message message explaining the\n * problem. (Instead of a confusing exception thrown inside the implementation\n * of the `value` object).\n */\n// $FlowFixMe only called in DEV, so void return is not possible.\nfunction typeName(value) {\n {\n // toStringTag is needed for namespaced types like Temporal.Instant\n var hasToStringTag = typeof Symbol === 'function' && Symbol.toStringTag;\n var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || 'Object';\n return type;\n }\n} // $FlowFixMe only called in DEV, so void return is not possible.\n\n\nfunction willCoercionThrow(value) {\n {\n try {\n testStringCoercion(value);\n return false;\n } catch (e) {\n return true;\n }\n }\n}\n\nfunction testStringCoercion(value) {\n // If you ended up here by following an exception call stack, here's what's\n // happened: you supplied an object or symbol value to React (as a prop, key,\n // DOM attribute, CSS property, string ref, etc.) and when React tried to\n // coerce it to a string using `'' + value`, an exception was thrown.\n //\n // The most common types that will cause this exception are `Symbol` instances\n // and Temporal objects like `Temporal.Instant`. But any object that has a\n // `valueOf` or `[Symbol.toPrimitive]` method that throws will also cause this\n // exception. (Library authors do this to prevent users from using built-in\n // numeric operators like `+` or comparison operators like `>=` because custom\n // methods are needed to perform accurate arithmetic or comparison.)\n //\n // To fix the problem, coerce this object or symbol value to a string before\n // passing it to React. The most reliable way is usually `String(value)`.\n //\n // To find which value is throwing, check the browser or debugger console.\n // Before this exception was thrown, there should be `console.error` output\n // that shows the type (Symbol, Temporal.PlainDate, etc.) that caused the\n // problem and how that type was used: key, atrribute, input value prop, etc.\n // In most cases, this console output also shows the component and its\n // ancestor components where the exception happened.\n //\n // eslint-disable-next-line react-internal/safe-string-coercion\n return '' + value;\n}\nfunction checkKeyStringCoercion(value) {\n {\n if (willCoercionThrow(value)) {\n error('The provided key is an unsupported type %s.' + ' This value must be coerced to a string before before using it here.', typeName(value));\n\n return testStringCoercion(value); // throw (to help callers find troubleshooting comments)\n }\n }\n}\n\nvar ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;\nvar RESERVED_PROPS = {\n key: true,\n ref: true,\n __self: true,\n __source: true\n};\nvar specialPropKeyWarningShown;\nvar specialPropRefWarningShown;\nvar didWarnAboutStringRefs;\n\n{\n didWarnAboutStringRefs = {};\n}\n\nfunction hasValidRef(config) {\n {\n if (hasOwnProperty.call(config, 'ref')) {\n var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;\n\n if (getter && getter.isReactWarning) {\n return false;\n }\n }\n }\n\n return config.ref !== undefined;\n}\n\nfunction hasValidKey(config) {\n {\n if (hasOwnProperty.call(config, 'key')) {\n var getter = Object.getOwnPropertyDescriptor(config, 'key').get;\n\n if (getter && getter.isReactWarning) {\n return false;\n }\n }\n }\n\n return config.key !== undefined;\n}\n\nfunction warnIfStringRefCannotBeAutoConverted(config, self) {\n {\n if (typeof config.ref === 'string' && ReactCurrentOwner.current && self && ReactCurrentOwner.current.stateNode !== self) {\n var componentName = getComponentNameFromType(ReactCurrentOwner.current.type);\n\n if (!didWarnAboutStringRefs[componentName]) {\n error('Component \"%s\" contains the string ref \"%s\". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-string-ref', getComponentNameFromType(ReactCurrentOwner.current.type), config.ref);\n\n didWarnAboutStringRefs[componentName] = true;\n }\n }\n }\n}\n\nfunction defineKeyPropWarningGetter(props, displayName) {\n {\n var warnAboutAccessingKey = function () {\n if (!specialPropKeyWarningShown) {\n specialPropKeyWarningShown = true;\n\n error('%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);\n }\n };\n\n warnAboutAccessingKey.isReactWarning = true;\n Object.defineProperty(props, 'key', {\n get: warnAboutAccessingKey,\n configurable: true\n });\n }\n}\n\nfunction defineRefPropWarningGetter(props, displayName) {\n {\n var warnAboutAccessingRef = function () {\n if (!specialPropRefWarningShown) {\n specialPropRefWarningShown = true;\n\n error('%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);\n }\n };\n\n warnAboutAccessingRef.isReactWarning = true;\n Object.defineProperty(props, 'ref', {\n get: warnAboutAccessingRef,\n configurable: true\n });\n }\n}\n/**\n * Factory method to create a new React element. This no longer adheres to\n * the class pattern, so do not use new to call it. Also, instanceof check\n * will not work. Instead test $$typeof field against Symbol.for('react.element') to check\n * if something is a React Element.\n *\n * @param {*} type\n * @param {*} props\n * @param {*} key\n * @param {string|object} ref\n * @param {*} owner\n * @param {*} self A *temporary* helper to detect places where `this` is\n * different from the `owner` when React.createElement is called, so that we\n * can warn. We want to get rid of owner and replace string `ref`s with arrow\n * functions, and as long as `this` and owner are the same, there will be no\n * change in behavior.\n * @param {*} source An annotation object (added by a transpiler or otherwise)\n * indicating filename, line number, and/or other information.\n * @internal\n */\n\n\nvar ReactElement = function (type, key, ref, self, source, owner, props) {\n var element = {\n // This tag allows us to uniquely identify this as a React Element\n $$typeof: REACT_ELEMENT_TYPE,\n // Built-in properties that belong on the element\n type: type,\n key: key,\n ref: ref,\n props: props,\n // Record the component responsible for creating this element.\n _owner: owner\n };\n\n {\n // The validation flag is currently mutative. We put it on\n // an external backing store so that we can freeze the whole object.\n // This can be replaced with a WeakMap once they are implemented in\n // commonly used development environments.\n element._store = {}; // To make comparing ReactElements easier for testing purposes, we make\n // the validation flag non-enumerable (where possible, which should\n // include every environment we run tests in), so the test framework\n // ignores it.\n\n Object.defineProperty(element._store, 'validated', {\n configurable: false,\n enumerable: false,\n writable: true,\n value: false\n }); // self and source are DEV only properties.\n\n Object.defineProperty(element, '_self', {\n configurable: false,\n enumerable: false,\n writable: false,\n value: self\n }); // Two elements created in two different places should be considered\n // equal for testing purposes and therefore we hide it from enumeration.\n\n Object.defineProperty(element, '_source', {\n configurable: false,\n enumerable: false,\n writable: false,\n value: source\n });\n\n if (Object.freeze) {\n Object.freeze(element.props);\n Object.freeze(element);\n }\n }\n\n return element;\n};\n/**\n * https://github.com/reactjs/rfcs/pull/107\n * @param {*} type\n * @param {object} props\n * @param {string} key\n */\n\nfunction jsxDEV(type, config, maybeKey, source, self) {\n {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null; // Currently, key can be spread in as a prop. This causes a potential\n // issue if key is also explicitly declared (ie. <div {...props} key=\"Hi\" />\n // or <div key=\"Hi\" {...props} /> ). We want to deprecate key spread,\n // but as an intermediary step, we will use jsxDEV for everything except\n // <div {...props} key=\"Hi\" />, because we aren't currently able to tell if\n // key is explicitly declared to be undefined or not.\n\n if (maybeKey !== undefined) {\n {\n checkKeyStringCoercion(maybeKey);\n }\n\n key = '' + maybeKey;\n }\n\n if (hasValidKey(config)) {\n {\n checkKeyStringCoercion(config.key);\n }\n\n key = '' + config.key;\n }\n\n if (hasValidRef(config)) {\n ref = config.ref;\n warnIfStringRefCannotBeAutoConverted(config, self);\n } // Remaining properties are added to a new props object\n\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n }\n}\n\nvar ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;\nvar ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;\n\nfunction setCurrentlyValidatingElement$1(element) {\n {\n if (element) {\n var owner = element._owner;\n var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);\n ReactDebugCurrentFrame$1.setExtraStackFrame(stack);\n } else {\n ReactDebugCurrentFrame$1.setExtraStackFrame(null);\n }\n }\n}\n\nvar propTypesMisspellWarningShown;\n\n{\n propTypesMisspellWarningShown = false;\n}\n/**\n * Verifies the object is a ReactElement.\n * See https://reactjs.org/docs/react-api.html#isvalidelement\n * @param {?object} object\n * @return {boolean} True if `object` is a ReactElement.\n * @final\n */\n\n\nfunction isValidElement(object) {\n {\n return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;\n }\n}\n\nfunction getDeclarationErrorAddendum() {\n {\n if (ReactCurrentOwner$1.current) {\n var name = getComponentNameFromType(ReactCurrentOwner$1.current.type);\n\n if (name) {\n return '\\n\\nCheck the render method of `' + name + '`.';\n }\n }\n\n return '';\n }\n}\n\nfunction getSourceInfoErrorAddendum(source) {\n {\n if (source !== undefined) {\n var fileName = source.fileName.replace(/^.*[\\\\\\/]/, '');\n var lineNumber = source.lineNumber;\n return '\\n\\nCheck your code at ' + fileName + ':' + lineNumber + '.';\n }\n\n return '';\n }\n}\n/**\n * Warn if there's no key explicitly set on dynamic arrays of children or\n * object keys are not valid. This allows us to keep track of children between\n * updates.\n */\n\n\nvar ownerHasKeyUseWarning = {};\n\nfunction getCurrentComponentErrorInfo(parentType) {\n {\n var info = getDeclarationErrorAddendum();\n\n if (!info) {\n var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;\n\n if (parentName) {\n info = \"\\n\\nCheck the top-level render call using <\" + parentName + \">.\";\n }\n }\n\n return info;\n }\n}\n/**\n * Warn if the element doesn't have an explicit key assigned to it.\n * This element is in an array. The array could grow and shrink or be\n * reordered. All children that haven't already been validated are required to\n * have a \"key\" property assigned to it. Error statuses are cached so a warning\n * will only be shown once.\n *\n * @internal\n * @param {ReactElement} element Element that requires a key.\n * @param {*} parentType element's parent's type.\n */\n\n\nfunction validateExplicitKey(element, parentType) {\n {\n if (!element._store || element._store.validated || element.key != null) {\n return;\n }\n\n element._store.validated = true;\n var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);\n\n if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {\n return;\n }\n\n ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a\n // property, it may be the creator of the child that's responsible for\n // assigning it a key.\n\n var childOwner = '';\n\n if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) {\n // Give the component that originally created this child.\n childOwner = \" It was passed a child from \" + getComponentNameFromType(element._owner.type) + \".\";\n }\n\n setCurrentlyValidatingElement$1(element);\n\n error('Each child in a list should have a unique \"key\" prop.' + '%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner);\n\n setCurrentlyValidatingElement$1(null);\n }\n}\n/**\n * Ensure that every element either is passed in a static location, in an\n * array with an explicit keys property defined, or in an object literal\n * with valid key property.\n *\n * @internal\n * @param {ReactNode} node Statically passed child of any type.\n * @param {*} parentType node's parent's type.\n */\n\n\nfunction validateChildKeys(node, parentType) {\n {\n if (typeof node !== 'object') {\n return;\n }\n\n if (isArray(node)) {\n for (var i = 0; i < node.length; i++) {\n var child = node[i];\n\n if (isValidElement(child)) {\n validateExplicitKey(child, parentType);\n }\n }\n } else if (isValidElement(node)) {\n // This element was passed in a valid location.\n if (node._store) {\n node._store.validated = true;\n }\n } else if (node) {\n var iteratorFn = getIteratorFn(node);\n\n if (typeof iteratorFn === 'function') {\n // Entry iterators used to provide implicit keys,\n // but now we print a separate warning for them later.\n if (iteratorFn !== node.entries) {\n var iterator = iteratorFn.call(node);\n var step;\n\n while (!(step = iterator.next()).done) {\n if (isValidElement(step.value)) {\n validateExplicitKey(step.value, parentType);\n }\n }\n }\n }\n }\n }\n}\n/**\n * Given an element, validate that its props follow the propTypes definition,\n * provided by the type.\n *\n * @param {ReactElement} element\n */\n\n\nfunction validatePropTypes(element) {\n {\n var type = element.type;\n\n if (type === null || type === undefined || typeof type === 'string') {\n return;\n }\n\n var propTypes;\n\n if (typeof type === 'function') {\n propTypes = type.propTypes;\n } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.\n // Inner props are checked in the reconciler.\n type.$$typeof === REACT_MEMO_TYPE)) {\n propTypes = type.propTypes;\n } else {\n return;\n }\n\n if (propTypes) {\n // Intentionally inside to avoid triggering lazy initializers:\n var name = getComponentNameFromType(type);\n checkPropTypes(propTypes, element.props, 'prop', name, element);\n } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {\n propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers:\n\n var _name = getComponentNameFromType(type);\n\n error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown');\n }\n\n if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) {\n error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');\n }\n }\n}\n/**\n * Given a fragment, validate that it can only be provided with fragment props\n * @param {ReactElement} fragment\n */\n\n\nfunction validateFragmentProps(fragment) {\n {\n var keys = Object.keys(fragment.props);\n\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n\n if (key !== 'children' && key !== 'key') {\n setCurrentlyValidatingElement$1(fragment);\n\n error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);\n\n setCurrentlyValidatingElement$1(null);\n break;\n }\n }\n\n if (fragment.ref !== null) {\n setCurrentlyValidatingElement$1(fragment);\n\n error('Invalid attribute `ref` supplied to `React.Fragment`.');\n\n setCurrentlyValidatingElement$1(null);\n }\n }\n}\n\nvar didWarnAboutKeySpread = {};\nfunction jsxWithValidation(type, props, key, isStaticChildren, source, self) {\n {\n var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to\n // succeed and there will likely be errors in render.\n\n if (!validType) {\n var info = '';\n\n if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {\n info += ' You likely forgot to export your component from the file ' + \"it's defined in, or you might have mixed up default and named imports.\";\n }\n\n var sourceInfo = getSourceInfoErrorAddendum(source);\n\n if (sourceInfo) {\n info += sourceInfo;\n } else {\n info += getDeclarationErrorAddendum();\n }\n\n var typeString;\n\n if (type === null) {\n typeString = 'null';\n } else if (isArray(type)) {\n typeString = 'array';\n } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {\n typeString = \"<\" + (getComponentNameFromType(type.type) || 'Unknown') + \" />\";\n info = ' Did you accidentally export a JSX literal instead of a component?';\n } else {\n typeString = typeof type;\n }\n\n error('React.jsx: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info);\n }\n\n var element = jsxDEV(type, props, key, source, self); // The result can be nullish if a mock or a custom function is used.\n // TODO: Drop this when these are no longer allowed as the type argument.\n\n if (element == null) {\n return element;\n } // Skip key warning if the type isn't valid since our key validation logic\n // doesn't expect a non-string/function type and can throw confusing errors.\n // We don't want exception behavior to differ between dev and prod.\n // (Rendering will throw with a helpful message and as soon as the type is\n // fixed, the key warnings will appear.)\n\n\n if (validType) {\n var children = props.children;\n\n if (children !== undefined) {\n if (isStaticChildren) {\n if (isArray(children)) {\n for (var i = 0; i < children.length; i++) {\n validateChildKeys(children[i], type);\n }\n\n if (Object.freeze) {\n Object.freeze(children);\n }\n } else {\n error('React.jsx: Static children should always be an array. ' + 'You are likely explicitly calling React.jsxs or React.jsxDEV. ' + 'Use the Babel transform instead.');\n }\n } else {\n validateChildKeys(children, type);\n }\n }\n }\n\n {\n if (hasOwnProperty.call(props, 'key')) {\n var componentName = getComponentNameFromType(type);\n var keys = Object.keys(props).filter(function (k) {\n return k !== 'key';\n });\n var beforeExample = keys.length > 0 ? '{key: someKey, ' + keys.join(': ..., ') + ': ...}' : '{key: someKey}';\n\n if (!didWarnAboutKeySpread[componentName + beforeExample]) {\n var afterExample = keys.length > 0 ? '{' + keys.join(': ..., ') + ': ...}' : '{}';\n\n error('A props object containing a \"key\" prop is being spread into JSX:\\n' + ' let props = %s;\\n' + ' <%s {...props} />\\n' + 'React keys must be passed directly to JSX without using spread:\\n' + ' let props = %s;\\n' + ' <%s key={someKey} {...props} />', beforeExample, componentName, afterExample, componentName);\n\n didWarnAboutKeySpread[componentName + beforeExample] = true;\n }\n }\n }\n\n if (type === REACT_FRAGMENT_TYPE) {\n validateFragmentProps(element);\n } else {\n validatePropTypes(element);\n }\n\n return element;\n }\n} // These two functions exist to still get child warnings in dev\n// even with the prod transform. This means that jsxDEV is purely\n// opt-in behavior for better messages but that we won't stop\n// giving you warnings if you use production apis.\n\nfunction jsxWithValidationStatic(type, props, key) {\n {\n return jsxWithValidation(type, props, key, true);\n }\n}\nfunction jsxWithValidationDynamic(type, props, key) {\n {\n return jsxWithValidation(type, props, key, false);\n }\n}\n\nvar jsx = jsxWithValidationDynamic ; // we may want to special case jsxs internally to take advantage of static children.\n// for now we can ship identical prod functions\n\nvar jsxs = jsxWithValidationStatic ;\n\nexports.Fragment = REACT_FRAGMENT_TYPE;\nexports.jsx = jsx;\nexports.jsxs = jsxs;\n })();\n}\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-jsx-runtime.production.min.js');\n} else {\n module.exports = require('./cjs/react-jsx-runtime.development.js');\n}\n","function r(e){var t,f,n=\"\";if(\"string\"==typeof e||\"number\"==typeof e)n+=e;else if(\"object\"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=\" \"),n+=f)}else for(f in e)e[f]&&(n&&(n+=\" \"),n+=f);return n}export function clsx(){for(var e,t,f=0,n=\"\",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=\" \"),n+=t);return n}export default clsx;","export interface PaymentsConfig {\n baseUrl: string;\n}\n\n/** @internal — surfaced as `PaymentsConfig & { spreedlyScriptUrl }` only for tests + the script loader. */\ninterface InternalPaymentsConfig extends PaymentsConfig {\n spreedlyScriptUrl: string;\n}\n\nconst DEFAULT_SPREEDLY_SCRIPT_URL = 'https://core.spreedly.com/iframe/iframe-v1.min.js';\n\nlet overrides: Partial<InternalPaymentsConfig> = {};\n\nexport const setPaymentsConfig = (config: Partial<PaymentsConfig>): void => {\n overrides = { ...overrides, ...config };\n};\n\nconst readEnv = (key: string): string | undefined => {\n // `process.env` is the conventional carrier for `REACT_APP_*` config in\n // consumers built with CRA / Vite / Webpack — those bundlers replace\n // `process.env.X` at build time, so this is type-only access at runtime.\n const proc = (globalThis as { process?: { env?: Record<string, string | undefined> } }).process;\n return proc?.env?.[key];\n};\n\nexport const getPaymentsConfig = (): InternalPaymentsConfig => ({\n baseUrl: overrides.baseUrl ?? readEnv('REACT_APP_MOVMO_API_URL') ?? '',\n spreedlyScriptUrl:\n overrides.spreedlyScriptUrl ??\n readEnv('REACT_APP_SPREEDLY_SCRIPT_URL') ??\n DEFAULT_SPREEDLY_SCRIPT_URL,\n});\n\n/** Reset overrides — used by tests and Storybook decorators. */\nexport const __resetPaymentsConfig = (): void => {\n overrides = {};\n};\n","import { getPaymentsConfig } from './config';\nimport type { PaymentMethodSummary, TokenizationSession } from './types';\n\ninterface PaymentMethodResponse {\n id: string;\n last4: string;\n brand: string;\n expMonth: number;\n expYear: number;\n isDefault: boolean;\n}\n\nconst jsonHeaders: HeadersInit = {\n Accept: 'application/json',\n 'Content-Type': 'application/json',\n};\n\nconst apiUrl = (path: string): string => {\n const { baseUrl } = getPaymentsConfig();\n if (!baseUrl) {\n throw new Error(\n '@movmo_app/payments: baseUrl is not configured. Call setPaymentsConfig({ baseUrl }) at app boot, or set REACT_APP_MOVMO_API_URL.',\n );\n }\n return `${baseUrl}${path}`;\n};\n\nconst readError = async (res: Response, fallback: string): Promise<string> => {\n try {\n const body = (await res.json()) as { message?: string };\n return body.message || fallback;\n } catch {\n return fallback;\n }\n};\n\nexport const fetchTokenizationSession = async (): Promise<TokenizationSession> => {\n const res = await fetch(apiUrl('/v1/payments/tokenization-session'), {\n method: 'GET',\n headers: jsonHeaders,\n credentials: 'include',\n });\n if (!res.ok) {\n throw new Error(await readError(res, `Failed to fetch tokenization session (${res.status})`));\n }\n return (await res.json()) as TokenizationSession;\n};\n\nexport const savePaymentMethodFromToken = async (\n userId: string,\n tokenizedPaymentMethodId: string,\n isDefault: boolean,\n): Promise<PaymentMethodSummary> => {\n const res = await fetch(apiUrl(`/v1/users/${encodeURIComponent(userId)}/payment-methods/from-token`), {\n method: 'POST',\n headers: jsonHeaders,\n credentials: 'include',\n body: JSON.stringify({ tokenizedPaymentMethodId, isDefault }),\n });\n if (!res.ok) {\n throw new Error(await readError(res, `Failed to save payment method (${res.status})`));\n }\n const body = (await res.json()) as PaymentMethodResponse;\n return {\n id: body.id,\n last4: body.last4,\n brand: body.brand,\n expMonth: body.expMonth,\n expYear: body.expYear,\n isDefault: body.isDefault,\n };\n};\n","import type { SpreedlyGlobal } from './spreedly-global';\nimport { getPaymentsConfig } from './config';\n\nlet scriptPromise: Promise<SpreedlyGlobal> | null = null;\n\n/**\n * Idempotently inject the Spreedly iframe SDK script and resolve with the\n * `window.Spreedly` global. Subsequent calls return the same promise.\n */\nexport const loadSpreedlyScript = (): Promise<SpreedlyGlobal> => {\n if (typeof window === 'undefined') {\n return Promise.reject(new Error('Spreedly can only be loaded in a browser environment.'));\n }\n if (window.Spreedly) {\n return Promise.resolve(window.Spreedly);\n }\n if (scriptPromise) {\n return scriptPromise;\n }\n\n const { spreedlyScriptUrl } = getPaymentsConfig();\n\n scriptPromise = new Promise<SpreedlyGlobal>((resolve, reject) => {\n const existing = document.querySelector<HTMLScriptElement>(\n `script[src=\"${spreedlyScriptUrl}\"]`,\n );\n\n const onScriptLoad = () => {\n if (window.Spreedly) {\n resolve(window.Spreedly);\n } else {\n reject(new Error('Spreedly script loaded but window.Spreedly is undefined.'));\n }\n };\n\n if (existing) {\n if (window.Spreedly) {\n onScriptLoad();\n return;\n }\n existing.addEventListener('load', onScriptLoad, { once: true });\n existing.addEventListener(\n 'error',\n () => {\n existing.remove();\n reject(new Error('Failed to load Spreedly iframe script.'));\n },\n { once: true },\n );\n return;\n }\n\n const script = document.createElement('script');\n script.src = spreedlyScriptUrl;\n script.async = true;\n script.onload = onScriptLoad;\n script.onerror = () => {\n // Without removing the failed tag, the next call hits the `existing`\n // branch above and attaches listeners to a script that already errored —\n // the promise would never resolve.\n script.remove();\n reject(new Error('Failed to load Spreedly iframe script.'));\n };\n document.head.appendChild(script);\n }).catch((err) => {\n scriptPromise = null;\n throw err;\n });\n\n return scriptPromise;\n};\n\nexport const __resetSpreedlyScriptCache = (): void => {\n scriptPromise = null;\n};\n","import { useCallback, useEffect, useRef, useState } from 'react';\n\nimport { fetchTokenizationSession } from './api';\nimport { loadSpreedlyScript } from './loadSpreedlyScript';\nimport type { SpreedlyGlobal, SpreedlyTokenizeData } from './spreedly-global';\nimport type { CardFieldError } from './types';\n\nexport interface CardholderTokenizeData {\n firstName: string;\n lastName: string;\n /** Two-digit month, e.g. \"01\"–\"12\". */\n month: string;\n /** Four-digit year, e.g. \"2030\". */\n year: string;\n email?: string;\n zip?: string;\n}\n\nexport interface UseMovmoCardFieldsOptions {\n /** DOM element id where the card-number field mounts. Defaults to `movmo-card-number`. */\n numberEl?: string;\n /** DOM element id where the CVV field mounts. Defaults to `movmo-card-cvv`. */\n cvvEl?: string;\n onCardTokenized?: (token: string) => void;\n onFieldErrors?: (errors: CardFieldError[]) => void;\n}\n\nexport interface UseMovmoCardFieldsResult {\n status: 'idle' | 'loading' | 'ready' | 'error';\n error: string | null;\n tokenize: (data: CardholderTokenizeData) => void;\n}\n\nconst DEFAULT_NUMBER_EL = 'movmo-card-number';\nconst DEFAULT_CVV_EL = 'movmo-card-cvv';\n\nconst toSdkPayload = (data: CardholderTokenizeData): SpreedlyTokenizeData => ({\n first_name: data.firstName,\n last_name: data.lastName,\n month: data.month,\n year: data.year,\n ...(data.email ? { email: data.email } : {}),\n ...(data.zip ? { zip: data.zip } : {}),\n});\n\n/**\n * Mounts PCI-safe card-capture fields into the DOM containers identified by\n * `numberEl` and `cvvEl`, fetches a signed tokenization session from\n * monolith-api, and exposes a `tokenize()` function that returns an opaque\n * vault token via the `onCardTokenized` callback.\n *\n * The vault implementation (Spreedly Hosted Fields) is intentionally not part\n * of the public surface — callers receive a vault-neutral token they hand back\n * to monolith-api, which derives card metadata server-side.\n */\nexport const useMovmoCardFields = (\n options: UseMovmoCardFieldsOptions = {},\n): UseMovmoCardFieldsResult => {\n const {\n numberEl = DEFAULT_NUMBER_EL,\n cvvEl = DEFAULT_CVV_EL,\n onCardTokenized,\n onFieldErrors,\n } = options;\n\n const [status, setStatus] = useState<UseMovmoCardFieldsResult['status']>('idle');\n const [error, setError] = useState<string | null>(null);\n const spreedlyRef = useRef<SpreedlyGlobal | null>(null);\n\n const onCardTokenizedRef = useRef(onCardTokenized);\n const onFieldErrorsRef = useRef(onFieldErrors);\n useEffect(() => {\n onCardTokenizedRef.current = onCardTokenized;\n }, [onCardTokenized]);\n useEffect(() => {\n onFieldErrorsRef.current = onFieldErrors;\n }, [onFieldErrors]);\n\n useEffect(() => {\n let cancelled = false;\n setStatus('loading');\n setError(null);\n\n (async () => {\n try {\n const [session, spreedly] = await Promise.all([\n fetchTokenizationSession(),\n loadSpreedlyScript(),\n ]);\n if (cancelled) return;\n\n // Assign the ref before registering handlers so the cleanup can always\n // call removeHandlers — even if unmount runs before the 'ready' event\n // fires. window.Spreedly is a module-scoped singleton, so leaked\n // handlers would otherwise fire on the next mount.\n spreedlyRef.current = spreedly;\n\n spreedly.on('ready', () => {\n if (cancelled) return;\n setStatus('ready');\n });\n\n spreedly.on('paymentMethod', (token) => {\n onCardTokenizedRef.current?.(token);\n });\n\n spreedly.on('errors', (errors) => {\n onFieldErrorsRef.current?.(errors);\n });\n\n spreedly.on('consoleError', (err) => {\n // Without this, vault-internal failures during tokenizeCreditCard\n // leave consumers stuck in their 'tokenizing' state forever.\n const message =\n err instanceof Error\n ? err.message\n : 'An unexpected error occurred while securing your card.';\n onFieldErrorsRef.current?.([{ message }]);\n });\n\n spreedly.init(session.environmentKey, {\n numberEl,\n cvvEl,\n nonce: session.nonce,\n timestamp: String(session.timestamp),\n certificateToken: session.certificateToken,\n signature: session.signature,\n });\n } catch (err) {\n if (cancelled) return;\n const message = err instanceof Error ? err.message : 'Failed to initialize card form.';\n setError(message);\n setStatus('error');\n }\n })();\n\n return () => {\n cancelled = true;\n try {\n spreedlyRef.current?.removeHandlers?.();\n } catch {\n // best-effort cleanup\n }\n spreedlyRef.current = null;\n };\n }, [numberEl, cvvEl]);\n\n const tokenize = useCallback((data: CardholderTokenizeData) => {\n spreedlyRef.current?.tokenizeCreditCard(toSdkPayload(data));\n }, []);\n\n return { status, error, tokenize };\n};\n","import { useCallback, useMemo, useState } from 'react';\nimport clsx from 'clsx';\n\nimport { savePaymentMethodFromToken } from '../api';\nimport { useMovmoCardFields } from '../useMovmoCardFields';\nimport type { CardFieldError, CardFormStatus, PaymentMethodSummary } from '../types';\n\nexport interface MovmoCardFormProps {\n userId: string;\n onSuccess: (paymentMethod: PaymentMethodSummary) => void;\n onError: (error: string) => void;\n isDefault?: boolean;\n className?: string;\n /**\n * Pre-fills the cardholder first-name input. Cardholders aren't always the\n * logged-in user (spouse card, corporate card), so the field remains\n * editable — pass `user.firstName` as a sensible default.\n */\n defaultCardholderFirstName?: string;\n /** Pre-fills the cardholder last-name input. See `defaultCardholderFirstName`. */\n defaultCardholderLastName?: string;\n}\n\nconst fieldShellClass =\n 'h-11 w-full rounded-md border border-grayWarm-300 bg-white px-3 py-2 text-sm text-grayWarm-900 placeholder:text-grayWarm-400 focus:border-brand-500 focus:outline-none focus:ring-1 focus:ring-brand-500';\n\nconst iframeShellClass =\n 'h-11 w-full rounded-md border border-grayWarm-300 bg-white px-3 py-2 focus-within:border-brand-500 focus-within:ring-1 focus-within:ring-brand-500';\n\nconst labelClass = 'mb-1 block text-xs font-medium text-grayWarm-700';\n\nconst monthOptions = Array.from({ length: 12 }, (_, i) => String(i + 1).padStart(2, '0'));\nconst yearOptions = (() => {\n const start = new Date().getFullYear();\n return Array.from({ length: 15 }, (_, i) => String(start + i));\n})();\n\nexport const MovmoCardForm = ({\n userId,\n onSuccess,\n onError,\n isDefault = false,\n className,\n defaultCardholderFirstName = '',\n defaultCardholderLastName = '',\n}: MovmoCardFormProps) => {\n const [firstName, setFirstName] = useState(defaultCardholderFirstName);\n const [lastName, setLastName] = useState(defaultCardholderLastName);\n const [month, setMonth] = useState('');\n const [year, setYear] = useState('');\n const [formStatus, setFormStatus] = useState<CardFormStatus>('idle');\n const [formError, setFormError] = useState<string | null>(null);\n\n const handleCardTokenized = useCallback(\n async (token: string) => {\n setFormStatus('saving');\n try {\n const summary = await savePaymentMethodFromToken(userId, token, isDefault);\n setFormStatus('ready');\n onSuccess(summary);\n } catch (err) {\n const message = err instanceof Error ? err.message : 'Failed to save payment method.';\n setFormError(message);\n setFormStatus('ready');\n onError(message);\n }\n },\n [userId, isDefault, onSuccess, onError],\n );\n\n const handleFieldErrors = useCallback(\n (errors: CardFieldError[]) => {\n const message =\n errors.map((e) => e.message).filter(Boolean).join('; ') || 'Card validation failed.';\n setFormError(message);\n // Only clear an in-flight 'tokenizing' state. Leave 'saving' alone so the\n // save round-trip can resolve on its own, and don't churn 'ready'/'idle'.\n setFormStatus((prev) => (prev === 'tokenizing' ? 'ready' : prev));\n onError(message);\n },\n [onError],\n );\n\n const hookOptions = useMemo(\n () => ({\n onCardTokenized: handleCardTokenized,\n onFieldErrors: handleFieldErrors,\n }),\n [handleCardTokenized, handleFieldErrors],\n );\n\n const { status: hookStatus, error: hookError, tokenize } = useMovmoCardFields(hookOptions);\n\n const formInvalid = !firstName.trim() || !lastName.trim() || !month || !year;\n\n const isBusy = formStatus === 'tokenizing' || formStatus === 'saving';\n const canSubmit = hookStatus === 'ready' && !isBusy && !formInvalid;\n\n const handleSubmit = (e: React.FormEvent) => {\n e.preventDefault();\n if (!canSubmit) return;\n setFormError(null);\n setFormStatus('tokenizing');\n tokenize({\n firstName: firstName.trim(),\n lastName: lastName.trim(),\n month,\n year,\n });\n };\n\n const displayedError = formError ?? hookError;\n\n return (\n <form\n onSubmit={handleSubmit}\n className={clsx('flex w-full flex-col gap-4', className)}\n data-testid=\"movmo-card-form\"\n >\n <div className=\"grid grid-cols-1 gap-3 sm:grid-cols-2\">\n <div>\n <label htmlFor=\"movmo-card-first-name\" className={labelClass}>\n First name\n </label>\n <input\n id=\"movmo-card-first-name\"\n type=\"text\"\n autoComplete=\"cc-given-name\"\n value={firstName}\n onChange={(e) => setFirstName(e.target.value)}\n className={fieldShellClass}\n disabled={hookStatus !== 'ready' || isBusy}\n required\n />\n </div>\n <div>\n <label htmlFor=\"movmo-card-last-name\" className={labelClass}>\n Last name\n </label>\n <input\n id=\"movmo-card-last-name\"\n type=\"text\"\n autoComplete=\"cc-family-name\"\n value={lastName}\n onChange={(e) => setLastName(e.target.value)}\n className={fieldShellClass}\n disabled={hookStatus !== 'ready' || isBusy}\n required\n />\n </div>\n </div>\n\n <div>\n {/*\n The card-number container is a <div> (the Spreedly iframe mounts into\n it), so a <label htmlFor> would target a non-form-control and Chrome\n DevTools flags it. Use a styled <span> + aria-labelledby instead.\n */}\n <span id=\"movmo-card-number-label\" className={labelClass}>\n Card number\n </span>\n <div\n id=\"movmo-card-number\"\n aria-labelledby=\"movmo-card-number-label\"\n className={iframeShellClass}\n data-testid=\"movmo-card-number-mount\"\n />\n </div>\n\n <div className=\"grid grid-cols-3 gap-3\">\n <div>\n <label htmlFor=\"movmo-card-exp-month\" className={labelClass}>\n Month\n </label>\n <select\n id=\"movmo-card-exp-month\"\n value={month}\n onChange={(e) => setMonth(e.target.value)}\n className={fieldShellClass}\n disabled={hookStatus !== 'ready' || isBusy}\n required\n >\n <option value=\"\">MM</option>\n {monthOptions.map((m) => (\n <option key={m} value={m}>\n {m}\n </option>\n ))}\n </select>\n </div>\n <div>\n <label htmlFor=\"movmo-card-exp-year\" className={labelClass}>\n Year\n </label>\n <select\n id=\"movmo-card-exp-year\"\n value={year}\n onChange={(e) => setYear(e.target.value)}\n className={fieldShellClass}\n disabled={hookStatus !== 'ready' || isBusy}\n required\n >\n <option value=\"\">YYYY</option>\n {yearOptions.map((y) => (\n <option key={y} value={y}>\n {y}\n </option>\n ))}\n </select>\n </div>\n <div>\n <span id=\"movmo-card-cvv-label\" className={labelClass}>\n CVV\n </span>\n <div\n id=\"movmo-card-cvv\"\n aria-labelledby=\"movmo-card-cvv-label\"\n className={iframeShellClass}\n data-testid=\"movmo-card-cvv-mount\"\n />\n </div>\n </div>\n\n {displayedError ? (\n <p\n role=\"alert\"\n className=\"rounded-md bg-error-50 px-3 py-2 text-sm text-error-700\"\n data-testid=\"movmo-card-error\"\n >\n {displayedError}\n </p>\n ) : null}\n\n <button\n type=\"submit\"\n disabled={!canSubmit}\n className={clsx(\n 'inline-flex h-11 items-center justify-center rounded-md bg-brand-500 px-4 text-sm font-semibold text-white transition-colors hover:bg-brand-600',\n 'disabled:cursor-not-allowed disabled:bg-grayWarm-300 disabled:text-grayWarm-500',\n )}\n data-testid=\"movmo-card-save\"\n >\n {isBusy ? 'Saving…' : hookStatus === 'loading' ? 'Loading…' : 'Save card'}\n </button>\n </form>\n );\n};\n\nMovmoCardForm.displayName = 'MovmoCardForm';\n\nexport default MovmoCardForm;\n"],"names":["f","require$$0","k","l","m","n","p","q","c","a","g","b","d","e","h","reactJsxRuntime_production_min","React","REACT_ELEMENT_TYPE","REACT_PORTAL_TYPE","REACT_FRAGMENT_TYPE","REACT_STRICT_MODE_TYPE","REACT_PROFILER_TYPE","REACT_PROVIDER_TYPE","REACT_CONTEXT_TYPE","REACT_FORWARD_REF_TYPE","REACT_SUSPENSE_TYPE","REACT_SUSPENSE_LIST_TYPE","REACT_MEMO_TYPE","REACT_LAZY_TYPE","REACT_OFFSCREEN_TYPE","MAYBE_ITERATOR_SYMBOL","FAUX_ITERATOR_SYMBOL","getIteratorFn","maybeIterable","maybeIterator","ReactSharedInternals","error","format","_len2","args","_key2","printWarning","level","ReactDebugCurrentFrame","stack","argsWithFormat","item","enableScopeAPI","enableCacheElement","enableTransitionTracing","enableLegacyHidden","enableDebugTracing","REACT_MODULE_REFERENCE","isValidElementType","type","getWrappedName","outerType","innerType","wrapperName","displayName","functionName","getContextName","getComponentNameFromType","context","provider","outerName","lazyComponent","payload","init","assign","disabledDepth","prevLog","prevInfo","prevWarn","prevError","prevGroup","prevGroupCollapsed","prevGroupEnd","disabledLog","disableLogs","props","reenableLogs","ReactCurrentDispatcher","prefix","describeBuiltInComponentFrame","name","source","ownerFn","x","match","reentry","componentFrameCache","PossiblyWeakMap","describeNativeComponentFrame","fn","construct","frame","control","previousPrepareStackTrace","previousDispatcher","Fake","sample","sampleLines","controlLines","s","_frame","syntheticFrame","describeFunctionComponentFrame","shouldConstruct","Component","prototype","describeUnknownElementTypeFrameInDEV","hasOwnProperty","loggedTypeFailures","setCurrentlyValidatingElement","element","owner","checkPropTypes","typeSpecs","values","location","componentName","has","typeSpecName","error$1","err","ex","isArrayImpl","isArray","typeName","value","hasToStringTag","willCoercionThrow","testStringCoercion","checkKeyStringCoercion","ReactCurrentOwner","RESERVED_PROPS","specialPropKeyWarningShown","specialPropRefWarningShown","hasValidRef","config","getter","hasValidKey","warnIfStringRefCannotBeAutoConverted","self","defineKeyPropWarningGetter","warnAboutAccessingKey","defineRefPropWarningGetter","warnAboutAccessingRef","ReactElement","key","ref","jsxDEV","maybeKey","propName","defaultProps","ReactCurrentOwner$1","ReactDebugCurrentFrame$1","setCurrentlyValidatingElement$1","propTypesMisspellWarningShown","isValidElement","object","getDeclarationErrorAddendum","getSourceInfoErrorAddendum","ownerHasKeyUseWarning","getCurrentComponentErrorInfo","parentType","info","parentName","validateExplicitKey","currentComponentErrorInfo","childOwner","validateChildKeys","node","i","child","iteratorFn","iterator","step","validatePropTypes","propTypes","_name","validateFragmentProps","fragment","keys","didWarnAboutKeySpread","jsxWithValidation","isStaticChildren","validType","sourceInfo","typeString","children","beforeExample","afterExample","jsxWithValidationStatic","jsxWithValidationDynamic","jsx","jsxs","reactJsxRuntime_development","jsxRuntimeModule","require$$1","r","t","o","clsx","DEFAULT_SPREEDLY_SCRIPT_URL","overrides","setPaymentsConfig","readEnv","proc","_a","getPaymentsConfig","jsonHeaders","apiUrl","path","baseUrl","readError","res","fallback","fetchTokenizationSession","savePaymentMethodFromToken","userId","tokenizedPaymentMethodId","isDefault","body","scriptPromise","loadSpreedlyScript","spreedlyScriptUrl","resolve","reject","existing","onScriptLoad","script","DEFAULT_NUMBER_EL","DEFAULT_CVV_EL","toSdkPayload","data","useMovmoCardFields","options","numberEl","cvvEl","onCardTokenized","onFieldErrors","status","setStatus","useState","setError","spreedlyRef","useRef","onCardTokenizedRef","onFieldErrorsRef","useEffect","cancelled","session","spreedly","token","errors","message","_b","tokenize","useCallback","fieldShellClass","iframeShellClass","labelClass","monthOptions","_","yearOptions","start","MovmoCardForm","onSuccess","onError","className","defaultCardholderFirstName","defaultCardholderLastName","firstName","setFirstName","lastName","setLastName","month","setMonth","year","setYear","formStatus","setFormStatus","formError","setFormError","handleCardTokenized","summary","handleFieldErrors","prev","hookOptions","useMemo","hookStatus","hookError","formInvalid","isBusy","canSubmit","handleSubmit","displayedError","y"],"mappings":";;;;;;;;4CASa,IAAIA,EAAEC,EAAiBC,EAAE,OAAO,IAAI,eAAe,EAAEC,EAAE,OAAO,IAAI,gBAAgB,EAAEC,EAAE,OAAO,UAAU,eAAeC,EAAEL,EAAE,mDAAmD,kBAAkBM,EAAE,CAAC,IAAI,GAAG,IAAI,GAAG,OAAO,GAAG,SAAS,EAAE,EAClP,SAASC,EAAEC,EAAEC,EAAEC,EAAE,CAAC,IAAIC,EAAEC,EAAE,CAAA,EAAGC,EAAE,KAAKC,EAAE,KAAcJ,IAAT,SAAaG,EAAE,GAAGH,GAAYD,EAAE,MAAX,SAAiBI,EAAE,GAAGJ,EAAE,KAAcA,EAAE,MAAX,SAAiBK,EAAEL,EAAE,KAAK,IAAIE,KAAKF,EAAEL,EAAE,KAAKK,EAAEE,CAAC,GAAG,CAACL,EAAE,eAAeK,CAAC,IAAIC,EAAED,CAAC,EAAEF,EAAEE,CAAC,GAAG,GAAGH,GAAGA,EAAE,aAAa,IAAIG,KAAKF,EAAED,EAAE,aAAaC,EAAWG,EAAED,CAAC,IAAZ,SAAgBC,EAAED,CAAC,EAAEF,EAAEE,CAAC,GAAG,MAAM,CAAC,SAAST,EAAE,KAAKM,EAAE,IAAIK,EAAE,IAAIC,EAAE,MAAMF,EAAE,OAAOP,EAAE,OAAO,CAAC,CAAC,OAAAU,WAAiBZ,EAAEY,EAAA,IAAYR,EAAEQ,EAAA,KAAaR;;;;;;;;yCCEtW,QAAQ,IAAI,WAAa,cAC1B,UAAW,CAGd,IAAIS,EAAQf,EAMRgB,EAAqB,OAAO,IAAI,eAAe,EAC/CC,EAAoB,OAAO,IAAI,cAAc,EAC7CC,EAAsB,OAAO,IAAI,gBAAgB,EACjDC,EAAyB,OAAO,IAAI,mBAAmB,EACv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OAAI,EACpBsE,GAAY,IAAKiC,GAChBvG,EAAAA,IAAC,UAAe,MAAOuG,EACpB,SAAAA,CAAA,EADUA,CAEb,CACD,CAAA,CAAA,CAAA,CACH,EACF,SACC,MAAA,CACC,SAAA,CAAAvG,MAAC,OAAA,CAAK,GAAG,uBAAuB,UAAWmE,EAAY,SAAA,MAEvD,EACAnE,EAAAA,IAAC,MAAA,CACC,GAAG,iBACH,kBAAgB,uBAChB,UAAWkE,GACX,cAAY,sBAAA,CAAA,CACd,CAAA,CACF,CAAA,EACF,EAECoC,EACCtG,EAAAA,IAAC,IAAA,CACC,KAAK,QACL,UAAU,0DACV,cAAY,mBAEX,SAAAsG,CAAA,CAAA,EAED,KAEJtG,EAAAA,IAAC,SAAA,CACC,KAAK,SACL,SAAU,CAACoG,EACX,UAAW5F,GACT,kJACA,iFAAA,EAEF,cAAY,kBAEX,SAAA2F,EAAS,UAAYH,IAAe,UAAY,WAAa,WAAA,CAAA,CAChE,CAAA,CAAA,CAGN,EAEAxB,GAAc,YAAc","x_google_ignoreList":[0,1,2,3]}
@@ -0,0 +1,90 @@
1
+ import { JSX as JSX_2 } from 'react/jsx-runtime';
2
+
3
+ /** A validation error reported by the underlying card-field iframes. */
4
+ export declare interface CardFieldError {
5
+ attribute?: string;
6
+ key?: string;
7
+ message: string;
8
+ }
9
+
10
+ export declare type CardFormStatus = 'idle' | 'loading' | 'ready' | 'tokenizing' | 'saving' | 'error';
11
+
12
+ export declare interface CardholderTokenizeData {
13
+ firstName: string;
14
+ lastName: string;
15
+ /** Two-digit month, e.g. "01"–"12". */
16
+ month: string;
17
+ /** Four-digit year, e.g. "2030". */
18
+ year: string;
19
+ email?: string;
20
+ zip?: string;
21
+ }
22
+
23
+ export declare const getPaymentsConfig: () => InternalPaymentsConfig;
24
+
25
+ /* Excluded from this release type: InternalPaymentsConfig */
26
+
27
+ export declare const MovmoCardForm: {
28
+ ({ userId, onSuccess, onError, isDefault, className, defaultCardholderFirstName, defaultCardholderLastName, }: MovmoCardFormProps): JSX_2.Element;
29
+ displayName: string;
30
+ };
31
+
32
+ export declare interface MovmoCardFormProps {
33
+ userId: string;
34
+ onSuccess: (paymentMethod: PaymentMethodSummary) => void;
35
+ onError: (error: string) => void;
36
+ isDefault?: boolean;
37
+ className?: string;
38
+ /**
39
+ * Pre-fills the cardholder first-name input. Cardholders aren't always the
40
+ * logged-in user (spouse card, corporate card), so the field remains
41
+ * editable — pass `user.firstName` as a sensible default.
42
+ */
43
+ defaultCardholderFirstName?: string;
44
+ /** Pre-fills the cardholder last-name input. See `defaultCardholderFirstName`. */
45
+ defaultCardholderLastName?: string;
46
+ }
47
+
48
+ export declare interface PaymentMethodSummary {
49
+ id: string;
50
+ last4: string;
51
+ brand: string;
52
+ expMonth: number;
53
+ expYear: number;
54
+ isDefault: boolean;
55
+ }
56
+
57
+ export declare interface PaymentsConfig {
58
+ baseUrl: string;
59
+ }
60
+
61
+ export declare const setPaymentsConfig: (config: Partial<PaymentsConfig>) => void;
62
+
63
+ /**
64
+ * Mounts PCI-safe card-capture fields into the DOM containers identified by
65
+ * `numberEl` and `cvvEl`, fetches a signed tokenization session from
66
+ * monolith-api, and exposes a `tokenize()` function that returns an opaque
67
+ * vault token via the `onCardTokenized` callback.
68
+ *
69
+ * The vault implementation (Spreedly Hosted Fields) is intentionally not part
70
+ * of the public surface — callers receive a vault-neutral token they hand back
71
+ * to monolith-api, which derives card metadata server-side.
72
+ */
73
+ export declare const useMovmoCardFields: (options?: UseMovmoCardFieldsOptions) => UseMovmoCardFieldsResult;
74
+
75
+ export declare interface UseMovmoCardFieldsOptions {
76
+ /** DOM element id where the card-number field mounts. Defaults to `movmo-card-number`. */
77
+ numberEl?: string;
78
+ /** DOM element id where the CVV field mounts. Defaults to `movmo-card-cvv`. */
79
+ cvvEl?: string;
80
+ onCardTokenized?: (token: string) => void;
81
+ onFieldErrors?: (errors: CardFieldError[]) => void;
82
+ }
83
+
84
+ export declare interface UseMovmoCardFieldsResult {
85
+ status: 'idle' | 'loading' | 'ready' | 'error';
86
+ error: string | null;
87
+ tokenize: (data: CardholderTokenizeData) => void;
88
+ }
89
+
90
+ export { }