@privy-io/expo 0.76.3 → 0.76.4

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.
@@ -0,0 +1,315 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _chunk23WNYVKLjs = require('./chunk-23WNYVKL.js');var _chunkK5SPDXVFjs = require('./chunk-K5SPDXVF.js');var C=class extends Error{constructor(o,u){super(u);this.code=o,this.error=u}},he= exports.M =class extends C{constructor(o){super("underlying_error",o instanceof Error?o.message:"An underlying error occurred");this.wrappedError=o}};var _react = require('react'); var _react2 = _interopRequireDefault(_react);var O=_react.createContext.call(void 0, void 0);var ge="#5B4FFF";function Se({colorScheme:a,accentHex:t}){return a==="dark"?{interactive:t,background:"#22222A",backgroundSecondary:"#010110",backgroundInformation:"#1E1B4B",backgroundTertiary:"#010110",backgroundHighlight:"#052E16",text:"#ffffff",textPlaceholder:"#9498B8",textMuted:"#FFFFFF",textHighlight:"#BBF7D0",textTitle:"#FFFFFF",textInteractive:"#FFFFFF",icon:"#FFFFFF",iconInformation:"#818CF8",iconSubtle:"#919191",privyBrand:"#FFFFFF",success:"#4ADE80",successLight:"#C5F7D7",border:"#474869",borderInformation:"#818CF8",error:"#FCA5A5",errorDark:"#EF4444"}:{interactive:t,background:"#FFFFFF",backgroundSecondary:"#F3F3F3",backgroundInformation:"#E0E7FF",backgroundTertiary:"#FFFFFF",backgroundHighlight:"#F1F2F9",text:"#040217",textPlaceholder:"#9498B8",textMuted:"#64668B",textHighlight:"#64668B",textTitle:"#1A1C29",textInteractive:"#FFFFFF",icon:"#110F2A",iconSubtle:"#9498B8",iconInformation:"#4F46E5",privyBrand:"#010110",success:"#16A34A",successLight:"#DCFCE7",border:"#E2E3F0",borderInformation:"#5B4FFF",error:"#EF4444",errorDark:"#B91C1C"}}function ke({colorScheme:a,accentHex:t}){return{colors:Se({colorScheme:a,accentHex:t}),colorScheme:a}}function Oe({children:a,appearance:t={}}){let{colorScheme:o="light",accentColor:u}=t,{isReady:d,client:l}=_react.useContext.call(void 0, _chunk23WNYVKLjs.ka),f=_react.useMemo.call(void 0, ()=>{var B,L;let s=d?l.app.getConfig():void 0,i=(B=s==null?void 0:s.accent_color)!=null?B:void 0;return ke({colorScheme:o,accentHex:(L=u!=null?u:i)!=null?L:ge})},[o,u,d,l]);return _react2.default.createElement(O.Provider,{value:f},a)}var n=()=>{let a=_react.useContext.call(void 0, O);if(a===void 0)throw new Error("Components calling useTheme must be wrapped in an ElementsThemeProvider");return a};var _zustand = require('zustand');var _vanilla = require('zustand/vanilla');var H=_vanilla.createStore.call(void 0, )(a=>({elementsConfig:null,updateUIMounted:t=>a({elementsConfig:t})})),Ra= exports.N =()=>{let{elementsConfig:a}=H.getState();if(!(a!==null))throw new C("privy_elements_not_ready","Privy Elements is not mounted")},ba= exports.O =()=>{let{elementsConfig:a}=H.getState();if(a===null)throw new C("privy_elements_not_ready","Privy Elements is not mounted");return a},qa= exports.P =()=>_zustand.useStore.call(void 0, H,a=>{var t;return(t=a.elementsConfig)==null?void 0:t.appearance}),va= exports.Q =a=>{_react.useEffect.call(void 0, ()=>{let{updateUIMounted:t}=H.getState();return t(a),()=>{t(null)}},[a])};var we={regular:"Inter_400Regular",medium:"Inter_500Medium",semibold:"Inter_600SemiBold"};var _reactnative = require('react-native');var Xe=_react2.default.forwardRef((d,u)=>{var l=d,{style:a,variant:t="default"}=l,o=_chunkK5SPDXVFjs.d.call(void 0, l,["style","variant"]);let{colors:f}=n();return _react2.default.createElement(_reactnative.View,_chunkK5SPDXVFjs.b.call(void 0, {ref:u,style:[E.alert,t==="info"&&{backgroundColor:f.backgroundInformation,borderColor:f.borderInformation},a]},o))});Xe.displayName="Alert";var Ne=_react2.default.forwardRef((u,o)=>{var d=u,{style:a}=d,t=_chunkK5SPDXVFjs.d.call(void 0, d,["style"]);let{colors:l}=n();return _react2.default.createElement(_reactnative.Text,_chunkK5SPDXVFjs.b.call(void 0, {ref:o,style:[E.title,{color:l.text},a]},t))});Ne.displayName="AlertTitle";var _e=_react2.default.forwardRef((u,o)=>{var d=u,{style:a}=d,t=_chunkK5SPDXVFjs.d.call(void 0, d,["style"]);let{colors:l}=n();return _react2.default.createElement(_reactnative.Text,_chunkK5SPDXVFjs.b.call(void 0, {ref:o,style:[E.description,{color:l.text},a]},t))});_e.displayName="AlertDescription";var E=_reactnative.StyleSheet.create({alert:{borderRadius:8,alignItems:"center",gap:12,paddingHorizontal:12,paddingVertical:8,flexDirection:"row"},title:{marginBottom:4,fontFamily:we.semibold,fontSize:16},description:{fontSize:14,lineHeight:20}});var _reactnativesvg = require('react-native-svg'); var V = _interopRequireWildcard(_reactnativesvg);var I={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},Ae={fill:I.fill,stroke:I.stroke,strokeWidth:I.strokeWidth,strokeLinecap:I.strokeLinecap,strokeLinejoin:I.strokeLinejoin};var e=(a,t)=>{let o=_react.forwardRef.call(void 0, (p,L)=>{var M=p,{color:u="currentColor",size:d=24,strokeWidth:l=2,absoluteStrokeWidth:f,children:s,"data-testid":i}=M,B=_chunkK5SPDXVFjs.d.call(void 0, M,["color","size","strokeWidth","absoluteStrokeWidth","children","data-testid"]);let v=_chunkK5SPDXVFjs.b.call(void 0, {stroke:u,strokeWidth:f?Number(l)*24/Number(d):l},B);return _react.createElement.call(void 0, V.Svg,_chunkK5SPDXVFjs.b.call(void 0, _chunkK5SPDXVFjs.c.call(void 0, _chunkK5SPDXVFjs.b.call(void 0, {ref:L},I),{width:d,height:d,"data-testid":i}),v),[...t.map(([D,Te])=>{let Re=D.charAt(0).toUpperCase()+D.slice(1);return _react.createElement.call(void 0, V[Re],_chunkK5SPDXVFjs.b.call(void 0, _chunkK5SPDXVFjs.b.call(void 0, _chunkK5SPDXVFjs.b.call(void 0, {},Ae),v),Te))}),...(Array.isArray(s)?s:[s])||[]])});return o.displayName=`${a}`,o};var G=e("ArrowLeftRight",[["path",{d:"M8 3 4 7l4 4",key:"9rb6wj"}],["path",{d:"M4 7h16",key:"6tx8e3"}],["path",{d:"m16 21 4-4-4-4",key:"siv7j2"}],["path",{d:"M20 17H4",key:"h6l3hr"}]]);var T=e("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);var W=e("Ban",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.9 4.9 14.2 14.2",key:"1m5liu"}]]);var g=e("ChartLine",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"m19 9-5 5-4-4-3 3",key:"2osh9i"}]]);var z=e("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);var X=e("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);var N=e("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);var S=e("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);var k=e("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);var w=e("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);var P=e("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);var _=e("Clock10",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 8 10",key:"atfzqc"}]]);var A=e("CloudUpload",[["path",{d:"M12 13v8",key:"1l5pq0"}],["path",{d:"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242",key:"1pljnt"}],["path",{d:"m8 17 4-4 4 4",key:"1quai1"}]]);var K=e("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);var Z=e("CreditCard",[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]]);var J=e("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);var Q=e("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);var j=e("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);var Y=e("FileCheck",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"m9 15 2 2 4-4",key:"1grp1n"}]]);var y=e("FilePen",[["path",{d:"M12.5 22H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v9.5",key:"1couwa"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M13.378 15.626a1 1 0 1 0-3.004-3.004l-5.01 5.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z",key:"1y4qbx"}]]);var $=e("Files",[["path",{d:"M20 7h-3a2 2 0 0 1-2-2V2",key:"x099mo"}],["path",{d:"M9 18a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h7l4 4v10a2 2 0 0 1-2 2Z",key:"18t6ie"}],["path",{d:"M3 7.6v12.8A1.6 1.6 0 0 0 4.6 22h9.8",key:"1nja0z"}]]);var ee=e("Fingerprint",[["path",{d:"M12 10a2 2 0 0 0-2 2c0 1.02-.1 2.51-.26 4",key:"1nerag"}],["path",{d:"M14 13.12c0 2.38 0 6.38-1 8.88",key:"o46ks0"}],["path",{d:"M17.29 21.02c.12-.6.43-2.3.5-3.02",key:"ptglia"}],["path",{d:"M2 12a10 10 0 0 1 18-6",key:"ydlgp0"}],["path",{d:"M2 16h.01",key:"1gqxmh"}],["path",{d:"M21.8 16c.2-2 .131-5.354 0-6",key:"drycrb"}],["path",{d:"M5 19.5C5.5 18 6 15 6 12a6 6 0 0 1 .34-2",key:"1tidbn"}],["path",{d:"M8.65 22c.21-.66.45-1.32.57-2",key:"13wd9y"}],["path",{d:"M9 6.8a6 6 0 0 1 9 5.2v2",key:"1fr1j5"}]]);var ae=e("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);var te=e("LogIn",[["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}],["polyline",{points:"10 17 15 12 10 7",key:"1ail0h"}],["line",{x1:"15",x2:"3",y1:"12",y2:"12",key:"v6grx8"}]]);var oe=e("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]]);var ue=e("Phone",[["path",{d:"M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z",key:"foiqr5"}]]);var de=e("QrCode",[["rect",{width:"5",height:"5",x:"3",y:"3",rx:"1",key:"1tu5fj"}],["rect",{width:"5",height:"5",x:"16",y:"3",rx:"1",key:"1v8r4q"}],["rect",{width:"5",height:"5",x:"3",y:"16",rx:"1",key:"1x03jg"}],["path",{d:"M21 16h-3a2 2 0 0 0-2 2v3",key:"177gqh"}],["path",{d:"M21 21v.01",key:"ents32"}],["path",{d:"M12 7v3a2 2 0 0 1-2 2H7",key:"8crl2c"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M12 3h.01",key:"n36tog"}],["path",{d:"M12 16v.01",key:"133mhm"}],["path",{d:"M16 12h1",key:"1slzba"}],["path",{d:"M21 12v.01",key:"1lwtk9"}],["path",{d:"M12 21v-1",key:"1880an"}]]);var le=e("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);var re=e("ScanFace",[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}],["path",{d:"M8 14s1.5 2 4 2 4-2 4-2",key:"1y1vjs"}],["path",{d:"M9 9h.01",key:"1q5me6"}],["path",{d:"M15 9h.01",key:"x1ddxp"}]]);var fe=e("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);var se=e("ShieldAlert",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]);var ie=e("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);var ce=e("Smartphone",[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]]);var ne=e("Store",[["path",{d:"m2 7 4.41-4.41A2 2 0 0 1 7.83 2h8.34a2 2 0 0 1 1.42.59L22 7",key:"ztvudi"}],["path",{d:"M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8",key:"1b2hhj"}],["path",{d:"M15 22v-4a2 2 0 0 0-2-2h-2a2 2 0 0 0-2 2v4",key:"2ebpfo"}],["path",{d:"M2 7h20",key:"1fcdvo"}],["path",{d:"M22 7v3a2 2 0 0 1-2 2a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 16 12a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 12 12a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 8 12a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 4 12a2 2 0 0 1-2-2V7",key:"6c3vgh"}]]);var pe=e("UserCheck",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["polyline",{points:"16 11 18 13 22 9",key:"1pwet4"}]]);var R=e("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);var au=({goBack:a,close:t})=>_react2.default.createElement(_reactnative.View,{style:me.navigationBar},_react2.default.createElement(_reactnative.View,null,a&&_react2.default.createElement(Je,{onPress:a})),_react2.default.createElement(_reactnative.View,null,t&&_react2.default.createElement(Qe,{onPress:t}))),Je=a=>{let{colors:t}=n();return _react2.default.createElement(_reactnative.Pressable,_chunkK5SPDXVFjs.b.call(void 0, {accessibilityRole:"button",accessibilityLabel:"Back"},a),_react2.default.createElement(_reactnative.View,{style:me.backButton},_react2.default.createElement(T,{size:24,color:t.icon})))},Qe=a=>{let{colors:t}=n();return _react2.default.createElement(_reactnative.Pressable,_chunkK5SPDXVFjs.b.call(void 0, {accessibilityRole:"button",accessibilityLabel:"Close"},a),_react2.default.createElement(_reactnative.View,{style:me.backButton},_react2.default.createElement(R,{size:24,color:t.icon})))},me=_reactnative.StyleSheet.create({navigationBar:{height:48,flexDirection:"row",justifyContent:"space-between"},backButton:{width:48,height:48,justifyContent:"center",alignItems:"center"}});var Le=_zustand.create.call(void 0, ()=>null),Ye= exports.Y =()=>{var t;let a=(t=Le.getState())==null?void 0:t.controller;return!a||a.signal.aborted?null:a},du= exports.Z =()=>{var a;(a=Ye())==null||a.abort(),Le.setState(null)},lu= exports._ =a=>{Le.setState(t=>t&&{step:a})};var Be=({color:a})=>{let t=_reactnative.useAnimatedValue.call(void 0, 0);_react.useEffect.call(void 0, ()=>{t.setValue(0);let u=_reactnative.Animated.loop(_reactnative.Animated.timing(t,{toValue:1,duration:1200,useNativeDriver:!0,easing:_reactnative.Easing.linear}));return u.start(),()=>u.stop()},[t]);let o=t.interpolate({inputRange:[0,1],outputRange:["0deg","360deg"]});return _react2.default.createElement(_reactnative.Animated.View,{style:{transform:[{rotate:o}]}},_react2.default.createElement(V.default,{width:20,height:20,viewBox:"0 0 20 20",fill:"none"},_react2.default.createElement(_reactnativesvg.Path,{d:"M19 10a9 9 0 11-6.219-8.56",stroke:a,strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"})))};var Iu=B=>{var L=B,{variant:a="primary",title:t,destroy:o=!1,loading:u=!1,LeftIcon:d,RightIcon:l,color:f,style:s}=L,i=_chunkK5SPDXVFjs.d.call(void 0, L,["variant","title","destroy","loading","LeftIcon","RightIcon","color","style"]);let{colors:p}=n(),M=o?p.errorDark:p.interactive,v={primary:M,secondary:p.backgroundTertiary,tertiary:p.background}[a],D={primary:p.textInteractive,secondary:p.text,tertiary:M}[a];return _react2.default.createElement(_reactnative.Pressable,_chunkK5SPDXVFjs.c.call(void 0, _chunkK5SPDXVFjs.b.call(void 0, {},i),{disabled:i.disabled||u}),_react2.default.createElement(_reactnative.View,{style:[q.buttonBox,{backgroundColor:v},a==="secondary"&&q.buttonBoxSecondary,a==="secondary"&&{borderColor:p.border},s]},u?_react2.default.createElement(Be,{color:f!=null?f:D}):_react2.default.createElement(_react2.default.Fragment,null,d,_react2.default.createElement(_reactnative.Text,{style:[q.buttonLabel,{color:f!=null?f:D},a==="secondary"&&q.buttonLabelSecondary,a==="tertiary"&&q.buttonLabelTertiary]},t),!!l&&_react2.default.createElement(_reactnative.View,{style:{marginLeft:"auto"}},l))))},q=_reactnative.StyleSheet.create({buttonBox:{height:54,flexDirection:"row",justifyContent:"center",alignItems:"center",borderRadius:14,paddingHorizontal:16,gap:12},buttonBoxSecondary:{justifyContent:"flex-start",borderWidth:1,borderRadius:12},buttonLabel:{fontFamily:"Inter_600SemiBold",fontSize:16,lineHeight:24},buttonLabelSecondary:{fontFamily:"Inter_400Regular"},buttonLabelTertiary:{fontFamily:"Inter_500Medium"}});var _expowebbrowser = require('expo-web-browser'); var F = _interopRequireWildcard(_expowebbrowser);var gu=a=>{if(!a)return null;try{return new URL(a).protocol==="https:"?a:null}catch(t){return null}},Su= exports.W =a=>{let t=!1,o=!1,u=null;function d(){o=!0,u==null||u.remove()}function l(f){if(t||o)return;t=!0;let s=!1;u=_reactnative.Platform.OS==="android"?_reactnative.AppState.addEventListener("change",i=>{i==="background"&&(s=!0),i==="active"&&s&&d()}):null,F.openBrowserAsync(f,{createTask:!1}).then(i=>{i.type!==F.WebBrowserResultType.OPENED&&d()}).catch(d)}return a&&l(a),{navigate:l,isClosed:()=>o,dismiss:()=>{o||(d(),t&&_reactnative.Platform.OS==="ios"&&F.dismissBrowser().catch(()=>{}))}}};exports.a = Oe; exports.b = n; exports.c = Iu; exports.d = G; exports.e = W; exports.f = g; exports.g = z; exports.h = X; exports.i = N; exports.j = S; exports.k = k; exports.l = w; exports.m = P; exports.n = _; exports.o = A; exports.p = K; exports.q = Z; exports.r = J; exports.s = Q; exports.t = j; exports.u = Y; exports.v = y; exports.w = $; exports.x = ee; exports.y = ae; exports.z = te; exports.A = oe; exports.B = ue; exports.C = de; exports.D = le; exports.E = re; exports.F = fe; exports.G = se; exports.H = ie; exports.I = ce; exports.J = ne; exports.K = pe; exports.L = C; exports.M = he; exports.N = Ra; exports.O = ba; exports.P = qa; exports.Q = va; exports.R = we; exports.S = Xe; exports.T = _e; exports.U = au; exports.V = gu; exports.W = Su; exports.X = Le; exports.Y = Ye; exports.Z = du; exports._ = lu;
2
+ /*! Bundled license information:
3
+
4
+ lucide-react-native/dist/esm/defaultAttributes.js:
5
+ (**
6
+ * @license lucide-react-native v0.474.0 - ISC
7
+ *
8
+ * This source code is licensed under the ISC license.
9
+ * See the LICENSE file in the root directory of this source tree.
10
+ *)
11
+
12
+ lucide-react-native/dist/esm/createLucideIcon.js:
13
+ (**
14
+ * @license lucide-react-native v0.474.0 - ISC
15
+ *
16
+ * This source code is licensed under the ISC license.
17
+ * See the LICENSE file in the root directory of this source tree.
18
+ *)
19
+
20
+ lucide-react-native/dist/esm/icons/arrow-left-right.js:
21
+ (**
22
+ * @license lucide-react-native v0.474.0 - ISC
23
+ *
24
+ * This source code is licensed under the ISC license.
25
+ * See the LICENSE file in the root directory of this source tree.
26
+ *)
27
+
28
+ lucide-react-native/dist/esm/icons/arrow-left.js:
29
+ (**
30
+ * @license lucide-react-native v0.474.0 - ISC
31
+ *
32
+ * This source code is licensed under the ISC license.
33
+ * See the LICENSE file in the root directory of this source tree.
34
+ *)
35
+
36
+ lucide-react-native/dist/esm/icons/ban.js:
37
+ (**
38
+ * @license lucide-react-native v0.474.0 - ISC
39
+ *
40
+ * This source code is licensed under the ISC license.
41
+ * See the LICENSE file in the root directory of this source tree.
42
+ *)
43
+
44
+ lucide-react-native/dist/esm/icons/chart-line.js:
45
+ (**
46
+ * @license lucide-react-native v0.474.0 - ISC
47
+ *
48
+ * This source code is licensed under the ISC license.
49
+ * See the LICENSE file in the root directory of this source tree.
50
+ *)
51
+
52
+ lucide-react-native/dist/esm/icons/check.js:
53
+ (**
54
+ * @license lucide-react-native v0.474.0 - ISC
55
+ *
56
+ * This source code is licensed under the ISC license.
57
+ * See the LICENSE file in the root directory of this source tree.
58
+ *)
59
+
60
+ lucide-react-native/dist/esm/icons/chevron-down.js:
61
+ (**
62
+ * @license lucide-react-native v0.474.0 - ISC
63
+ *
64
+ * This source code is licensed under the ISC license.
65
+ * See the LICENSE file in the root directory of this source tree.
66
+ *)
67
+
68
+ lucide-react-native/dist/esm/icons/chevron-right.js:
69
+ (**
70
+ * @license lucide-react-native v0.474.0 - ISC
71
+ *
72
+ * This source code is licensed under the ISC license.
73
+ * See the LICENSE file in the root directory of this source tree.
74
+ *)
75
+
76
+ lucide-react-native/dist/esm/icons/circle-check-big.js:
77
+ (**
78
+ * @license lucide-react-native v0.474.0 - ISC
79
+ *
80
+ * This source code is licensed under the ISC license.
81
+ * See the LICENSE file in the root directory of this source tree.
82
+ *)
83
+
84
+ lucide-react-native/dist/esm/icons/circle-check.js:
85
+ (**
86
+ * @license lucide-react-native v0.474.0 - ISC
87
+ *
88
+ * This source code is licensed under the ISC license.
89
+ * See the LICENSE file in the root directory of this source tree.
90
+ *)
91
+
92
+ lucide-react-native/dist/esm/icons/circle-help.js:
93
+ (**
94
+ * @license lucide-react-native v0.474.0 - ISC
95
+ *
96
+ * This source code is licensed under the ISC license.
97
+ * See the LICENSE file in the root directory of this source tree.
98
+ *)
99
+
100
+ lucide-react-native/dist/esm/icons/circle-x.js:
101
+ (**
102
+ * @license lucide-react-native v0.474.0 - ISC
103
+ *
104
+ * This source code is licensed under the ISC license.
105
+ * See the LICENSE file in the root directory of this source tree.
106
+ *)
107
+
108
+ lucide-react-native/dist/esm/icons/clock-10.js:
109
+ (**
110
+ * @license lucide-react-native v0.474.0 - ISC
111
+ *
112
+ * This source code is licensed under the ISC license.
113
+ * See the LICENSE file in the root directory of this source tree.
114
+ *)
115
+
116
+ lucide-react-native/dist/esm/icons/cloud-upload.js:
117
+ (**
118
+ * @license lucide-react-native v0.474.0 - ISC
119
+ *
120
+ * This source code is licensed under the ISC license.
121
+ * See the LICENSE file in the root directory of this source tree.
122
+ *)
123
+
124
+ lucide-react-native/dist/esm/icons/copy.js:
125
+ (**
126
+ * @license lucide-react-native v0.474.0 - ISC
127
+ *
128
+ * This source code is licensed under the ISC license.
129
+ * See the LICENSE file in the root directory of this source tree.
130
+ *)
131
+
132
+ lucide-react-native/dist/esm/icons/credit-card.js:
133
+ (**
134
+ * @license lucide-react-native v0.474.0 - ISC
135
+ *
136
+ * This source code is licensed under the ISC license.
137
+ * See the LICENSE file in the root directory of this source tree.
138
+ *)
139
+
140
+ lucide-react-native/dist/esm/icons/external-link.js:
141
+ (**
142
+ * @license lucide-react-native v0.474.0 - ISC
143
+ *
144
+ * This source code is licensed under the ISC license.
145
+ * See the LICENSE file in the root directory of this source tree.
146
+ *)
147
+
148
+ lucide-react-native/dist/esm/icons/eye-off.js:
149
+ (**
150
+ * @license lucide-react-native v0.474.0 - ISC
151
+ *
152
+ * This source code is licensed under the ISC license.
153
+ * See the LICENSE file in the root directory of this source tree.
154
+ *)
155
+
156
+ lucide-react-native/dist/esm/icons/eye.js:
157
+ (**
158
+ * @license lucide-react-native v0.474.0 - ISC
159
+ *
160
+ * This source code is licensed under the ISC license.
161
+ * See the LICENSE file in the root directory of this source tree.
162
+ *)
163
+
164
+ lucide-react-native/dist/esm/icons/file-check.js:
165
+ (**
166
+ * @license lucide-react-native v0.474.0 - ISC
167
+ *
168
+ * This source code is licensed under the ISC license.
169
+ * See the LICENSE file in the root directory of this source tree.
170
+ *)
171
+
172
+ lucide-react-native/dist/esm/icons/file-pen.js:
173
+ (**
174
+ * @license lucide-react-native v0.474.0 - ISC
175
+ *
176
+ * This source code is licensed under the ISC license.
177
+ * See the LICENSE file in the root directory of this source tree.
178
+ *)
179
+
180
+ lucide-react-native/dist/esm/icons/files.js:
181
+ (**
182
+ * @license lucide-react-native v0.474.0 - ISC
183
+ *
184
+ * This source code is licensed under the ISC license.
185
+ * See the LICENSE file in the root directory of this source tree.
186
+ *)
187
+
188
+ lucide-react-native/dist/esm/icons/fingerprint.js:
189
+ (**
190
+ * @license lucide-react-native v0.474.0 - ISC
191
+ *
192
+ * This source code is licensed under the ISC license.
193
+ * See the LICENSE file in the root directory of this source tree.
194
+ *)
195
+
196
+ lucide-react-native/dist/esm/icons/info.js:
197
+ (**
198
+ * @license lucide-react-native v0.474.0 - ISC
199
+ *
200
+ * This source code is licensed under the ISC license.
201
+ * See the LICENSE file in the root directory of this source tree.
202
+ *)
203
+
204
+ lucide-react-native/dist/esm/icons/log-in.js:
205
+ (**
206
+ * @license lucide-react-native v0.474.0 - ISC
207
+ *
208
+ * This source code is licensed under the ISC license.
209
+ * See the LICENSE file in the root directory of this source tree.
210
+ *)
211
+
212
+ lucide-react-native/dist/esm/icons/mail.js:
213
+ (**
214
+ * @license lucide-react-native v0.474.0 - ISC
215
+ *
216
+ * This source code is licensed under the ISC license.
217
+ * See the LICENSE file in the root directory of this source tree.
218
+ *)
219
+
220
+ lucide-react-native/dist/esm/icons/phone.js:
221
+ (**
222
+ * @license lucide-react-native v0.474.0 - ISC
223
+ *
224
+ * This source code is licensed under the ISC license.
225
+ * See the LICENSE file in the root directory of this source tree.
226
+ *)
227
+
228
+ lucide-react-native/dist/esm/icons/qr-code.js:
229
+ (**
230
+ * @license lucide-react-native v0.474.0 - ISC
231
+ *
232
+ * This source code is licensed under the ISC license.
233
+ * See the LICENSE file in the root directory of this source tree.
234
+ *)
235
+
236
+ lucide-react-native/dist/esm/icons/refresh-cw.js:
237
+ (**
238
+ * @license lucide-react-native v0.474.0 - ISC
239
+ *
240
+ * This source code is licensed under the ISC license.
241
+ * See the LICENSE file in the root directory of this source tree.
242
+ *)
243
+
244
+ lucide-react-native/dist/esm/icons/scan-face.js:
245
+ (**
246
+ * @license lucide-react-native v0.474.0 - ISC
247
+ *
248
+ * This source code is licensed under the ISC license.
249
+ * See the LICENSE file in the root directory of this source tree.
250
+ *)
251
+
252
+ lucide-react-native/dist/esm/icons/search.js:
253
+ (**
254
+ * @license lucide-react-native v0.474.0 - ISC
255
+ *
256
+ * This source code is licensed under the ISC license.
257
+ * See the LICENSE file in the root directory of this source tree.
258
+ *)
259
+
260
+ lucide-react-native/dist/esm/icons/shield-alert.js:
261
+ (**
262
+ * @license lucide-react-native v0.474.0 - ISC
263
+ *
264
+ * This source code is licensed under the ISC license.
265
+ * See the LICENSE file in the root directory of this source tree.
266
+ *)
267
+
268
+ lucide-react-native/dist/esm/icons/shield-check.js:
269
+ (**
270
+ * @license lucide-react-native v0.474.0 - ISC
271
+ *
272
+ * This source code is licensed under the ISC license.
273
+ * See the LICENSE file in the root directory of this source tree.
274
+ *)
275
+
276
+ lucide-react-native/dist/esm/icons/smartphone.js:
277
+ (**
278
+ * @license lucide-react-native v0.474.0 - ISC
279
+ *
280
+ * This source code is licensed under the ISC license.
281
+ * See the LICENSE file in the root directory of this source tree.
282
+ *)
283
+
284
+ lucide-react-native/dist/esm/icons/store.js:
285
+ (**
286
+ * @license lucide-react-native v0.474.0 - ISC
287
+ *
288
+ * This source code is licensed under the ISC license.
289
+ * See the LICENSE file in the root directory of this source tree.
290
+ *)
291
+
292
+ lucide-react-native/dist/esm/icons/user-check.js:
293
+ (**
294
+ * @license lucide-react-native v0.474.0 - ISC
295
+ *
296
+ * This source code is licensed under the ISC license.
297
+ * See the LICENSE file in the root directory of this source tree.
298
+ *)
299
+
300
+ lucide-react-native/dist/esm/icons/x.js:
301
+ (**
302
+ * @license lucide-react-native v0.474.0 - ISC
303
+ *
304
+ * This source code is licensed under the ISC license.
305
+ * See the LICENSE file in the root directory of this source tree.
306
+ *)
307
+
308
+ lucide-react-native/dist/esm/lucide-react-native.js:
309
+ (**
310
+ * @license lucide-react-native v0.474.0 - ISC
311
+ *
312
+ * This source code is licensed under the ISC license.
313
+ * See the LICENSE file in the root directory of this source tree.
314
+ *)
315
+ */
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } }var _chunkHNRKZKAWjs = require('./chunk-HNRKZKAW.js');var _chunkK5SPDXVFjs = require('./chunk-K5SPDXVF.js');var _expolinking = require('expo-linking'); var O = _interopRequireWildcard(_expolinking); var Q = _interopRequireWildcard(_expolinking);var _react = require('react');var _reactnative = require('react-native');var _jssdkcore = require('@privy-io/js-sdk-core');function M(){return _chunkK5SPDXVFjs.e.call(void 0, this,null,function*(){_chunkHNRKZKAWjs.g.call(void 0, "expo-apple-authentication");try{return yield Promise.resolve().then(() => _interopRequireWildcard(require("expo-apple-authentication")))}catch(t){throw new (0, _jssdkcore.PrivyClientError)({code:"configuration_error",error:"`expo-apple-authentication` is not installed. Install it and rebuild the native app."})}})}function H(u){return _chunkK5SPDXVFjs.e.call(void 0, this,arguments,function*({oauthProviderUrl:t,isLogin:i}){try{let o=yield M();return yield o.signInAsync({state:Y(t),requestedScopes:[o.AppleAuthenticationScope.EMAIL,o.AppleAuthenticationScope.FULL_NAME]})}catch(o){throw o instanceof Error&&"code"in o&&o.code==="ERR_REQUEST_CANCELED"?new (0, _jssdkcore.PrivyClientError)({error:"Apple login was cancelled",code:i?"login_with_oauth_was_cancelled_by_user":"link_with_oauth_was_cancelled_by_user"}):o}})}function Y(t){var u;return(u=new URL(t).searchParams.get("state"))!=null?u:""}function z(t){return _reactnative.Platform.select({android:t.replace("x.com","twitter.com"),default:t})}var _expowebbrowser = require('expo-web-browser'); var m = _interopRequireWildcard(_expowebbrowser);function V(o){return _chunkK5SPDXVFjs.e.call(void 0, this,arguments,function*({oauthProviderUrl:t,isLogin:i,returnUrl:u}){var a,p;let n=yield m.openAuthSessionAsync(t,u,{createTask:!1});if(n.type===m.WebBrowserResultType.CANCEL||n.type===m.WebBrowserResultType.DISMISS)throw new (0, _jssdkcore.PrivyClientError)({error:"OAuth was cancelled",code:i?"login_with_oauth_was_cancelled_by_user":"link_with_oauth_was_cancelled_by_user"});if(n.type!=="success")throw new (0, _jssdkcore.PrivyClientError)({error:"OAuth session failed",code:i?"failed_to_complete_login_with_oauth":"failed_to_complete_link_with_oauth"});let r=Q.parse(n.url).queryParams;return{authorizationCode:(a=r==null?void 0:r.privy_oauth_code)!=null?a:null,state:(p=r==null?void 0:r.privy_oauth_state)!=null?p:null,resultUrl:n.url}})}var $=(u={})=>{var o=u,{action:t}=o,i=_chunkK5SPDXVFjs.d.call(void 0, o,["action"]);let{oAuthState:n,setOAuthState:r,client:a}=_react.useContext.call(void 0, _chunkHNRKZKAWjs.ka),p=_react.useRef.call(void 0, i);return _react.useEffect.call(void 0, ()=>{p.current=i},[i]),{start:_react.useCallback.call(void 0, function(Nt){return _chunkK5SPDXVFjs.e.call(void 0, this,arguments,function*({provider:c,redirectUri:d,isLegacyAppleIosBehaviorEnabled:G=!1,disableSignup:J,onAppleOAuthUserInfo:S}){var C,U,L,v;r({status:"loading"});let y=_chunkHNRKZKAWjs.b.call(void 0, ),g=t?t==="login":!!!y;try{if(y&&t==="login"&&!a.isMultiUserModeEnabled)throw new (0, _jssdkcore.PrivyClientError)({code:"attempted_login_with_oauth_while_already_logged_in",error:"Already logged in, if trying to link an OAuth account use `useLinkWithOAuth`"});if(!y&&t==="link")throw new (0, _jssdkcore.PrivyClientError)({code:"attempted_link_oauth_before_logged_in",error:"Must be logged in to link an OAuth account, use `useLoginWithOAuth`"});if(__DEV__&&d!=null&&d.includes("://")){let e=d.split("://")[0];console.warn(`redirectUri includes a scheme prefix (${e}://), it should be a path instead, such as '/authenticated'`)}let w=O.createURL(d||"/"),{url:s}=yield a.auth.oauth.generateURL(c,w);c==="twitter"&&(s=z(s));let h,b,A,f,I,k,_;if(_reactnative.Platform.OS==="ios"&&c==="apple"&&!G){let e=yield H({oauthProviderUrl:s,isLogin:g});A=e.authorizationCode,f=e.state,_=e,I="raw"}else{let e=yield V({oauthProviderUrl:s,isLogin:g,returnUrl:w});A=e.authorizationCode,f=e.state,k=e.resultUrl}if(!A||!f)throw new (0, _jssdkcore.PrivyClientError)({error:"OAuth invalid credentials",code:g?"login_with_oauth_returned_with_invalid_credentials":"link_with_oauth_returned_with_invalid_credentials"});if(g){let e=_chunkHNRKZKAWjs.a.call(void 0, ),x=yield a.auth.oauth.loginWithCode(A,f,c,I,J?"no-signup":"login-or-sign-up",{embedded:e==null?void 0:e.embedded});h=x.user,b=x.is_new_user}else({user:h}=yield a.auth.oauth.linkWithCode(A,f,c,I));return _&&S&&S({fullName:_.fullName,email:_.email}),(U=(C=p.current).onSuccess)==null||U.call(C,h,b),k&&(yield O.openURL(k.split("?")[0])),r({status:"done",isNewUser:b}),h!=null?h:void 0}catch(w){let s=_chunkHNRKZKAWjs.h.call(void 0, w);throw r({status:"error",error:s}),(v=(L=p.current).onError)==null||v.call(L,s),s}})},[a.auth.oauth,t,r]),state:n}};function Pt(t){let{state:i,start:u}=$(_chunkK5SPDXVFjs.c.call(void 0, _chunkK5SPDXVFjs.b.call(void 0, {},t),{action:"login"}));return{state:i,login:u}}exports.a = $; exports.b = Pt;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } }var _chunk23WNYVKLjs = require('./chunk-23WNYVKL.js');var _chunkK5SPDXVFjs = require('./chunk-K5SPDXVF.js');var _expolinking = require('expo-linking'); var O = _interopRequireWildcard(_expolinking); var Q = _interopRequireWildcard(_expolinking);var _react = require('react');var _reactnative = require('react-native');var _jssdkcore = require('@privy-io/js-sdk-core');function M(){return _chunkK5SPDXVFjs.e.call(void 0, this,null,function*(){_chunk23WNYVKLjs.g.call(void 0, "expo-apple-authentication");try{return yield Promise.resolve().then(() => _interopRequireWildcard(require("expo-apple-authentication")))}catch(t){throw new (0, _jssdkcore.PrivyClientError)({code:"configuration_error",error:"`expo-apple-authentication` is not installed. Install it and rebuild the native app."})}})}function H(u){return _chunkK5SPDXVFjs.e.call(void 0, this,arguments,function*({oauthProviderUrl:t,isLogin:i}){try{let o=yield M();return yield o.signInAsync({state:Y(t),requestedScopes:[o.AppleAuthenticationScope.EMAIL,o.AppleAuthenticationScope.FULL_NAME]})}catch(o){throw o instanceof Error&&"code"in o&&o.code==="ERR_REQUEST_CANCELED"?new (0, _jssdkcore.PrivyClientError)({error:"Apple login was cancelled",code:i?"login_with_oauth_was_cancelled_by_user":"link_with_oauth_was_cancelled_by_user"}):o}})}function Y(t){var u;return(u=new URL(t).searchParams.get("state"))!=null?u:""}function z(t){return _reactnative.Platform.select({android:t.replace("x.com","twitter.com"),default:t})}var _expowebbrowser = require('expo-web-browser'); var m = _interopRequireWildcard(_expowebbrowser);function V(o){return _chunkK5SPDXVFjs.e.call(void 0, this,arguments,function*({oauthProviderUrl:t,isLogin:i,returnUrl:u}){var a,p;let n=yield m.openAuthSessionAsync(t,u,{createTask:!1});if(n.type===m.WebBrowserResultType.CANCEL||n.type===m.WebBrowserResultType.DISMISS)throw new (0, _jssdkcore.PrivyClientError)({error:"OAuth was cancelled",code:i?"login_with_oauth_was_cancelled_by_user":"link_with_oauth_was_cancelled_by_user"});if(n.type!=="success")throw new (0, _jssdkcore.PrivyClientError)({error:"OAuth session failed",code:i?"failed_to_complete_login_with_oauth":"failed_to_complete_link_with_oauth"});let r=Q.parse(n.url).queryParams;return{authorizationCode:(a=r==null?void 0:r.privy_oauth_code)!=null?a:null,state:(p=r==null?void 0:r.privy_oauth_state)!=null?p:null,resultUrl:n.url}})}var $=(u={})=>{var o=u,{action:t}=o,i=_chunkK5SPDXVFjs.d.call(void 0, o,["action"]);let{oAuthState:n,setOAuthState:r,client:a}=_react.useContext.call(void 0, _chunk23WNYVKLjs.ka),p=_react.useRef.call(void 0, i);return _react.useEffect.call(void 0, ()=>{p.current=i},[i]),{start:_react.useCallback.call(void 0, function(Nt){return _chunkK5SPDXVFjs.e.call(void 0, this,arguments,function*({provider:c,redirectUri:d,isLegacyAppleIosBehaviorEnabled:G=!1,disableSignup:J,onAppleOAuthUserInfo:S}){var C,U,L,v;r({status:"loading"});let y=_chunk23WNYVKLjs.b.call(void 0, ),g=t?t==="login":!!!y;try{if(y&&t==="login"&&!a.isMultiUserModeEnabled)throw new (0, _jssdkcore.PrivyClientError)({code:"attempted_login_with_oauth_while_already_logged_in",error:"Already logged in, if trying to link an OAuth account use `useLinkWithOAuth`"});if(!y&&t==="link")throw new (0, _jssdkcore.PrivyClientError)({code:"attempted_link_oauth_before_logged_in",error:"Must be logged in to link an OAuth account, use `useLoginWithOAuth`"});if(__DEV__&&d!=null&&d.includes("://")){let e=d.split("://")[0];console.warn(`redirectUri includes a scheme prefix (${e}://), it should be a path instead, such as '/authenticated'`)}let w=O.createURL(d||"/"),{url:s}=yield a.auth.oauth.generateURL(c,w);c==="twitter"&&(s=z(s));let h,b,A,f,I,k,_;if(_reactnative.Platform.OS==="ios"&&c==="apple"&&!G){let e=yield H({oauthProviderUrl:s,isLogin:g});A=e.authorizationCode,f=e.state,_=e,I="raw"}else{let e=yield V({oauthProviderUrl:s,isLogin:g,returnUrl:w});A=e.authorizationCode,f=e.state,k=e.resultUrl}if(!A||!f)throw new (0, _jssdkcore.PrivyClientError)({error:"OAuth invalid credentials",code:g?"login_with_oauth_returned_with_invalid_credentials":"link_with_oauth_returned_with_invalid_credentials"});if(g){let e=_chunk23WNYVKLjs.a.call(void 0, ),x=yield a.auth.oauth.loginWithCode(A,f,c,I,J?"no-signup":"login-or-sign-up",{embedded:e==null?void 0:e.embedded});h=x.user,b=x.is_new_user}else({user:h}=yield a.auth.oauth.linkWithCode(A,f,c,I));return _&&S&&S({fullName:_.fullName,email:_.email}),(U=(C=p.current).onSuccess)==null||U.call(C,h,b),k&&(yield O.openURL(k.split("?")[0])),r({status:"done",isNewUser:b}),h!=null?h:void 0}catch(w){let s=_chunk23WNYVKLjs.h.call(void 0, w);throw r({status:"error",error:s}),(v=(L=p.current).onError)==null||v.call(L,s),s}})},[a.auth.oauth,t,r]),state:n}};function Pt(t){let{state:i,start:u}=$(_chunkK5SPDXVFjs.c.call(void 0, _chunkK5SPDXVFjs.b.call(void 0, {},t),{action:"login"}));return{state:i,login:u}}exports.a = $; exports.b = Pt;
package/dist/esm/cards.js CHANGED
@@ -1 +1,65 @@
1
- import{B as De,H as fe,J as xe,L as Le,N as Ue,P as i,Q as Se,R as he,S as Ae,T as ee,V as Me,a as ze,b as h,c as R,e as Ie,g as Ve,i as Pe}from"./chunk-KPLYSDTS.js";import{m as L}from"./chunk-HNRKZKAW.js";import{b as ae,c as ke,e as M}from"./chunk-K5SPDXVF.js";import{useMemo as nr}from"react";import{listCards as ir}from"@privy-io/js-sdk-core";var ar=()=>{let e=L();return nr(()=>({getCardsForUser:o=>ir(e,o)}),[e])};import{useCallback as Ee,useMemo as sr}from"react";import{getSpendApproval as lr,handleSignUpClose as dr}from"@privy-io/js-sdk-core";var cr=()=>{let e=L(),o=ee(t=>t!==null),r=Ee(t=>M(void 0,null,function*(){var b;if(Le(),ee.getState())throw new xe("existing_ui_flow_in_progress","Card sign-up is already in progress");let f=t.environment==="production"?t.spendApproval:void 0;if(((b=lr(t.chainId,f))==null?void 0:b.kind)!=="evm")throw new xe("chain_not_supported",`Card spending is not supported on ${t.chainId}`);let s={environment:t.environment,chainId:t.chainId,asset:t.asset},d=new AbortController,y=n=>{let g=ee.getState();if((g==null?void 0:g.controller)!==d)return!1;let x=g.step.status;return Me(),e.track({name:"sdk_card_signup_closed",properties:ae(ke(ae({},s),{status:x}),n?{cardId:n}:{})}),!0};return yield new Promise((n,g)=>{ee.setState({options:t,step:{status:"loading"},controller:d,onSuccess:x=>{y(x.id)&&n(x)},onFailure:x=>{y()&&g(x)}}),e.track({name:"sdk_card_signup_started",properties:s})})}),[e]),u=Ee(()=>{let t=ee.getState();t&&dr({step:t.step,onSuccess:t.onSuccess,onFailure:t.onFailure})},[]);return sr(()=>({signUp:r,close:u,isOpen:o}),[r,u,o])};import a,{useEffect as Yr,useState as ue}from"react";import{FlatList as Jr,Pressable as Qr,StyleSheet as Xr,Text as q,View as O}from"react-native";import{getCardAssetDisplayName as Zr,isCardExpired as Rr,replaceCard as et,updateCardStatus as rr}from"@privy-io/js-sdk-core";import w from"react";import{ActivityIndicator as ur,Pressable as we,StyleSheet as mr,Text as W,View as se}from"react-native";import{formatSignedTransactionAmount as pr,formatTransactionDate as fr,getTransactionBadge as gr}from"@privy-io/js-sdk-core";var yr={credit:{label:"Credit",tone:"success"},pending:{label:"Pending",tone:"neutral"},declined:{label:"Declined",tone:"error"},expired:{label:"Expired",tone:"neutral"},reversed:{label:"Reversed",tone:"neutral"}};function He({transaction:e,onPress:o}){let{colors:r}=h(),{text:u,isCredit:t}=pr(e),f=gr(e),s=f?yr[f]:null,d=(s==null?void 0:s.tone)==="success"?r.success:(s==null?void 0:s.tone)==="error"?r.error:r.textMuted;return w.createElement(we,{onPress:()=>o(e),accessibilityRole:"button",style:z.row},w.createElement(se,{style:[z.merchantIcon,{backgroundColor:r.backgroundSecondary}]},w.createElement(fe,{size:16,color:r.iconSubtle})),w.createElement(se,{style:z.text},w.createElement(W,{numberOfLines:1,style:[z.merchant,{color:r.text}]},e.merchant.name),w.createElement(W,{style:[z.date,{color:r.textMuted}]},fr({unixSeconds:e.created}))),s?w.createElement(W,{style:[z.badge,{color:d,backgroundColor:r.backgroundSecondary}]},s.label):null,w.createElement(W,{style:[z.amount,{color:t?r.success:r.text}]},u))}function Be({hasMore:e,isLoadingMore:o,loadMoreError:r,onLoadMore:u}){let{colors:t}=h();return r?w.createElement(se,{style:z.loaderRow},w.createElement(W,{style:[z.date,{color:t.error}]},r),w.createElement(we,{onPress:u,accessibilityRole:"button"},w.createElement(W,{style:[z.retry,{color:t.interactive}]},"Try again"))):o?w.createElement(se,{style:z.loaderRow},w.createElement(ur,{color:t.iconSubtle})):e?w.createElement(se,{style:z.loaderRow},w.createElement(we,{onPress:u,accessibilityRole:"button"},w.createElement(W,{style:[z.retry,{color:t.interactive}]},"Load more"))):null}var z=mr.create({row:{flexDirection:"row",alignItems:"center",gap:12,paddingVertical:10},merchantIcon:{width:36,height:36,borderRadius:18,alignItems:"center",justifyContent:"center"},text:{flex:1,gap:2},merchant:{fontFamily:i.medium,fontSize:14,lineHeight:20},date:{fontFamily:i.regular,fontSize:12,lineHeight:18},badge:{fontFamily:i.medium,fontSize:12,lineHeight:18,paddingHorizontal:8,paddingVertical:2,borderRadius:6,overflow:"hidden"},amount:{fontFamily:i.medium,fontSize:14,lineHeight:20},loaderRow:{alignItems:"center",gap:8,paddingVertical:16},retry:{fontFamily:i.medium,fontSize:14}});import I from"react";import{ActivityIndicator as br,Pressable as Cr,StyleSheet as xr,Text as le,View as de}from"react-native";var Sr=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD"});function _e(e){if(e===null)return"\u2014";let o=Number(e);return Number.isFinite(o)?Sr.format(o):e}function Ne({isLoading:e,balance:o,assetSymbol:r,cardTitle:u,last4:t,cardColor:f,onViewDetails:s}){let{colors:d}=h();return I.createElement(de,{style:[U.container,{borderColor:d.border}]},I.createElement(de,{style:U.balance},I.createElement(le,{style:[U.label,{color:d.textMuted}]},"Spending balance"),e?I.createElement(br,{style:U.amountLoader,color:d.iconSubtle}):I.createElement(le,{style:[U.amount,{color:d.textTitle}]},o),r&&!e?I.createElement(le,{style:[U.asset,{color:d.text,backgroundColor:d.backgroundSecondary}]},r):null),I.createElement(de,{style:[U.divider,{backgroundColor:d.border}]}),I.createElement(Cr,{onPress:s,disabled:!s,accessibilityRole:s?"button":void 0,style:U.cardRow},I.createElement(de,{style:[U.thumbnail,{backgroundColor:f}]}),I.createElement(de,{style:U.cardText},I.createElement(le,{style:[U.cardTitle,{color:d.text}]},u),t?I.createElement(le,{style:[U.last4,{color:d.textMuted}]},"****",t):null),s?I.createElement(Pe,{size:20,color:d.iconSubtle}):null))}var U=xr.create({container:{borderWidth:1,borderRadius:16},balance:{alignItems:"center",gap:4,paddingVertical:24},label:{fontFamily:i.medium,fontSize:14,lineHeight:20},amount:{fontFamily:i.semibold,fontSize:36,lineHeight:44},amountLoader:{height:44},asset:{fontFamily:i.medium,fontSize:12,lineHeight:18,paddingHorizontal:8,paddingVertical:2,borderRadius:999,overflow:"hidden"},divider:{height:1},cardRow:{flexDirection:"row",alignItems:"center",gap:12,padding:16},thumbnail:{width:40,height:26,borderRadius:4},cardText:{flex:1,gap:2},cardTitle:{fontFamily:i.medium,fontSize:14,lineHeight:20},last4:{fontFamily:i.regular,fontSize:13,lineHeight:18}});import l,{useState as Tr}from"react";import{Pressable as je,ScrollView as vr,StyleSheet as Fr,Switch as kr,Text as A,View as H}from"react-native";import B from"react";import{Modal as hr,StyleSheet as wr,Text as Oe,View as Te}from"react-native";function ge({visible:e,title:o,description:r,confirmLabel:u,confirmDisabled:t=!1,dismissLabel:f="Never mind",destructive:s=!1,onConfirm:d,onDismiss:y,children:b}){let{colors:n}=h();return B.createElement(hr,{transparent:!0,animationType:"fade",visible:e,onRequestClose:y},B.createElement(Te,{style:re.backdrop},B.createElement(Te,{style:[re.dialog,{backgroundColor:n.background}]},B.createElement(Oe,{style:[re.title,{color:n.textTitle}]},o),r?B.createElement(Oe,{style:[re.description,{color:n.text}]},r):null,b,B.createElement(Te,{style:re.actions},B.createElement(R,{title:u,destroy:s,disabled:t,style:t?re.confirmDisabled:void 0,onPress:d}),B.createElement(R,{variant:"tertiary",title:f,onPress:y})))))}var re=wr.create({backdrop:{flex:1,justifyContent:"center",padding:24,backgroundColor:"rgba(0, 0, 0, 0.4)"},dialog:{gap:12,padding:24,borderRadius:16},title:{fontFamily:i.semibold,fontSize:18,lineHeight:24},description:{fontFamily:i.regular,fontSize:16,lineHeight:24},confirmDisabled:{opacity:.4},actions:{gap:4,marginTop:8}});var zr=[{value:"lost",label:"Lost"},{value:"stolen",label:"Stolen"},{value:"expired",label:"Expired"}];function Ge({card:e,cardColor:o,frozen:r,canceled:u,busy:t,expired:f,onToggleFreeze:s,onCancel:d,onReplace:y}){let{colors:b}=h(),[n,g]=Tr({kind:"none"}),x=()=>g({kind:"none"});return l.createElement(vr,{contentContainerStyle:p.container},l.createElement(Ir,{card:e,cardColor:o,frozen:r,canceled:u}),l.createElement(H,{style:p.tiles},l.createElement($e,{Icon:De,label:"Replace",disabled:u||t,onPress:()=>g({kind:"replace-reason",reason:f?"expired":null})}),l.createElement($e,{Icon:Ie,label:"Cancel",disabled:u||t,onPress:()=>g({kind:"cancel"})})),l.createElement(H,{style:[p.freezeRow,{borderColor:b.border}]},l.createElement(H,{style:p.freezeText},l.createElement(A,{style:[p.rowTitle,{color:b.text}]},"Freeze Card"),l.createElement(A,{style:[p.rowSubtitle,{color:b.textMuted}]},"Temporarily disable your card")),l.createElement(kr,{accessibilityLabel:"Freeze Card",value:r,disabled:u||t,onValueChange:T=>g({kind:"freeze",next:T})})),l.createElement(ge,{visible:n.kind==="freeze",title:n.kind==="freeze"&&!n.next?"Unfreeze this card?":"Freeze this card?",description:n.kind==="freeze"&&!n.next?"This will instantly unfreeze the current card.":"This will instantly freeze the current card.",confirmLabel:n.kind==="freeze"&&!n.next?"Unfreeze card":"Freeze card",onConfirm:()=>{n.kind==="freeze"&&s(n.next),x()},onDismiss:x}),l.createElement(ge,{visible:n.kind==="cancel",title:"Cancel this card?",description:"This will instantly cancel the current card.",confirmLabel:"Cancel card",destructive:!0,onConfirm:()=>{d(),x()},onDismiss:x}),l.createElement(ge,{visible:n.kind==="replace-reason"||n.kind==="replace-warn",title:n.kind==="replace-warn"?"Replace this card?":"Why are you replacing your card?",description:n.kind==="replace-warn"?"This will instantly close the current card and issue a new one.":void 0,confirmLabel:n.kind==="replace-warn"?"Replace":"Continue",confirmDisabled:n.kind==="replace-reason"&&n.reason===null,dismissLabel:"Back",destructive:n.kind==="replace-warn",onConfirm:()=>{n.kind==="replace-reason"&&n.reason?g({kind:"replace-warn",reason:n.reason}):n.kind==="replace-warn"&&(y(n.reason),x())},onDismiss:()=>{n.kind==="replace-warn"?g({kind:"replace-reason",reason:n.reason}):x()}},n.kind==="replace-reason"?zr.map(({value:T,label:K})=>{let V=n.reason===T;return l.createElement(je,{key:T,accessibilityRole:"radio",accessibilityState:{checked:V},onPress:()=>g({kind:"replace-reason",reason:T}),style:[p.reason,{borderColor:V?b.interactive:b.border}]},l.createElement(A,{style:[p.rowTitle,{color:b.text}]},K),V?l.createElement(Ve,{size:18,color:b.interactive}):null)}):null))}function Ir({card:e,cardColor:o,frozen:r,canceled:u}){var s,d,y;let t=e.exp_month&&e.exp_year?`${String(e.exp_month).padStart(2,"0")}/${String(e.exp_year).slice(-2)}`:null,f=u?"Cancelled":r?"Frozen":null;return l.createElement(H,{style:[p.face,{backgroundColor:o},f?p.faceDimmed:null]},l.createElement(H,{style:p.faceTop},f?l.createElement(A,{style:p.faceBadge},f):l.createElement(H,null)),l.createElement(A,{accessibilityLabel:e.last4?`Card ending in ${e.last4}`:void 0,style:p.faceNumber},"\u2022\u2022\u2022\u2022 ",(s=e.last4)!=null?s:"0000"),l.createElement(H,{style:p.faceBottom},l.createElement(H,{style:p.faceField},l.createElement(A,{style:p.faceLabel},"Cardholder"),l.createElement(A,{style:p.faceValue},(d=e.cardholder.name)!=null?d:"")),t?l.createElement(H,{style:p.faceField},l.createElement(A,{style:p.faceLabel},"Valid thru"),l.createElement(A,{style:p.faceValue},t)):null,((y=e.brand)==null?void 0:y.toLowerCase())==="visa"?l.createElement(A,{style:p.faceBrand},"VISA"):null))}function $e({Icon:e,label:o,disabled:r,onPress:u}){let{colors:t}=h();return l.createElement(je,{accessibilityRole:"button",accessibilityState:{disabled:r},disabled:r,onPress:u,style:[p.tile,{backgroundColor:t.backgroundSecondary},r?p.tileDisabled:null]},l.createElement(e,{size:20,color:t.icon}),l.createElement(A,{style:[p.tileLabel,{color:t.text}]},o))}var p=Fr.create({container:{gap:16,padding:16},face:{aspectRatio:1.586,borderRadius:16,padding:20,justifyContent:"space-between"},faceDimmed:{opacity:.6},faceTop:{flexDirection:"row",justifyContent:"flex-end"},faceBadge:{fontFamily:i.semibold,fontSize:12,color:"#FFFFFF",backgroundColor:"rgba(0, 0, 0, 0.35)",paddingHorizontal:10,paddingVertical:4,borderRadius:999,overflow:"hidden"},faceNumber:{fontFamily:i.semibold,fontSize:20,letterSpacing:2,color:"#FFFFFF"},faceBottom:{flexDirection:"row",alignItems:"flex-end",gap:24},faceField:{gap:2},faceLabel:{fontFamily:i.regular,fontSize:10,color:"rgba(255, 255, 255, 0.75)"},faceValue:{fontFamily:i.medium,fontSize:14,color:"#FFFFFF"},faceBrand:{marginLeft:"auto",fontFamily:i.semibold,fontSize:20,fontStyle:"italic",color:"#FFFFFF"},tiles:{flexDirection:"row",gap:12},tile:{flex:1,alignItems:"center",gap:6,paddingVertical:14,borderRadius:12},tileDisabled:{opacity:.4},tileLabel:{fontFamily:i.medium,fontSize:14},freezeRow:{flexDirection:"row",alignItems:"center",gap:12,padding:16,borderWidth:1,borderRadius:12},freezeText:{flex:1,gap:2},rowTitle:{fontFamily:i.medium,fontSize:16,lineHeight:22},rowSubtitle:{fontFamily:i.regular,fontSize:13,lineHeight:18},reason:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",padding:14,borderWidth:1,borderRadius:12}});import We from"react";import{StyleSheet as Vr,Text as Pr,View as Dr}from"react-native";import{getCardDisclosure as Lr}from"@privy-io/js-sdk-core";function Ke(){let{colors:e}=h(),o=L().app.getConfig(),r=(o==null?void 0:o.legal_name)||(o==null?void 0:o.name)||"This app";return We.createElement(Dr,{style:[qe.container,{backgroundColor:e.backgroundSecondary}]},We.createElement(Pr,{style:[qe.text,{color:e.textMuted}]},Lr(r)))}var qe=Vr.create({container:{padding:16,borderRadius:12},text:{fontFamily:i.regular,fontSize:12,lineHeight:18}});import C,{useState as Ur}from"react";import{Linking as Ar,Modal as Mr,Pressable as Er,ScrollView as Hr,StyleSheet as Br,Text as _,View as te}from"react-native";import{formatSignedTransactionAmount as _r,formatTransactionDate as Nr,formatUsdAmount as Ye}from"@privy-io/js-sdk-core";var Je="+1 (855) 935-3124",Or={pending:"Pending",posted:"Posted",declined:"Declined",expired:"Expired",reversed:"Reversed"},$r={expired:"Dispute expired",lost:"Dispute lost",submitted:"Dispute submitted",unsubmitted:"Dispute unsubmitted",won:"Dispute won"};function jr(e){return`tel:${e.trimStart().startsWith("+")?"+":""}${e.replace(/\D/g,"")}`}function Qe({transaction:e,cardLast4:o}){let{colors:r}=h(),[u,t]=Ur(!1),{text:f,isCredit:s}=_r(e),d=s?r.success:r.textTitle,y=e.status==="posted"?r.success:e.status==="declined"?r.error:r.textMuted,b=[{label:"Amount",value:f,color:d},{label:"ATM Fee",value:Ye(0)},{label:"Cashback",value:Ye(0)},{label:"Currency",value:e.currency.toUpperCase()},{label:"Status",value:Or[e.status],color:y},{label:"Dispute",value:e.dispute?$r[e.dispute.status]:"None"},{label:"Merchant",value:e.merchant.name},{label:"From",value:o?`\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 ${o}`:null,accessibilityLabel:o?`Card ending in ${o}`:void 0},{label:"Date created",value:Nr({unixSeconds:e.created})}];return C.createElement(Hr,{contentContainerStyle:v.container},C.createElement(te,{style:v.summary},C.createElement(te,{style:[v.merchantIcon,{backgroundColor:r.backgroundSecondary}]},C.createElement(fe,{size:24,color:r.iconSubtle})),C.createElement(_,{style:[v.amountHeading,{color:d}]},f),C.createElement(_,{style:[v.subheader,{color:r.textMuted}]},`Card payment to ${e.merchant.name}`)),C.createElement(te,{style:v.details},C.createElement(_,{style:[v.detailsHeading,{color:r.textTitle}]},"Details"),b.filter(n=>n.value!==null).map(n=>{var g;return C.createElement(te,{key:n.label,style:v.detailRow},C.createElement(_,{style:[v.detailLabel,{color:r.textMuted}]},n.label),C.createElement(_,{accessibilityLabel:n.accessibilityLabel,style:[v.detailValue,{color:(g=n.color)!=null?g:r.text}]},n.value))})),C.createElement(R,{variant:"secondary",title:"Dispute transaction",style:v.centeredButton,onPress:()=>t(!0)}),C.createElement(Mr,{transparent:!0,animationType:"fade",visible:u,onRequestClose:()=>t(!1)},C.createElement(te,{style:v.backdrop},C.createElement(te,{style:[v.dialog,{backgroundColor:r.background}]},C.createElement(_,{style:[v.detailsHeading,{color:r.textTitle}]},"Dispute this transaction"),C.createElement(_,{style:[v.dialogBody,{color:r.text}]},"To dispute this transaction, call the number below and our support team will help you."),C.createElement(Er,{accessibilityRole:"link",onPress:()=>void Ar.openURL(jr(Je))},C.createElement(_,{style:[v.phone,{color:r.interactive}]},Je)),C.createElement(R,{title:"Done",onPress:()=>t(!1)})))))}var v=Br.create({container:{gap:24,padding:24},summary:{alignItems:"center",gap:4},merchantIcon:{width:56,height:56,borderRadius:28,alignItems:"center",justifyContent:"center",marginBottom:8},amountHeading:{fontFamily:i.semibold,fontSize:28,lineHeight:36},subheader:{fontFamily:i.regular,fontSize:14,lineHeight:20,textAlign:"center"},details:{gap:12},detailsHeading:{fontFamily:i.semibold,fontSize:18,lineHeight:24},detailRow:{flexDirection:"row",justifyContent:"space-between",gap:16},detailLabel:{fontFamily:i.regular,fontSize:14,lineHeight:20},detailValue:{flexShrink:1,fontFamily:i.medium,fontSize:14,lineHeight:20,textAlign:"right"},centeredButton:{justifyContent:"center"},backdrop:{flex:1,justifyContent:"center",padding:24,backgroundColor:"rgba(0, 0, 0, 0.4)"},dialog:{gap:16,padding:24,borderRadius:16},dialogBody:{fontFamily:i.regular,fontSize:16,lineHeight:24},phone:{fontFamily:i.semibold,fontSize:16,lineHeight:24}});import{useCallback as oe,useEffect as Gr,useRef as ce,useState as N}from"react";import{getCardById as Wr,listCardTransactions as Xe,toTransactionRow as qr}from"@privy-io/js-sdk-core";var Ze=25;function Re({cardId:e,environment:o}){let r=L(),[u,t]=N(null),[f,s]=N(!0),[d,y]=N(void 0),[b,n]=N([]),[g,x]=N(!0),[T,K]=N(!1),[V,c]=N(!1),[ye,$]=N(void 0),ne=ce(null),Y=ce(!1),j=ce(null),J=ce(0),Q=ce(!1),X=oe(m=>{ne.current=m.next_cursor,Y.current=!0,n(S=>{let P=new Set(S.map(D=>D.id));return[...S,...m.data.filter(D=>!P.has(D.id)).map(D=>qr({transaction:D,unknownMerchantName:"Unknown merchant"}))]}),K(m.next_cursor!==null)},[]),Z=oe(m=>M(this,null,function*(){s(!0),y(void 0);try{let S=yield Wr(r,{cardId:e,environment:o});if(m.aborted)return;t(S),S||y("Could not load this card.")}catch(S){m.aborted||y("Could not load this card.")}finally{m.aborted||s(!1)}}),[r,e,o]),E=oe(m=>M(this,null,function*(){let S=++J.current,P=()=>!m.aborted&&S===J.current;x(!0),$(void 0),ne.current=null,Y.current=!1,n([]);try{let D=yield Xe(r,{cardId:e,environment:o,limit:Ze});if(!P())return;X(D)}catch(D){if(!P())return;K(!0),$("Could not load transactions.")}finally{P()&&x(!1)}}),[r,e,o,X]),me=oe(()=>M(this,null,function*(){let m=j.current;if(!m||m.signal.aborted)return;let{signal:S}=m;if(!Y.current){yield E(S);return}let P=ne.current;if(P===null||Q.current)return;let D=J.current,pe=()=>!S.aborted&&D===J.current;Q.current=!0,c(!0),$(void 0);try{let ie=yield Xe(r,{cardId:e,environment:o,limit:Ze,cursor:P});if(!pe())return;X(ie)}catch(ie){pe()&&$("Could not load transactions.")}finally{Q.current=!1,S.aborted||c(!1)}}),[r,e,o,X,E]),be=oe(()=>{let m=j.current;!m||m.signal.aborted||(Z(m.signal),E(m.signal))},[Z,E]),Ce=oe(m=>{var S;(S=j.current)!=null&&S.signal.aborted||t(m)},[]);return Gr(()=>{let m=new AbortController;return j.current=m,Z(m.signal),E(m.signal),()=>m.abort()},[Z,E]),{card:u,isCardLoading:f,cardError:d,transactions:b,isLoadingTransactions:g,hasMore:T,isLoadingMore:V,loadMoreError:ye,loadMore:me,retry:be,applyCard:Ce}}import{useEffect as Kr}from"react";var er=({cardId:e,environment:o})=>{let r=L();Kr(()=>{r.track({name:"sdk_card_summary_view_loaded",properties:{cardId:e,environment:o}})},[r,e,o])};var rt=e=>{let o=Ue();return a.createElement(ze,{appearance:o},a.createElement(tt,ae({key:`${e.environment}:${e.cardId}`},e)))};function tt({cardId:e,environment:o,onClose:r,onReplaced:u}){var ie,ve,Fe;let{colors:t}=h(),f=L();er({cardId:e,environment:o});let[s,d]=ue({kind:"summary"}),[y,b]=ue(!1),[n,g]=ue(!1),[x,T]=ue(null),[K,V]=ue(!1),{card:c,isCardLoading:ye,cardError:$,transactions:ne,isLoadingTransactions:Y,hasMore:j,isLoadingMore:J,loadMoreError:Q,loadMore:X,retry:Z,applyCard:E}=Re({cardId:e,environment:o}),me=n||(c==null?void 0:c.status)==="canceled";Yr(()=>{c&&b(c.status==="inactive")},[c]);let be=k=>M(this,null,function*(){let G=y;b(k),T(null),V(!0);try{E(yield rr(f,{cardId:e,environment:o,status:k?"inactive":"active"}))}catch(or){b(G),T("Could not update this card. Please try again."),console.error("[privy] Failed to update the card freeze state",or)}finally{V(!1)}}),Ce=()=>M(this,null,function*(){T(null),V(!0);try{E(yield rr(f,{cardId:e,environment:o,status:"canceled"})),g(!0)}catch(k){T("Could not cancel this card. Please try again."),console.error("[privy] Failed to cancel the card",k)}finally{V(!1)}}),m=k=>M(this,null,function*(){T(null),V(!0);try{let G=yield et(f,{cardId:e,environment:o,reason:k});g(!0),u==null||u(G.id)}catch(G){T("Could not replace this card. Please try again."),console.error("[privy] Failed to replace the card",G)}finally{V(!1)}}),S=me?a.createElement(tr,null,"This card has been cancelled"):y?a.createElement(tr,null,"This card is frozen"):null,P=a.createElement(a.Fragment,null,a.createElement(Ae,{goBack:s.kind==="summary"?void 0:()=>{T(null),d({kind:"summary"})},close:r}),o==="sandbox"?a.createElement(O,{style:F.banner},a.createElement(Se,{variant:"info"},a.createElement(he,null,"In sandbox mode using test funds"))):null);if(s.kind==="transaction")return a.createElement(O,{style:[F.screen,{backgroundColor:t.background}]},P,a.createElement(Qe,{transaction:s.transaction,cardLast4:(ie=c==null?void 0:c.last4)!=null?ie:null}));if(s.kind==="details"&&c)return a.createElement(O,{style:[F.screen,{backgroundColor:t.background}]},P,a.createElement(O,{style:F.detailsHeader},a.createElement(q,{style:[F.heading,{color:t.textTitle}]},"Your Card"),S,x?a.createElement(q,{accessibilityRole:"alert",style:[F.errorText,{color:t.error}]},x):null),a.createElement(Ge,{card:c,cardColor:t.interactive,frozen:y,canceled:me,busy:K,expired:Rr(c),onToggleFreeze:k=>void be(k),onCancel:()=>void Ce(),onReplace:k=>void m(k)}));let D=Zr(c==null?void 0:c.asset),pe=a.createElement(O,{style:F.sections},a.createElement(q,{style:[F.heading,{color:t.textTitle}]},"Wallet"),S,$?a.createElement(O,{style:[F.errorRow,{backgroundColor:t.backgroundSecondary}]},a.createElement(q,{style:[F.errorText,{color:t.error}]},$),a.createElement(Qr,{onPress:Z,accessibilityRole:"button"},a.createElement(q,{style:[F.retry,{color:t.interactive}]},"Try again"))):a.createElement(Ne,{isLoading:ye,balance:_e((ve=c==null?void 0:c.balance_formatted)!=null?ve:null),assetSymbol:D,cardTitle:c!=null&&c.brand?`${c.brand} debit card`:"Debit card",last4:(Fe=c==null?void 0:c.last4)!=null?Fe:void 0,cardColor:t.interactive,onViewDetails:c?()=>{T(null),d({kind:"details"})}:void 0}),a.createElement(q,{style:[F.heading,{color:t.textTitle}]},"Transactions"));return a.createElement(O,{style:[F.screen,{backgroundColor:t.background}]},P,a.createElement(Jr,{data:ne,keyExtractor:k=>k.id,renderItem:({item:k})=>a.createElement(He,{transaction:k,onPress:G=>d({kind:"transaction",transaction:G})}),ListHeaderComponent:pe,ListEmptyComponent:Y||Q||j?null:a.createElement(q,{style:[F.empty,{color:t.textMuted}]},"No transactions found"),ListFooterComponent:a.createElement(O,{style:F.footer},a.createElement(Be,{hasMore:j,isLoadingMore:J||Y,loadMoreError:Q,onLoadMore:()=>void X()}),a.createElement(Ke,null)),contentContainerStyle:F.list}))}function tr({children:e}){let{colors:o}=h();return a.createElement(Se,{style:{backgroundColor:o.backgroundHighlight}},a.createElement(he,{style:{color:o.textHighlight}},e))}var F=Xr.create({screen:{flex:1},banner:{paddingHorizontal:16},detailsHeader:{gap:12,paddingHorizontal:16},list:{padding:16},sections:{gap:12,marginBottom:4},heading:{fontFamily:i.semibold,fontSize:20,lineHeight:24,marginTop:12},errorRow:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:12,padding:16,borderRadius:12},errorText:{flex:1,fontFamily:i.regular,fontSize:14},retry:{fontFamily:i.medium,fontSize:14},empty:{fontFamily:i.regular,fontSize:14,paddingVertical:16,textAlign:"center"},footer:{gap:24,marginTop:8}});export{rt as CardSummaryView,ar as useGetCardsForUser,cr as useSignUpForCard};
1
+ import{D as qe,J as he,L as ke,N as Ye,P as Je,R as i,S as Ie,T as Fe,U as Ze,V as Xe,X as ie,Z as Qe,a as $e,b as I,c as oe,e as Oe,g as je,i as Ke,s as Ge,t as We}from"./chunk-JIZ4JSW7.js";import{m as E}from"./chunk-23WNYVKL.js";import{b as ce,c as Re,e as K}from"./chunk-K5SPDXVF.js";import{useMemo as _r}from"react";import{listCards as Mr}from"@privy-io/js-sdk-core";var Ur=()=>{let e=E();return _r(()=>({getCardsForUser:r=>Mr(e,r)}),[e])};import{useCallback as er,useMemo as Hr}from"react";import{getSpendApproval as Nr,handleSignUpClose as Br}from"@privy-io/js-sdk-core";var Rr=()=>{let e=E(),r=ie(n=>n!==null),t=er(n=>K(void 0,null,function*(){var g;if(Ye(),ie.getState())throw new ke("existing_ui_flow_in_progress","Card sign-up is already in progress");let f=n.environment==="production"?n.spendApproval:void 0;if(((g=Nr(n.chainId,f))==null?void 0:g.kind)!=="evm")throw new ke("chain_not_supported",`Card spending is not supported on ${n.chainId}`);let d={environment:n.environment,chainId:n.chainId,asset:n.asset},a=new AbortController,l=m=>{let v=ie.getState();if((v==null?void 0:v.controller)!==a)return!1;let S=v.step.status;return Qe(),e.track({name:"sdk_card_signup_closed",properties:ce(Re(ce({},d),{status:S}),m?{cardId:m}:{})}),!0};return yield new Promise((m,v)=>{ie.setState({options:n,step:{status:"loading"},controller:a,onSuccess:S=>{l(S.id)&&m(S)},onFailure:S=>{l()&&v(S)}}),e.track({name:"sdk_card_signup_started",properties:d})})}),[e]),s=er(()=>{let n=ie.getState();n&&Br({step:n.step,onSuccess:n.onSuccess,onFailure:n.onFailure})},[]);return Hr(()=>({signUp:t,close:s,isOpen:r}),[t,s,r])};import p,{useEffect as Ar,useState as de}from"react";import{FlatList as jt,Pressable as Kt,StyleSheet as Gt,Text as te,View as Q}from"react-native";import{getCardAssetDisplayName as Wt,getCardsConfig as qt,isCardExpired as Yt,replaceCard as Jt,updateCardStatus as Vr}from"@privy-io/js-sdk-core";import F from"react";import{ActivityIndicator as $r,Pressable as Ee,StyleSheet as Or,Text as re,View as ue}from"react-native";import{formatSignedTransactionAmount as jr,formatTransactionDate as Kr,getTransactionBadge as Gr}from"@privy-io/js-sdk-core";var Wr={credit:{label:"Credit",tone:"success"},pending:{label:"Pending",tone:"neutral"},declined:{label:"Declined",tone:"error"},expired:{label:"Expired",tone:"neutral"},reversed:{label:"Reversed",tone:"neutral"}};function rr({transaction:e,onPress:r}){let{colors:t}=I(),{text:s,isCredit:n}=jr(e),f=Gr(e),d=f?Wr[f]:null,a=(d==null?void 0:d.tone)==="success"?t.success:(d==null?void 0:d.tone)==="error"?t.error:t.textMuted;return F.createElement(Ee,{onPress:()=>r(e),accessibilityRole:"button",style:M.row},F.createElement(ue,{style:[M.merchantIcon,{backgroundColor:t.backgroundSecondary}]},F.createElement(he,{size:16,color:t.iconSubtle})),F.createElement(ue,{style:M.text},F.createElement(re,{numberOfLines:1,style:[M.merchant,{color:t.text}]},e.merchant.name),F.createElement(re,{style:[M.date,{color:t.textMuted}]},Kr({unixSeconds:e.created}))),d?F.createElement(re,{style:[M.badge,{color:a,backgroundColor:t.backgroundSecondary}]},d.label):null,F.createElement(re,{style:[M.amount,{color:n?t.success:t.text}]},s))}function tr({hasMore:e,isLoadingMore:r,loadMoreError:t,onLoadMore:s}){let{colors:n}=I();return t?F.createElement(ue,{style:M.loaderRow},F.createElement(re,{style:[M.date,{color:n.error}]},t),F.createElement(Ee,{onPress:s,accessibilityRole:"button"},F.createElement(re,{style:[M.retry,{color:n.interactive}]},"Try again"))):r?F.createElement(ue,{style:M.loaderRow},F.createElement($r,{color:n.iconSubtle})):e?F.createElement(ue,{style:M.loaderRow},F.createElement(Ee,{onPress:s,accessibilityRole:"button"},F.createElement(re,{style:[M.retry,{color:n.interactive}]},"Load more"))):null}var M=Or.create({row:{flexDirection:"row",alignItems:"center",gap:12,paddingVertical:10},merchantIcon:{width:36,height:36,borderRadius:18,alignItems:"center",justifyContent:"center"},text:{flex:1,gap:2},merchant:{fontFamily:i.medium,fontSize:14,lineHeight:20},date:{fontFamily:i.regular,fontSize:12,lineHeight:18},badge:{fontFamily:i.medium,fontSize:12,lineHeight:18,paddingHorizontal:8,paddingVertical:2,borderRadius:6,overflow:"hidden"},amount:{fontFamily:i.medium,fontSize:14,lineHeight:20},loaderRow:{alignItems:"center",gap:8,paddingVertical:16},retry:{fontFamily:i.medium,fontSize:14}});import U from"react";import{ActivityIndicator as qr,Pressable as Yr,StyleSheet as Jr,Text as pe,View as me}from"react-native";var Zr=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD"});function nr(e){if(e===null)return"\u2014";let r=Number(e);return Number.isFinite(r)?Zr.format(r):e}function or({isLoading:e,balance:r,assetSymbol:t,cardTitle:s,last4:n,cardColor:f,onViewDetails:d}){let{colors:a}=I();return U.createElement(me,{style:[H.container,{borderColor:a.border}]},U.createElement(me,{style:H.balance},U.createElement(pe,{style:[H.label,{color:a.textMuted}]},"Spending balance"),e?U.createElement(qr,{style:H.amountLoader,color:a.iconSubtle}):U.createElement(pe,{style:[H.amount,{color:a.textTitle}]},r),t&&!e?U.createElement(pe,{style:[H.asset,{color:a.text,backgroundColor:a.backgroundSecondary}]},t):null),U.createElement(me,{style:[H.divider,{backgroundColor:a.border}]}),U.createElement(Yr,{onPress:d,disabled:!d,accessibilityRole:d?"button":void 0,style:H.cardRow},U.createElement(me,{style:[H.thumbnail,{backgroundColor:f}]}),U.createElement(me,{style:H.cardText},U.createElement(pe,{style:[H.cardTitle,{color:a.text}]},s),n?U.createElement(pe,{style:[H.last4,{color:a.textMuted}]},"****",n):null),d?U.createElement(Ke,{size:20,color:a.iconSubtle}):null))}var H=Jr.create({container:{borderWidth:1,borderRadius:16},balance:{alignItems:"center",gap:4,paddingVertical:24},label:{fontFamily:i.medium,fontSize:14,lineHeight:20},amount:{fontFamily:i.semibold,fontSize:36,lineHeight:44},amountLoader:{height:44},asset:{fontFamily:i.medium,fontSize:12,lineHeight:18,paddingHorizontal:8,paddingVertical:2,borderRadius:999,overflow:"hidden"},divider:{height:1},cardRow:{flexDirection:"row",alignItems:"center",gap:12,padding:16},thumbnail:{width:40,height:26,borderRadius:4},cardText:{flex:1,gap:2},cardTitle:{fontFamily:i.medium,fontSize:14,lineHeight:20},last4:{fontFamily:i.regular,fontSize:13,lineHeight:18}});import u,{useState as br}from"react";import{Image as ht,Pressable as Cr,ScrollView as vt,StyleSheet as wt,Switch as xt,Text as O,View as q}from"react-native";import J from"react";import{Modal as Xr,StyleSheet as Qr,Text as ir,View as Pe}from"react-native";function ve({visible:e,title:r,description:t,confirmLabel:s,confirmDisabled:n=!1,dismissLabel:f="Never mind",destructive:d=!1,onConfirm:a,onDismiss:l,children:g}){let{colors:m}=I();return J.createElement(Xr,{transparent:!0,animationType:"fade",visible:e,onRequestClose:l},J.createElement(Pe,{style:se.backdrop},J.createElement(Pe,{style:[se.dialog,{backgroundColor:m.background}]},J.createElement(ir,{style:[se.title,{color:m.textTitle}]},r),t?J.createElement(ir,{style:[se.description,{color:m.text}]},t):null,g,J.createElement(Pe,{style:se.actions},J.createElement(oe,{title:s,destroy:d,disabled:n,style:n?se.confirmDisabled:void 0,onPress:a}),J.createElement(oe,{variant:"tertiary",title:f,onPress:l})))))}var se=Qr.create({backdrop:{flex:1,justifyContent:"center",padding:24,backgroundColor:"rgba(0, 0, 0, 0.4)"},dialog:{gap:12,padding:24,borderRadius:16},title:{fontFamily:i.semibold,fontSize:18,lineHeight:24},description:{fontFamily:i.regular,fontSize:16,lineHeight:24},confirmDisabled:{opacity:.4},actions:{gap:4,marginTop:8}});import*as gr from"expo-crypto";import R,{useEffect as lt,useMemo as dt,useRef as Ve,useState as mr}from"react";import{ActivityIndicator as ct,Platform as De,Pressable as ut,StyleSheet as pt,Text as ze,View as fe}from"react-native";import mt from"react-native-webview";import{getCardEphemeralKey as ft}from"@privy-io/js-sdk-core";var et={primary:"#FFFFFF",secondary:"rgba(255, 255, 255, 0.75)"},rt={primary:"#0D0F1C",secondary:"rgba(13, 15, 28, 0.64)"};function we(e){return tt(e)?rt:et}function tt(e){let r=nt(e);return r?(r.r*299+r.g*587+r.b*114)/1e3>=128:!1}function nt(e){let r=e.trim().replace(/^#/,""),t=r.length===3?r.replace(/./g,s=>s+s):r.slice(0,6);return/^[0-9a-fA-F]{6}$/.test(t)?{r:Number.parseInt(t.slice(0,2),16),g:Number.parseInt(t.slice(2,4),16),b:Number.parseInt(t.slice(4,6),16)}:null}var Se="https://card-details.privy.invalid",xe="__privyMountCardDetails",ot=/^pk_(test|live)_[A-Za-z0-9]+$/,it=/^acct_[A-Za-z0-9]+$/,st=/^ic_[A-Za-z0-9]+$/,at=/^ek_(test|live)_[A-Za-z0-9_]+$/,sr=e=>ot.test(e),ar=e=>it.test(e),lr=e=>st.test(e),dr=e=>at.test(e);function cr(e){let r;try{r=JSON.parse(e)}catch(t){return null}if(typeof r!="object"||r===null||!("type"in r))return null;switch(r.type){case"nonce":return"nonce"in r&&typeof r.nonce=="string"&&r.nonce?{type:"nonce",nonce:r.nonce}:null;case"ready":case"error":return{type:r.type};default:return null}}function ur(e){return`window.${xe} && window.${xe}(${JSON.stringify(e)}); true;`}function pr({publishableKey:e,issuingCard:r,stripeAccount:t,scriptNonce:s,textColor:n}){let f=JSON.stringify({publishableKey:e,issuingCard:r,stripeAccount:t,textColor:n}).replace(/</g,"\\u003c");return`<!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta http-equiv="Content-Security-Policy" content="${["default-src 'none'",`script-src 'nonce-${s}' https://js.stripe.com https://*.js.stripe.com`,"frame-src https://js.stripe.com https://*.js.stripe.com https://hooks.stripe.com","connect-src https://api.stripe.com","img-src https://*.stripe.com","style-src 'unsafe-inline'"].join("; ")}">
6
+ <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
7
+ <style>
8
+ html, body { margin: 0; background: transparent; color: ${n}; font-family: -apple-system, system-ui, sans-serif; }
9
+ .fields { display: flex; flex-direction: column; gap: 14px; padding: 20px; }
10
+ .row { display: flex; gap: 24px; }
11
+ .row > div { flex: 1; min-width: 0; }
12
+ .label { font-size: 11px; opacity: 0.75; margin-bottom: 2px; }
13
+ .value { display: flex; align-items: center; gap: 8px; }
14
+ .mount { min-width: 0; flex: 1; height: 28px; overflow: hidden; }
15
+ .copy { position: relative; width: 28px; height: 28px; flex-shrink: 0; }
16
+ .copy svg { position: absolute; top: 6px; left: 6px; }
17
+ .copy-target { position: absolute; inset: 0; }
18
+ </style>
19
+ <script src="https://js.stripe.com/v3" nonce="${s}"></script>
20
+ </head>
21
+ <body>
22
+ <div class="fields">
23
+ <div><div class="label">Card number</div>${Ae("number",n)}</div>
24
+ <div class="row">
25
+ <div><div class="label">Expiration</div>${Ae("expiry",n)}</div>
26
+ <div><div class="label">CVC</div>${Ae("cvc",n)}</div>
27
+ </div>
28
+ </div>
29
+ <script nonce="${s}">
30
+ (function () {
31
+ var config = ${f};
32
+ var fields = [
33
+ {key: 'number', element: 'issuingCardNumberDisplay'},
34
+ {key: 'expiry', element: 'issuingCardExpiryDisplay'},
35
+ {key: 'cvc', element: 'issuingCardCvcDisplay'}
36
+ ];
37
+ var style = {base: {color: config.textColor, fontFamily: 'ui-monospace, Menlo, monospace', fontSize: '17px', fontWeight: 600, lineHeight: '28px'}};
38
+ function send(message) { window.ReactNativeWebView.postMessage(JSON.stringify(message)); }
39
+ var stripe;
40
+ var options = config.stripeAccount ? {stripeAccount: config.stripeAccount} : undefined;
41
+ try { stripe = Stripe(config.publishableKey, options); } catch (error) { send({type: 'error'}); return; }
42
+ stripe.createEphemeralKeyNonce({issuingCard: config.issuingCard}).then(function (result) {
43
+ if (!result || result.error || !result.nonce) { send({type: 'error'}); return; }
44
+ var nonce = result.nonce;
45
+ window.${xe} = function (ephemeralKeySecret) {
46
+ window.${xe} = undefined;
47
+ var authorization = {issuingCard: config.issuingCard, nonce: nonce, ephemeralKeySecret: ephemeralKeySecret};
48
+ stripe.retrieveIssuingCard(config.issuingCard, {ephemeralKeySecret: ephemeralKeySecret, nonce: nonce}).then(function () {
49
+ var elements = stripe.elements();
50
+ var ready = 0;
51
+ fields.forEach(function (field) {
52
+ var display = elements.create(field.element, Object.assign({style: style}, authorization));
53
+ display.on('ready', function () { ready += 1; if (ready === fields.length) send({type: 'ready'}); });
54
+ display.mount('#' + field.key);
55
+ var copy = elements.create('issuingCardCopyButton', {toCopy: field.key});
56
+ copy.mount('#' + field.key + '-copy');
57
+ });
58
+ }, function () { send({type: 'error'}); });
59
+ };
60
+ send({type: 'nonce', nonce: nonce});
61
+ }, function () { send({type: 'error'}); });
62
+ })();
63
+ </script>
64
+ </body>
65
+ </html>`}function Ae(e,r){return`<div class="value"><div id="${e}" class="mount"></div><div class="copy"><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="${r}" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect width="14" height="14" x="8" y="8" rx="2"/><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"/></svg><div id="${e}-copy" class="copy-target"></div></div></div>`}var gt=14*60*1e3,yt=3e4,bt=12e3,fr=e=>e===Se||e.startsWith(`${Se}/`),Ct={loading:yt,mounting:bt,ready:gt};function yr({cardId:e,issuingCard:r,environment:t,publishableKey:s,stripeAccount:n,cardColor:f}){let d=E(),a=Ve(null),[l,g]=mr("loading"),[m,v]=mr(0),S=Ve(m);S.current=m;let w=Ve(l);w.current=l;let G=sr(s)&&lr(r)&&(n===null||ar(n)),o=we(f),b=dt(()=>G?pr({publishableKey:s,issuingCard:r,stripeAccount:n,scriptNonce:gr.randomUUID().replace(/-/g,""),textColor:o.primary}):null,[G,s,r,n,o.primary]),L=()=>{g("loading"),v(h=>h+1)};lt(()=>{if(De.OS==="web"||l==="error")return;let h=setTimeout(()=>{l==="loading"?g("error"):l==="mounting"?g("ready"):(g("loading"),v(D=>D+1))},Ct[l]);return()=>clearTimeout(h)},[l,m]);let c=h=>{if(!fr(h.nativeEvent.url))return;let D=cr(h.nativeEvent.data);if(D)switch(D.type){case"nonce":{let z=m;ft(d,{cardId:e,environment:t,nonce:D.nonce}).then(N=>{var W;if(!(S.current!==z||w.current==="error")){if(!dr(N))throw new Error("Unexpected ephemeral key format");(W=a.current)==null||W.injectJavaScript(ur(N)),g("mounting")}}).catch(N=>{S.current===z&&(console.error("[privy] Failed to authorize card details",N),g("error"))});return}case"ready":{g("ready");return}case"error":{g("error");return}default:}},V=l==="loading"||l==="mounting";return De.OS==="web"?R.createElement(fe,{style:[$.face,{backgroundColor:f}]},R.createElement(fe,{style:$.overlay},R.createElement(ze,{style:[$.error,{color:o.primary}]},"Card numbers are shown in the iOS and Android app."))):R.createElement(fe,{style:[$.face,{backgroundColor:f}]},b&&l!=="error"?R.createElement(mt,{key:m,ref:a,source:{html:b,baseUrl:Se},originWhitelist:["*"],onShouldStartLoadWithRequest:h=>h.isTopFrame===!1?/^(https|about):/.test(h.url):fr(h.url),onMessage:c,onError:()=>g("error"),onContentProcessDidTerminate:L,onRenderProcessGone:L,incognito:De.OS==="ios",cacheEnabled:!1,dataDetectorTypes:["none"],allowFileAccess:!1,allowsLinkPreview:!1,javaScriptCanOpenWindowsAutomatically:!1,setSupportMultipleWindows:!1,mixedContentMode:"never",scrollEnabled:!1,style:V?[$.webView,$.hidden]:$.webView}):null,V&&b?R.createElement(fe,{style:$.overlay},R.createElement(ct,{color:o.primary})):null,l==="error"||!b?R.createElement(fe,{style:$.overlay},R.createElement(ze,{style:[$.error,{color:o.primary}]},"Card details could not be loaded. Please try again."),b?R.createElement(ut,{accessibilityRole:"button",onPress:L},R.createElement(ze,{style:[$.retry,{color:o.primary}]},"Try again")):null):null)}var $=pt.create({face:{aspectRatio:1.586,borderRadius:16,overflow:"hidden"},webView:{flex:1,backgroundColor:"transparent"},hidden:{opacity:0},overlay:{position:"absolute",top:0,right:0,bottom:0,left:0,alignItems:"center",justifyContent:"center",padding:24},error:{fontFamily:i.medium,fontSize:14,textAlign:"center"},retry:{fontFamily:i.semibold,fontSize:14,marginTop:12,textDecorationLine:"underline"}});var St=[{value:"lost",label:"Lost"},{value:"stolen",label:"Stolen"},{value:"expired",label:"Expired"}];function hr({card:e,environment:r,cardColor:t,publishableKey:s,stripeAccount:n,logoUrl:f,frozen:d,canceled:a,busy:l,expired:g,onToggleFreeze:m,onCancel:v,onReplace:S}){let{colors:w}=I(),G=E(),[o,b]=br({kind:"none"}),[L,c]=br(!1),V=()=>b({kind:"none"});return u.createElement(vt,{contentContainerStyle:C.container},L&&s?u.createElement(yr,{cardId:e.id,issuingCard:e.provider_id,environment:r,publishableKey:s,stripeAccount:n,cardColor:t}):u.createElement(Tt,{card:e,cardColor:t,logoUrl:f,frozen:d,canceled:a}),u.createElement(q,{style:C.tiles},u.createElement(Le,{Icon:L?Ge:We,label:L?"Hide details":"Details",disabled:!s,onPress:()=>{c(!L),L||G.track({name:"sdk_card_details_revealed",properties:{cardId:e.id,environment:r}})}}),u.createElement(Le,{Icon:qe,label:"Replace",disabled:a||l,onPress:()=>b({kind:"replace-reason",reason:g?"expired":null})}),u.createElement(Le,{Icon:Oe,label:"Cancel",disabled:a||l,onPress:()=>b({kind:"cancel"})})),u.createElement(q,{style:[C.freezeRow,{borderColor:w.border}]},u.createElement(q,{style:C.freezeText},u.createElement(O,{style:[C.rowTitle,{color:w.text}]},"Freeze Card"),u.createElement(O,{style:[C.rowSubtitle,{color:w.textMuted}]},"Temporarily disable your card")),u.createElement(xt,{accessibilityLabel:"Freeze Card",value:d,disabled:a||l,onValueChange:h=>b({kind:"freeze",next:h})})),u.createElement(ve,{visible:o.kind==="freeze",title:o.kind==="freeze"&&!o.next?"Unfreeze this card?":"Freeze this card?",description:o.kind==="freeze"&&!o.next?"This will instantly unfreeze the current card.":"This will instantly freeze the current card.",confirmLabel:o.kind==="freeze"&&!o.next?"Unfreeze card":"Freeze card",onConfirm:()=>{o.kind==="freeze"&&m(o.next),V()},onDismiss:V}),u.createElement(ve,{visible:o.kind==="cancel",title:"Cancel this card?",description:"This will instantly cancel the current card.",confirmLabel:"Cancel card",destructive:!0,onConfirm:()=>{v(),V()},onDismiss:V}),u.createElement(ve,{visible:o.kind==="replace-reason"||o.kind==="replace-warn",title:o.kind==="replace-warn"?"Replace this card?":"Why are you replacing your card?",description:o.kind==="replace-warn"?"This will instantly close the current card and issue a new one.":void 0,confirmLabel:o.kind==="replace-warn"?"Replace":"Continue",confirmDisabled:o.kind==="replace-reason"&&o.reason===null,dismissLabel:"Back",destructive:o.kind==="replace-warn",onConfirm:()=>{o.kind==="replace-reason"&&o.reason?b({kind:"replace-warn",reason:o.reason}):o.kind==="replace-warn"&&(S(o.reason),V())},onDismiss:()=>{o.kind==="replace-warn"?b({kind:"replace-reason",reason:o.reason}):V()}},o.kind==="replace-reason"?St.map(({value:h,label:D})=>{let z=o.reason===h;return u.createElement(Cr,{key:h,accessibilityRole:"radio",accessibilityState:{checked:z},onPress:()=>b({kind:"replace-reason",reason:h}),style:[C.reason,{borderColor:z?w.interactive:w.border}]},u.createElement(O,{style:[C.rowTitle,{color:w.text}]},D),z?u.createElement(je,{size:18,color:w.interactive}):null)}):null))}function Tt({card:e,cardColor:r,logoUrl:t,frozen:s,canceled:n}){var g,m,v;let f=Xe(t),d=e.exp_month&&e.exp_year?`${String(e.exp_month).padStart(2,"0")}/${String(e.exp_year).slice(-2)}`:null,a=n?"Cancelled":s?"Frozen":null,l=we(r);return u.createElement(q,{style:[C.face,{backgroundColor:r},a?C.faceDimmed:null]},u.createElement(q,{style:C.faceTop},f?u.createElement(ht,{source:{uri:f},style:C.faceLogo,resizeMode:"contain",accessibilityIgnoresInvertColors:!0}):u.createElement(q,null),a?u.createElement(O,{style:C.faceBadge},a):null),u.createElement(O,{accessibilityLabel:e.last4?`Card ending in ${e.last4}`:void 0,style:[C.faceNumber,{color:l.primary}]},"\u2022\u2022\u2022\u2022 ",(g=e.last4)!=null?g:"0000"),u.createElement(q,{style:C.faceBottom},u.createElement(q,{style:C.faceField},u.createElement(O,{style:[C.faceLabel,{color:l.secondary}]},"Cardholder"),u.createElement(O,{style:[C.faceValue,{color:l.primary}]},(m=e.cardholder.name)!=null?m:"")),d?u.createElement(q,{style:C.faceField},u.createElement(O,{style:[C.faceLabel,{color:l.secondary}]},"Valid thru"),u.createElement(O,{style:[C.faceValue,{color:l.primary}]},d)):null,((v=e.brand)==null?void 0:v.toLowerCase())==="visa"?u.createElement(O,{style:[C.faceBrand,{color:l.primary}]},"VISA"):null))}function Le({Icon:e,label:r,disabled:t,onPress:s}){let{colors:n}=I();return u.createElement(Cr,{accessibilityRole:"button",accessibilityState:{disabled:t},disabled:t,onPress:s,style:[C.tile,{backgroundColor:n.backgroundSecondary},t?C.tileDisabled:null]},u.createElement(e,{size:20,color:n.icon}),u.createElement(O,{style:[C.tileLabel,{color:n.text}]},r))}var C=wt.create({container:{gap:16,padding:16},face:{aspectRatio:1.586,borderRadius:16,padding:20,justifyContent:"space-between"},faceDimmed:{opacity:.6},faceTop:{flexDirection:"row",alignItems:"center",justifyContent:"space-between"},faceLogo:{width:96,height:28},faceBadge:{fontFamily:i.semibold,fontSize:12,color:"#FFFFFF",backgroundColor:"rgba(0, 0, 0, 0.35)",paddingHorizontal:10,paddingVertical:4,borderRadius:999,overflow:"hidden"},faceNumber:{fontFamily:i.semibold,fontSize:20,letterSpacing:2},faceBottom:{flexDirection:"row",alignItems:"flex-end",gap:24},faceField:{gap:2},faceLabel:{fontFamily:i.regular,fontSize:10},faceValue:{fontFamily:i.medium,fontSize:14},faceBrand:{marginLeft:"auto",fontFamily:i.semibold,fontSize:20,fontStyle:"italic"},tiles:{flexDirection:"row",gap:12},tile:{flex:1,alignItems:"center",gap:6,paddingVertical:14,borderRadius:12},tileDisabled:{opacity:.4},tileLabel:{fontFamily:i.medium,fontSize:14},freezeRow:{flexDirection:"row",alignItems:"center",gap:12,padding:16,borderWidth:1,borderRadius:12},freezeText:{flex:1,gap:2},rowTitle:{fontFamily:i.medium,fontSize:16,lineHeight:22},rowSubtitle:{fontFamily:i.regular,fontSize:13,lineHeight:18},reason:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",padding:14,borderWidth:1,borderRadius:12}});import vr from"react";import{StyleSheet as kt,Text as It,View as Ft}from"react-native";import{getCardDisclosure as Et}from"@privy-io/js-sdk-core";function xr(){let{colors:e}=I(),r=E().app.getConfig(),t=(r==null?void 0:r.legal_name)||(r==null?void 0:r.name)||"This app";return vr.createElement(Ft,{style:[wr.container,{backgroundColor:e.backgroundSecondary}]},vr.createElement(It,{style:[wr.text,{color:e.textMuted}]},Et(t)))}var wr=kt.create({container:{padding:16,borderRadius:12},text:{fontFamily:i.regular,fontSize:12,lineHeight:18}});import x,{useState as Pt}from"react";import{Linking as At,Modal as Vt,Pressable as Dt,ScrollView as zt,StyleSheet as Lt,Text as Z,View as ae}from"react-native";import{formatSignedTransactionAmount as _t,formatTransactionDate as Mt,formatUsdAmount as Sr}from"@privy-io/js-sdk-core";var Tr="+1 (855) 935-3124",Ut={pending:"Pending",posted:"Posted",declined:"Declined",expired:"Expired",reversed:"Reversed"},Ht={expired:"Dispute expired",lost:"Dispute lost",submitted:"Dispute submitted",unsubmitted:"Dispute unsubmitted",won:"Dispute won"};function Nt(e){return`tel:${e.trimStart().startsWith("+")?"+":""}${e.replace(/\D/g,"")}`}function kr({transaction:e,cardLast4:r}){let{colors:t}=I(),[s,n]=Pt(!1),{text:f,isCredit:d}=_t(e),a=d?t.success:t.textTitle,l=e.status==="posted"?t.success:e.status==="declined"?t.error:t.textMuted,g=[{label:"Amount",value:f,color:a},{label:"ATM Fee",value:Sr(0)},{label:"Cashback",value:Sr(0)},{label:"Currency",value:e.currency.toUpperCase()},{label:"Status",value:Ut[e.status],color:l},{label:"Dispute",value:e.dispute?Ht[e.dispute.status]:"None"},{label:"Merchant",value:e.merchant.name},{label:"From",value:r?`\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 ${r}`:null,accessibilityLabel:r?`Card ending in ${r}`:void 0},{label:"Date created",value:Mt({unixSeconds:e.created})}];return x.createElement(zt,{contentContainerStyle:P.container},x.createElement(ae,{style:P.summary},x.createElement(ae,{style:[P.merchantIcon,{backgroundColor:t.backgroundSecondary}]},x.createElement(he,{size:24,color:t.iconSubtle})),x.createElement(Z,{style:[P.amountHeading,{color:a}]},f),x.createElement(Z,{style:[P.subheader,{color:t.textMuted}]},`Card payment to ${e.merchant.name}`)),x.createElement(ae,{style:P.details},x.createElement(Z,{style:[P.detailsHeading,{color:t.textTitle}]},"Details"),g.filter(m=>m.value!==null).map(m=>{var v;return x.createElement(ae,{key:m.label,style:P.detailRow},x.createElement(Z,{style:[P.detailLabel,{color:t.textMuted}]},m.label),x.createElement(Z,{accessibilityLabel:m.accessibilityLabel,style:[P.detailValue,{color:(v=m.color)!=null?v:t.text}]},m.value))})),x.createElement(oe,{variant:"secondary",title:"Dispute transaction",style:P.centeredButton,onPress:()=>n(!0)}),x.createElement(Vt,{transparent:!0,animationType:"fade",visible:s,onRequestClose:()=>n(!1)},x.createElement(ae,{style:P.backdrop},x.createElement(ae,{style:[P.dialog,{backgroundColor:t.background}]},x.createElement(Z,{style:[P.detailsHeading,{color:t.textTitle}]},"Dispute this transaction"),x.createElement(Z,{style:[P.dialogBody,{color:t.text}]},"To dispute this transaction, call the number below and our support team will help you."),x.createElement(Dt,{accessibilityRole:"link",onPress:()=>void At.openURL(Nt(Tr))},x.createElement(Z,{style:[P.phone,{color:t.interactive}]},Tr)),x.createElement(oe,{title:"Done",onPress:()=>n(!1)})))))}var P=Lt.create({container:{gap:24,padding:24},summary:{alignItems:"center",gap:4},merchantIcon:{width:56,height:56,borderRadius:28,alignItems:"center",justifyContent:"center",marginBottom:8},amountHeading:{fontFamily:i.semibold,fontSize:28,lineHeight:36},subheader:{fontFamily:i.regular,fontSize:14,lineHeight:20,textAlign:"center"},details:{gap:12},detailsHeading:{fontFamily:i.semibold,fontSize:18,lineHeight:24},detailRow:{flexDirection:"row",justifyContent:"space-between",gap:16},detailLabel:{fontFamily:i.regular,fontSize:14,lineHeight:20},detailValue:{flexShrink:1,fontFamily:i.medium,fontSize:14,lineHeight:20,textAlign:"right"},centeredButton:{justifyContent:"center"},backdrop:{flex:1,justifyContent:"center",padding:24,backgroundColor:"rgba(0, 0, 0, 0.4)"},dialog:{gap:16,padding:24,borderRadius:16},dialogBody:{fontFamily:i.regular,fontSize:16,lineHeight:24},phone:{fontFamily:i.semibold,fontSize:16,lineHeight:24}});import{useCallback as le,useEffect as Bt,useRef as ge,useState as X}from"react";import{getCardById as Rt,listCardTransactions as Ir,toTransactionRow as $t}from"@privy-io/js-sdk-core";var Fr=25;function Er({cardId:e,environment:r}){let t=E(),[s,n]=X(null),[f,d]=X(!0),[a,l]=X(void 0),[g,m]=X([]),[v,S]=X(!0),[w,G]=X(!1),[o,b]=X(!1),[L,c]=X(void 0),V=ge(null),h=ge(!1),D=ge(null),z=ge(0),N=ge(!1),W=le(y=>{V.current=y.next_cursor,h.current=!0,m(T=>{let j=new Set(T.map(_=>_.id));return[...T,...y.data.filter(_=>!j.has(_.id)).map(_=>$t({transaction:_,unknownMerchantName:"Unknown merchant"}))]}),G(y.next_cursor!==null)},[]),ee=le(y=>K(this,null,function*(){d(!0),l(void 0);try{let T=yield Rt(t,{cardId:e,environment:r});if(y.aborted)return;n(T),T||l("Could not load this card.")}catch(T){y.aborted||l("Could not load this card.")}finally{y.aborted||d(!1)}}),[t,e,r]),Y=le(y=>K(this,null,function*(){let T=++z.current,j=()=>!y.aborted&&T===z.current;S(!0),c(void 0),V.current=null,h.current=!1,m([]);try{let _=yield Ir(t,{cardId:e,environment:r,limit:Fr});if(!j())return;W(_)}catch(_){if(!j())return;G(!0),c("Could not load transactions.")}finally{j()&&S(!1)}}),[t,e,r,W]),Te=le(()=>K(this,null,function*(){let y=D.current;if(!y||y.signal.aborted)return;let{signal:T}=y;if(!h.current){yield Y(T);return}let j=V.current;if(j===null||N.current)return;let _=z.current,ne=()=>!T.aborted&&_===z.current;N.current=!0,b(!0),c(void 0);try{let Ce=yield Ir(t,{cardId:e,environment:r,limit:Fr,cursor:j});if(!ne())return;W(Ce)}catch(Ce){ne()&&c("Could not load transactions.")}finally{N.current=!1,T.aborted||b(!1)}}),[t,e,r,W,Y]),ye=le(()=>{let y=D.current;!y||y.signal.aborted||(ee(y.signal),Y(y.signal))},[ee,Y]),be=le(y=>{var T;(T=D.current)!=null&&T.signal.aborted||n(y)},[]);return Bt(()=>{let y=new AbortController;return D.current=y,ee(y.signal),Y(y.signal),()=>y.abort()},[ee,Y]),{card:s,isCardLoading:f,cardError:a,transactions:g,isLoadingTransactions:v,hasMore:w,isLoadingMore:o,loadMoreError:L,loadMore:Te,retry:ye,applyCard:be}}import{useEffect as Ot}from"react";var Pr=({cardId:e,environment:r})=>{let t=E();Ot(()=>{t.track({name:"sdk_card_summary_view_loaded",properties:{cardId:e,environment:r}})},[t,e,r])};var Zt=e=>{let r=Je();return p.createElement($e,{appearance:r},p.createElement(Xt,ce({key:`${e.environment}:${e.cardId}`},e)))};function Xt({cardId:e,environment:r,onClose:t,onReplaced:s}){var _e,Me,Ue,He,Ne,Be;let{colors:n}=I(),f=E();Pr({cardId:e,environment:r});let[d,a]=de({kind:"summary"}),[l,g]=de(!1),[m,v]=de(!1),[S,w]=de(null),[G,o]=de(!1),[b,L]=de(null),{card:c,isCardLoading:V,cardError:h,transactions:D,isLoadingTransactions:z,hasMore:N,isLoadingMore:W,loadMoreError:ee,loadMore:Y,retry:Te,applyCard:ye}=Er({cardId:e,environment:r}),be=m||(c==null?void 0:c.status)==="canceled";Ar(()=>{let k=!0;return qt(f,{appId:f.app.appId,environment:r}).then(B=>{k&&L(B)}).catch(B=>{console.error("[privy] Failed to load the card issuing config",B)}),()=>{k=!1}},[f,r]),Ar(()=>{c&&g(c.status==="inactive")},[c]);let y=k=>K(this,null,function*(){let B=l;g(k),w(null),o(!0);try{ye(yield Vr(f,{cardId:e,environment:r,status:k?"inactive":"active"}))}catch(Lr){g(B),w("Could not update this card. Please try again."),console.error("[privy] Failed to update the card freeze state",Lr)}finally{o(!1)}}),T=()=>K(this,null,function*(){w(null),o(!0);try{ye(yield Vr(f,{cardId:e,environment:r,status:"canceled"})),v(!0)}catch(k){w("Could not cancel this card. Please try again."),console.error("[privy] Failed to cancel the card",k)}finally{o(!1)}}),j=k=>K(this,null,function*(){w(null),o(!0);try{let B=yield Jt(f,{cardId:e,environment:r,reason:k});v(!0),s==null||s(B.id)}catch(B){w("Could not replace this card. Please try again."),console.error("[privy] Failed to replace the card",B)}finally{o(!1)}}),_=be?p.createElement(Dr,null,"This card has been cancelled"):l?p.createElement(Dr,null,"This card is frozen"):null,ne=p.createElement(p.Fragment,null,p.createElement(Ze,{goBack:d.kind==="summary"?void 0:()=>{w(null),a({kind:"summary"})},close:t}),r==="sandbox"?p.createElement(Q,{style:A.banner},p.createElement(Ie,{variant:"info"},p.createElement(Fe,null,"In sandbox mode using test funds"))):null);if(d.kind==="transaction")return p.createElement(Q,{style:[A.screen,{backgroundColor:n.background}]},ne,p.createElement(kr,{transaction:d.transaction,cardLast4:(_e=c==null?void 0:c.last4)!=null?_e:null}));if(d.kind==="details"&&c)return p.createElement(Q,{style:[A.screen,{backgroundColor:n.background}]},ne,p.createElement(Q,{style:A.detailsHeader},p.createElement(te,{style:[A.heading,{color:n.textTitle}]},"Your Card"),_,S?p.createElement(te,{accessibilityRole:"alert",style:[A.errorText,{color:n.error}]},S):null),p.createElement(hr,{card:c,environment:r,cardColor:n.interactive,publishableKey:(Me=b==null?void 0:b.publishableKey)!=null?Me:null,stripeAccount:(Ue=b==null?void 0:b.stripeAccount)!=null?Ue:null,logoUrl:(He=b==null?void 0:b.cardLogoUrl)!=null?He:null,frozen:l,canceled:be,busy:G,expired:Yt(c),onToggleFreeze:k=>void y(k),onCancel:()=>void T(),onReplace:k=>void j(k)}));let Ce=Wt(c==null?void 0:c.asset),zr=p.createElement(Q,{style:A.sections},p.createElement(te,{style:[A.heading,{color:n.textTitle}]},"Wallet"),_,h?p.createElement(Q,{style:[A.errorRow,{backgroundColor:n.backgroundSecondary}]},p.createElement(te,{style:[A.errorText,{color:n.error}]},h),p.createElement(Kt,{onPress:Te,accessibilityRole:"button"},p.createElement(te,{style:[A.retry,{color:n.interactive}]},"Try again"))):p.createElement(or,{isLoading:V,balance:nr((Ne=c==null?void 0:c.balance_formatted)!=null?Ne:null),assetSymbol:Ce,cardTitle:c!=null&&c.brand?`${c.brand} debit card`:"Debit card",last4:(Be=c==null?void 0:c.last4)!=null?Be:void 0,cardColor:n.interactive,onViewDetails:c?()=>{w(null),a({kind:"details"})}:void 0}),p.createElement(te,{style:[A.heading,{color:n.textTitle}]},"Transactions"));return p.createElement(Q,{style:[A.screen,{backgroundColor:n.background}]},ne,p.createElement(jt,{data:D,keyExtractor:k=>k.id,renderItem:({item:k})=>p.createElement(rr,{transaction:k,onPress:B=>a({kind:"transaction",transaction:B})}),ListHeaderComponent:zr,ListEmptyComponent:z||ee||N?null:p.createElement(te,{style:[A.empty,{color:n.textMuted}]},"No transactions found"),ListFooterComponent:p.createElement(Q,{style:A.footer},p.createElement(tr,{hasMore:N,isLoadingMore:W||z,loadMoreError:ee,onLoadMore:()=>void Y()}),p.createElement(xr,null)),contentContainerStyle:A.list}))}function Dr({children:e}){let{colors:r}=I();return p.createElement(Ie,{style:{backgroundColor:r.backgroundHighlight}},p.createElement(Fe,{style:{color:r.textHighlight}},e))}var A=Gt.create({screen:{flex:1},banner:{paddingHorizontal:16},detailsHeader:{gap:12,paddingHorizontal:16},list:{padding:16},sections:{gap:12,marginBottom:4},heading:{fontFamily:i.semibold,fontSize:20,lineHeight:24,marginTop:12},errorRow:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:12,padding:16,borderRadius:12},errorText:{flex:1,fontFamily:i.regular,fontSize:14},retry:{fontFamily:i.medium,fontSize:14},empty:{fontFamily:i.regular,fontSize:14,paddingVertical:16,textAlign:"center"},footer:{gap:24,marginTop:8}});export{Zt as CardSummaryView,Ur as useGetCardsForUser,Rr as useSignUpForCard};