@privy-io/react-auth 1.86.0 → 1.87.0-beta-20240920172644

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunkZ4PCJGI3js = require('./chunk-Z4PCJGI3.js');function E(e,t){return{...e,rpcUrls:{...e.rpcUrls,privyWalletOverride:{http:[t]}}}}function N(e){let t=e.filter(n=>!_chunkZ4PCJGI3js.la.has(n.id));return _chunkZ4PCJGI3js.ka.concat(t)}function R(e){return _nullishCoalesce(e.find(n=>n.walletClientType==="privy"&&n.connectorType==="embedded"&&!n.imported), () => (null))}var _react = require('react');var _jsxruntime = require('react/jsx-runtime');function p({src:e,...t}){return _jsxruntime.jsx.call(void 0, "img",{src:e,...t,style:{display:"none"}})}var f=_react.createContext.call(void 0, {ready:!1,app:_chunkZ4PCJGI3js.ma,currentScreen:null,lastScreen:null,navigate:_chunkZ4PCJGI3js.W,navigateBack:_chunkZ4PCJGI3js.W,resetNavigation:_chunkZ4PCJGI3js.W,setModalData:_chunkZ4PCJGI3js.W,onUserCloseViaDialogOrKeybindRef:void 0}),y=["LANDING","CONNECT_ONLY_LANDING_SCREEN",null],W= exports.a =e=>{let t=_chunkZ4PCJGI3js.oa.call(void 0, ),n=e.authenticated,[i,l]=_react.useState.call(void 0, e.initialScreen);_react.useEffect.call(void 0, ()=>{!n&&!y.includes(e.initialScreen)&&e.setInitialScreen(null)},[n]);let o=_react.useRef.call(void 0, null);_react.useEffect.call(void 0, ()=>{e.open||(o.current=null)},[e.open]),_react.useEffect.call(void 0, ()=>{o.current=null},[e.initialScreen]);let g={ready:!!t.id,app:t,data:e.data,setModalData:e.setModalData,currentScreen:e.initialScreen,lastScreen:i,navigate:(S,m=!0)=>{e.setInitialScreen(S),m&&l(e.initialScreen)},navigateBack:()=>{e.setInitialScreen(i)},resetNavigation:()=>{e.setInitialScreen(null),l(null)},onUserCloseViaDialogOrKeybindRef:o};return _jsxruntime.jsxs.call(void 0, f.Provider,{value:g,children:[(typeof t.appearance.logo=="string"||_optionalChain([t, 'access', _ => _.appearance, 'access', _2 => _2.logo, 'optionalAccess', _3 => _3.type])==="img")&&_jsxruntime.jsx.call(void 0, p,{src:typeof t.appearance.logo=="string"?t.appearance.logo:t.appearance.logo.props.src}),e.children]})},k= exports.b =()=>_react.useContext.call(void 0, f);function G(e){let n=_optionalChain([new RegExp(/^eip155:(?<chainId>\d+)$/gm), 'access', _4 => _4.exec, 'call', _5 => _5(e), 'optionalAccess', _6 => _6.groups, 'optionalAccess', _7 => _7.chainId]);if(n)return parseInt(n);throw new Error("Chain ID not compatible with CAIP-2 format.")}exports.a = W; exports.b = k; exports.c = E; exports.d = N; exports.e = G; exports.f = R;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunkV5T6BXGXjs = require('./chunk-V5T6BXGX.js');function E(e,t){return{...e,rpcUrls:{...e.rpcUrls,privyWalletOverride:{http:[t]}}}}function N(e){let t=e.filter(n=>!_chunkV5T6BXGXjs.la.has(n.id));return _chunkV5T6BXGXjs.ka.concat(t)}function R(e){return _nullishCoalesce(e.find(n=>n.walletClientType==="privy"&&n.connectorType==="embedded"&&!n.imported), () => (null))}var _react = require('react');var _jsxruntime = require('react/jsx-runtime');function p({src:e,...t}){return _jsxruntime.jsx.call(void 0, "img",{src:e,...t,style:{display:"none"}})}var f=_react.createContext.call(void 0, {ready:!1,app:_chunkV5T6BXGXjs.ma,currentScreen:null,lastScreen:null,navigate:_chunkV5T6BXGXjs.W,navigateBack:_chunkV5T6BXGXjs.W,resetNavigation:_chunkV5T6BXGXjs.W,setModalData:_chunkV5T6BXGXjs.W,onUserCloseViaDialogOrKeybindRef:void 0}),y=["LANDING","CONNECT_ONLY_LANDING_SCREEN",null],W= exports.a =e=>{let t=_chunkV5T6BXGXjs.oa.call(void 0, ),n=e.authenticated,[i,l]=_react.useState.call(void 0, e.initialScreen);_react.useEffect.call(void 0, ()=>{!n&&!y.includes(e.initialScreen)&&e.setInitialScreen(null)},[n]);let o=_react.useRef.call(void 0, null);_react.useEffect.call(void 0, ()=>{e.open||(o.current=null)},[e.open]),_react.useEffect.call(void 0, ()=>{o.current=null},[e.initialScreen]);let g={ready:!!t.id,app:t,data:e.data,setModalData:e.setModalData,currentScreen:e.initialScreen,lastScreen:i,navigate:(S,m=!0)=>{e.setInitialScreen(S),m&&l(e.initialScreen)},navigateBack:()=>{e.setInitialScreen(i)},resetNavigation:()=>{e.setInitialScreen(null),l(null)},onUserCloseViaDialogOrKeybindRef:o};return _jsxruntime.jsxs.call(void 0, f.Provider,{value:g,children:[(typeof t.appearance.logo=="string"||_optionalChain([t, 'access', _ => _.appearance, 'access', _2 => _2.logo, 'optionalAccess', _3 => _3.type])==="img")&&_jsxruntime.jsx.call(void 0, p,{src:typeof t.appearance.logo=="string"?t.appearance.logo:t.appearance.logo.props.src}),e.children]})},k= exports.b =()=>_react.useContext.call(void 0, f);function G(e){let n=_optionalChain([new RegExp(/^eip155:(?<chainId>\d+)$/gm), 'access', _4 => _4.exec, 'call', _5 => _5(e), 'optionalAccess', _6 => _6.groups, 'optionalAccess', _7 => _7.chainId]);if(n)return parseInt(n);throw new Error("Chain ID not compatible with CAIP-2 format.")}exports.a = W; exports.b = k; exports.c = E; exports.d = N; exports.e = G; exports.f = R;