@powerhousedao/connect 4.0.3 → 4.0.5

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.
Files changed (58) hide show
  1. package/dist/assets/{AddDriveModal.Dvx49ymn.js → AddDriveModal.CWoBv_48.js} +2 -2
  2. package/dist/assets/{AddDriveModal.Dvx49ymn.js.map → AddDriveModal.CWoBv_48.js.map} +1 -1
  3. package/dist/assets/{CreateDocumentModal.HxsTTO3O.js → CreateDocumentModal.DL-HobBg.js} +2 -2
  4. package/dist/assets/{CreateDocumentModal.HxsTTO3O.js.map → CreateDocumentModal.DL-HobBg.js.map} +1 -1
  5. package/dist/assets/{DebugSettingsModal.FcsYdItm.js → DebugSettingsModal.DxIXmwiM.js} +2 -2
  6. package/dist/assets/{DebugSettingsModal.FcsYdItm.js.map → DebugSettingsModal.DxIXmwiM.js.map} +1 -1
  7. package/dist/assets/{SettingsModal.DNuw8Ol8.js → SettingsModal.CDMLwaCk.js} +2 -2
  8. package/dist/assets/{SettingsModal.DNuw8Ol8.js.map → SettingsModal.CDMLwaCk.js.map} +1 -1
  9. package/dist/assets/{app.4_SWVXbR.js → app.BtXNojPV.js} +4 -4
  10. package/dist/assets/{app.4_SWVXbR.js.map → app.BtXNojPV.js.map} +1 -1
  11. package/dist/assets/{atlas-import.BcpRC7pw.js → atlas-import.KxjJCNA4.js} +2 -2
  12. package/dist/assets/{atlas-import.BcpRC7pw.js.map → atlas-import.KxjJCNA4.js.map} +1 -1
  13. package/dist/assets/{connect.config.DUXg7xh4.js → connect.config.DFiOOfbL.js} +2 -2
  14. package/dist/assets/{connect.config.DUXg7xh4.js.map → connect.config.DFiOOfbL.js.map} +1 -1
  15. package/dist/assets/{content.CdBQrvpu.js → content.DgV6Mq0-.js} +2 -2
  16. package/dist/assets/{content.CdBQrvpu.js.map → content.DgV6Mq0-.js.map} +1 -1
  17. package/dist/assets/{cookie-banner.CFaAyloc.js → cookie-banner.B_XhP7he.js} +2 -2
  18. package/dist/assets/{cookie-banner.CFaAyloc.js.map → cookie-banner.B_XhP7he.js.map} +1 -1
  19. package/dist/assets/{home.Dms1SdKb.js → home.C_U1tfub.js} +2 -2
  20. package/dist/assets/{home.Dms1SdKb.js.map → home.C_U1tfub.js.map} +1 -1
  21. package/dist/assets/{index.B0EhmKCF.js → index.BAvGLKEb.js} +2 -2
  22. package/dist/assets/{index.B0EhmKCF.js.map → index.BAvGLKEb.js.map} +1 -1
  23. package/dist/assets/{index.BI78I5tG.js → index.C4pUfNnz.js} +2 -2
  24. package/dist/assets/{index.BI78I5tG.js.map → index.C4pUfNnz.js.map} +1 -1
  25. package/dist/assets/{index.DJB97pbh.js → index.C5mu1t4S.js} +2 -2
  26. package/dist/assets/{index.DJB97pbh.js.map → index.C5mu1t4S.js.map} +1 -1
  27. package/dist/assets/{index.BDEjD6s0.js → index.CrfEkaEE.js} +3 -3
  28. package/dist/assets/{index.BDEjD6s0.js.map → index.CrfEkaEE.js.map} +1 -1
  29. package/dist/assets/{index.9LsxHx9v.js → index.Dy1TXvFH.js} +2 -2
  30. package/dist/assets/{index.9LsxHx9v.js.map → index.Dy1TXvFH.js.map} +1 -1
  31. package/dist/assets/{index.BspU3wnc.js → index.vknY1pvt.js} +2 -2
  32. package/dist/assets/{index.BspU3wnc.js.map → index.vknY1pvt.js.map} +1 -1
  33. package/dist/assets/{main.CQ97ZtJ9.js → main.BKU6sAOE.js} +3 -3
  34. package/dist/assets/{main.CQ97ZtJ9.js.map → main.BKU6sAOE.js.map} +1 -1
  35. package/dist/assets/{modal.BurIaDHm.js → modal.bK1fuPa_.js} +3 -3
  36. package/dist/assets/{modal.BurIaDHm.js.map → modal.bK1fuPa_.js.map} +1 -1
  37. package/dist/assets/{modals.BgBl4OEM.js → modals.CkpMpa3F.js} +2 -2
  38. package/dist/assets/{modals.BgBl4OEM.js.map → modals.CkpMpa3F.js.map} +1 -1
  39. package/dist/assets/{registerServiceWorker.D6UhEnk-.js → registerServiceWorker.DUgNo8Ta.js} +2 -2
  40. package/dist/assets/{registerServiceWorker.D6UhEnk-.js.map → registerServiceWorker.DUgNo8Ta.js.map} +1 -1
  41. package/dist/assets/{root.OFkJ3D8n.js → root.eCpkkkef.js} +2 -2
  42. package/dist/assets/{root.OFkJ3D8n.js.map → root.eCpkkkef.js.map} +1 -1
  43. package/dist/assets/{useAcceptedCookies.CxwtiZdL.js → useAcceptedCookies.D_OU6xT7.js} +2 -2
  44. package/dist/assets/{useAcceptedCookies.CxwtiZdL.js.map → useAcceptedCookies.D_OU6xT7.js.map} +1 -1
  45. package/dist/assets/useConnectConfig.BvkNvwSB.js +2 -0
  46. package/dist/assets/{useConnectConfig.PFYS-3o2.js.map → useConnectConfig.BvkNvwSB.js.map} +1 -1
  47. package/dist/assets/{useDefaultDocumentModelEditor.CN7iHYLX.js → useDefaultDocumentModelEditor.CtjvbYvO.js} +2 -2
  48. package/dist/assets/{useDefaultDocumentModelEditor.CN7iHYLX.js.map → useDefaultDocumentModelEditor.CtjvbYvO.js.map} +1 -1
  49. package/dist/assets/{useDocumentDriveServer.DiA5ncH8.js → useDocumentDriveServer.B5iYllwN.js} +2 -2
  50. package/dist/assets/{useDocumentDriveServer.DiA5ncH8.js.map → useDocumentDriveServer.B5iYllwN.js.map} +1 -1
  51. package/dist/assets/{useFeatureFlags.Dp7X50k3.js → useFeatureFlags.CZev5A6L.js} +2 -2
  52. package/dist/assets/{useFeatureFlags.Dp7X50k3.js.map → useFeatureFlags.CZev5A6L.js.map} +1 -1
  53. package/dist/assets/{user.BQU9ztVh.js → user.C5X0s2J6.js} +4 -4
  54. package/dist/assets/{user.BQU9ztVh.js.map → user.C5X0s2J6.js.map} +1 -1
  55. package/dist/index.html +1 -1
  56. package/dist/vite-envs.sh +1 -1
  57. package/package.json +9 -9
  58. package/dist/assets/useConnectConfig.PFYS-3o2.js +0 -2
@@ -1,2 +1,2 @@
1
- import{jsxs as y,jsx as o}from"react/jsx-runtime";import{u as v}from"./useAcceptedCookies.CxwtiZdL.js";import{c as b}from"./connect.config.DUXg7xh4.js";import{useSyncExternalStore as g}from"react";import{i as l}from"./i18next.CqOP20KE.js";import{s as k,a as w,u as S}from"./useTranslation.BpVv6XIW.js";import{useModal as C}from"./modal.BurIaDHm.js";import{v as D}from"./index.DFyMrewv.js";import{T as B}from"./Trans.-pu2RC5T.js";import"./browser.BkwNmV2Z.js";import"react-dom";const x={type:"3rdParty",init(e){k(e.options.react),w(e)}},A={cancel:"Cancel",delete:"Delete",continue:"Continue",empty:"Empty",create:"Create",save:"Save",export:"Export",reload:"Reload",reloadConnect:"Click here to reload Connect"},T={placeholder:"Search Powerhouse",filterLabel:"File type"},N={sections:{folders:{title:"Folders",empty:"No folders 🗂️"},documents:{title:"Documents and files",empty:"No documents or files 📄"}}},E={options:{switchboardLink:"Switchboard Link"}},I={deleteItem:{folder:{header:"Delete “{{item}}” folder?",body:"Are you sure you want to delete this folder? All files and subfolders within it will be removed."},file:{header:"Delete “{{item}}” file?",body:"Are you sure you want to delete this file?"}},deleteDrive:{title:'Delete "{{label}}" drive?',body:"Are you sure you want to delete this drive? All files and subfolders within it will be removed. Do you want to proceed?",inputPlaceholder:"Enter drive name..."},upgradeDrive:{header:"Upgrade to cloud drive",body:"You are moving files from a private to a shared drive. These files will become accessible to others in the shared drive.Do you want to proceed?"},createDocument:{header:"Create a new document",placeholder:"Document name"},connectSettings:{title:"Settings",body:"These settings will apply to all drives.",clearStorage:{button:"Clear Storage",description:"Delete previous session data",confirmation:{title:"Clear Storage",body:"Are you sure you want to clear the storage? This will remove all previous session data.",clearButton:"Clear Storage"}},enabledDocumentTypes:{title:"Document Models",description:"Documents enabled",allSelected:"All documents are selected"}},exportDocumentWithErrors:{title:"Your document contains errors",body:"Your document contains structure errors. Do you want to export it anyway?"},disclaimer:{title:"Disclaimer",body:"All content provided herein our website, hyperlinked sites, associated applications, forums, blogs, social media accounts and other platforms (“Site”) is for your general information only, procured from third party sources. We make no warranties of any kind in relation to our content, including but not limited to accuracy and updatedness. No part of the content that we provide constitutes financial advice, legal advice or any other form of advice meant for your specific reliance for any purpose. Any use or reliance on our content is solely at your own risk and discretion. You should conduct your own research, review, analyse and verify our content before relying on them. Trading is a highly risky activity that can lead to major losses, please therefore consult your financial advisor before making any decision. No content on our Site is meant to be a solicitation or offer."},cookiesPolicy:{title:"Cookies Policy",body:"<subtitle>Use of Cookies and Similar Technologies</subtitle><p>The Site is using cookies. Cookies are small text files that are placed on your computer by websites that you visit. They are widely used in order to make websites work, or work more efficiently, as well as to provide information to the owners of the site. Cookies are typically stored on your computer´s hard drive.Information collected from cookies is used by us to evaluate the effectiveness of our Site and analyze trends. The information collected from cookies allows us to determine such things as which parts of the Site are most visited and difficulties our visitors may experience in accessing the SIte. With this knowledge, we can improve the quality of your experience on the Site by recognizing and delivering more of the most desired features and information, as well as by resolving access difficulties.</p><p>We use third party service providers, to assist us in better understanding the use of our Site. Our service providers will place cookies on the hard drive of your computer (or use similar technologies) and will receive information that we select that will educate us on such things as how visitors navigate around our Site. This information is aggregated to provide statistical data about our users browsing actions and patterns, and does not personally identify individuals. This information may include:</p><p>Computer or mobile device information, Website usage information, such as:<list></p><bullet>Page views,</bullet><bullet>Button clicks,</bullet><bullet>Input form changes (without the values being entered),</bullet><bullet>Errors.</bullet></list><p>Our service providers analyses this information and provides us with aggregate reports. The information and analysis provided by our service providers will be used to assist us in better understanding our visitors interests in our Site and how to better serve those interests. If you want to avoid using cookies altogether, you can disable cookies in your browser. However, disabling cookies might make it impossible for you to use certain features of the Site. Your use of the Site with a browser that is configured to accept cookies constitutes an acceptance of our and third-party cookies.</p>"}},P={deleteDriveSuccess:"Drive successfully deleted",deleteFolderSuccess:"Folder deleted",fileDeleteSuccess:"File deleted",addDriveSuccess:"New drive successfully added",driveSyncSuccess:"Drive synced successfully",driveSyncError:"Error synchronizing drive {{drive}}",driveSyncConflict:"Conflict error detected in {{drive}}",reloadApp:"It seems like you're running an outdated version of the app. Please reload Connect to get the latest version."},j={cookiePolicy:"Cookie Policy",termsOfUse:"Terms of Use",disclaimer:"Disclaimer",builtWith:"Built with <icon /> Powerhouse"},F={message:"This website uses cookies for analytic purposes only. Cookies are anonymous and do not link to user data. We collect information to improve the user experience and validate UI changes. You can still use the page without cookies. For more information, please read our <a>cookies policy.</a>",accept:"Accept configured cookies",reject:"Reject all cookies",cookies:{functional:"Functional cookies",analytics:"Analytics cookies"}},O={common:A,searchbar:T,folderView:N,files:E,modals:I,notifications:P,footer:j,cookieBanner:F},R={en:{code:"en",name:"English",translation:O}};l.use(x).init({resources:R,fallbackLng:"en",debug:!1,interpolation:{escapeValue:!1}}).catch(e=>{console.error(e)});const W=b.routerBasename,c=`${W}:display-cookie-banner`,n=new Set;let d=Y();function Y(){try{return localStorage.getItem(c)!=="false"}catch(e){return console.error(e),!0}}function a(){return d}function L(e){d=e,localStorage.setItem(c,JSON.stringify(e))}function U(e){return n.add(e),()=>n.delete(e)}const z=()=>[g(U,a,a),L],K=(e,i)=>e.some(t=>t.id===i&&t.value),ee=()=>{const{t:e}=S(void 0,{useSuspense:!0,i18n:l}),{showModal:i}=C(),[t,s]=z(),[,r]=v(),u=[{id:"analytics-cookie",label:e("cookieBanner.cookies.analytics"),value:!0}],m=p=>{s(!1),K(p,"analytics-cookie")&&r(h=>({...h,analytics:!0}))},f=()=>{s(!1),r(()=>({analytics:!1,functional:!1,marketing:!1}))};return t?y("div",{className:"absolute inset-0 z-[10000] backdrop-blur-sm",children:[o("div",{className:"absolute inset-0 bg-black opacity-15"}),o("div",{className:"absolute inset-x-0 bottom-0 flex justify-center bg-white px-10 pb-16 pt-10 shadow-lg",children:o(D,{className:"max-w-[1024px] ",cookies:u,onSubmit:m,onReject:f,submitLabel:e("cookieBanner.accept"),rejectLabel:e("cookieBanner.reject"),children:o("p",{className:"font-semibold text-gray-500",children:o(B,{i18nKey:"cookieBanner.message",components:{a:o("a",{onClick:()=>i("cookiesPolicy",{}),className:"cursor-pointer text-gray-900 hover:underline"},"cookieBanner.message-link")}},"cookieBanner.message")})})})]}):null};export{ee as CookieBanner};
2
- //# sourceMappingURL=cookie-banner.CFaAyloc.js.map
1
+ import{jsxs as y,jsx as o}from"react/jsx-runtime";import{u as v}from"./useAcceptedCookies.D_OU6xT7.js";import{c as b}from"./connect.config.DFiOOfbL.js";import{useSyncExternalStore as g}from"react";import{i as l}from"./i18next.CqOP20KE.js";import{s as k,a as w,u as S}from"./useTranslation.BpVv6XIW.js";import{useModal as C}from"./modal.bK1fuPa_.js";import{v as D}from"./index.DFyMrewv.js";import{T as B}from"./Trans.-pu2RC5T.js";import"./browser.BkwNmV2Z.js";import"react-dom";const x={type:"3rdParty",init(e){k(e.options.react),w(e)}},A={cancel:"Cancel",delete:"Delete",continue:"Continue",empty:"Empty",create:"Create",save:"Save",export:"Export",reload:"Reload",reloadConnect:"Click here to reload Connect"},T={placeholder:"Search Powerhouse",filterLabel:"File type"},N={sections:{folders:{title:"Folders",empty:"No folders 🗂️"},documents:{title:"Documents and files",empty:"No documents or files 📄"}}},E={options:{switchboardLink:"Switchboard Link"}},I={deleteItem:{folder:{header:"Delete “{{item}}” folder?",body:"Are you sure you want to delete this folder? All files and subfolders within it will be removed."},file:{header:"Delete “{{item}}” file?",body:"Are you sure you want to delete this file?"}},deleteDrive:{title:'Delete "{{label}}" drive?',body:"Are you sure you want to delete this drive? All files and subfolders within it will be removed. Do you want to proceed?",inputPlaceholder:"Enter drive name..."},upgradeDrive:{header:"Upgrade to cloud drive",body:"You are moving files from a private to a shared drive. These files will become accessible to others in the shared drive.Do you want to proceed?"},createDocument:{header:"Create a new document",placeholder:"Document name"},connectSettings:{title:"Settings",body:"These settings will apply to all drives.",clearStorage:{button:"Clear Storage",description:"Delete previous session data",confirmation:{title:"Clear Storage",body:"Are you sure you want to clear the storage? This will remove all previous session data.",clearButton:"Clear Storage"}},enabledDocumentTypes:{title:"Document Models",description:"Documents enabled",allSelected:"All documents are selected"}},exportDocumentWithErrors:{title:"Your document contains errors",body:"Your document contains structure errors. Do you want to export it anyway?"},disclaimer:{title:"Disclaimer",body:"All content provided herein our website, hyperlinked sites, associated applications, forums, blogs, social media accounts and other platforms (“Site”) is for your general information only, procured from third party sources. We make no warranties of any kind in relation to our content, including but not limited to accuracy and updatedness. No part of the content that we provide constitutes financial advice, legal advice or any other form of advice meant for your specific reliance for any purpose. Any use or reliance on our content is solely at your own risk and discretion. You should conduct your own research, review, analyse and verify our content before relying on them. Trading is a highly risky activity that can lead to major losses, please therefore consult your financial advisor before making any decision. No content on our Site is meant to be a solicitation or offer."},cookiesPolicy:{title:"Cookies Policy",body:"<subtitle>Use of Cookies and Similar Technologies</subtitle><p>The Site is using cookies. Cookies are small text files that are placed on your computer by websites that you visit. They are widely used in order to make websites work, or work more efficiently, as well as to provide information to the owners of the site. Cookies are typically stored on your computer´s hard drive.Information collected from cookies is used by us to evaluate the effectiveness of our Site and analyze trends. The information collected from cookies allows us to determine such things as which parts of the Site are most visited and difficulties our visitors may experience in accessing the SIte. With this knowledge, we can improve the quality of your experience on the Site by recognizing and delivering more of the most desired features and information, as well as by resolving access difficulties.</p><p>We use third party service providers, to assist us in better understanding the use of our Site. Our service providers will place cookies on the hard drive of your computer (or use similar technologies) and will receive information that we select that will educate us on such things as how visitors navigate around our Site. This information is aggregated to provide statistical data about our users browsing actions and patterns, and does not personally identify individuals. This information may include:</p><p>Computer or mobile device information, Website usage information, such as:<list></p><bullet>Page views,</bullet><bullet>Button clicks,</bullet><bullet>Input form changes (without the values being entered),</bullet><bullet>Errors.</bullet></list><p>Our service providers analyses this information and provides us with aggregate reports. The information and analysis provided by our service providers will be used to assist us in better understanding our visitors interests in our Site and how to better serve those interests. If you want to avoid using cookies altogether, you can disable cookies in your browser. However, disabling cookies might make it impossible for you to use certain features of the Site. Your use of the Site with a browser that is configured to accept cookies constitutes an acceptance of our and third-party cookies.</p>"}},P={deleteDriveSuccess:"Drive successfully deleted",deleteFolderSuccess:"Folder deleted",fileDeleteSuccess:"File deleted",addDriveSuccess:"New drive successfully added",driveSyncSuccess:"Drive synced successfully",driveSyncError:"Error synchronizing drive {{drive}}",driveSyncConflict:"Conflict error detected in {{drive}}",reloadApp:"It seems like you're running an outdated version of the app. Please reload Connect to get the latest version."},j={cookiePolicy:"Cookie Policy",termsOfUse:"Terms of Use",disclaimer:"Disclaimer",builtWith:"Built with <icon /> Powerhouse"},F={message:"This website uses cookies for analytic purposes only. Cookies are anonymous and do not link to user data. We collect information to improve the user experience and validate UI changes. You can still use the page without cookies. For more information, please read our <a>cookies policy.</a>",accept:"Accept configured cookies",reject:"Reject all cookies",cookies:{functional:"Functional cookies",analytics:"Analytics cookies"}},O={common:A,searchbar:T,folderView:N,files:E,modals:I,notifications:P,footer:j,cookieBanner:F},R={en:{code:"en",name:"English",translation:O}};l.use(x).init({resources:R,fallbackLng:"en",debug:!1,interpolation:{escapeValue:!1}}).catch(e=>{console.error(e)});const W=b.routerBasename,c=`${W}:display-cookie-banner`,n=new Set;let d=Y();function Y(){try{return localStorage.getItem(c)!=="false"}catch(e){return console.error(e),!0}}function a(){return d}function L(e){d=e,localStorage.setItem(c,JSON.stringify(e))}function U(e){return n.add(e),()=>n.delete(e)}const z=()=>[g(U,a,a),L],K=(e,i)=>e.some(t=>t.id===i&&t.value),ee=()=>{const{t:e}=S(void 0,{useSuspense:!0,i18n:l}),{showModal:i}=C(),[t,s]=z(),[,r]=v(),u=[{id:"analytics-cookie",label:e("cookieBanner.cookies.analytics"),value:!0}],m=p=>{s(!1),K(p,"analytics-cookie")&&r(h=>({...h,analytics:!0}))},f=()=>{s(!1),r(()=>({analytics:!1,functional:!1,marketing:!1}))};return t?y("div",{className:"absolute inset-0 z-[10000] backdrop-blur-sm",children:[o("div",{className:"absolute inset-0 bg-black opacity-15"}),o("div",{className:"absolute inset-x-0 bottom-0 flex justify-center bg-white px-10 pb-16 pt-10 shadow-lg",children:o(D,{className:"max-w-[1024px] ",cookies:u,onSubmit:m,onReject:f,submitLabel:e("cookieBanner.accept"),rejectLabel:e("cookieBanner.reject"),children:o("p",{className:"font-semibold text-gray-500",children:o(B,{i18nKey:"cookieBanner.message",components:{a:o("a",{onClick:()=>i("cookiesPolicy",{}),className:"cursor-pointer text-gray-900 hover:underline"},"cookieBanner.message-link")}},"cookieBanner.message")})})})]}):null};export{ee as CookieBanner};
2
+ //# sourceMappingURL=cookie-banner.B_XhP7he.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"cookie-banner.CFaAyloc.js","sources":["../../../../node_modules/.pnpm/react-i18next@13.5.0_i18next@23.16.8_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-i18next/dist/es/initReactI18next.js","../../src/i18n/index.ts","../../src/hooks/useCookiebanner.ts","../../src/components/cookie-banner.tsx"],"sourcesContent":["import { setDefaults } from './defaults.js';\nimport { setI18n } from './i18nInstance.js';\nexport const initReactI18next = {\n type: '3rdParty',\n init(instance) {\n setDefaults(instance.options.react);\n setI18n(instance);\n }\n};","import i18n, { type Resource } from 'i18next';\nimport { initReactI18next } from 'react-i18next';\n\nimport translationEN from './locales/en.json' with { type: 'json' };\n\nconst resources: Resource = {\n en: {\n code: 'en',\n name: 'English',\n translation: translationEN,\n },\n};\n\ni18n.use(initReactI18next)\n .init({\n resources,\n fallbackLng: 'en',\n debug: false,\n interpolation: {\n escapeValue: false,\n },\n })\n .catch((e: unknown) => {\n console.error(e);\n });\n\nexport default i18n;\n","import connectConfig from '#connect-config';\nimport { useSyncExternalStore } from 'react';\n\nconst namespace = connectConfig.routerBasename;\n\nexport const COOKIE_BANNER_KEY_STORAGE = `${namespace}:display-cookie-banner`;\n\nconst listeners = new Set<() => void>();\n\nlet bannerShown = getInitial();\n\nfunction getInitial(): boolean {\n try {\n const value = localStorage.getItem(COOKIE_BANNER_KEY_STORAGE);\n return value !== 'false';\n } catch (error) {\n console.error(error);\n return true;\n }\n}\n\nfunction getCookieBannerState(): boolean {\n return bannerShown;\n}\n\nfunction setCookieBannerState(state: boolean) {\n bannerShown = state;\n localStorage.setItem(COOKIE_BANNER_KEY_STORAGE, JSON.stringify(state));\n}\n\nfunction subscribe(fn: () => void) {\n listeners.add(fn);\n return () => listeners.delete(fn);\n}\n\nexport const useCookieBanner = () => {\n const cookieBannerShown = useSyncExternalStore(\n subscribe,\n getCookieBannerState,\n getCookieBannerState,\n );\n return [cookieBannerShown, setCookieBannerState] as const;\n};\n","import {\n type CookieInput,\n CookieBanner as PHCookieBanner,\n} from '@powerhousedao/design-system';\nimport { Trans, useTranslation } from 'react-i18next';\nimport { useAcceptedCookies } from '../hooks/useAcceptedCookies.js';\nimport { useCookieBanner } from '../hooks/useCookiebanner.js';\nimport i18n from '../i18n';\nimport { useModal } from './modal/index.js';\n\nconst isCookieAccepted = (cookies: CookieInput[], id: string) => {\n return cookies.some(cookie => cookie.id === id && cookie.value);\n};\n\nexport const CookieBanner = () => {\n const { t } = useTranslation(undefined, {\n useSuspense: true,\n i18n,\n });\n const { showModal } = useModal();\n const [showBanner, setShowBanner] = useCookieBanner();\n const [, setAcceptedCookies] = useAcceptedCookies();\n\n const cookiesInput: CookieInput[] = [\n {\n id: 'analytics-cookie',\n label: t('cookieBanner.cookies.analytics'),\n value: true,\n },\n ];\n\n const handleAccept = (cookies: CookieInput[]) => {\n setShowBanner(false);\n\n if (isCookieAccepted(cookies, 'analytics-cookie')) {\n setAcceptedCookies(acceptedCookies => ({\n ...acceptedCookies,\n analytics: true,\n }));\n }\n };\n\n const handleReject = () => {\n setShowBanner(false);\n setAcceptedCookies(() => ({\n analytics: false,\n functional: false,\n marketing: false,\n }));\n };\n\n if (!showBanner) {\n return null;\n }\n\n return (\n <div className=\"absolute inset-0 z-[10000] backdrop-blur-sm\">\n <div className=\"absolute inset-0 bg-black opacity-15\" />\n <div className=\"absolute inset-x-0 bottom-0 flex justify-center bg-white px-10 pb-16 pt-10 shadow-lg\">\n <PHCookieBanner\n className=\"max-w-[1024px] \"\n cookies={cookiesInput}\n onSubmit={handleAccept}\n onReject={handleReject}\n submitLabel={t('cookieBanner.accept')}\n rejectLabel={t('cookieBanner.reject')}\n >\n <p className=\"font-semibold text-gray-500\">\n <Trans\n key={'cookieBanner.message'}\n i18nKey=\"cookieBanner.message\"\n components={{\n a: (\n <a\n onClick={() =>\n showModal('cookiesPolicy', {})\n }\n key={'cookieBanner.message-link'}\n className=\"cursor-pointer text-gray-900 hover:underline\"\n />\n ),\n }}\n />\n </p>\n </PHCookieBanner>\n </div>\n </div>\n );\n};\n"],"names":["initReactI18next","instance","setDefaults","setI18n","resources","translationEN","i18n","namespace","connectConfig","COOKIE_BANNER_KEY_STORAGE","listeners","bannerShown","getInitial","error","getCookieBannerState","setCookieBannerState","state","subscribe","fn","useCookieBanner","useSyncExternalStore","isCookieAccepted","cookies","id","cookie","CookieBanner","t","useTranslation","showModal","useModal","showBanner","setShowBanner","setAcceptedCookies","useAcceptedCookies","cookiesInput","handleAccept","acceptedCookies","handleReject","jsxs","jsx","PHCookieBanner","Trans"],"mappings":"6dAEO,MAAMA,EAAmB,CAC9B,KAAM,WACN,KAAKC,EAAU,CACbC,EAAYD,EAAS,QAAQ,KAAK,EAClCE,EAAQF,CAAQ,CACpB,CACA,47LCHMG,EAAsB,CACxB,GAAI,CACA,KAAM,KACN,KAAM,UACN,YAAaC,CAAA,CAErB,EAEAC,EAAK,IAAIN,CAAgB,EACpB,KAAK,CACF,UAAAI,EACA,YAAa,KACb,MAAO,GACP,cAAe,CACX,YAAa,EAAA,CAErB,CAAC,EACA,MAAO,GAAe,CACnB,QAAQ,MAAM,CAAC,CACnB,CAAC,ECrBL,MAAMG,EAAYC,EAAc,eAEnBC,EAA4B,GAAGF,CAAS,yBAE/CG,MAAgB,IAEtB,IAAIC,EAAcC,EAAA,EAElB,SAASA,GAAsB,CAC3B,GAAI,CAEA,OADc,aAAa,QAAQH,CAAyB,IAC3C,OAAA,OACZI,EAAO,CACZ,eAAQ,MAAMA,CAAK,EACZ,EAAA,CAEf,CAEA,SAASC,GAAgC,CACrC,OAAOH,CACX,CAEA,SAASI,EAAqBC,EAAgB,CA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,uBACR,WAAY,CACR,EACIF,EAAC,IAAA,CACG,QAAS,IACLX,EAAU,gBAAiB,EAAE,EAGjC,UAAU,8CAAA,EADL,2BAAA,CAET,CAER,EAZK,sBAAA,CAaT,CACJ,CAAA,CAAA,CACJ,CACJ,CAAA,EACJ,EAlCO,IAoCf","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"cookie-banner.B_XhP7he.js","sources":["../../../../node_modules/.pnpm/react-i18next@13.5.0_i18next@23.16.8_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-i18next/dist/es/initReactI18next.js","../../src/i18n/index.ts","../../src/hooks/useCookiebanner.ts","../../src/components/cookie-banner.tsx"],"sourcesContent":["import { setDefaults } from './defaults.js';\nimport { setI18n } from './i18nInstance.js';\nexport const initReactI18next = {\n type: '3rdParty',\n init(instance) {\n setDefaults(instance.options.react);\n setI18n(instance);\n }\n};","import i18n, { type Resource } from 'i18next';\nimport { initReactI18next } from 'react-i18next';\n\nimport translationEN from './locales/en.json' with { type: 'json' };\n\nconst resources: Resource = {\n en: {\n code: 'en',\n name: 'English',\n translation: translationEN,\n },\n};\n\ni18n.use(initReactI18next)\n .init({\n resources,\n fallbackLng: 'en',\n debug: false,\n interpolation: {\n escapeValue: false,\n },\n })\n .catch((e: unknown) => {\n console.error(e);\n });\n\nexport default i18n;\n","import connectConfig from '#connect-config';\nimport { useSyncExternalStore } from 'react';\n\nconst namespace = connectConfig.routerBasename;\n\nexport const COOKIE_BANNER_KEY_STORAGE = `${namespace}:display-cookie-banner`;\n\nconst listeners = new Set<() => void>();\n\nlet bannerShown = getInitial();\n\nfunction getInitial(): boolean {\n try {\n const value = localStorage.getItem(COOKIE_BANNER_KEY_STORAGE);\n return value !== 'false';\n } catch (error) {\n console.error(error);\n return true;\n }\n}\n\nfunction getCookieBannerState(): boolean {\n return bannerShown;\n}\n\nfunction setCookieBannerState(state: boolean) {\n bannerShown = state;\n localStorage.setItem(COOKIE_BANNER_KEY_STORAGE, JSON.stringify(state));\n}\n\nfunction subscribe(fn: () => void) {\n listeners.add(fn);\n return () => listeners.delete(fn);\n}\n\nexport const useCookieBanner = () => {\n const cookieBannerShown = useSyncExternalStore(\n subscribe,\n getCookieBannerState,\n getCookieBannerState,\n );\n return [cookieBannerShown, setCookieBannerState] as const;\n};\n","import {\n type CookieInput,\n CookieBanner as PHCookieBanner,\n} from '@powerhousedao/design-system';\nimport { Trans, useTranslation } from 'react-i18next';\nimport { useAcceptedCookies } from '../hooks/useAcceptedCookies.js';\nimport { useCookieBanner } from '../hooks/useCookiebanner.js';\nimport i18n from '../i18n';\nimport { useModal } from './modal/index.js';\n\nconst isCookieAccepted = (cookies: CookieInput[], id: string) => {\n return cookies.some(cookie => cookie.id === id && cookie.value);\n};\n\nexport const CookieBanner = () => {\n const { t } = useTranslation(undefined, {\n useSuspense: true,\n i18n,\n });\n const { showModal } = useModal();\n const [showBanner, setShowBanner] = useCookieBanner();\n const [, setAcceptedCookies] = useAcceptedCookies();\n\n const cookiesInput: CookieInput[] = [\n {\n id: 'analytics-cookie',\n label: t('cookieBanner.cookies.analytics'),\n value: true,\n },\n ];\n\n const handleAccept = (cookies: CookieInput[]) => {\n setShowBanner(false);\n\n if (isCookieAccepted(cookies, 'analytics-cookie')) {\n setAcceptedCookies(acceptedCookies => ({\n ...acceptedCookies,\n analytics: true,\n }));\n }\n };\n\n const handleReject = () => {\n setShowBanner(false);\n setAcceptedCookies(() => ({\n analytics: false,\n functional: false,\n marketing: false,\n }));\n };\n\n if (!showBanner) {\n return null;\n }\n\n return (\n <div className=\"absolute inset-0 z-[10000] backdrop-blur-sm\">\n <div className=\"absolute inset-0 bg-black opacity-15\" />\n <div className=\"absolute inset-x-0 bottom-0 flex justify-center bg-white px-10 pb-16 pt-10 shadow-lg\">\n <PHCookieBanner\n className=\"max-w-[1024px] \"\n cookies={cookiesInput}\n onSubmit={handleAccept}\n onReject={handleReject}\n submitLabel={t('cookieBanner.accept')}\n rejectLabel={t('cookieBanner.reject')}\n >\n <p className=\"font-semibold text-gray-500\">\n <Trans\n key={'cookieBanner.message'}\n i18nKey=\"cookieBanner.message\"\n components={{\n a: (\n <a\n onClick={() =>\n showModal('cookiesPolicy', {})\n }\n key={'cookieBanner.message-link'}\n className=\"cursor-pointer text-gray-900 hover:underline\"\n />\n ),\n }}\n />\n </p>\n </PHCookieBanner>\n </div>\n </div>\n );\n};\n"],"names":["initReactI18next","instance","setDefaults","setI18n","resources","translationEN","i18n","namespace","connectConfig","COOKIE_BANNER_KEY_STORAGE","listeners","bannerShown","getInitial","error","getCookieBannerState","setCookieBannerState","state","subscribe","fn","useCookieBanner","useSyncExternalStore","isCookieAccepted","cookies","id","cookie","CookieBanner","t","useTranslation","showModal","useModal","showBanner","setShowBanner","setAcceptedCookies","useAcceptedCookies","cookiesInput","handleAccept","acceptedCookies","handleReject","jsxs","jsx","PHCookieBanner","Trans"],"mappings":"6dAEO,MAAMA,EAAmB,CAC9B,KAAM,WACN,KAAKC,EAAU,CACbC,EAAYD,EAAS,QAAQ,KAAK,EAClCE,EAAQF,CAAQ,CACpB,CACA,47LCHMG,EAAsB,CACxB,GAAI,CACA,KAAM,KACN,KAAM,UACN,YAAaC,CAAA,CAErB,EAEAC,EAAK,IAAIN,CAAgB,EACpB,KAAK,CACF,UAAAI,EACA,YAAa,KACb,MAAO,GACP,cAAe,CACX,YAAa,EAAA,CAErB,CAAC,EACA,MAAO,GAAe,CACnB,QAAQ,MAAM,CAAC,CACnB,CAAC,ECrBL,MAAMG,EAAYC,EAAc,eAEnBC,EAA4B,GAAGF,CAAS,yBAE/CG,MAAgB,IAEtB,IAAIC,EAAcC,EAAA,EAElB,SAASA,GAAsB,CAC3B,GAAI,CAEA,OADc,aAAa,QAAQH,CAAyB,IAC3C,OAAA,OACZI,EAAO,CACZ,eAAQ,MAAMA,CAAK,EACZ,EAAA,CAEf,CAEA,SAASC,GAAgC,CACrC,OAAOH,CACX,CAEA,SAASI,EAAqBC,EAAgB,CAC1CL,EAAcK,EACd,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,EACIF,EAAC,IAAA,CACG,QAAS,IACLX,EAAU,gBAAiB,EAAE,EAGjC,UAAU,8CAAA,EADL,2BAAA,CAET,CAER,EAZK,sBAAA,CAaT,CACJ,CAAA,CAAA,CACJ,CACJ,CAAA,EACJ,EAlCO,IAoCf","x_google_ignoreList":[0]}
@@ -1,2 +1,2 @@
1
- import{jsxs as C,jsx as r}from"react/jsx-runtime";import{useCallback as c}from"react";import{a as A}from"./user.BQU9ztVh.js";import{x as g,H as v,y as I,z as S,B as p}from"./index.DFyMrewv.js";import{u as x}from"./modals.BgBl4OEM.js";import{u as H}from"./useDocumentDriveServer.DiA5ncH8.js";import{u as k}from"./useConnectConfig.PFYS-3o2.js";import"./connect.config.DUXg7xh4.js";import"./browser.BkwNmV2Z.js";import"./index.BDEjD6s0.js";import"react-dom/client";import"./app-skeleton.js";import"react-dom";import"./i18next.CqOP20KE.js";import"./slug.C6xW_7Wm.js";import"./modal.BurIaDHm.js";import"./useFeatureFlags.Dp7X50k3.js";function E(o){return o.icon?r("img",{src:o.icon,alt:o.name,height:32,width:32}):o.sharingType==="LOCAL"?r(p,{name:"Hdd",size:32}):r(p,{name:"Server",size:32})}function Q(){const o=A(),i=x(),{documentDrives:a}=H(),{driveNodes:d,setSelectedNode:n}=g(),[u]=k(),l=c(e=>{n(e)},[n]),f=c(()=>{i()},[i]);return C(v,{children:[d.map(e=>{var s;const t=a.find(h=>h.header.id===e.id),m=(s=t==null?void 0:t.header.meta)==null?void 0:s.preferredEditor,D=m?o(m):void 0;return r(I,{title:e.name,description:D||"Drive Explorer App",icon:E(e),onClick:()=>l(e)},e.id)}),u.drives.addDriveEnabled&&r(S,{onClick:f})]})}export{Q as Home};
2
- //# sourceMappingURL=home.Dms1SdKb.js.map
1
+ import{jsxs as C,jsx as r}from"react/jsx-runtime";import{useCallback as c}from"react";import{a as A}from"./user.C5X0s2J6.js";import{x as g,H as v,y as I,z as S,B as p}from"./index.DFyMrewv.js";import{u as x}from"./modals.CkpMpa3F.js";import{u as H}from"./useDocumentDriveServer.B5iYllwN.js";import{u as k}from"./useConnectConfig.BvkNvwSB.js";import"./connect.config.DFiOOfbL.js";import"./browser.BkwNmV2Z.js";import"./index.CrfEkaEE.js";import"react-dom/client";import"./app-skeleton.js";import"react-dom";import"./i18next.CqOP20KE.js";import"./slug.C6xW_7Wm.js";import"./modal.bK1fuPa_.js";import"./useFeatureFlags.CZev5A6L.js";function E(o){return o.icon?r("img",{src:o.icon,alt:o.name,height:32,width:32}):o.sharingType==="LOCAL"?r(p,{name:"Hdd",size:32}):r(p,{name:"Server",size:32})}function Q(){const o=A(),i=x(),{documentDrives:a}=H(),{driveNodes:d,setSelectedNode:n}=g(),[u]=k(),l=c(e=>{n(e)},[n]),f=c(()=>{i()},[i]);return C(v,{children:[d.map(e=>{var s;const t=a.find(h=>h.header.id===e.id),m=(s=t==null?void 0:t.header.meta)==null?void 0:s.preferredEditor,D=m?o(m):void 0;return r(I,{title:e.name,description:D||"Drive Explorer App",icon:E(e),onClick:()=>l(e)},e.id)}),u.drives.addDriveEnabled&&r(S,{onClick:f})]})}export{Q as Home};
2
+ //# sourceMappingURL=home.C_U1tfub.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"home.Dms1SdKb.js","sources":["../../src/pages/home.tsx"],"sourcesContent":["import {\n useConnectConfig,\n useDocumentDriveServer,\n useShowAddDriveModal,\n} from '#hooks';\nimport { useGetAppNameForEditorId } from '#store';\nimport {\n HomeScreen,\n HomeScreenAddDriveItem,\n HomeScreenItem,\n Icon,\n type UiDriveNode,\n} from '@powerhousedao/design-system';\nimport { useUiNodesContext } from '@powerhousedao/reactor-browser';\nimport { useCallback } from 'react';\n\nfunction getDriveIcon(driveNode: UiDriveNode) {\n if (driveNode.icon) {\n return (\n <img\n src={driveNode.icon}\n alt={driveNode.name}\n height={32}\n width={32}\n />\n );\n }\n if (driveNode.sharingType === 'LOCAL') {\n return <Icon name=\"Hdd\" size={32} />;\n } else {\n return <Icon name=\"Server\" size={32} />;\n }\n}\n\nexport function Home() {\n const getAppDescriptionForEditorId = useGetAppNameForEditorId();\n const showAddDriveModal = useShowAddDriveModal();\n const { documentDrives } = useDocumentDriveServer();\n const { driveNodes, setSelectedNode } = useUiNodesContext();\n const [config] = useConnectConfig();\n const handleDriveClick = useCallback(\n (driveNode: UiDriveNode) => {\n setSelectedNode(driveNode);\n },\n [setSelectedNode],\n );\n\n const onAddDriveClick = useCallback(() => {\n showAddDriveModal();\n }, [showAddDriveModal]);\n\n return (\n <HomeScreen>\n {driveNodes.map(driveNode => {\n const drive = documentDrives.find(\n d => d.header.id === driveNode.id,\n );\n const editorId = drive?.header.meta?.preferredEditor;\n const appName = editorId\n ? getAppDescriptionForEditorId(editorId)\n : undefined;\n return (\n <HomeScreenItem\n key={driveNode.id}\n title={driveNode.name}\n description={appName || 'Drive Explorer App'}\n icon={getDriveIcon(driveNode)}\n onClick={() => handleDriveClick(driveNode)}\n />\n );\n })}\n {config.drives.addDriveEnabled && (\n <HomeScreenAddDriveItem onClick={onAddDriveClick} />\n )}\n </HomeScreen>\n );\n}\n"],"names":["getDriveIcon","driveNode","jsx","Icon","Home","getAppDescriptionForEditorId","useGetAppNameForEditorId","showAddDriveModal","useShowAddDriveModal","documentDrives","useDocumentDriveServer","driveNodes","setSelectedNode","useUiNodesContext","config","useConnectConfig","handleDriveClick","useCallback","onAddDriveClick","HomeScreen","drive","d","editorId","_a","appName","HomeScreenItem","HomeScreenAddDriveItem"],"mappings":"qnBAgBA,SAASA,EAAaC,EAAwB,CAC1C,OAAIA,EAAU,KAENC,EAAC,MAAA,CACG,IAAKD,EAAU,KACf,IAAKA,EAAU,KACf,OAAQ,GACR,MAAO,EAAA,CAAA,EAIfA,EAAU,cAAgB,QACnBC,EAACC,EAAA,CAAK,KAAK,MAAM,KAAM,GAAI,EAE3BD,EAACC,EAAA,CAAK,KAAK,SAAS,KAAM,GAAI,CAE7C,CAEO,SAASC,GAAO,CACnB,MAAMC,EAA+BC,EAAA,EAC/BC,EAAoBC,EAAA,EACpB,CAAE,eAAAC,CAAA,EAAmBC,EAAA,EACrB,CAAE,WAAAC,EAAY,gBAAAC,CAAA,EAAoBC,EAAA,EAClC,CAACC,CAAM,EAAIC,EAAA,EACXC,EAAmBC,EACpBhB,GAA2B,CACxBW,EAAgBX,CAAS,CAAA,EAE7B,CAACW,CAAe,CAAA,EAGdM,EAAkBD,EAAY,IAAM,CACtCV,EAAA,CAAkB,EACnB,CAACA,CAAiB,CAAC,EAEtB,SACKY,EAAA,CACI,SAAA,CAAAR,EAAW,IAAIV,GAAa,OACzB,MAAMmB,EAAQX,EAAe,KACzBY,GAAKA,EAAE,OAAO,KAAOpB,EAAU,EAAA,EAE7BqB,GAAWC,EAAAH,GAAA,YAAAA,EAAO,OAAO,OAAd,YAAAG,EAAoB,gBAC/BC,EAAUF,EACVjB,EAA6BiB,CAAQ,EACrC,OACN,OACIpB,EAACuB,EAAA,CAEG,MAAOxB,EAAU,KACjB,YAAauB,GAAW,qBACxB,KAAMxB,EAAaC,CAAS,EAC5B,QAAS,IAAMe,EAAiBf,CAAS,CAAA,EAJpCA,EAAU,EAAA,CAKnB,CAEP,EACAa,EAAO,OAAO,iBACXZ,EAACwB,EAAA,CAAuB,QAASR,CAAA,CAAiB,CAAA,EAE1D,CAER"}
1
+ {"version":3,"file":"home.C_U1tfub.js","sources":["../../src/pages/home.tsx"],"sourcesContent":["import {\n useConnectConfig,\n useDocumentDriveServer,\n useShowAddDriveModal,\n} from '#hooks';\nimport { useGetAppNameForEditorId } from '#store';\nimport {\n HomeScreen,\n HomeScreenAddDriveItem,\n HomeScreenItem,\n Icon,\n type UiDriveNode,\n} from '@powerhousedao/design-system';\nimport { useUiNodesContext } from '@powerhousedao/reactor-browser';\nimport { useCallback } from 'react';\n\nfunction getDriveIcon(driveNode: UiDriveNode) {\n if (driveNode.icon) {\n return (\n <img\n src={driveNode.icon}\n alt={driveNode.name}\n height={32}\n width={32}\n />\n );\n }\n if (driveNode.sharingType === 'LOCAL') {\n return <Icon name=\"Hdd\" size={32} />;\n } else {\n return <Icon name=\"Server\" size={32} />;\n }\n}\n\nexport function Home() {\n const getAppDescriptionForEditorId = useGetAppNameForEditorId();\n const showAddDriveModal = useShowAddDriveModal();\n const { documentDrives } = useDocumentDriveServer();\n const { driveNodes, setSelectedNode } = useUiNodesContext();\n const [config] = useConnectConfig();\n const handleDriveClick = useCallback(\n (driveNode: UiDriveNode) => {\n setSelectedNode(driveNode);\n },\n [setSelectedNode],\n );\n\n const onAddDriveClick = useCallback(() => {\n showAddDriveModal();\n }, [showAddDriveModal]);\n\n return (\n <HomeScreen>\n {driveNodes.map(driveNode => {\n const drive = documentDrives.find(\n d => d.header.id === driveNode.id,\n );\n const editorId = drive?.header.meta?.preferredEditor;\n const appName = editorId\n ? getAppDescriptionForEditorId(editorId)\n : undefined;\n return (\n <HomeScreenItem\n key={driveNode.id}\n title={driveNode.name}\n description={appName || 'Drive Explorer App'}\n icon={getDriveIcon(driveNode)}\n onClick={() => handleDriveClick(driveNode)}\n />\n );\n })}\n {config.drives.addDriveEnabled && (\n <HomeScreenAddDriveItem onClick={onAddDriveClick} />\n )}\n </HomeScreen>\n );\n}\n"],"names":["getDriveIcon","driveNode","jsx","Icon","Home","getAppDescriptionForEditorId","useGetAppNameForEditorId","showAddDriveModal","useShowAddDriveModal","documentDrives","useDocumentDriveServer","driveNodes","setSelectedNode","useUiNodesContext","config","useConnectConfig","handleDriveClick","useCallback","onAddDriveClick","HomeScreen","drive","d","editorId","_a","appName","HomeScreenItem","HomeScreenAddDriveItem"],"mappings":"qnBAgBA,SAASA,EAAaC,EAAwB,CAC1C,OAAIA,EAAU,KAENC,EAAC,MAAA,CACG,IAAKD,EAAU,KACf,IAAKA,EAAU,KACf,OAAQ,GACR,MAAO,EAAA,CAAA,EAIfA,EAAU,cAAgB,QACnBC,EAACC,EAAA,CAAK,KAAK,MAAM,KAAM,GAAI,EAE3BD,EAACC,EAAA,CAAK,KAAK,SAAS,KAAM,GAAI,CAE7C,CAEO,SAASC,GAAO,CACnB,MAAMC,EAA+BC,EAAA,EAC/BC,EAAoBC,EAAA,EACpB,CAAE,eAAAC,CAAA,EAAmBC,EAAA,EACrB,CAAE,WAAAC,EAAY,gBAAAC,CAAA,EAAoBC,EAAA,EAClC,CAACC,CAAM,EAAIC,EAAA,EACXC,EAAmBC,EACpBhB,GAA2B,CACxBW,EAAgBX,CAAS,CAAA,EAE7B,CAACW,CAAe,CAAA,EAGdM,EAAkBD,EAAY,IAAM,CACtCV,EAAA,CAAkB,EACnB,CAACA,CAAiB,CAAC,EAEtB,SACKY,EAAA,CACI,SAAA,CAAAR,EAAW,IAAIV,GAAa,OACzB,MAAMmB,EAAQX,EAAe,KACzBY,GAAKA,EAAE,OAAO,KAAOpB,EAAU,EAAA,EAE7BqB,GAAWC,EAAAH,GAAA,YAAAA,EAAO,OAAO,OAAd,YAAAG,EAAoB,gBAC/BC,EAAUF,EACVjB,EAA6BiB,CAAQ,EACrC,OACN,OACIpB,EAACuB,EAAA,CAEG,MAAOxB,EAAU,KACjB,YAAauB,GAAW,qBACxB,KAAMxB,EAAaC,CAAS,EAC5B,QAAS,IAAMe,EAAiBf,CAAS,CAAA,EAJpCA,EAAU,EAAA,CAKnB,CAEP,EACAa,EAAO,OAAO,iBACXZ,EAACwB,EAAA,CAAuB,QAASR,CAAA,CAAiB,CAAA,EAE1D,CAER"}
@@ -1,2 +1,2 @@
1
- var C=r=>{throw TypeError(r)};var R=(r,t,e)=>t.has(r)||C("Cannot "+e);var a=(r,t,e)=>(R(r,t,"read from private field"),e?e.call(r):t.get(r)),c=(r,t,e)=>t.has(r)?C("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(r):t.set(r,e),d=(r,t,e,s)=>(R(r,t,"write to private field"),s?s.call(r,e):t.set(r,e),e),i=(r,t,e)=>(R(r,t,"access private method"),e);import{at as B,au as L,av as S,aw as U,ax as k,ay as x,az as T,aA as j,aB as A,aC as _,n as b}from"./index.DFyMrewv.js";import{R as $,k as D,l as P}from"./useFeatureFlags.Dp7X50k3.js";import{c as z}from"./connect.config.DUXg7xh4.js";const J=[U,k,x,T,j,A];function K(r){return J.find(t=>t.id===r)}let E=S({chain:U,batch:{multicall:!0},transport:_()});function F(r){var e;if(((e=E.chain)==null?void 0:e.id)===r)return;const t=K(r);if(!t)throw new Error(`Invalid chain id: ${r}`);E=S({chain:t,batch:{multicall:!0},transport:_()})}const G=async(r,t)=>{const e={};try{F(t);const s=await B(E,{address:r});if(s){e.name=s;const n=await L(E,{name:s});n&&(e.avatarUrl=n)}}catch(s){console.error(s)}return e};function y(r){const t=r.split(":");if(!r.startsWith("did:pkh:")||t.length!==5)throw new Error("Invalid pkh did");const[,,e,s,n]=t;if(!n.startsWith("0x"))throw new Error(`Invalid address: ${n}`);const h=Number(s);if(isNaN(h))throw new Error(`Invalid chain id: ${s}`);return{chainId:h,networkId:e,address:n}}var u,v,f,I;class H{constructor(t,e){c(this,f);c(this,u);c(this,v);d(this,u,t),d(this,v,e)}get(t){return a(this,u).get(i(this,f,I).call(this,t))}set(t,e){return a(this,u).set(i(this,f,I).call(this,t),e)}delete(t){return a(this,u).delete(i(this,f,I).call(this,t))}}u=new WeakMap,v=new WeakMap,f=new WeakSet,I=function(t){return`${a(this,v)}:${t.toString()}`};const M={get:function(r){const t=localStorage.getItem(r);if(t)return JSON.parse(t)},set:function(r,t){return t?localStorage.setItem(r,JSON.stringify(t)):localStorage.removeItem(r)},delete:function(r){return localStorage.removeItem(r)}};class q extends H{constructor(t){super(M,`${z.routerBasename}:${t}`)}}function Q(r){return new O(new q("renown"),r)}var m,g,w,p,o,l,W;class O{constructor(t,e,s=$){c(this,o);c(this,m);c(this,g);c(this,w);c(this,p,new EventTarget);d(this,g,t),d(this,w,e),d(this,m,s),this.user&&this.login(this.user.did).catch(()=>{})}get user(){return a(this,g).get("user")}set connectId(t){d(this,w,t);const e=this.user;i(this,o,l).call(this,void 0),e&&this.login(e.did).catch(s=>{console.log("User no longer authenticated:",s)})}async login(t){try{const e=y(t),s=await i(this,o,W).call(this,e.address,e.chainId,a(this,w));if(!s)throw i(this,o,l).call(this,void 0),new Error("Credential not found");const n={...e,did:t,credential:s};return G(n.address,n.chainId).then(h=>{var N;((N=this.user)==null?void 0:N.address)===n.address&&this.user.chainId===n.chainId&&i(this,o,l).call(this,{...this.user,ens:h})}).catch(b.error),i(this,o,l).call(this,n),n}catch(e){throw b.error(e),i(this,o,l).call(this,void 0),e}}logout(){i(this,o,l).call(this,void 0)}on(t,e){const s=n=>{e(n.detail)};return a(this,p).addEventListener(t,s),()=>{a(this,p).removeEventListener(t,s)}}}m=new WeakMap,g=new WeakMap,w=new WeakMap,p=new WeakMap,o=new WeakSet,l=function(t){t?a(this,g).set("user",t):a(this,g).delete("user"),a(this,p).dispatchEvent(new CustomEvent("user",{detail:t}))},W=async function(t,e,s){if(!a(this,m))throw new Error("RENOWN_URL is not set");const n=new URL(`/api/auth/credential?address=${encodeURIComponent(t)}&chainId=${encodeURIComponent(e)}&connectId=${encodeURIComponent(s)}`,a(this,m)),h=await fetch(n,{method:"GET"});if(h.ok)return(await h.json()).credential;throw new Error("Failed to get credential")};const tt=Object.freeze(Object.defineProperty({__proto__:null,RENOWN_CHAIN_ID:P,RENOWN_NETWORK_ID:D,RENOWN_URL:$,Renown:O,initRenownBrowser:Q,parsePkhDid:y},Symbol.toStringTag,{value:"Module"}));export{H as B,O as R,G as a,tt as b,K as g,Q as i,y as p};
2
- //# sourceMappingURL=index.B0EhmKCF.js.map
1
+ var C=r=>{throw TypeError(r)};var R=(r,t,e)=>t.has(r)||C("Cannot "+e);var a=(r,t,e)=>(R(r,t,"read from private field"),e?e.call(r):t.get(r)),c=(r,t,e)=>t.has(r)?C("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(r):t.set(r,e),d=(r,t,e,s)=>(R(r,t,"write to private field"),s?s.call(r,e):t.set(r,e),e),i=(r,t,e)=>(R(r,t,"access private method"),e);import{at as B,au as L,av as S,aw as U,ax as k,ay as x,az as T,aA as j,aB as A,aC as _,n as b}from"./index.DFyMrewv.js";import{R as $,k as D,l as P}from"./useFeatureFlags.CZev5A6L.js";import{c as z}from"./connect.config.DFiOOfbL.js";const J=[U,k,x,T,j,A];function K(r){return J.find(t=>t.id===r)}let E=S({chain:U,batch:{multicall:!0},transport:_()});function F(r){var e;if(((e=E.chain)==null?void 0:e.id)===r)return;const t=K(r);if(!t)throw new Error(`Invalid chain id: ${r}`);E=S({chain:t,batch:{multicall:!0},transport:_()})}const G=async(r,t)=>{const e={};try{F(t);const s=await B(E,{address:r});if(s){e.name=s;const n=await L(E,{name:s});n&&(e.avatarUrl=n)}}catch(s){console.error(s)}return e};function y(r){const t=r.split(":");if(!r.startsWith("did:pkh:")||t.length!==5)throw new Error("Invalid pkh did");const[,,e,s,n]=t;if(!n.startsWith("0x"))throw new Error(`Invalid address: ${n}`);const h=Number(s);if(isNaN(h))throw new Error(`Invalid chain id: ${s}`);return{chainId:h,networkId:e,address:n}}var u,v,f,I;class H{constructor(t,e){c(this,f);c(this,u);c(this,v);d(this,u,t),d(this,v,e)}get(t){return a(this,u).get(i(this,f,I).call(this,t))}set(t,e){return a(this,u).set(i(this,f,I).call(this,t),e)}delete(t){return a(this,u).delete(i(this,f,I).call(this,t))}}u=new WeakMap,v=new WeakMap,f=new WeakSet,I=function(t){return`${a(this,v)}:${t.toString()}`};const M={get:function(r){const t=localStorage.getItem(r);if(t)return JSON.parse(t)},set:function(r,t){return t?localStorage.setItem(r,JSON.stringify(t)):localStorage.removeItem(r)},delete:function(r){return localStorage.removeItem(r)}};class q extends H{constructor(t){super(M,`${z.routerBasename}:${t}`)}}function Q(r){return new O(new q("renown"),r)}var m,g,w,p,o,l,W;class O{constructor(t,e,s=$){c(this,o);c(this,m);c(this,g);c(this,w);c(this,p,new EventTarget);d(this,g,t),d(this,w,e),d(this,m,s),this.user&&this.login(this.user.did).catch(()=>{})}get user(){return a(this,g).get("user")}set connectId(t){d(this,w,t);const e=this.user;i(this,o,l).call(this,void 0),e&&this.login(e.did).catch(s=>{console.log("User no longer authenticated:",s)})}async login(t){try{const e=y(t),s=await i(this,o,W).call(this,e.address,e.chainId,a(this,w));if(!s)throw i(this,o,l).call(this,void 0),new Error("Credential not found");const n={...e,did:t,credential:s};return G(n.address,n.chainId).then(h=>{var N;((N=this.user)==null?void 0:N.address)===n.address&&this.user.chainId===n.chainId&&i(this,o,l).call(this,{...this.user,ens:h})}).catch(b.error),i(this,o,l).call(this,n),n}catch(e){throw b.error(e),i(this,o,l).call(this,void 0),e}}logout(){i(this,o,l).call(this,void 0)}on(t,e){const s=n=>{e(n.detail)};return a(this,p).addEventListener(t,s),()=>{a(this,p).removeEventListener(t,s)}}}m=new WeakMap,g=new WeakMap,w=new WeakMap,p=new WeakMap,o=new WeakSet,l=function(t){t?a(this,g).set("user",t):a(this,g).delete("user"),a(this,p).dispatchEvent(new CustomEvent("user",{detail:t}))},W=async function(t,e,s){if(!a(this,m))throw new Error("RENOWN_URL is not set");const n=new URL(`/api/auth/credential?address=${encodeURIComponent(t)}&chainId=${encodeURIComponent(e)}&connectId=${encodeURIComponent(s)}`,a(this,m)),h=await fetch(n,{method:"GET"});if(h.ok)return(await h.json()).credential;throw new Error("Failed to get credential")};const tt=Object.freeze(Object.defineProperty({__proto__:null,RENOWN_CHAIN_ID:P,RENOWN_NETWORK_ID:D,RENOWN_URL:$,Renown:O,initRenownBrowser:Q,parsePkhDid:y},Symbol.toStringTag,{value:"Module"}));export{H as B,O as R,G as a,tt as b,K as g,Q as i,y as p};
2
+ //# sourceMappingURL=index.BAvGLKEb.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.B0EhmKCF.js","sources":["../../src/services/viem.ts","../../src/services/renown/utils.ts","../../src/services/storage/index.ts","../../src/services/storage/browser.ts","../../src/services/renown/browser.ts","../../src/services/renown/index.ts"],"sourcesContent":["import { createPublicClient, http, type PublicClient } from 'viem';\nimport { getEnsAvatar, getEnsName } from 'viem/actions';\nimport {\n arbitrum,\n base,\n type Chain,\n goerli,\n mainnet,\n optimism,\n sepolia,\n} from 'viem/chains';\n\nconst defaultChains = [mainnet, sepolia, goerli, arbitrum, base, optimism];\n\nexport function getChain(id: number): Chain | undefined {\n return defaultChains.find(chain => chain.id === id);\n // TODO: allow loading extra chains at build time\n // const chains = await import('viem/chains');\n // return Object.values(chains).find(\n // x =>\n // typeof x === 'object' &&\n // x !== null &&\n // 'id' in x &&\n // (x as Chain).id === id,\n // ) as Chain | undefined;\n}\n\nlet client: PublicClient = createPublicClient({\n chain: mainnet,\n batch: {\n multicall: true,\n },\n transport: http(),\n});\n\nfunction updateChain(chainId: number) {\n if (client.chain?.id === chainId) {\n return;\n }\n\n const chain = getChain(chainId);\n if (!chain) {\n throw new Error(`Invalid chain id: ${chainId}`);\n }\n\n client = createPublicClient({\n chain,\n batch: {\n multicall: true,\n },\n transport: http(),\n });\n}\n\nexport type ENSInfo = {\n name?: string;\n avatarUrl?: string;\n};\n\nexport const getEnsInfo = async (\n address: `0x${string}`,\n chainId: number,\n): Promise<ENSInfo> => {\n const result: ENSInfo = {};\n try {\n updateChain(chainId);\n const name = await getEnsName(client, { address });\n if (name) {\n result.name = name;\n\n const avatarUrl = await getEnsAvatar(client, { name });\n if (avatarUrl) {\n result.avatarUrl = avatarUrl;\n }\n }\n } catch (e) {\n console.error(e);\n }\n return result;\n};\n","export type PKHDid = {\n networkId: string;\n chainId: number;\n address: `0x${string}`;\n};\n\nexport function parsePkhDid(did: string): PKHDid {\n const parts = did.split(':');\n if (!did.startsWith('did:pkh:') || parts.length !== 5) {\n throw new Error('Invalid pkh did');\n }\n const [, , networkId, chainIdStr, address] = parts;\n\n if (!address.startsWith('0x')) {\n throw new Error(`Invalid address: ${address}`);\n }\n\n const chainId = Number(chainIdStr);\n if (isNaN(chainId)) {\n throw new Error(`Invalid chain id: ${chainIdStr}`);\n }\n\n return {\n chainId,\n networkId,\n address: address as PKHDid['address'],\n };\n}\n","export interface IStorage<\n T extends Record<string, unknown> = Record<string, unknown>,\n> {\n get<Key extends keyof T>(key: Key): T[Key];\n set<Key extends keyof T>(key: Key, value?: T[Key]): void;\n delete<Key extends keyof T>(key: Key): void;\n}\n\nexport class BaseStorage<\n T extends Record<string, unknown> = Record<string, unknown>,\n> implements IStorage<T>\n{\n #store: IStorage<T>;\n #namespace: string;\n\n protected constructor(store: IStorage<T>, namespace: string) {\n this.#store = store;\n this.#namespace = namespace;\n }\n\n #buildKey<Key extends keyof T>(key: Key): Key {\n return `${this.#namespace}:${key.toString()}` as Key;\n }\n\n get<Key extends keyof T>(key: Key): T[Key] {\n return this.#store.get(this.#buildKey(key));\n }\n set<Key extends keyof T>(key: Key, value?: T[Key] | undefined): void {\n return this.#store.set(this.#buildKey(key), value);\n }\n delete<Key extends keyof T>(key: Key): void {\n return this.#store.delete(this.#buildKey(key));\n }\n}\n","import connectConfig from '#connect-config';\nimport { BaseStorage, type IStorage } from './index.js';\n\nconst store: IStorage = {\n get: function <Key extends string>(key: Key): unknown {\n const value = localStorage.getItem(key);\n if (value) {\n return JSON.parse(value);\n }\n return undefined;\n },\n set: function <Key extends string>(key: Key, value?: unknown): void {\n return value\n ? localStorage.setItem(key, JSON.stringify(value))\n : localStorage.removeItem(key);\n },\n delete: function <Key extends string>(key: Key): void {\n return localStorage.removeItem(key);\n },\n};\n\nexport class BrowserStorage<\n T extends Record<string, unknown> = Record<string, unknown>,\n> extends BaseStorage<T> {\n constructor(namespace: string) {\n super(\n store as IStorage<T>,\n `${connectConfig.routerBasename}:${namespace}`,\n );\n }\n}\n","import { Renown } from './index.js';\nimport { BrowserStorage } from '../storage/browser.js';\n\nexport function initRenownBrowser(connectId: string) {\n return new Renown(new BrowserStorage('renown'), connectId);\n}\n","import { logger } from 'document-drive';\nimport type { IStorage } from '../storage/index.js';\nimport { getEnsInfo } from '../viem.js';\nimport { RENOWN_URL } from './constants.js';\nimport {\n type PowerhouseVerifiableCredential,\n type RenownStorage,\n type User,\n} from './types.js';\nimport { parsePkhDid } from './utils.js';\n\nexport * from './browser.js';\nexport * from './constants.js';\nexport * from './types.js';\nexport type {\n PowerhouseVerifiableCredential,\n Unsubscribe,\n User,\n} from './types.js';\nexport * from './utils.js';\n\nexport class Renown {\n #baseUrl: string;\n #store: RenownStorage;\n #connectId: string;\n #eventEmitter = new EventTarget();\n\n constructor(store: IStorage, connectId: string, baseUrl = RENOWN_URL) {\n this.#store = store as RenownStorage;\n this.#connectId = connectId;\n this.#baseUrl = baseUrl;\n\n if (this.user) {\n this.login(this.user.did).catch(() => void 0);\n }\n }\n\n get user() {\n return this.#store.get('user');\n }\n\n #updateUser(user: User | undefined) {\n // eslint-disable-next-line @typescript-eslint/no-unused-expressions\n user ? this.#store.set('user', user) : this.#store.delete('user');\n this.#eventEmitter.dispatchEvent(\n new CustomEvent('user', { detail: user }),\n );\n }\n\n set connectId(connectId: string) {\n this.#connectId = connectId;\n const user = this.user;\n\n this.#updateUser(undefined);\n\n // tries to login with new connectId\n if (user) {\n this.login(user.did).catch(e => {\n console.log('User no longer authenticated:', e);\n });\n }\n }\n\n async login(did: string): Promise<User> {\n try {\n const result = parsePkhDid(did);\n\n const credential = await this.#getCredential(\n result.address,\n result.chainId,\n this.#connectId,\n );\n if (!credential) {\n this.#updateUser(undefined);\n throw new Error('Credential not found');\n }\n const user: User = {\n ...result,\n did,\n credential,\n };\n\n getEnsInfo(user.address, user.chainId)\n .then(ens => {\n if (\n this.user?.address === user.address &&\n this.user.chainId === user.chainId\n ) {\n this.#updateUser({ ...this.user, ens });\n }\n })\n .catch(logger.error);\n\n this.#updateUser(user);\n return user;\n } catch (error) {\n logger.error(error);\n this.#updateUser(undefined);\n throw error;\n }\n }\n\n logout() {\n this.#updateUser(undefined);\n }\n\n on(event: 'user', listener: (user: User) => void) {\n const eventListener = ((e: CustomEvent<User>) => {\n listener(e.detail);\n }) as EventListener;\n\n this.#eventEmitter.addEventListener(event, eventListener);\n return () => {\n this.#eventEmitter.removeEventListener(event, eventListener);\n };\n }\n\n async #getCredential(\n address: string,\n chainId: number,\n connectId: string,\n ): Promise<PowerhouseVerifiableCredential | undefined> {\n if (!this.#baseUrl) {\n throw new Error('RENOWN_URL is not set');\n }\n const url = new URL(\n `/api/auth/credential?address=${encodeURIComponent(address)}&chainId=${encodeURIComponent(chainId)}&connectId=${encodeURIComponent(connectId)}`,\n this.#baseUrl,\n );\n const response = await fetch(url, {\n method: 'GET',\n });\n if (response.ok) {\n const result = (await response.json()) as {\n credential: PowerhouseVerifiableCredential;\n };\n return result.credential;\n } else {\n throw new Error('Failed to get credential');\n }\n }\n}\n"],"names":["defaultChains","mainnet","sepolia","goerli","arbitrum","base","optimism","getChain","id","chain","client","createPublicClient","http","updateChain","chainId","_a","getEnsInfo","address","result","name","getEnsName","avatarUrl","getEnsAvatar","e","parsePkhDid","did","parts","networkId","chainIdStr","BaseStorage","store","namespace","__privateAdd","_BaseStorage_instances","_store","_namespace","__privateSet","key","__privateGet","__privateMethod","buildKey_fn","value","BrowserStorage","connectConfig","initRenownBrowser","connectId","Renown","baseUrl","RENOWN_URL","_Renown_instances","_baseUrl","_connectId","_eventEmitter","user","updateUser_fn","credential","getCredential_fn","ens","logger","error","event","listener","eventListener","url","response"],"mappings":"kmBAYA,MAAMA,EAAgB,CAACC,EAASC,EAASC,EAAQC,EAAUC,EAAMC,CAAQ,EAElE,SAASC,EAASC,EAA+B,CACpD,OAAOR,EAAc,KAAKS,GAASA,EAAM,KAAOD,CAAE,CAUtD,CAEA,IAAIE,EAAuBC,EAAmB,CAC1C,MAAOV,EACP,MAAO,CACH,UAAW,EAAA,EAEf,UAAWW,EAAA,CACf,CAAC,EAED,SAASC,EAAYC,EAAiB,OAClC,KAAIC,EAAAL,EAAO,QAAP,YAAAK,EAAc,MAAOD,EACrB,OAGJ,MAAML,EAAQF,EAASO,CAAO,EAC9B,GAAI,CAACL,EACD,MAAM,IAAI,MAAM,qBAAqBK,CAAO,EAAE,EAGlDJ,EAASC,EAAmB,CACxB,MAAAF,EACA,MAAO,CACH,U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c,GAAc,oBAAoBQ,EAAOE,CAAa,CAAA,CAC/D,CA2BR,CAvHIZ,EAAA,YACAhB,EAAA,YACAiB,EAAA,YACAC,EAAA,YAJGH,EAAA,YAoBHK,WAAYD,EAAwB,CAEhCA,EAAOf,EAAA,KAAKJ,GAAO,IAAI,OAAQmB,CAAI,EAAIf,EAAA,KAAKJ,GAAO,OAAO,MAAM,EAChEI,EAAA,KAAKc,GAAc,cACf,IAAI,YAAY,OAAQ,CAAE,OAAQC,EAAM,CAAA,CAC5C,EAuEEG,EAAA,eACFvC,EACAH,EACA+B,EACmD,CACnD,GAAI,CAACP,EAAA,KAAKY,GACN,MAAM,IAAI,MAAM,uBAAuB,EAE3C,MAAMa,EAAM,IAAI,IACZ,gCAAgC,mBAAmB9C,CAAO,CAAC,YAAY,mBAAmBH,CAAO,CAAC,cAAc,mBAAmB+B,CAAS,CAAC,GAC7IP,EAAA,KAAKY,EAAA,EAEHc,EAAW,MAAM,MAAMD,EAAK,CAC9B,OAAQ,KAAA,CACX,EACD,GAAIC,EAAS,GAIT,OAHgB,MAAMA,EAAS,KAAA,GAGjB,WAEd,MAAM,IAAI,MAAM,0BAA0B,CAC9C"}
1
+ {"version":3,"file":"index.BAvGLKEb.js","sources":["../../src/services/viem.ts","../../src/services/renown/utils.ts","../../src/services/storage/index.ts","../../src/services/storage/browser.ts","../../src/services/renown/browser.ts","../../src/services/renown/index.ts"],"sourcesContent":["import { createPublicClient, http, type PublicClient } from 'viem';\nimport { getEnsAvatar, getEnsName } from 'viem/actions';\nimport {\n arbitrum,\n base,\n type Chain,\n goerli,\n mainnet,\n optimism,\n sepolia,\n} from 'viem/chains';\n\nconst defaultChains = [mainnet, sepolia, goerli, arbitrum, base, optimism];\n\nexport function getChain(id: number): Chain | undefined {\n return defaultChains.find(chain => chain.id === id);\n // TODO: allow loading extra chains at build time\n // const chains = await import('viem/chains');\n // return Object.values(chains).find(\n // x =>\n // typeof x === 'object' &&\n // x !== null &&\n // 'id' in x &&\n // (x as Chain).id === id,\n // ) as Chain | undefined;\n}\n\nlet client: PublicClient = createPublicClient({\n chain: mainnet,\n batch: {\n multicall: true,\n },\n transport: http(),\n});\n\nfunction updateChain(chainId: number) {\n if (client.chain?.id === chainId) {\n return;\n }\n\n const chain = getChain(chainId);\n if (!chain) {\n throw new Error(`Invalid chain id: ${chainId}`);\n }\n\n client = createPublicClient({\n chain,\n batch: {\n multicall: true,\n },\n transport: http(),\n });\n}\n\nexport type ENSInfo = {\n name?: string;\n avatarUrl?: string;\n};\n\nexport const getEnsInfo = async (\n address: `0x${string}`,\n chainId: number,\n): Promise<ENSInfo> => {\n const result: ENSInfo = {};\n try {\n updateChain(chainId);\n const name = await getEnsName(client, { address });\n if (name) {\n result.name = name;\n\n const avatarUrl = await getEnsAvatar(client, { name });\n if (avatarUrl) {\n result.avatarUrl = avatarUrl;\n }\n }\n } catch (e) {\n console.error(e);\n }\n return result;\n};\n","export type PKHDid = {\n networkId: string;\n chainId: number;\n address: `0x${string}`;\n};\n\nexport function parsePkhDid(did: string): PKHDid {\n const parts = did.split(':');\n if (!did.startsWith('did:pkh:') || parts.length !== 5) {\n throw new Error('Invalid pkh did');\n }\n const [, , networkId, chainIdStr, address] = parts;\n\n if (!address.startsWith('0x')) {\n throw new Error(`Invalid address: ${address}`);\n }\n\n const chainId = Number(chainIdStr);\n if (isNaN(chainId)) {\n throw new Error(`Invalid chain id: ${chainIdStr}`);\n }\n\n return {\n chainId,\n networkId,\n address: address as PKHDid['address'],\n };\n}\n","export interface IStorage<\n T extends Record<string, unknown> = Record<string, unknown>,\n> {\n get<Key extends keyof T>(key: Key): T[Key];\n set<Key extends keyof T>(key: Key, value?: T[Key]): void;\n delete<Key extends keyof T>(key: Key): void;\n}\n\nexport class BaseStorage<\n T extends Record<string, unknown> = Record<string, unknown>,\n> implements IStorage<T>\n{\n #store: IStorage<T>;\n #namespace: string;\n\n protected constructor(store: IStorage<T>, namespace: string) {\n this.#store = store;\n this.#namespace = namespace;\n }\n\n #buildKey<Key extends keyof T>(key: Key): Key {\n return `${this.#namespace}:${key.toString()}` as Key;\n }\n\n get<Key extends keyof T>(key: Key): T[Key] {\n return this.#store.get(this.#buildKey(key));\n }\n set<Key extends keyof T>(key: Key, value?: T[Key] | undefined): void {\n return this.#store.set(this.#buildKey(key), value);\n }\n delete<Key extends keyof T>(key: Key): void {\n return this.#store.delete(this.#buildKey(key));\n }\n}\n","import connectConfig from '#connect-config';\nimport { BaseStorage, type IStorage } from './index.js';\n\nconst store: IStorage = {\n get: function <Key extends string>(key: Key): unknown {\n const value = localStorage.getItem(key);\n if (value) {\n return JSON.parse(value);\n }\n return undefined;\n },\n set: function <Key extends string>(key: Key, value?: unknown): void {\n return value\n ? localStorage.setItem(key, JSON.stringify(value))\n : localStorage.removeItem(key);\n },\n delete: function <Key extends string>(key: Key): void {\n return localStorage.removeItem(key);\n },\n};\n\nexport class BrowserStorage<\n T extends Record<string, unknown> = Record<string, unknown>,\n> extends BaseStorage<T> {\n constructor(namespace: string) {\n super(\n store as IStorage<T>,\n `${connectConfig.routerBasename}:${namespace}`,\n );\n }\n}\n","import { Renown } from './index.js';\nimport { BrowserStorage } from '../storage/browser.js';\n\nexport function initRenownBrowser(connectId: string) {\n return new Renown(new BrowserStorage('renown'), connectId);\n}\n","import { logger } from 'document-drive';\nimport type { IStorage } from '../storage/index.js';\nimport { getEnsInfo } from '../viem.js';\nimport { RENOWN_URL } from './constants.js';\nimport {\n type PowerhouseVerifiableCredential,\n type RenownStorage,\n type User,\n} from './types.js';\nimport { parsePkhDid } from './utils.js';\n\nexport * from './browser.js';\nexport * from './constants.js';\nexport * from './types.js';\nexport type {\n PowerhouseVerifiableCredential,\n Unsubscribe,\n User,\n} from './types.js';\nexport * from './utils.js';\n\nexport class Renown {\n #baseUrl: string;\n #store: RenownStorage;\n #connectId: string;\n #eventEmitter = new EventTarget();\n\n constructor(store: IStorage, connectId: string, baseUrl = RENOWN_URL) {\n this.#store = store as RenownStorage;\n this.#connectId = connectId;\n this.#baseUrl = baseUrl;\n\n if (this.user) {\n this.login(this.user.did).catch(() => void 0);\n }\n }\n\n get user() {\n return this.#store.get('user');\n }\n\n #updateUser(user: User | undefined) {\n // eslint-disable-next-line @typescript-eslint/no-unused-expressions\n user ? this.#store.set('user', user) : this.#store.delete('user');\n this.#eventEmitter.dispatchEvent(\n new CustomEvent('user', { detail: user }),\n );\n }\n\n set connectId(connectId: string) {\n this.#connectId = connectId;\n const user = this.user;\n\n this.#updateUser(undefined);\n\n // tries to login with new connectId\n if (user) {\n this.login(user.did).catch(e => {\n console.log('User no longer authenticated:', e);\n });\n }\n }\n\n async login(did: string): Promise<User> {\n try {\n const result = parsePkhDid(did);\n\n const credential = await this.#getCredential(\n result.address,\n result.chainId,\n this.#connectId,\n );\n if (!credential) {\n this.#updateUser(undefined);\n throw new Error('Credential not found');\n }\n const user: User = {\n ...result,\n did,\n credential,\n };\n\n getEnsInfo(user.address, user.chainId)\n .then(ens => {\n if (\n this.user?.address === user.address &&\n this.user.chainId === user.chainId\n ) {\n this.#updateUser({ ...this.user, ens });\n }\n })\n .catch(logger.error);\n\n this.#updateUser(user);\n return user;\n } catch (error) {\n logger.error(error);\n this.#updateUser(undefined);\n throw error;\n }\n }\n\n logout() {\n this.#updateUser(undefined);\n }\n\n on(event: 'user', listener: (user: User) => void) {\n const eventListener = ((e: CustomEvent<User>) => {\n listener(e.detail);\n }) as EventListener;\n\n this.#eventEmitter.addEventListener(event, eventListener);\n return () => {\n this.#eventEmitter.removeEventListener(event, eventListener);\n };\n }\n\n async #getCredential(\n address: string,\n chainId: number,\n connectId: string,\n ): Promise<PowerhouseVerifiableCredential | undefined> {\n if (!this.#baseUrl) {\n throw new Error('RENOWN_URL is not set');\n }\n const url = new URL(\n `/api/auth/credential?address=${encodeURIComponent(address)}&chainId=${encodeURIComponent(chainId)}&connectId=${encodeURIComponent(connectId)}`,\n this.#baseUrl,\n );\n const response = await fetch(url, {\n method: 'GET',\n });\n if (response.ok) {\n const result = (await response.json()) as {\n credential: PowerhouseVerifiableCredential;\n };\n return result.credential;\n } else {\n throw new Error('Failed to get credential');\n }\n }\n}\n"],"names":["defaultChains","mainnet","sepolia","goerli","arbitrum","base","optimism","getChain","id","chain","client","createPublicClient","http","updateChain","chainId","_a","getEnsInfo","address","result","name","getEnsName","avatarUrl","getEnsAvatar","e","parsePkhDid","did","parts","networkId","chainIdStr","BaseStorage","store","namespace","__privateAdd","_BaseStorage_instances","_store","_namespace","__privateSet","key","__privateGet","__privateMethod","buildKey_fn","value","BrowserStorage","connectConfig","initRenownBrowser","connectId","Renown","baseUrl","RENOWN_URL","_Renown_instances","_baseUrl","_connectId","_eventEmitter","user","updateUser_fn","credential","getCredential_fn","ens","logger","error","event","listener","eventListener","url","response"],"mappings":"kmBAYA,MAAMA,EAAgB,CAACC,EAASC,EAASC,EAAQC,EAAUC,EAAMC,CAAQ,EAElE,SAASC,EAASC,EAA+B,CACpD,OAAOR,EAAc,KAAKS,GAASA,EAAM,KAAOD,CAAE,CAUtD,CAEA,IAAIE,EAAuBC,EAAmB,CAC1C,MAAOV,EACP,MAAO,CACH,UAAW,EAAA,EAEf,UAAWW,EAAA,CACf,CAAC,EAED,SAASC,EAAYC,EAAiB,OAClC,KAAIC,EAAAL,EAAO,QAAP,YAAAK,EAAc,MAAOD,EACrB,OAGJ,MAAML,EAAQF,EAASO,CAAO,EAC9B,GAAI,CAACL,EACD,MAAM,IAAI,MAAM,qBAAqBK,CAAO,EAAE,EAGlDJ,EAASC,EAAmB,CACxB,MAAAF,EACA,MAAO,CACH,UAAW,EAAA,EAEf,UAAWG,EAAA,CAAK,CACnB,CACL,CAOO,MAAMI,EAAa,MACtBC,EACAH,IACmB,CACnB,MAAMI,EAAkB,CAAA,EACxB,GAAI,CACAL,EAAYC,CAAO,EACnB,MAAMK,EAAO,MAAMC,EAAWV,EAAQ,CAAE,QAAAO,EAAS,EACjD,GAAIE,EAAM,CACND,EAAO,KAAOC,EAEd,MAAME,EAAY,MAAMC,E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ACf,IAAI,YAAY,OAAQ,CAAE,OAAQC,EAAM,CAAA,CAC5C,EAuEEG,EAAA,eACFvC,EACAH,EACA+B,EACmD,CACnD,GAAI,CAACP,EAAA,KAAKY,GACN,MAAM,IAAI,MAAM,uBAAuB,EAE3C,MAAMa,EAAM,IAAI,IACZ,gCAAgC,mBAAmB9C,CAAO,CAAC,YAAY,mBAAmBH,CAAO,CAAC,cAAc,mBAAmB+B,CAAS,CAAC,GAC7IP,EAAA,KAAKY,EAAA,EAEHc,EAAW,MAAM,MAAMD,EAAK,CAC9B,OAAQ,KAAA,CACX,EACD,GAAIC,EAAS,GAIT,OAHgB,MAAMA,EAAS,KAAA,GAGjB,WAEd,MAAM,IAAI,MAAM,0BAA0B,CAC9C"}
@@ -1,4 +1,4 @@
1
- import{j as fn,t as Rl,k as Dt,D as Ms,l as h,m as ze,G as U,C as aa,n as se,o as bi,p as it,q as Lt,v as ca,w as At,S as Os,x as Pt,y as Ns,z as Te,A as gr,B as Cl,E as xl,F as Ie,H as k,I as ua,J as A,K as ae,L as Al,M as Ds,N as _r,O as Gt,P as pn,Q as Ml,R as lt,T as j,U as ot,V as Ol,W as Nl,X as Jn,Y as yr,Z as la,_ as Dl,$ as Ll,a0 as Pl,a1 as Fl,a2 as $l,a3 as Ei,a4 as Ls,a5 as vi,a6 as Ps,a7 as Fs,a8 as da,a9 as Zn,aa as Ti,ab as He,ac as Yt,ad as $s,ae as oe,af as at,ag as fa,ah as pa,ai as ha,aj as rs,ak as ma,al as ga,am as Bl,an as ss,ao as Ft,ap as Sn,aq as Bs,ar as Ii,as as Hl,at as Mt,au as Hs,av as Ul,aw as Wl,ax as zl,ay as je,az as Qn,aA as Sr,aB as _a,aC as jl,aD as wi,aE as ki,aF as ql,aG as is,aH as Gl,aI as Yl,aJ as Ri,aK as Vl}from"./user.BQU9ztVh.js";import{aL as Dv,aM as Lv,aN as Pv,aO as Fv,aP as $v,aQ as Bv,aR as Hv,aS as Uv,aT as Wv,aU as zv,aV as jv,aW as qv,aX as Gv,aY as Yv,aZ as Vv,a_ as Kv,a$ as Xv}from"./user.BQU9ztVh.js";import{p as Ci,aD as br}from"./index.DFyMrewv.js";import*as me from"react";import"./connect.config.DUXg7xh4.js";import"./browser.BkwNmV2Z.js";import"./index.BDEjD6s0.js";import"react-dom/client";import"react/jsx-runtime";import"./app-skeleton.js";import"react-dom";function ya(e,t,n=250,r,s,i,o){if(!i.exception||!i.exception.values||!o||!fn(o.originalException,Error))return;const a=i.exception.values.length>0?i.exception.values[i.exception.values.length-1]:void 0;a&&(i.exception.values=Kl(os(e,t,s,o.originalException,r,i.exception.values,a,0),n))}function os(e,t,n,r,s,i,o,a){if(i.length>=n+1)return i;let c=[...i];if(fn(r[s],Error)){xi(o,a);const u=e(t,r[s]),l=c.length;Ai(u,s,l,a),c=os(e,t,n,r[s],s,[u,...c],u,l)}return Array.isArray(r.errors)&&r.errors.forEach((u,l)=>{if(fn(u,Error)){xi(o,a);const d=e(t,u),f=c.length;Ai(d,`errors[${l}]`,f,a),c=os(e,t,n,u,s,[d,...c],d,f)}}),c}function xi(e,t){e.mechanism=e.mechanism||{type:"generic",handled:!0},e.mechanism={...e.mechanism,...e.type==="AggregateError"&&{is_exception_group:!0},exception_id:t}}function Ai(e,t,n,r){e.mechanism=e.mechanism||{type:"generic",handled:!0},e.mechanism={...e.mechanism,type:"chained",source:t,exception_id:n,parent_id:r}}function Kl(e,t){return e.map(n=>(n.value&&(n.value=Rl(n.value,t)),n))}const Xl=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function Jl(e){return e==="http"||e==="https"}function dt(e,t=!1){const{host:n,path:r,pass:s,port:i,projectId:o,protocol:a,publicKey:c}=e;return`${a}://${c}${t&&s?`:${s}`:""}@${n}${i?`:${i}`:""}/${r&&`${r}/`}${o}`}function Sa(e){const t=Xl.exec(e);if(!t){Dt(()=>{console.error(`Invalid Sentry Dsn: ${e}`)});return}const[n,r,s="",i,o="",a]=t.slice(1);let c="",u=a;const l=u.split("/");if(l.length>1&&(c=l.slice(0,-1).join("/"),u=l.pop()),u){const d=u.match(/^\d+/);d&&(u=d[0])}return ba({host:i,pass:s,path:c,projectId:u,port:o,protocol:n,publicKey:r})}function ba(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}function Zl(e){if(!Ms)return!0;const{port:t,projectId:n,protocol:r}=e;return["protocol","publicKey","host","projectId"].find(o=>e[o]?!1:(h.error(`Invalid Sentry Dsn: ${o} missing`),!0))?!1:n.match(/^\d+$/)?Jl(r)?t&&isNaN(parseInt(t,10))?(h.error(`Invalid Sentry Dsn: Invalid port ${t}`),!1):!0:(h.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),!1):(h.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),!1)}function Ea(e){const t=typeof e=="string"?Sa(e):ba(e);if(!(!t||!Zl(t)))return t}class Ce extends Error{constructor(t,n="warn"){super(t),this.message=t,this.name=new.target.prototype.constructor.name,Object.setPrototypeOf(this,new.target.prototype),this.logLevel=n}}const Gn={},Mi={};function ft(e,t){Gn[e]=Gn[e]||[],Gn[e].push(t)}function pt(e,t){Mi[e]||(t(),Mi[e]=!0)}function ve(e,t){const n=e&&Gn[e];if(n)for(const r of n)try{r(t)}catch(s){Ms&&h.error(`Error while triggering instrumentation handler.
1
+ import{j as fn,t as Rl,k as Dt,D as Ms,l as h,m as ze,G as U,C as aa,n as se,o as bi,p as it,q as Lt,v as ca,w as At,S as Os,x as Pt,y as Ns,z as Te,A as gr,B as Cl,E as xl,F as Ie,H as k,I as ua,J as A,K as ae,L as Al,M as Ds,N as _r,O as Gt,P as pn,Q as Ml,R as lt,T as j,U as ot,V as Ol,W as Nl,X as Jn,Y as yr,Z as la,_ as Dl,$ as Ll,a0 as Pl,a1 as Fl,a2 as $l,a3 as Ei,a4 as Ls,a5 as vi,a6 as Ps,a7 as Fs,a8 as da,a9 as Zn,aa as Ti,ab as He,ac as Yt,ad as $s,ae as oe,af as at,ag as fa,ah as pa,ai as ha,aj as rs,ak as ma,al as ga,am as Bl,an as ss,ao as Ft,ap as Sn,aq as Bs,ar as Ii,as as Hl,at as Mt,au as Hs,av as Ul,aw as Wl,ax as zl,ay as je,az as Qn,aA as Sr,aB as _a,aC as jl,aD as wi,aE as ki,aF as ql,aG as is,aH as Gl,aI as Yl,aJ as Ri,aK as Vl}from"./user.C5X0s2J6.js";import{aL as Dv,aM as Lv,aN as Pv,aO as Fv,aP as $v,aQ as Bv,aR as Hv,aS as Uv,aT as Wv,aU as zv,aV as jv,aW as qv,aX as Gv,aY as Yv,aZ as Vv,a_ as Kv,a$ as Xv}from"./user.C5X0s2J6.js";import{p as Ci,aD as br}from"./index.DFyMrewv.js";import*as me from"react";import"./connect.config.DFiOOfbL.js";import"./browser.BkwNmV2Z.js";import"./index.CrfEkaEE.js";import"react-dom/client";import"react/jsx-runtime";import"./app-skeleton.js";import"react-dom";function ya(e,t,n=250,r,s,i,o){if(!i.exception||!i.exception.values||!o||!fn(o.originalException,Error))return;const a=i.exception.values.length>0?i.exception.values[i.exception.values.length-1]:void 0;a&&(i.exception.values=Kl(os(e,t,s,o.originalException,r,i.exception.values,a,0),n))}function os(e,t,n,r,s,i,o,a){if(i.length>=n+1)return i;let c=[...i];if(fn(r[s],Error)){xi(o,a);const u=e(t,r[s]),l=c.length;Ai(u,s,l,a),c=os(e,t,n,r[s],s,[u,...c],u,l)}return Array.isArray(r.errors)&&r.errors.forEach((u,l)=>{if(fn(u,Error)){xi(o,a);const d=e(t,u),f=c.length;Ai(d,`errors[${l}]`,f,a),c=os(e,t,n,u,s,[d,...c],d,f)}}),c}function xi(e,t){e.mechanism=e.mechanism||{type:"generic",handled:!0},e.mechanism={...e.mechanism,...e.type==="AggregateError"&&{is_exception_group:!0},exception_id:t}}function Ai(e,t,n,r){e.mechanism=e.mechanism||{type:"generic",handled:!0},e.mechanism={...e.mechanism,type:"chained",source:t,exception_id:n,parent_id:r}}function Kl(e,t){return e.map(n=>(n.value&&(n.value=Rl(n.value,t)),n))}const Xl=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function Jl(e){return e==="http"||e==="https"}function dt(e,t=!1){const{host:n,path:r,pass:s,port:i,projectId:o,protocol:a,publicKey:c}=e;return`${a}://${c}${t&&s?`:${s}`:""}@${n}${i?`:${i}`:""}/${r&&`${r}/`}${o}`}function Sa(e){const t=Xl.exec(e);if(!t){Dt(()=>{console.error(`Invalid Sentry Dsn: ${e}`)});return}const[n,r,s="",i,o="",a]=t.slice(1);let c="",u=a;const l=u.split("/");if(l.length>1&&(c=l.slice(0,-1).join("/"),u=l.pop()),u){const d=u.match(/^\d+/);d&&(u=d[0])}return ba({host:i,pass:s,path:c,projectId:u,port:o,protocol:n,publicKey:r})}function ba(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}function Zl(e){if(!Ms)return!0;const{port:t,projectId:n,protocol:r}=e;return["protocol","publicKey","host","projectId"].find(o=>e[o]?!1:(h.error(`Invalid Sentry Dsn: ${o} missing`),!0))?!1:n.match(/^\d+$/)?Jl(r)?t&&isNaN(parseInt(t,10))?(h.error(`Invalid Sentry Dsn: Invalid port ${t}`),!1):!0:(h.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),!1):(h.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),!1)}function Ea(e){const t=typeof e=="string"?Sa(e):ba(e);if(!(!t||!Zl(t)))return t}class Ce extends Error{constructor(t,n="warn"){super(t),this.message=t,this.name=new.target.prototype.constructor.name,Object.setPrototypeOf(this,new.target.prototype),this.logLevel=n}}const Gn={},Mi={};function ft(e,t){Gn[e]=Gn[e]||[],Gn[e].push(t)}function pt(e,t){Mi[e]||(t(),Mi[e]=!0)}function ve(e,t){const n=e&&Gn[e];if(n)for(const r of n)try{r(t)}catch(s){Ms&&h.error(`Error while triggering instrumentation handler.
2
2
  Type: ${e}
3
3
  Name: ${ze(r)}
4
4
  Error:`,s)}}function va(e){const t="console";ft(t,e),pt(t,Ql)}function Ql(){"console"in U&&aa.forEach(function(e){e in U.console&&se(U.console,e,function(t){return bi[e]=t,function(...n){ve("console",{args:n,level:e});const s=bi[e];s&&s.apply(U.console,n)}})})}const bt=U,ed=1e3;let Oi,as,cs;function Ta(e){const t="dom";ft(t,e),pt(t,td)}function td(){if(!bt.document)return;const e=ve.bind(null,"dom"),t=Ni(e,!0);bt.document.addEventListener("click",t,!1),bt.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach(n=>{const r=bt[n]&&bt[n].prototype;!r||!r.hasOwnProperty||!r.hasOwnProperty("addEventListener")||(se(r,"addEventListener",function(s){return function(i,o,a){if(i==="click"||i=="keypress")try{const c=this,u=c.__sentry_instrumentation_handlers__=c.__sentry_instrumentation_handlers__||{},l=u[i]=u[i]||{refCount:0};if(!l.handler){const d=Ni(e);l.handler=d,s.call(this,i,d,a)}l.refCount++}catch{}return s.call(this,i,o,a)}}),se(r,"removeEventListener",function(s){return function(i,o,a){if(i==="click"||i=="keypress")try{const c=this,u=c.__sentry_instrumentation_handlers__||{},l=u[i];l&&(l.refCount--,l.refCount<=0&&(s.call(this,i,l.handler,a),l.handler=void 0,delete u[i]),Object.keys(u).length===0&&delete c.__sentry_instrumentation_handlers__)}catch{}return s.call(this,i,o,a)}}))})}function nd(e){if(e.type!==as)return!1;try{if(!e.target||e.target._sentryId!==cs)return!1}catch{}return!0}function rd(e,t){return e!=="keypress"?!1:!t||!t.tagName?!0:!(t.tagName==="INPUT"||t.tagName==="TEXTAREA"||t.isContentEditable)}function Ni(e,t=!1){return n=>{if(!n||n._sentryCaptured)return;const r=sd(n);if(rd(n.type,r))return;it(n,"_sentryCaptured",!0),r&&!r._sentryId&&it(r,"_sentryId",Lt());const s=n.type==="keypress"?"input":n.type;nd(n)||(e({event:n,name:s,global:t}),as=n.type,cs=r?r._sentryId:void 0),clearTimeout(Oi),Oi=bt.setTimeout(()=>{cs=void 0,as=void 0},ed)}}function sd(e){try{return e.target}catch{return null}}const er=ca();function Ia(){if(!("fetch"in er))return!1;try{return new Headers,new Request("http://www.example.com"),new Response,!0}catch{return!1}}function us(e){return e&&/^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function wa(){if(typeof EdgeRuntime=="string")return!0;if(!Ia())return!1;if(us(er.fetch))return!0;let e=!1;const t=er.document;if(t&&typeof t.createElement=="function")try{const n=t.createElement("iframe");n.hidden=!0,t.head.appendChild(n),n.contentWindow&&n.contentWindow.fetch&&(e=us(n.contentWindow.fetch)),t.head.removeChild(n)}catch(n){Ms&&h.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",n)}return e}function id(){return"ReportingObserver"in er}function Er(e){const t="fetch";ft(t,e),pt(t,od)}function od(){wa()&&se(U,"fetch",function(e){return function(...t){const{method:n,url:r}=ad(t),s={args:t,fetchData:{method:n,url:r},startTimestamp:Date.now()};return ve("fetch",{...s}),e.apply(U,t).then(i=>{const o={...s,endTimestamp:Date.now(),response:i};return ve("fetch",o),i},i=>{const o={...s,endTimestamp:Date.now(),error:i};throw ve("fetch",o),i})}})}function ls(e,t){return!!e&&typeof e=="object"&&!!e[t]}function Di(e){return typeof e=="string"?e:e?ls(e,"url")?e.url:e.toString?e.toString():"":""}function ad(e){if(e.length===0)return{method:"GET",url:""};if(e.length===2){const[n,r]=e;return{url:Di(n),method:ls(r,"method")?String(r.method).toUpperCase():"GET"}}const t=e[0];return{url:Di(t),method:ls(t,"method")?String(t.method).toUpperCase():"GET"}}let On=null;function ka(e){const t="error";ft(t,e),pt(t,cd)}function cd(){On=U.onerror,U.onerror=function(e,t,n,r,s){return ve("error",{column:r,error:s,line:n,msg:e,url:t}),On&&!On.__SENTRY_LOADER__?On.apply(this,arguments):!1},U.onerror.__SENTRY_INSTRUMENTED__=!0}let Nn=null;function Ra(e){const t="unhandledrejection";ft(t,e),pt(t,ud)}function ud(){Nn=U.onunhandledrejection,U.onunhandledrejection=function(e){return ve("unhandledrejection",e),Nn&&!Nn.__SENTRY_LOADER__?Nn.apply(this,arguments):!0},U.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}const Dn=ca();function ld(){const e=Dn.chrome,t=e&&e.app&&e.app.runtime,n="history"in Dn&&!!Dn.history.pushState&&!!Dn.history.replaceState;return!t&&n}const en=U;let Ln;function bn(e){const t="history";ft(t,e),pt(t,dd)}function dd(){if(!ld())return;const e=en.onpopstate;en.onpopstate=function(...n){const r=en.location.href,s=Ln;if(Ln=r,ve("history",{from:s,to:r}),e)try{return e.apply(this,n)}catch{}};function t(n){return function(...r){const s=r.length>2?r[2]:void 0;if(s){const i=Ln,o=String(s);Ln=o,ve("history",{from:i,to:o})}return n.apply(this,r)}}se(en.history,"pushState",t),se(en.history,"replaceState",t)}const fd=U,Me="__sentry_xhr_v3__";function vr(e){const t="xhr";ft(t,e),pt(t,pd)}function pd(){if(!fd.XMLHttpRequest)return;const e=XMLHttpRequest.prototype;se(e,"open",function(t){return function(...n){const r=Date.now(),s=At(n[0])?n[0].toUpperCase():void 0,i=hd(n[1]);if(!s||!i)return t.apply(this,n);this[Me]={method:s,url:i,request_headers:{}},s==="POST"&&i.match(/sentry_key/)&&(this.__sentry_own_request__=!0);const o=()=>{const a=this[Me];if(a&&this.readyState===4){try{a.status_code=this.status}catch{}const c={args:[s,i],endTimestamp:Date.now(),startTimestamp:r,xhr:this};ve("xhr",c)}};return"onreadystatechange"in this&&typeof this.onreadystatechange=="function"?se(this,"onreadystatechange",function(a){return function(...c){return o(),a.apply(this,c)}}):this.addEventListener("readystatechange",o),se(this,"setRequestHeader",function(a){return function(...c){const[u,l]=c,d=this[Me];return d&&At(u)&&At(l)&&(d.request_headers[u.toLowerCase()]=l),a.apply(this,c)}}),t.apply(this,n)}}),se(e,"send",function(t){return function(...n){const r=this[Me];if(!r)return t.apply(this,n);n[0]!==void 0&&(r.body=n[0]);const s={args:[r.method,r.url],startTimestamp:Date.now(),xhr:this};return ve("xhr",s),t.apply(this,n)}})}function hd(e){if(At(e))return e;try{return e.toString()}catch{}}function md(){return typeof __SENTRY_BROWSER_BUNDLE__<"u"&&!!__SENTRY_BROWSER_BUNDLE__}function gd(){return"npm"}function _d(){return!md()&&Object.prototype.toString.call(typeof Ci<"u"?Ci:0)==="[object process]"}function ds(){return typeof window<"u"&&(!_d()||yd())}function yd(){return U.process!==void 0&&U.process.type==="renderer"}function Sd(e,t){let n=0;for(let r=e.length-1;r>=0;r--){const s=e[r];s==="."?e.splice(r,1):s===".."?(e.splice(r,1),n++):n&&(e.splice(r,1),n--)}if(t)for(;n--;n)e.unshift("..");return e}const bd=/^(\S+:\\|\/?)([\s\S]*?)((?:\.{1,2}|[^/\\]+?|)(\.[^./\\]*|))(?:[/\\]*)$/;function Ed(e){const t=e.length>1024?`<truncated>${e.slice(-1024)}`:e,n=bd.exec(t);return n?n.slice(1):[]}function Li(...e){let t="",n=!1;for(let r=e.length-1;r>=-1&&!n;r--){const s=r>=0?e[r]:"/";s&&(t=`${s}/${t}`,n=s.charAt(0)==="/")}return t=Sd(t.split("/").filter(r=>!!r),!n).join("/"),(n?"/":"")+t||"."}function Pi(e){let t=0;for(;t<e.length&&e[t]==="";t++);let n=e.length-1;for(;n>=0&&e[n]==="";n--);return t>n?[]:e.slice(t,n-t+1)}function vd(e,t){e=Li(e).slice(1),t=Li(t).slice(1);const n=Pi(e.split("/")),r=Pi(t.split("/")),s=Math.min(n.length,r.length);let i=s;for(let a=0;a<s;a++)if(n[a]!==r[a]){i=a;break}let o=[];for(let a=i;a<n.length;a++)o.push("..");return o=o.concat(r.slice(i)),o.join("/")}function Td(e,t){return Ed(e)[2]}function Id(e){const t=[];function n(){return e===void 0||t.length<e}function r(o){return t.splice(t.indexOf(o),1)[0]}function s(o){if(!n())return Ns(new Ce("Not adding Promise because buffer limit was reached."));const a=o();return t.indexOf(a)===-1&&t.push(a),a.then(()=>r(a)).then(null,()=>r(a).then(null,()=>{})),a}function i(o){return new Os((a,c)=>{let u=t.length;if(!u)return a(!0);const l=setTimeout(()=>{o&&o>0&&a(!1)},o);t.forEach(d=>{Pt(d).then(()=>{--u||(clearTimeout(l),a(!0))},c)})})}return{$:t,add:s,drain:i}}function et(e){if(!e)return{};const t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};const n=t[6]||"",r=t[8]||"";return{host:t[4],path:t[5],protocol:t[2],search:n,hash:r,relative:t[5]+n+r}}function wd(e){return e.split(/[\?#]/,1)[0]}function Fi(e){return e.split(/\\?\//).filter(t=>t.length>0&&t!==",").length}const kd=["fatal","error","warning","log","info","debug"];function Ca(e){return e==="warn"?"warning":kd.includes(e)?e:"log"}function Ne(e,t=[]){return[e,t]}function Rd(e,t){const[n,r]=e;return[n,[...r,t]]}function $t(e,t){const n=e[1];for(const r of n){const s=r[0].type;if(t(r,s))return!0}return!1}function Cd(e,t){return $t(e,(n,r)=>t.includes(r))}function fs(e,t){return(t||new TextEncoder).encode(e)}function xa(e,t){const[n,r]=e;let s=JSON.stringify(n);function i(o){typeof s=="string"?s=typeof o=="string"?s+o:[fs(s,t),o]:s.push(typeof o=="string"?fs(o,t):o)}for(const o of r){const[a,c]=o;if(i(`
@@ -358,4 +358,4 @@ ${t==="system"?`
358
358
  `),"</html>"];return s.forEach(a=>{const c=a.stacktrace;c&&c.frames&&(c.frames=c.frames.map(u=>Kb(u,o,r,t)))}),e}function Kb(e,t,n,r){return e.filename!==n||!e.lineno||!t.length||Gl(t,e,r),e}function yn(e){return new Promise((t,n)=>{e.oncomplete=e.onsuccess=()=>t(e.result),e.onabort=e.onerror=()=>n(e.error)})}function Xb(e,t){const n=indexedDB.open(e);n.onupgradeneeded=()=>n.result.createObjectStore(t);const r=yn(n);return s=>r.then(i=>s(i.transaction(t,"readwrite").objectStore(t)))}function al(e){return yn(e.getAllKeys())}function Jb(e,t,n){return e(r=>al(r).then(s=>{if(!(s.length>=n))return r.put(t,Math.max(...s,0)+1),yn(r.transaction)}))}function Zb(e){return e(t=>al(t).then(n=>{if(n.length!==0)return yn(t.get(n[0])).then(r=>(t.delete(n[0]),yn(t.transaction).then(()=>r)))}))}function Qb(e){let t;function n(){return t==null&&(t=Xb(e.dbName||"sentry-offline",e.storeName||"queue")),t}return{insert:async r=>{try{const s=await xa(r,e.textEncoder);await Jb(n(),s,e.maxQueueSize||30)}catch{}},pop:async()=>{try{const r=await Zb(n());if(r)return Ad(r,e.textEncoder||new TextEncoder,e.textDecoder||new TextDecoder)}catch{}}}}function eE(e){return t=>e({...t,createStore:Qb})}function hv(e){return eE(Pf(e))}const ea=1e6,Xn=String(0),tE="main";let cl="",ul="",ll="",Cs=E.navigator&&E.navigator.userAgent||"",dl="";const nE=E.navigator&&E.navigator.language||E.navigator&&E.navigator.languages&&E.navigator.languages[0]||"";function rE(e){return typeof e=="object"&&e!==null&&"getHighEntropyValues"in e}const ta=E.navigator&&E.navigator.userAgentData;rE(ta)&&ta.getHighEntropyValues(["architecture","model","platform","platformVersion","fullVersionList"]).then(e=>{if(cl=e.platform||"",ll=e.architecture||"",dl=e.model||"",ul=e.platformVersion||"",e.fullVersionList&&e.fullVersionList.length>0){const t=e.fullVersionList[e.fullVersionList.length-1];Cs=`${t.brand} ${t.version}`}}).catch(e=>{});function sE(e){return!("thread_metadata"in e)}function iE(e){return sE(e)?cE(e):e}function oE(e){const t=e&&e.contexts&&e.contexts.trace&&e.contexts.trace.trace_id;return typeof t=="string"&&t.length!==32&&F&&h.log(`[Profiling] Invalid traceId: ${t} on profiled event`),typeof t!="string"?"":t}function aE(e,t,n,r){if(r.type!=="transaction")throw new TypeError("Profiling events may only be attached to transactions, this should never occur.");if(n==null)throw new TypeError(`Cannot construct profiling event envelope without a valid profile. Got ${n} instead.`);const s=oE(r),i=iE(n),o=t||(typeof r.start_timestamp=="number"?r.start_timestamp*1e3:Date.now()),a=typeof r.timestamp=="number"?r.timestamp*1e3:Date.now();return{event_id:e,timestamp:new Date(o).toISOString(),platform:"javascript",version:"1",release:r.release||"",environment:r.environment||Yl,runtime:{name:"javascript",version:E.navigator.userAgent},os:{name:cl,version:ul,build_number:Cs},device:{locale:nE,model:dl,manufacturer:Cs,architecture:ll,is_emulator:!1},debug_meta:{images:dE(n.resources)},profile:i,transactions:[{name:r.transaction||"",id:r.event_id||Lt(),trace_id:s,active_thread_id:Xn,relative_start_ns:"0",relative_end_ns:((a-o)*1e6).toFixed(0)}]}}function fl(e){return e.op==="pageload"}function cE(e){let t,n=0;const r={samples:[],stacks:[],frames:[],thread_metadata:{[Xn]:{name:tE}}};if(!e.samples.length)return r;const s=e.samples[0].timestamp,i=typeof performance.timeOrigin=="number"?performance.timeOrigin:oe||0,o=i-(oe||i);for(let a=0;a<e.samples.length;a++){const c=e.samples[a];if(c.stackId===void 0){t===void 0&&(t=n,r.stacks[t]=[],n++),r.samples[a]={elapsed_since_start_ns:((c.timestamp+o-s)*ea).toFixed(0),stack_id:t,thread_id:Xn};continue}let u=e.stacks[c.stackId];const l=[];for(;u;){l.push(u.frameId);const f=e.frames[u.frameId];r.frames[u.frameId]===void 0&&(r.frames[u.frameId]={function:f.name,abs_path:typeof f.resourceId=="number"?e.resources[f.resourceId]:void 0,lineno:f.line,colno:f.column}),u=u.parentId===void 0?void 0:e.stacks[u.parentId]}const d={elapsed_since_start_ns:((c.timestamp+o-s)*ea).toFixed(0),stack_id:n,thread_id:Xn};r.stacks[n]=l,r.samples[a]=d,n++}return r}function uE(e,t){if(!t.length)return e;for(const n of t)e[1].push([{type:"profile"},n]);return e}function lE(e){const t=[];return $t(e,(n,r)=>{if(r==="transaction")for(let s=1;s<n.length;s++){const i=n[s];i&&i.contexts&&i.contexts.profile&&i.contexts.profile.profile_id&&t.push(n[s])}}),t}const na=new WeakMap;function dE(e){const t=U._sentryDebugIds;if(!t)return[];const n=A(),r=n&&n.getOptions(),s=r&&r.stackParser;if(!s)return[];let i;const o=na.get(s);o?i=o:(i=new Map,na.set(s,i));const a=Object.keys(t).reduce((u,l)=>{let d;const f=i.get(l);f?d=f:(d=s(l),i.set(l,d));for(let p=d.length-1;p>=0;p--){const m=d[p],_=m&&m.filename;if(m&&_){u[_]=t[l];break}}return u},{}),c=[];for(const u of e)u&&a[u]&&c.push({type:"sourcemap",code_file:u,debug_id:a[u]});return c}function fE(e){return typeof e!="number"&&typeof e!="boolean"||typeof e=="number"&&isNaN(e)?(F&&h.warn(`[Profiling] Invalid sample rate. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(e)} of type ${JSON.stringify(typeof e)}.`),!1):e===!0||e===!1?!0:e<0||e>1?(F&&h.warn(`[Profiling] Invalid sample rate. Sample rate must be between 0 and 1. Got ${e}.`),!1):!0}function pE(e){return e.samples.length<2?(F&&h.log("[Profiling] Discarding profile because it contains less than 2 samples"),!1):e.frames.length?!0:(F&&h.log("[Profiling] Discarding profile because it contains no frames"),!1)}let pl=!1;const hl=3e4;function hE(e){return typeof e=="function"}function mE(){const e=E.Profiler;if(!hE(e)){F&&h.log("[Profiling] Profiling is not supported by this browser, Profiler interface missing on window object.");return}const t=10,n=Math.floor(hl/t);try{return new e({sampleInterval:t,maxBufferSize:n})}catch{F&&(h.log("[Profiling] Failed to initialize the Profiling constructor, this is likely due to a missing 'Document-Policy': 'js-profiling' header."),h.log("[Profiling] Disabling profiling for current user session.")),pl=!0}}function xs(e){if(pl)return F&&h.log("[Profiling] Profiling has been disabled for the duration of the current user session."),!1;if(!e.isRecording())return F&&h.log("[Profiling] Discarding profile because transaction was not sampled."),!1;const t=A(),n=t&&t.getOptions();if(!n)return F&&h.log("[Profiling] Profiling disabled, no options found."),!1;const r=n.profilesSampleRate;return fE(r)?r?(r===!0?!0:Math.random()<r)?!0:(F&&h.log(`[Profiling] Discarding profile because it's not included in the random sample (sampling rate = ${Number(r)})`),!1):(F&&h.log("[Profiling] Discarding profile because a negative sampling decision was inherited or profileSampleRate is set to 0"),!1):(F&&h.warn("[Profiling] Discarding profile because of invalid sample rate."),!1)}function gE(e,t,n,r){return pE(n)?aE(e,t,n,r):null}const Qe=new Map;function _E(){return Qe.size}function yE(e){const t=Qe.get(e);return t&&Qe.delete(e),t}function SE(e,t){if(Qe.set(e,t),Qe.size>30){const n=Qe.keys().next().value;Qe.delete(n)}}function mv(e){return e?xs(e)?As(e):e:(F&&h.log("[Profiling] Transaction is undefined, skipping profiling"),e)}function As(e){let t;fl(e)&&(t=ot()*1e3);const n=mE();if(!n)return e;F&&h.log(`[Profiling] started profiling transaction: ${j(e).description}`);const r=Lt();async function s(){return!e||!n?null:n.stop().then(c=>(i&&(E.clearTimeout(i),i=void 0),F&&h.log(`[Profiling] stopped profiling of transaction: ${j(e).description}`),c?(SE(r,c),null):(F&&h.log(`[Profiling] profiler returned null profile for: ${j(e).description}`,"this may indicate an overlapping transaction or a call to stopProfiling with a profile title that was never started"),null))).catch(c=>(F&&h.log("[Profiling] error while stopping profiler:",c),null))}let i=E.setTimeout(()=>{F&&h.log("[Profiling] max profile duration elapsed, stopping profiling for:",j(e).description),s()},hl);const o=e.end.bind(e);function a(){return e?(s().then(()=>{e.setContext("profile",{profile_id:r,start_timestamp:t}),o()},()=>{o()}),e):o()}return e.end=a,e}const ml="BrowserProfiling",bE=()=>({name:ml,setupOnce(){},setup(e){const n=ae().getTransaction();if(n&&fl(n)&&xs(n)&&As(n),typeof e.on!="function"){h.warn("[Profiling] Client does not support hooks, profiling will be disabled");return}e.on("startTransaction",r=>{xs(r)&&As(r)}),e.on("beforeEnvelope",r=>{if(!_E())return;const s=lE(r);if(!s.length)return;const i=[];for(const o of s){const a=o&&o.contexts,c=a&&a.profile&&a.profile.profile_id,u=a&&a.profile&&a.profile.start_timestamp;if(typeof c!="string"){F&&h.log("[Profiling] cannot find profile for a transaction without a profile context");continue}if(!c){F&&h.log("[Profiling] cannot find profile for a transaction without a profile context");continue}a&&a.profile&&delete a.profile;const l=yE(c);if(!l){F&&h.log(`[Profiling] Could not retrieve profile for transaction: ${c}`);continue}const d=gE(c,u,l,o);d&&i.push(d)}uE(r,i)})}}),EE=bE,gv=Z(ml,EE);let gl={};E.Sentry&&E.Sentry.Integrations&&(gl=E.Sentry.Integrations);const _v={...gl,...Ip,...Jm};function yv(e){const t={...e};nc(t,"react"),Km(t)}const _l="ui.react.render",vE="ui.react.update",yl="ui.react.mount",ra="/home/runner/work/sentry-javascript/sentry-javascript/packages/react/src/profiler.tsx",TE="unknown";class Sl extends me.Component{static __initStatic(){this.defaultProps={disabled:!1,includeRender:!0,includeUpdates:!0}}constructor(t){super(t);const{name:n,disabled:r=!1}=this.props;r||(this._mountSpan=tt({name:`<${n}>`,onlyIfParent:!0,op:yl,origin:"auto.ui.react.profiler",attributes:{"ui.component_name":n}}))}componentDidMount(){this._mountSpan&&this._mountSpan.end()}shouldComponentUpdate({updateProps:t,includeUpdates:n=!0}){if(n&&this._mountSpan&&t!==this.props.updateProps){const r=Object.keys(t).filter(s=>t[s]!==this.props.updateProps[s]);if(r.length>0){const s=ot();this._updateSpan=Ri(this._mountSpan,()=>tt({name:`<${this.props.name}>`,onlyIfParent:!0,op:vE,origin:"auto.ui.react.profiler",startTimestamp:s,attributes:{"ui.component_name":this.props.name,"ui.react.changed_props":r}}))}}return!0}componentDidUpdate(){this._updateSpan&&(this._updateSpan.end(),this._updateSpan=void 0)}componentWillUnmount(){const t=ot(),{name:n,includeRender:r=!0}=this.props;if(this._mountSpan&&r){const s=j(this._mountSpan).timestamp;Ri(this._mountSpan,()=>{const i=tt({onlyIfParent:!0,name:`<${n}>`,op:_l,origin:"auto.ui.react.profiler",startTimestamp:s,attributes:{"ui.component_name":n}});i&&i.end(t)})}}render(){return this.props.children}}Sl.__initStatic();function Sv(e,t){const n=t&&t.name||e.displayName||e.name||TE,r=s=>me.createElement(Sl,{...t,name:n,updateProps:s,__self:this,__source:{fileName:ra,lineNumber:159}},me.createElement(e,{...s,__self:this,__source:{fileName:ra,lineNumber:160}}));return r.displayName=`profiler(${n})`,br(r,e),r}function bv(e,t={disabled:!1,hasRenderSpan:!0}){const[n]=me.useState(()=>{if(!(t&&t.disabled))return tt({name:`<${e}>`,onlyIfParent:!0,op:yl,origin:"auto.ui.react.profiler",attributes:{"ui.component_name":e}})});me.useEffect(()=>(n&&n.end(),()=>{if(n&&t.hasRenderSpan){const r=j(n).timestamp,s=ot(),i=tt({name:`<${e}>`,onlyIfParent:!0,op:_l,origin:"auto.ui.react.profiler",startTimestamp:r,attributes:{"ui.component_name":e}});i&&i.end(s)}}),[])}const fi=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,sa="/home/runner/work/sentry-javascript/sentry-javascript/packages/react/src/errorboundary.tsx";function IE(e){const t=e.match(/^([^.]+)/);return t!==null&&parseInt(t[0])>=17}const wE="unknown",ia={componentStack:null,error:null,eventId:null};function kE(e,t){const n=new WeakMap;function r(s,i){if(!n.has(s)){if(s.cause)return n.set(s,!0),r(s.cause,i);s.cause=i}}r(e,t)}class pi extends me.Component{constructor(t){super(t),pi.prototype.__init.call(this),this.state=ia,this._openFallbackReportDialog=!0;const n=A();n&&n.on&&t.showDialog&&(this._openFallbackReportDialog=!1,n.on("afterSendEvent",r=>{!r.type&&r.event_id===this._lastEventId&&lo({...t.dialogOptions,eventId:this._lastEventId})}))}componentDidCatch(t,{componentStack:n}){const{beforeCapture:r,onError:s,showDialog:i,dialogOptions:o}=this.props;lt(a=>{if(IE(me.version)&&Mt(t)){const u=new Error(t.message);u.name=`React ErrorBoundary ${t.name}`,u.stack=n,kE(t,u)}r&&r(a,t,n);const c=Sn(t,{captureContext:{contexts:{react:{componentStack:n}}},mechanism:{handled:!!this.props.fallback}});s&&s(t,n,c),i&&(this._lastEventId=c,this._openFallbackReportDialog&&lo({...o,eventId:c})),this.setState({error:t,componentStack:n,eventId:c})})}componentDidMount(){const{onMount:t}=this.props;t&&t()}componentWillUnmount(){const{error:t,componentStack:n,eventId:r}=this.state,{onUnmount:s}=this.props;s&&s(t,n,r)}__init(){this.resetErrorBoundary=()=>{const{onReset:t}=this.props,{error:n,componentStack:r,eventId:s}=this.state;t&&t(n,r,s),this.setState(ia)}}render(){const{fallback:t,children:n}=this.props,r=this.state;if(r.error){let s;return typeof t=="function"?s=t({error:r.error,componentStack:r.componentStack,resetError:this.resetErrorBoundary,eventId:r.eventId}):s=t,me.isValidElement(s)?s:(t&&fi&&h.warn("fallback did not produce a valid ReactElement"),null)}return typeof n=="function"?n():n}}function Ev(e,t){const n=e.displayName||e.name||wE,r=s=>me.createElement(pi,{...t,__self:this,__source:{fileName:sa,lineNumber:240}},me.createElement(e,{...s,__self:this,__source:{fileName:sa,lineNumber:241}}));return r.displayName=`errorBoundary(${n})`,br(r,e),r}const RE="redux.action",CE="info",xE={attachReduxState:!0,actionTransformer:e=>e,stateTransformer:e=>e||null};function vv(e){const t={...xE,...e};return n=>(r,s)=>(t.attachReduxState&&Vl().addEventProcessor((o,a)=>{try{o.type===void 0&&o.contexts.state.state.type==="redux"&&(a.attachments=[...a.attachments||[],{filename:"redux_state.json",data:JSON.stringify(o.contexts.state.state.value)}])}catch{}return o}),n((o,a)=>{const c=r(o,a),u=ae(),l=t.actionTransformer(a);typeof l<"u"&&l!==null&&u.addBreadcrumb({category:RE,data:l,type:CE});const d=t.stateTransformer(c);if(typeof d<"u"&&d!==null){const p=A(),m=p&&p.getOptions(),_=m&&m.normalizeDepth||3,S={state:{type:"redux",value:d}};it(S,"__sentry_override_normalization_depth__",3+_),u.setContext("state",S)}else u.setContext("state",null);const{configureScopeWithState:f}=t;return typeof f=="function"&&f(u,c),c},s))}function Tv(e){const t=Cr({...e,instrumentPageLoad:!1,instrumentNavigation:!1}),{history:n,routes:r,match:s,instrumentPageLoad:i=!0,instrumentNavigation:o=!0}=e;return{...t,afterAllSetup(a){t.afterAllSetup(a);const c=d=>{wn(a,d)},u=d=>{kn(a,d)},l=AE(n,r,s);l(c,i,!1),l(u,!1,o)}}}function AE(e,t,n){return(r,s=!0,i=!0)=>{let o,a;s&&E&&E.location&&oa(t,E.location,n,(c,u="url")=>{a=c,o=r({name:a,attributes:{[Ee]:"pageload",[he]:"auto.pageload.react.reactrouter_v3",[ee]:u}})}),i&&e.listen&&e.listen(c=>{(c.action==="PUSH"||c.action==="POP")&&(o&&o.end(),oa(t,c,n,(u,l="url")=>{a=u;const d={[Ee]:"navigation",[he]:"auto.navigation.react.reactrouter_v3",[ee]:l};o=r({name:a,attributes:d})}))})}}function oa(e,t,n,r){let s=t.pathname;n({location:t,routes:e},(i,o,a)=>{if(i||!a)return r(s);const c=ME(a.routes||[]);return c.length===0||c==="/*"?r(s):(s=c,r(s,"route"))})}function ME(e){if(!Array.isArray(e)||e.length===0)return"";const t=e.filter(r=>!!r.path);let n=-1;for(let r=t.length-1;r>=0;r--){const s=t[r];if(s.path&&s.path.startsWith("/")){n=r;break}}return t.slice(n).filter(({path:r})=>!!r).map(({path:r})=>r).join("")}const OE="/home/runner/work/sentry-javascript/sentry-javascript/packages/react/src/reactrouter.tsx";let xt;function Iv(e){const t=Cr({...e,instrumentPageLoad:!1,instrumentNavigation:!1}),{history:n,routes:r,matchPath:s,instrumentPageLoad:i=!0,instrumentNavigation:o=!0}=e;return{...t,afterAllSetup(a){t.afterAllSetup(a);const c=d=>{wn(a,d)},u=d=>{kn(a,d)},l=NE(n,r,s);l(c,i,!1),l(u,!1,o)}}}function wv(e){const t=Cr({...e,instrumentPageLoad:!1,instrumentNavigation:!1}),{history:n,routes:r,matchPath:s}=e;return{...t,afterAllSetup(i){t.afterAllSetup(i);const o=u=>{wn(i,u)},a=u=>{kn(i,u)},c=DE(n,r,s);c(o,e.instrumentPageLoad,!1),c(a,!1,e.instrumentNavigation)}}}function NE(e,t,n){return bl(e,"reactrouter_v4",t,n)}function DE(e,t,n){return bl(e,"reactrouter_v5",t,n)}function bl(e,t,n=[],r){function s(){if(e&&e.location)return e.location.pathname;if(E&&E.location)return E.location.pathname}function i(o){if(n.length===0||!r)return[o,"url"];const a=El(n,o,r);for(let c=0;c<a.length;c++)if(a[c].match.isExact)return[a[c].match.path,"route"];return[o,"url"]}return(o,a=!0,c=!0)=>{const u=s();if(a&&u){const[l,d]=i(u);xt=o({name:l,attributes:{[Ee]:"pageload",[he]:`auto.pageload.react.${t}`,[ee]:d}})}c&&e.listen&&e.listen((l,d)=>{if(d&&(d==="PUSH"||d==="POP")){xt&&xt.end();const[f,p]=i(l.pathname);xt=o({name:f,attributes:{[Ee]:"navigation",[he]:`auto.navigation.react.${t}`,[ee]:p}})}})}}function El(e,t,n,r=[]){return e.some(s=>{const i=s.path?n(t,s):r.length?r[r.length-1].match:LE(t);return i&&(r.push({route:s,match:i}),s.routes&&El(s.routes,t,n,r)),!!i}),r}function LE(e){return{path:"/",url:"/",params:{},isExact:e==="/"}}function kv(e){const t=e.displayName||e.name,n=r=>{if(r&&r.computedMatch&&r.computedMatch.isExact){const s=r.computedMatch.path,i=PE();i&&(i.updateName(s),i.setAttribute(ee,"route"))}return me.createElement(e,{...r,__self:this,__source:{fileName:OE,lineNumber:279}})};return n.displayName=`sentryRoute(${t})`,br(n,e),n}function PE(){if(xt)return xt;const e=Kt(),t=e?Jn(e):void 0;if(!t)return;const n=j(t).op;return n==="navigation"||n==="pageload"?t:void 0}const vl="/home/runner/work/sentry-javascript/sentry-javascript/packages/react/src/reactrouterv6.tsx";let Nt,nt,rt,st,dn,ut,qt,Fr,Je=!1;function Rv(e){const t=Cr({...e,instrumentPageLoad:!1,instrumentNavigation:!1}),{useEffect:n,useLocation:r,useNavigationType:s,createRoutesFromChildren:i,matchRoutes:o,stripBasename:a,instrumentPageLoad:c=!0,instrumentNavigation:u=!0}=e;return{...t,afterAllSetup(l){t.afterAllSetup(l);const d=p=>{kn(l,p)},f=E&&E.location&&E.location.pathname;c&&f&&wn(l,{name:f,attributes:{[ee]:"url",[Ee]:"pageload",[he]:"auto.pageload.react.reactrouter_v6"}}),nt=n,rt=r,st=s,ut=o,dn=i,Je=a||!1,qt=d,Fr=u}}}function Cv(e,t,n,r,s,i){return(o,a=!0,c=!0)=>{const u=E&&E.location&&E.location.pathname;a&&u&&(Nt=o({name:u,attributes:{[ee]:"url",[Ee]:"pageload",[he]:"auto.pageload.react.reactrouter_v6"}})),nt=e,rt=t,st=n,ut=s,dn=r,Je=i||!1,qt=o,Fr=c}}function ns(e,t){if(!t||t==="/"||!e.toLowerCase().startsWith(t.toLowerCase()))return e;const n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?e:e.slice(n)||"/"}function Tl(e,t,n,r=""){if(!e||e.length===0)return[Je?ns(t.pathname,r):t.pathname,"url"];let s="";if(n)for(let i=0;i<n.length;i++){const o=n[i],a=o.route;if(a){if(a.index)return[Je?ns(o.pathname,r):o.pathname,"route"];const c=a.path;if(c){const u=c[0]==="/"||s[s.length-1]==="/"?c:`/${c}`;if(s+=u,r+o.pathname===t.pathname)return Fi(s)!==Fi(o.pathname)&&s.slice(-2)!=="/*"?[(Je?"":r)+u,"route"]:[(Je?"":r)+s,"route"]}}}return[Je?ns(t.pathname,r):t.pathname,"url"]}function hi(e,t,n,r,s){const i=Array.isArray(r)?r:ut(n,t,s);if(e&&i){const[o,a]=Tl(n,t,i,s);e.updateName(o),e.setAttribute(ee,a)}}function mi(e,t,n,r,s){const i=Array.isArray(r)?r:ut(t,e,s);if(Fr&&(n==="PUSH"||n==="POP")&&i){Nt&&Nt.end();const[o,a]=Tl(t,e,i,s);Nt=qt({name:o,attributes:{[ee]:a,[Ee]:"navigation",[he]:"auto.navigation.react.reactrouter_v6"}})}}function xv(e){if(!nt||!rt||!st||!dn||!ut||!qt)return fi&&h.warn(`reactRouterV6Instrumentation was unable to wrap Routes because of one or more missing parameters.
359
359
  useEffect: ${nt}. useLocation: ${rt}. useNavigationType: ${st}.
360
360
  createRoutesFromChildren: ${dn}. matchRoutes: ${ut}. customStartTransaction: ${qt}.`),e;let t=!0;const n=r=>{const s=rt(),i=st();return nt(()=>{const o=dn(r.children);t?(hi(gi(),s,o),t=!1):mi(s,o,i)},[s,i]),me.createElement(e,{...r,__self:this,__source:{fileName:vl,lineNumber:329}})};return br(n,e),n}function Av(e){if(!nt||!rt||!st||!ut||!qt)return fi&&h.warn("reactRouterV6Instrumentation was unable to wrap `useRoutes` because of one or more missing parameters."),e;let t=!0;const n=r=>{const{routes:s,locationArg:i}=r,o=e(s,i),a=rt(),c=st(),u=typeof i=="string"||i&&i.pathname?i:a;return nt(()=>{const l=typeof u=="string"?{pathname:u}:u;t?(hi(gi(),l,s),t=!1):mi(l,s,c)},[c,u]),o};return(r,s)=>me.createElement(n,{routes:r,locationArg:s,__self:this,__source:{fileName:vl,lineNumber:386}})}function Mv(e){return function(t,n){const r=e(t,n),s=n&&n.basename,i=gi();return r.state.historyAction==="POP"&&i&&hi(i,r.state.location,t,void 0,s),r.subscribe(o=>{const a=o.location;Fr&&(o.historyAction==="PUSH"||o.historyAction==="POP")&&mi(a,t,o.historyAction,void 0,s)}),r}}function gi(){if(Nt)return Nt;const e=Kt(),t=e?Jn(e):void 0;if(!t)return;const n=j(t).op;return n==="navigation"||n==="pageload"?t:void 0}export{mm as Breadcrumbs,Hh as BrowserClient,gv as BrowserProfilingIntegration,rv as BrowserTracing,Im as Dedupe,pi as ErrorBoundary,Pr as Feedback,lp as FunctionToString,xm as GlobalHandlers,Pm as HttpContext,Dv as Hub,Qf as InboundFilters,_v as Integrations,Hm as LinkedErrors,tv as ModuleMetadata,Sl as Profiler,Dr as Replay,fv as ReplayCanvas,Ti as SDK_VERSION,Ee as SEMANTIC_ATTRIBUTE_SENTRY_OP,he as SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,Tt as SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE,ee as SEMANTIC_ATTRIBUTE_SENTRY_SOURCE,Lv as Scope,zm as TryCatch,E as WINDOW,je as addBreadcrumb,Tf as addEventProcessor,$l as addGlobalEventProcessor,ZE as addIntegration,za as addTracingExtensions,Dc as breadcrumbsIntegration,Vc as browserApiErrorsIntegration,EE as browserProfilingIntegration,Cr as browserTracingIntegration,pb as captureConsoleIntegration,Sr as captureEvent,Sn as captureException,is as captureMessage,ki as captureSession,uv as captureUserFeedback,em as chromeStackLineParser,Pv as close,Fv as configureScope,Yb as contextLinesIntegration,JE as continueTrace,vv as createReduxEnhancer,Qa as createTransport,$h as createUserFeedbackEnvelope,gb as debugIntegration,yb as dedupeIntegration,Ym as defaultIntegrations,ir as defaultRequestInstrumentationOptions,fm as defaultStackLineParsers,pm as defaultStackParser,$v as endSession,Dh as eventFromException,Lh as eventFromMessage,Mc as exceptionFromError,Tb as extraErrorDataIntegration,GE as extractTraceparentData,pv as feedbackIntegration,Bv as flush,ov as forceLoad,cc as functionToStringIntegration,sm as geckoStackLineParser,Kt as getActiveSpan,Oe as getActiveTransaction,A as getClient,Ie as getCurrentHub,ae as getCurrentScope,Vm as getDefaultIntegrations,Hv as getHubFromCarrier,dv as getReplay,Da as getSpanStatusFromHttpCode,Hc as globalHandlersIntegration,Db as httpClientIntegration,jc as httpContextIntegration,oc as inboundFiltersIntegration,yv as init,Cc as instrumentOutgoingRequests,Uv as isInitialized,Wv as lastEventId,Gc as linkedErrorsIntegration,hv as makeBrowserOfflineTransport,zh as makeFetchTransport,zv as makeMain,QE as makeMultiplexedTransport,qh as makeXHRTransport,nv as metrics,Kf as moduleMetadataIntegration,av as onLoad,mv as onProfilingStartRouteTransaction,sv as opera10StackLineParser,iv as opera11StackLineParser,ev as parameterize,Tv as reactRouterV3BrowserTracingIntegration,AE as reactRouterV3Instrumentation,Iv as reactRouterV4BrowserTracingIntegration,NE as reactRouterV4Instrumentation,wv as reactRouterV5BrowserTracingIntegration,DE as reactRouterV5Instrumentation,Rv as reactRouterV6BrowserTracingIntegration,Cv as reactRouterV6Instrumentation,DS as replayCanvasIntegration,lv as replayIntegration,Cb as reportingObserverIntegration,Ab as rewriteFramesIntegration,KS as sendFeedback,Ob as sessionTimingIntegration,ql as setContext,Mf as setCurrentClient,jv as setExtra,qv as setExtras,Ws as setHttpStatus,Xd as setMeasurement,Gv as setTag,Yv as setTags,Vv as setUser,lo as showReportDialog,YE as spanStatusfromHttpCode,kn as startBrowserTracingNavigationSpan,wn as startBrowserTracingPageLoadSpan,tt as startInactiveSpan,wi as startSession,KE as startSpan,XE as startSpanManual,Kv as startTransaction,VE as trace,bv as useProfiler,am as winjsStackLineParser,Ri as withActiveSpan,Ev as withErrorBoundary,Xv as withIsolationScope,Sv as withProfiler,lt as withScope,xv as withSentryReactRouterV6Routing,kv as withSentryRouting,cv as wrap,Mv as wrapCreateBrowserRouter,Av as wrapUseRoutes};
361
- //# sourceMappingURL=index.BI78I5tG.js.map
361
+ //# sourceMappingURL=index.C4pUfNnz.js.map