@stridge/kit 0.1.0-alpha.2 → 0.1.0-alpha.21

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 (132) hide show
  1. package/README.md +17 -3
  2. package/dist/KitProvider.d.ts +13 -0
  3. package/dist/KitProvider.js +1 -1
  4. package/dist/_internal/withdraw/driver/index.d.ts +2 -2
  5. package/dist/drivers/stridge/createStridgeDepositDriver.js +1 -1
  6. package/dist/drivers/stridge/createStridgeWithdrawDriver.d.ts +10 -12
  7. package/dist/drivers/stridge/createStridgeWithdrawDriver.js +1 -1
  8. package/dist/drivers/stridge/internal/metadata.js +1 -1
  9. package/dist/drivers/stridge/types.d.ts +7 -4
  10. package/dist/drivers/stridge-mock/createStridgeMockWithdrawDriver.d.ts +2 -2
  11. package/dist/drivers/stridge-mock/createStridgeMockWithdrawDriver.js +1 -1
  12. package/dist/drivers/stridge-mock/fixtures.d.ts +1 -1
  13. package/dist/drivers/stridge-mock/fixtures.js +1 -1
  14. package/dist/flows/deposit/dialog/DepositDialog.js +1 -1
  15. package/dist/flows/deposit/orchestrator/controller.js +1 -1
  16. package/dist/flows/deposit/widgets/deposit/Deposit.js +1 -1
  17. package/dist/flows/deposit/widgets/deposit-status-banner/DepositStatusBanner.js +1 -1
  18. package/dist/flows/deposit/widgets/deposit-status-banner/compound/DepositStatusBanner.js +1 -1
  19. package/dist/flows/deposit/widgets/transfer-crypto/compound/components/Address.js +1 -1
  20. package/dist/flows/deposit/widgets/transfer-crypto/compound/components/Disclosure.d.ts +2 -1
  21. package/dist/flows/deposit/widgets/transfer-crypto/compound/components/Disclosure.js +1 -1
  22. package/dist/flows/deposit/widgets/transfer-crypto/compound/components/QrCode.js +1 -1
  23. package/dist/flows/shared/transformers/pickRelevantSettlement.js +1 -1
  24. package/dist/flows/withdraw/bindings/WithdrawBindings.d.ts +92 -0
  25. package/dist/flows/withdraw/bindings/WithdrawBindings.js +1 -0
  26. package/dist/flows/withdraw/bindings/index.d.ts +1 -0
  27. package/dist/flows/withdraw/bindings/index.js +1 -0
  28. package/dist/flows/withdraw/dialog/WithdrawDialog.d.ts +57 -11
  29. package/dist/flows/withdraw/dialog/WithdrawDialog.js +1 -1
  30. package/dist/flows/withdraw/driver/payloads.d.ts +10 -1
  31. package/dist/flows/withdraw/driver/transformers/supportedAssetsToReceiveOptionsPayload.js +1 -1
  32. package/dist/flows/withdraw/driver/types.d.ts +53 -11
  33. package/dist/flows/withdraw/orchestrator/controller.js +1 -1
  34. package/dist/flows/withdraw/orchestrator/reducer.js +1 -1
  35. package/dist/flows/withdraw/orchestrator/types.d.ts +106 -31
  36. package/dist/flows/withdraw/widgets/withdraw-form/WithdrawForm.js +1 -1
  37. package/dist/flows/withdraw/widgets/withdraw-form/compound/WithdrawForm.js +1 -1
  38. package/dist/flows/withdraw/widgets/withdraw-form/compound/components/RecipientField.d.ts +7 -5
  39. package/dist/flows/withdraw/widgets/withdraw-form/compound/components/RecipientField.js +1 -1
  40. package/dist/flows/withdraw/widgets/withdraw-form/compound/types.d.ts +15 -5
  41. package/dist/flows/withdraw/widgets/withdraw-form/validation.js +1 -1
  42. package/dist/i18n/index.d.ts +5 -4
  43. package/dist/i18n/index.js +1 -1
  44. package/dist/i18n/locales/ar.js +1 -1
  45. package/dist/i18n/locales/es.js +1 -1
  46. package/dist/i18n/locales/source-keys.d.ts +12 -0
  47. package/dist/i18n/locales/source-keys.js +0 -0
  48. package/dist/icons/index.d.ts +2 -1
  49. package/dist/icons/index.js +1 -1
  50. package/dist/index.d.ts +7 -4
  51. package/dist/index.js +1 -1
  52. package/dist/package.js +1 -0
  53. package/dist/scope/KitPortalScope.js +1 -1
  54. package/dist/scope/KitScope.d.ts +18 -1
  55. package/dist/scope/KitScope.js +1 -1
  56. package/dist/scope/context.d.ts +17 -1
  57. package/dist/scope/index.d.ts +1 -1
  58. package/dist/shared/attribution/Attribution.js +1 -0
  59. package/dist/shared/attribution/Attribution.slots.js +1 -0
  60. package/dist/shared/attribution/Attribution.styles.js +1 -0
  61. package/dist/shared/attribution/index.js +1 -0
  62. package/dist/shared/chains/index.d.ts +48 -1
  63. package/dist/shared/chains/index.js +1 -1
  64. package/dist/shared/constants/brand-intercom.js +1 -0
  65. package/dist/shared/cuer/Cuer.js +1 -0
  66. package/dist/shared/cuer/QrCode.js +1 -0
  67. package/dist/shared/cuer/index.js +1 -0
  68. package/dist/shared/dialog/Frame.js +1 -1
  69. package/dist/shared/dialog/StepTransition.js +1 -1
  70. package/dist/shared/driver/types.d.ts +4 -3
  71. package/dist/shared/format/shortenAddress.d.ts +2 -2
  72. package/dist/shared/format/types.d.ts +2 -2
  73. package/dist/shared/i18n/KitI18nProvider.d.ts +11 -8
  74. package/dist/shared/i18n/KitI18nProvider.js +1 -1
  75. package/dist/shared/i18n/createKitI18n.d.ts +79 -16
  76. package/dist/shared/i18n/createKitI18n.js +1 -1
  77. package/dist/shared/i18n/useLingui.d.ts +11 -3
  78. package/dist/shared/icons/LogoIcon.d.ts +13 -0
  79. package/dist/shared/icons/LogoIcon.js +1 -0
  80. package/dist/shared/orchestrator/useSettlementWatcher.js +1 -1
  81. package/dist/shared/primitives/TxHashValue/TxHashValue.js +1 -1
  82. package/dist/shared/support/SupportButton.d.ts +1 -0
  83. package/dist/shared/support/SupportButton.js +1 -0
  84. package/dist/shared/support/SupportConfigContext.d.ts +1 -0
  85. package/dist/shared/support/SupportConfigContext.js +1 -0
  86. package/dist/shared/support/SupportLink.d.ts +1 -0
  87. package/dist/shared/support/SupportLink.js +1 -0
  88. package/dist/shared/support/SupportSpinner.d.ts +1 -0
  89. package/dist/shared/support/SupportSpinner.js +1 -0
  90. package/dist/shared/support/index.d.ts +2 -0
  91. package/dist/shared/support/index.js +1 -0
  92. package/dist/shared/support/intercom-loader.d.ts +17 -0
  93. package/dist/shared/support/intercom-loader.js +1 -0
  94. package/dist/shared/support/resolveSupport.d.ts +1 -0
  95. package/dist/shared/support/resolveSupport.js +1 -0
  96. package/dist/shared/support/types.d.ts +43 -0
  97. package/dist/shared/support/useIntercomMerchantContext.d.ts +27 -0
  98. package/dist/shared/support/useIntercomMerchantContext.js +1 -0
  99. package/dist/shared/support/useIntercomShutdownOnUnmount.js +1 -0
  100. package/dist/shared/support/useMerchantContext.d.ts +1 -0
  101. package/dist/shared/support/useMerchantContext.js +1 -0
  102. package/dist/shared/support/useSupportTrigger.js +1 -0
  103. package/dist/shared/ui/Card/Card.styles.js +1 -1
  104. package/dist/shared/ui/Details/Details.d.ts +10 -2
  105. package/dist/shared/ui/Details/Details.styles.js +1 -1
  106. package/dist/shared/ui/Dialog/Dialog.js +1 -1
  107. package/dist/shared/ui/Dialog/Dialog.styles.js +1 -1
  108. package/dist/shared/ui/ExternalLink/ExternalLink.js +1 -1
  109. package/dist/shared/ui/Select/Select.js +1 -1
  110. package/dist/shared/ui/WalletRow/WalletRow.d.ts +1 -1
  111. package/dist/shared/ui/WalletRow/WalletRow.js +1 -1
  112. package/dist/shared/widgets/confirm-transfer/compound/components/Disclaimer.js +1 -1
  113. package/dist/shared/widgets/confirm-transfer/compound/types.d.ts +1 -1
  114. package/dist/shared/widgets/error-state/compound/components/AssetValue.js +1 -1
  115. package/dist/shared/widgets/error-state/compound/components/HelpInfo.js +1 -1
  116. package/dist/shared/widgets/error-state/compound/components/StatusValue.js +1 -1
  117. package/dist/shared/widgets/processing-state/compound/components/Rows.js +1 -1
  118. package/dist/shared/widgets/success-state/compound/components/Actions.js +1 -1
  119. package/dist/shared/widgets/success-state/compound/components/AssetValue.js +1 -1
  120. package/dist/shared/widgets/success-state/compound/components/RouteValue.js +1 -1
  121. package/dist/shared/widgets/success-state/compound/components/StatusPill.js +1 -1
  122. package/dist/stridge/StridgeProvider.d.ts +88 -4
  123. package/dist/stridge/StridgeProvider.js +1 -1
  124. package/dist/stridge/optionalWagmi.js +1 -0
  125. package/dist/stridge/stubs.js +1 -1
  126. package/dist/styles/index.css +58 -12
  127. package/dist/types.d.ts +3 -2
  128. package/dist/ui/index.js +1 -1
  129. package/dist/withdraw/dialog/index.d.ts +3 -1
  130. package/package.json +10 -11
  131. package/dist/kit/package.js +0 -1
  132. /package/dist/{utils/src/use-copy-to-clipboard.js → shared/utils/useCopyToClipboard.js} +0 -0
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import{chains as e}from"./shared/chains/index.js";import{logos as t}from"./shared/utils/logos/api.js";import"./shared/utils/logos/index.js";import{createLocalStorageAdapter as n,createMemoryStorageAdapter as r,createSessionStorageAdapter as i,resolveStorageAdapter as a}from"./storage/adapters.js";import{createKitStorage as o}from"./storage/createKitStorage.js";import{DEFAULT_KIT_STORAGE_NAMESPACE as s,KitStorageProvider as c,useKitStorage as l,useKitStorageValue as u}from"./storage/context.js";import"./storage/index.js";import{bannerAckStorageKey as d,bucketFromSettlement as f,useBannerAck as p,useBannerAckForSettlement as m}from"./banners/useBannerAck.js";import"./banners/index.js";import{useDepositSnapshot as h}from"./flows/deposit/driver/context.js";import{useDepositState as g}from"./flows/deposit/orchestrator/controller.js";import{useDeposit as _}from"./flows/deposit/orchestrator/useDeposit.js";import{useWithdrawSnapshot as v}from"./flows/withdraw/driver/context.js";import{useWithdrawState as y}from"./flows/withdraw/orchestrator/controller.js";import{useWithdraw as b}from"./flows/withdraw/orchestrator/useWithdraw.js";import"./flows/withdraw/orchestrator/index.js";import{useKitConfig as x}from"./scope/context.js";import{KitPortalScope as S}from"./scope/KitPortalScope.js";import{useOptionalStridge as C,useStridge as w}from"./stridge/StridgeContext.js";import{StridgeProvider as T}from"./stridge/StridgeProvider.js";export{s as DEFAULT_KIT_STORAGE_NAMESPACE,S as KitPortalScope,c as KitStorageProvider,T as StridgeProvider,d as bannerAckStorageKey,f as bucketFromSettlement,e as chains,o as createKitStorage,n as createLocalStorageAdapter,r as createMemoryStorageAdapter,i as createSessionStorageAdapter,t as logos,a as resolveStorageAdapter,p as useBannerAck,m as useBannerAckForSettlement,_ as useDeposit,h as useDepositSnapshot,g as useDepositState,x as useKitConfig,l as useKitStorage,u as useKitStorageValue,C as useOptionalStridge,w as useStridge,b as useWithdraw,v as useWithdrawSnapshot,y as useWithdrawState};
1
+ import{chains as e,isValidAddressForChainType as t,isValidEvmAddress as n,isValidTronAddress as r,toChainType as i}from"./shared/chains/index.js";import{logos as a}from"./shared/utils/logos/api.js";import"./shared/utils/logos/index.js";import{createLocalStorageAdapter as o,createMemoryStorageAdapter as s,createSessionStorageAdapter as c,resolveStorageAdapter as l}from"./storage/adapters.js";import{createKitStorage as u}from"./storage/createKitStorage.js";import{DEFAULT_KIT_STORAGE_NAMESPACE as d,KitStorageProvider as f,useKitStorage as p,useKitStorageValue as m}from"./storage/context.js";import"./storage/index.js";import{bannerAckStorageKey as h,bucketFromSettlement as g,useBannerAck as _,useBannerAckForSettlement as v}from"./banners/useBannerAck.js";import"./banners/index.js";import{useDepositSnapshot as y}from"./flows/deposit/driver/context.js";import{useDepositState as b}from"./flows/deposit/orchestrator/controller.js";import{useDeposit as x}from"./flows/deposit/orchestrator/useDeposit.js";import{useWithdrawBindings as S}from"./flows/withdraw/bindings/WithdrawBindings.js";import"./flows/withdraw/bindings/index.js";import{useWithdrawSnapshot as C}from"./flows/withdraw/driver/context.js";import{useWithdrawState as w}from"./flows/withdraw/orchestrator/controller.js";import{useWithdraw as T}from"./flows/withdraw/orchestrator/useWithdraw.js";import"./flows/withdraw/orchestrator/index.js";import{useKitConfig as E}from"./scope/context.js";import{KitPortalScope as D}from"./scope/KitPortalScope.js";import{useOptionalStridge as O,useStridge as k}from"./stridge/StridgeContext.js";import{StridgeProvider as A}from"./stridge/StridgeProvider.js";export{d as DEFAULT_KIT_STORAGE_NAMESPACE,D as KitPortalScope,f as KitStorageProvider,A as StridgeProvider,h as bannerAckStorageKey,g as bucketFromSettlement,e as chains,u as createKitStorage,o as createLocalStorageAdapter,s as createMemoryStorageAdapter,c as createSessionStorageAdapter,t as isValidAddressForChainType,n as isValidEvmAddress,r as isValidTronAddress,a as logos,l as resolveStorageAdapter,i as toChainType,_ as useBannerAck,v as useBannerAckForSettlement,x as useDeposit,y as useDepositSnapshot,b as useDepositState,E as useKitConfig,p as useKitStorage,m as useKitStorageValue,O as useOptionalStridge,k as useStridge,T as useWithdraw,S as useWithdrawBindings,C as useWithdrawSnapshot,w as useWithdrawState};
@@ -0,0 +1 @@
1
+ var e=`0.1.0-alpha.21`;export{e as version};
@@ -1 +1 @@
1
- "use client";import{useKitConfig as e}from"./context.js";import{KIT_SCOPE_SLOTS as t}from"./KitScope.slots.js";import{jsx as n}from"react/jsx-runtime";import{DirectionProvider as r}from"@base-ui/react/direction-provider";function i({className:i,style:a,children:o,...s}){let{accent:c,direction:l,radius:u,theme:d}=e(),f=c?{"--stridge-kit-primary":c}:void 0,p=f||a?{...f,...a}:void 0;return n(r,{direction:l??`ltr`,children:n(`div`,{...s,dir:l,"data-stridge-scope":``,"data-stridge-radius":u,"data-stridge-theme":d,"data-stridge-slot":t.portalScope,className:i,style:p,children:o})})}export{i as KitPortalScope};
1
+ "use client";import{useKitConfig as e}from"./context.js";import{KIT_SCOPE_SLOTS as t}from"./KitScope.slots.js";import{jsx as n}from"react/jsx-runtime";import{DirectionProvider as r}from"@base-ui/react/direction-provider";function i({className:i,style:a,children:o,...s}){let{accent:c,direction:l,locale:u,radius:d,theme:f}=e(),p=c?{"--stridge-kit-primary":c}:void 0,m=p||a?{...p,...a}:void 0;return n(r,{direction:l??`ltr`,children:n(`div`,{...s,dir:l,"data-stridge-scope":``,"data-stridge-radius":d,"data-stridge-theme":f,"data-stridge-locale":u,"data-stridge-slot":t.portalScope,className:i,style:m,children:o})})}export{i as KitPortalScope};
@@ -1,4 +1,4 @@
1
- import { KitDirection, KitRadius, KitTarget, KitTheme } from "./context.js";
1
+ import { KitAttribution, KitDirection, KitRadius, KitTarget, KitTheme } from "./context.js";
2
2
  import { ComponentProps, ReactNode } from "react";
3
3
  import * as _$react_jsx_runtime0 from "react/jsx-runtime";
4
4
 
@@ -19,7 +19,9 @@ declare function KitScope({
19
19
  radius,
20
20
  theme,
21
21
  direction: directionProp,
22
+ locale,
22
23
  target,
24
+ attribution,
23
25
  className,
24
26
  style,
25
27
  dir,
@@ -55,6 +57,21 @@ declare namespace KitScope {
55
57
  * Use the standard HTML `dir` prop instead when you want a tree-wide DOM flip.
56
58
  */
57
59
  direction?: KitDirection;
60
+ /**
61
+ * Active BCP-47 locale tag (`"en"`, `"ar"`, `"fa"`, …). Forwarded by `KitProvider` from
62
+ * `i18n.locale` and stamped onto the scope div as `data-stridge-locale="…"` so hosts can
63
+ * target script-specific styling per locale — e.g. swap the kit's font stack to a Persian
64
+ * face on `[data-stridge-locale^="fa"]` while keeping the Arabic face on `[…^="ar"]`. RTL
65
+ * alone isn't fine-grained enough because both share `dir="rtl"`.
66
+ */
67
+ locale?: string;
68
+ /**
69
+ * Controls the "Powered by Stridge" attribution row inside every gateway widget frame.
70
+ * `"visible"` (default) auto-mounts the brand row at the bottom of every step; `"hidden"`
71
+ * suppresses the auto-mount for white-label installs. Explicit `<Stridge.PoweredBy />`
72
+ * compositions always render — set this to `"hidden"` when composing the brand row manually.
73
+ */
74
+ attribution?: KitAttribution;
58
75
  /** Children rendered inside the kit scope. */
59
76
  children?: ReactNode;
60
77
  }
@@ -1 +1 @@
1
- "use client";import{KitContext as e}from"./context.js";import{KIT_SCOPE_SLOTS as t}from"./KitScope.slots.js";import{useCallback as n,useLayoutEffect as r,useMemo as i,useRef as a,useState as o}from"react";import{jsx as s}from"react/jsx-runtime";import{DirectionProvider as c}from"@base-ui/react/direction-provider";function l({accent:r,radius:o,theme:l,direction:d,target:m,className:h,style:g,dir:_,ref:v,children:y,...b}){let x=a(null),S=f(x,_),C=u(_)??d??S,w=n(e=>{x.current=e,p(v,e)},[v]),T=i(()=>({accent:r,radius:o,theme:l,direction:C,target:m}),[r,o,l,C,m]),E=r?{"--stridge-kit-primary":r}:void 0,D=E||g?{...E,...g}:void 0;return s(e.Provider,{value:T,children:s(c,{direction:C??`ltr`,children:s(`div`,{...b,ref:w,dir:_,"data-stridge-scope":``,"data-stridge-radius":o,"data-stridge-theme":l,"data-stridge-slot":t.root,className:h,style:D,children:y})})})}function u(e){return e===`ltr`||e===`rtl`?e:void 0}function d(e){for(let t=e;t;t=t.parentElement){let e=u(t.getAttribute(`dir`)??void 0);if(e)return e}if(!(typeof window>`u`))return u(window.getComputedStyle(e).direction)}function f(e,t){let[n,i]=o(()=>u(t));return r(()=>{let n=e.current;if(!n){i(u(t));return}let r=()=>{i(d(n))};if(r(),typeof MutationObserver>`u`)return;let a=new MutationObserver(r);for(let e=n;e;e=e.parentElement)a.observe(e,{attributes:!0,attributeFilter:[`dir`]});return()=>a.disconnect()},[t,e]),n}function p(e,t){if(e){if(typeof e==`function`){e(t);return}e.current=t}}export{l as KitScope};
1
+ "use client";import{KitContext as e}from"./context.js";import{KIT_SCOPE_SLOTS as t}from"./KitScope.slots.js";import{useCallback as n,useLayoutEffect as r,useMemo as i,useRef as a,useState as o}from"react";import{jsx as s}from"react/jsx-runtime";import{DirectionProvider as c}from"@base-ui/react/direction-provider";function l({accent:r,radius:o,theme:l,direction:d,locale:m,target:h,attribution:g,className:_,style:v,dir:y,ref:b,children:x,...S}){let C=a(null),w=f(C,y),T=u(y)??d??w,E=n(e=>{C.current=e,p(b,e)},[b]),D=i(()=>({accent:r,radius:o,theme:l,direction:T,locale:m,target:h,attribution:g}),[r,o,l,T,m,h,g]),O=r?{"--stridge-kit-primary":r}:void 0,k=O||v?{...O,...v}:void 0;return s(e.Provider,{value:D,children:s(c,{direction:T??`ltr`,children:s(`div`,{...S,ref:E,dir:y,"data-stridge-scope":``,"data-stridge-radius":o,"data-stridge-theme":l,"data-stridge-locale":m,"data-stridge-slot":t.root,className:_,style:k,children:x})})})}function u(e){return e===`ltr`||e===`rtl`?e:void 0}function d(e){for(let t=e;t;t=t.parentElement){let e=u(t.getAttribute(`dir`)??void 0);if(e)return e}if(!(typeof window>`u`))return u(window.getComputedStyle(e).direction)}function f(e,t){let[n,i]=o(()=>u(t));return r(()=>{let n=e.current;if(!n){i(u(t));return}let r=()=>{i(d(n))};if(r(),typeof MutationObserver>`u`)return;let a=new MutationObserver(r);for(let e=n;e;e=e.parentElement)a.observe(e,{attributes:!0,attributeFilter:[`dir`]});return()=>a.disconnect()},[t,e]),n}function p(e,t){if(e){if(typeof e==`function`){e(t);return}e.current=t}}export{l as KitScope};
@@ -2,6 +2,7 @@
2
2
  type KitRadius = "sharp" | "subtle" | "rounded" | "pill";
3
3
  type KitTheme = "dark" | "light";
4
4
  type KitDirection = "ltr" | "rtl";
5
+ type KitAttribution = "visible" | "hidden";
5
6
  /**
6
7
  * Destination token credited by the gateway flow.
7
8
  */
@@ -53,10 +54,25 @@ interface KitConfig {
53
54
  * behavior when they render outside the provider's DOM subtree.
54
55
  */
55
56
  direction?: KitDirection;
57
+ /**
58
+ * Active BCP-47 locale tag (e.g. `"en"`, `"ar"`, `"fa"`, `"ar-EG"`). Forwarded by `KitProvider`
59
+ * from `i18n.locale` and stamped onto every kit scope as `data-stridge-locale="…"` so the host
60
+ * can target script-specific styling (typically the font stack) per locale — RTL alone isn't
61
+ * fine-grained enough (Arabic and Persian are both RTL but commonly want different faces).
62
+ */
63
+ locale?: string;
56
64
  /**
57
65
  * Destination token configuration.
58
66
  */
59
67
  target?: KitTarget;
68
+ /**
69
+ * Resolved state of the "Powered by Stridge" attribution row. `"visible"` (default) lets the
70
+ * gateway frame auto-mount the brand row at the bottom of every step; `"hidden"` suppresses
71
+ * the auto-mount for white-label installs. Explicit `<Stridge.PoweredBy />` compositions
72
+ * ignore this value and always render — the contract is "set `attribution=\"hidden\"` when
73
+ * composing the brand row manually".
74
+ */
75
+ attribution?: KitAttribution;
60
76
  }
61
77
  /**
62
78
  * Reads the active {@link KitConfig} from the nearest provider. Returns `{}` when no provider is
@@ -64,4 +80,4 @@ interface KitConfig {
64
80
  */
65
81
  declare function useKitConfig(): KitConfig;
66
82
  //#endregion
67
- export { KitConfig, KitDirection, KitRadius, KitTarget, KitTheme, useKitConfig };
83
+ export { KitAttribution, KitConfig, KitDirection, KitRadius, KitTarget, KitTheme, useKitConfig };
@@ -1,3 +1,3 @@
1
- import { KitConfig, KitDirection, KitRadius, KitTarget, KitTheme, useKitConfig } from "./context.js";
1
+ import { KitAttribution, KitConfig, KitDirection, KitRadius, KitTarget, KitTheme, useKitConfig } from "./context.js";
2
2
  import { KitPortalScope } from "./KitPortalScope.js";
3
3
  import { KitScope } from "./KitScope.js";
@@ -0,0 +1 @@
1
+ "use client";import{useLingui as e}from"../i18n/useLingui.js";import"../../i18n/index.js";import{joinClassNames as t}from"../utils/joinClassNames.js";import{LogoIcon as n}from"../icons/LogoIcon.js";import"../../icons/index.js";import{ATTRIBUTION_SLOTS as r}from"./Attribution.slots.js";import{elementStyles as i,styles as a}from"./Attribution.styles.js";import{Fragment as o,jsx as s,jsxs as c}from"react/jsx-runtime";import*as l from"@stylexjs/stylex";function u({href:u=`https://stridge.com`,target:d=`_blank`,rel:f=`noopener noreferrer`,asStatic:p,className:m,style:h}){let{_:g}=e(),_=l.props(a.root),v=l.props(a.link,!p&&a.anchor),y=l.props(i.prefix),b=l.props(i.mark),x=l.props(i.wordmark),S=t(_.className,m),C=_.style||h?{..._.style,...h}:void 0,w=c(o,{children:[s(`span`,{"data-stridge-slot":r.prefix,className:y.className,style:y.style,children:g({id:`g2UNkE`,message:`Powered by`})}),s(`span`,{"data-stridge-slot":r.mark,className:b.className,style:b.style,children:s(n,{"aria-hidden":!0,focusable:!1})}),s(`span`,{"data-stridge-slot":r.wordmark,className:x.className,style:x.style,children:`Stridge`})]});return s(`div`,{"data-stridge-slot":r.root,className:S,style:C,children:p?s(`span`,{className:v.className,style:v.style,children:w}):s(`a`,{href:u,target:d,rel:f,className:v.className,style:v.style,children:w})})}export{u as Attribution};
@@ -0,0 +1 @@
1
+ const e={root:`attribution`,prefix:`attribution-prefix`,mark:`attribution-mark`,wordmark:`attribution-wordmark`};export{e as ATTRIBUTION_SLOTS};
@@ -0,0 +1 @@
1
+ const e={root:{"Attribution__styles.root":`Attribution__styles.root`,"display-k1xSpc":`x78zum5`,"flexDirection-kXwgrk":`x1q0g3np`,"alignItems-kGNEyG":`x6s0dn4`,"justifyContent-kjj79g":`xl56j7k`,"paddingTop-kLKAdn":`x19ment4`,"paddingBottom-kGO01o":`xfvigk`,"paddingInline-kg3NbH":`x1ujb8i1`,$$css:`@stridge/kit:src/shared/attribution/Attribution.styles.ts:11`},link:{"Attribution__styles.link":`Attribution__styles.link`,"display-k1xSpc":`x3nfvp2`,"flexDirection-kXwgrk":`x1q0g3np`,"alignItems-kGNEyG":`x6s0dn4`,"gap-kOIVth":`x1a6yh9e`,"textDecoration-kybGjl":`x1hl2dhg`,"outline-kI3sdo":`x1a2a7pz`,"transitionProperty-k1ekBW":`xt3l3uh`,"transitionDuration-kIyJzY":`x1vhb3u9`,"transitionTimingFunction-kAMwcw":`x1xv5090`,$$css:`@stridge/kit:src/shared/attribution/Attribution.styles.ts:20`},anchor:{"Attribution__styles.anchor":`Attribution__styles.anchor`,":focus-visible_outline-k3Woio":`x1gvykhg`,":focus-visible_outlineOffset-kiEn40":`x7s97pk`,$$css:`@stridge/kit:src/shared/attribution/Attribution.styles.ts:35`}},t={prefix:{"Attribution__elementStyles.prefix":`Attribution__elementStyles.prefix`,"fontSize-kGuDYH":`x1oae1zf`,"fontWeight-k63SB2":`xxjjie5`,"lineHeight-kLWn49":`x1d3mw78`,"color-kMwMTN":`xd2gg92`,":is(a:hover, a:focus-visible) [data-stridge-slot~='attribution-prefix']_color-kKNNVu":`x1wa2jhk`,$$css:`@stridge/kit:src/shared/attribution/Attribution.styles.ts:51`},mark:{"Attribution__elementStyles.mark":`Attribution__elementStyles.mark`,"display-k1xSpc":`x3nfvp2`,"alignItems-kGNEyG":`x6s0dn4`,"color-kMwMTN":`x9irweu`,":is(a:hover, a:focus-visible) [data-stridge-slot~='attribution-mark']_color-kEC4n1":`x1perupi`,$$css:`@stridge/kit:src/shared/attribution/Attribution.styles.ts:60`},wordmark:{"Attribution__elementStyles.wordmark":`Attribution__elementStyles.wordmark`,"fontSize-kGuDYH":`x1oae1zf`,"fontWeight-k63SB2":`x1qvi77d`,"letterSpacing-kb6lSQ":`x1ixy4ik`,"lineHeight-kLWn49":`x1d3mw78`,"color-kMwMTN":`x1nxg1fm`,":is(a:hover, a:focus-visible) [data-stridge-slot~='attribution-wordmark']_color-kKiZkk":`x19k0ldo`,":is(a:hover, a:focus-visible) [data-stridge-slot~='attribution-wordmark']_textDecoration-k7BEHM":`x1l0eogd`,":is(a:hover, a:focus-visible) [data-stridge-slot~='attribution-wordmark']_textUnderlineOffset-kHPfEo":`x1diuls0`,$$css:`@stridge/kit:src/shared/attribution/Attribution.styles.ts:68`}};export{t as elementStyles,e as styles};
@@ -0,0 +1 @@
1
+ import"./Attribution.slots.js";import"./Attribution.js";
@@ -36,5 +36,52 @@ type ChainSlug = keyof typeof chains;
36
36
  * `network_id` (`"9006"`). The kit normalizes via {@link normalizeChainToNetworkId}.
37
37
  */
38
38
  type ChainInput = string | number;
39
+ /**
40
+ * Chain family a network belongs to. The kit-internal, case-stable mirror of the gateway's
41
+ * `chain_type` wire tag (`SupportedAssetDto.chain_type`):
42
+ *
43
+ * - `"evm"` — every EIP-155 chain (Ethereum, BSC, Polygon, …); addresses are `0x` + 40 hex.
44
+ * - `"tron"` — Tron mainnet; addresses are base58check, 34 chars, leading `T`.
45
+ * - `"unknown"` — a family the kit predates. Address validation falls back to a permissive
46
+ * shape check (see {@link isValidAddressForChainType}) so a chain the backend lists before
47
+ * the kit ships explicit support is still usable rather than hard-blocked.
48
+ *
49
+ * Drivers are the source of truth: each one tags its payloads (`ReceiveChainPayload.chainType`,
50
+ * …) so widgets and headless consumers never re-derive the family from chain-id heuristics.
51
+ */
52
+ type ChainType = "evm" | "tron" | "unknown";
53
+ /**
54
+ * Normalize a raw gateway `chain_type` value (or a missing one) into a {@link ChainType}.
55
+ * Surrounding whitespace is trimmed and matching is case-insensitive; the gateway tags Tron as
56
+ * `"TVM"` (Tron Virtual Machine). Any value the kit doesn't recognize — including `undefined` —
57
+ * collapses to `"unknown"`, which keeps the address gate permissive instead of blocking the flow.
58
+ */
59
+ declare function toChainType(raw: string | null | undefined): ChainType;
60
+ /**
61
+ * Lightweight EVM-address validator. Matches `0x` followed by exactly 40 hex characters.
62
+ * Does NOT enforce the EIP-55 mixed-case checksum — the gateway lowercases before routing, and
63
+ * checksum validation would reject the all-lowercase forms wallets and explorers commonly emit.
64
+ * Input is trimmed before matching.
65
+ */
66
+ declare function isValidEvmAddress(value: string): boolean;
67
+ /**
68
+ * Lightweight Tron-address validator. Matches the base58check mainnet shape: a leading `T`
69
+ * followed by 33 base58 characters (34 total). Does NOT verify the trailing checksum bytes —
70
+ * that needs a base58check decode the kit deliberately keeps out of the bundle; the gateway
71
+ * performs the authoritative check. Input is trimmed before matching.
72
+ */
73
+ declare function isValidTronAddress(value: string): boolean;
74
+ /**
75
+ * Validate a recipient address against the chain family it's being sent to — the chain-type-aware
76
+ * gate the withdraw form and headless integrators share. Pass the `chainType` the driver tagged
77
+ * onto the receive-chain payload.
78
+ *
79
+ * - `"evm"` / `"tron"` — checked against the family's real address shape.
80
+ * - `"unknown"` — a family the kit predates: accepts any whitespace-free token of at least 8
81
+ * characters, so a backend-listed chain still works before the kit ships a dedicated matcher.
82
+ *
83
+ * Empty / whitespace-only input is always rejected. Trim is handled internally.
84
+ */
85
+ declare function isValidAddressForChainType(value: string, chainType: ChainType): boolean;
39
86
  //#endregion
40
- export { ChainInput, ChainSlug, chains };
87
+ export { ChainInput, ChainSlug, ChainType, chains, isValidAddressForChainType, isValidEvmAddress, isValidTronAddress, toChainType };
@@ -1 +1 @@
1
- const e={ethereum:1,bsc:56,polygon:137,arbitrum:42161,base:8453},t={ethereum:`60`,bsc:`9006`,polygon:`966`,arbitrum:`9001`,base:`8453`},n={1:`60`,56:`9006`,137:`966`,42161:`9001`,8453:`8453`};function r(e){if(typeof e==`number`)return n[e]??String(e);let r=e.toLowerCase();return r in t?t[r]:/^\d+$/.test(e)?n[Number(e)]??e:e}export{e as chains,r as normalizeChainToNetworkId};
1
+ const e={ethereum:1,bsc:56,polygon:137,arbitrum:42161,base:8453},t={ethereum:`60`,bsc:`9006`,polygon:`966`,arbitrum:`9001`,base:`8453`},n={1:`60`,56:`9006`,137:`966`,42161:`9001`,8453:`8453`};function r(e){if(typeof e==`number`)return n[e]??String(e);let r=e.toLowerCase();return r in t?t[r]:/^\d+$/.test(e)?n[Number(e)]??e:e}function i(e){switch(e?.trim().toUpperCase()){case`EVM`:return`evm`;case`TVM`:return`tron`;default:return`unknown`}}const a=/^0x[0-9a-fA-F]{40}$/,o=/^T[1-9A-HJ-NP-Za-km-z]{33}$/;function s(e){return a.test(e.trim())}function c(e){return o.test(e.trim())}function l(e,t){let n=e.trim();if(n.length===0)return!1;switch(t){case`evm`:return a.test(n);case`tron`:return o.test(n);default:return/^\S{8,}$/.test(n)}}export{e as chains,l as isValidAddressForChainType,s as isValidEvmAddress,c as isValidTronAddress,r as normalizeChainToNetworkId,i as toChainType};
@@ -0,0 +1 @@
1
+ const e={appId:`ii7w0vsj`};export{e as BRAND_INTERCOM};
@@ -0,0 +1 @@
1
+ import{create as e}from"./QrCode.js";import*as t from"react";import{Fragment as n,jsx as r,jsxs as i}from"react/jsx-runtime";const a=e=>Math.max(0,Math.min(1,e));function o(e){let{arena:t,...n}=e;return i(o.Root,{...n,children:[r(o.Finder,{}),r(o.Cells,{}),t&&r(o.Arena,{children:typeof t==`string`?r(`img`,{alt:`Arena`,src:t,style:{borderRadius:1,height:`100%`,objectFit:`cover`,width:`100%`}}):t})]})}(function(o){let s=o.Context=t.createContext(null);function c(n){let{children:a,size:o=`100%`,value:c,version:l,errorCorrection:u,...d}=n,f=t.useMemo(()=>(t.Children.map(a,e=>!t.isValidElement(e)||typeof e.type==`string`?null:`displayName`in e.type&&e.type.displayName===`Arena`?!0:null)??[]).some(Boolean),[a]),p=t.useMemo(()=>{let t=u;return f&&u===`low`&&(t=`medium`),e(c,{errorCorrection:t,version:l})},[c,f,u,l]),m=p.edgeLength*1,h=p.finderLength*1/2,g=f?Math.floor(m/4):0,_=t.useMemo(()=>({arenaSize:g,cellSize:1,edgeSize:m,qrcode:p,finderSize:h}),[g,m,p,h]);return r(s.Provider,{value:_,children:i(`svg`,{...d,width:o,height:o,viewBox:`0 0 ${m} ${m}`,xmlns:`http://www.w3.org/2000/svg`,children:[r(`title`,{children:`QR Code`}),a]})})}o.Root=c,(function(e){e.displayName=`Root`})(c||=o.Root||={});function l(e){let{className:o,fill:c,innerClassName:l,radius:u=.25,stroke:d}=e,{cellSize:f,edgeSize:p,finderSize:m}=t.useContext(s),h=a(u);function g({position:e}){let t=m-(m-f)-f/2;e===`top-right`&&(t=p-m-(m-f)-f/2);let a=m-(m-f)-f/2;e===`bottom-left`&&(a=p-m-(m-f)-f/2);let s=m-f*1.5;e===`top-right`&&(s=p-m-f*1.5);let u=m-f*1.5;return e===`bottom-left`&&(u=p-m-f*1.5),i(n,{children:[r(`rect`,{className:o,stroke:d??c??`currentColor`,fill:`transparent`,x:t,y:a,width:f+(m-f)*2,height:f+(m-f)*2,rx:2*h*(m-f),ry:2*h*(m-f),strokeWidth:f}),r(`rect`,{className:l,fill:c??`currentColor`,x:s,y:u,width:f*3,height:f*3,rx:2*h*f,ry:2*h*f})]})}return i(n,{children:[r(g,{position:`top-left`}),r(g,{position:`top-right`}),r(g,{position:`bottom-left`})]})}o.Finder=l,(function(e){e.displayName=`Finder`})(l||=o.Finder||={});function u(e){let{className:n,fill:i=`currentColor`,inset:o=!0,radius:c=1}=e,{arenaSize:l,cellSize:u,qrcode:d}=t.useContext(s),{edgeLength:f,finderLength:p}=d,m=a(c);return r(`path`,{className:n,d:t.useMemo(()=>{let e=``;for(let t=0;t<d.grid.length;t++){let n=d.grid[t];if(n)for(let r=0;r<n.length;r++){if(!n[r])continue;let i=f/2-l/2,a=i+l;if(t>=i&&t<=a&&r>=i&&r<=a)continue;let s=t<p&&r<p,c=t<p&&r>=f-p,d=t>=f-p&&r<p;if(s||c||d)continue;let h=(u-(o?u*.1:0)*2)/2,g=r*u+u/2,_=t*u+u/2,v=g-h,y=g+h,b=_-h,x=_+h,S=m*h;e+=[`M ${v+S},${b}`,`L ${y-S},${b}`,`A ${S},${S} 0 0,1 ${y},${b+S}`,`L ${y},${x-S}`,`A ${S},${S} 0 0,1 ${y-S},${x}`,`L ${v+S},${x}`,`A ${S},${S} 0 0,1 ${v},${x-S}`,`L ${v},${b+S}`,`A ${S},${S} 0 0,1 ${v+S},${b}`,`z`].join(` `)}}return e},[l,u,f,p,d.grid,o,m]),fill:i})}o.Cells=u,(function(e){e.displayName=`Cells`})(u||=o.Cells||={});function d(e){let{children:n}=e,{arenaSize:i,cellSize:a,edgeSize:o}=t.useContext(s),c=i,l=(o-c)/2;return r(`foreignObject`,{x:l,y:l,width:c,height:c,children:r(`div`,{style:{alignItems:`center`,display:`flex`,fontSize:1,justifyContent:`center`,height:`100%`,overflow:`hidden`,width:`100%`,padding:a/2,boxSizing:`border-box`},children:n})})}o.Arena=d,(function(e){e.displayName=`Arena`})(d||=o.Arena||={})})(o||={});export{o as Cuer};
@@ -0,0 +1 @@
1
+ import{encodeQR as e}from"qr";function t(t,n={}){let{errorCorrection:r,version:i}=n,a=e(t,`raw`,{border:1,ecc:r,scale:1,version:i}).slice(1,-1).map(e=>e.slice(1,-1));return{edgeLength:a.length,finderLength:7,grid:a,value:t}}export{t as create};
@@ -0,0 +1 @@
1
+ import"./Cuer.js";
@@ -1 +1 @@
1
- "use client";import{useKitConfig as e}from"../../scope/context.js";import{useIsInsideDialogContent as t}from"../ui/Dialog/Dialog.js";import"../ui/Dialog/index.js";import{Card as n}from"../ui/Card/Card.js";import"../../ui/index.js";import{jsx as r}from"react/jsx-runtime";function i({className:i,style:a,dir:o,...s}){let c=t(),{direction:l}=e(),u=o??l;if(c){let e={className:`Frame__styles.bare x78zum5 xdt5ytf x12lumcd x2lwn1j x7giv3`,"data-style-src":`@stridge/kit:src/shared/dialog/Frame.tsx:25`};return r(`div`,{...s,dir:u,className:[e.className,i].filter(Boolean).join(` `)||void 0,style:{...e.style,...a}})}return r(n,{variant:`frame`,dir:u,className:i,style:a,...s})}export{i as Frame};
1
+ "use client";import{useKitConfig as e}from"../../scope/context.js";import{useIsInsideDialogContent as t}from"../ui/Dialog/Dialog.js";import"../ui/Dialog/index.js";import{Attribution as n}from"../attribution/Attribution.js";import"../attribution/index.js";import{Card as r}from"../ui/Card/Card.js";import"../../ui/index.js";import{jsx as i,jsxs as a}from"react/jsx-runtime";function o({className:o,style:s,dir:c,children:l,...u}){let d=t(),{direction:f,attribution:p}=e(),m=c??f,h=p!==`hidden`;if(d){let e={className:`Frame__styles.bare x78zum5 xdt5ytf xkz0k9k x2lwn1j x7giv3`,"data-style-src":`@stridge/kit:src/shared/dialog/Frame.tsx:33`};return a(`div`,{...u,dir:m,className:[e.className,o].filter(Boolean).join(` `)||void 0,style:{...e.style,...s},children:[l,h?i(n,{}):null]})}return a(r,{variant:`frame`,dir:m,className:o,style:s,...u,children:[l,h?i(n,{}):null]})}export{o as Frame};
@@ -1 +1 @@
1
- "use client";import{useEffect as e,useLayoutEffect as t,useRef as n}from"react";import{jsx as r}from"react/jsx-runtime";import{AnimatePresence as i,motion as a}from"motion/react";const o=[.3,0,.06,1],s={enter:e=>({opacity:0,x:e>=0?16:-16,filter:`blur(6px)`}),center:{opacity:1,x:0,filter:`blur(0px)`,transition:{duration:.22,delay:.12,ease:o}},exit:e=>({opacity:0,x:e>=0?-16:16,filter:`blur(6px)`,transition:{duration:.14,ease:o}})};function c({stateKey:o,children:c}){let l=n([]),u=n(null),d=l.current,f=d[d.length-1],p=0;o!==f&&(p=d.indexOf(o)>=0?-1:1);let m=n(null),h=n(o),g=n(null),_=n(null);return e(()=>{let e=l.current;if(e[e.length-1]===o)return;let t=e.indexOf(o);l.current=t>=0?e.slice(0,t+1):[...e,o]},[o]),t(()=>{let e=u.current;if(!e)return;let t=e.getBoundingClientRect().height;if(h.current===o){m.current=t;return}let n=m.current;if(h.current=o,m.current=t,n===null||n===t)return;let r=e.style.transition;e.style.transition=`none`,e.style.height=`${n}px`,e.offsetHeight,e.style.transition=r,_.current!==null&&window.cancelAnimationFrame(_.current),_.current=window.requestAnimationFrame(()=>{_.current=null,u.current&&(u.current.style.height=`${t}px`)}),g.current!==null&&window.clearTimeout(g.current),g.current=window.setTimeout(()=>{g.current=null;let e=u.current;e&&(e.style.height=``)},320)}),e(()=>()=>{g.current!==null&&(window.clearTimeout(g.current),g.current=null),_.current!==null&&(window.cancelAnimationFrame(_.current),_.current=null)},[]),r(`div`,{ref:u,style:{position:`relative`,overflow:`hidden`,transition:`height 260ms cubic-bezier(0.3, 0, 0.06, 1)`,flex:`0 1 auto`,minHeight:0,display:`flex`,flexDirection:`column`},children:r(i,{mode:`popLayout`,custom:p,initial:!1,children:r(a.div,{custom:p,variants:s,initial:`enter`,animate:`center`,exit:`exit`,tabIndex:-1,style:{display:`flex`,flexDirection:`column`,flex:`1 1 auto`,minHeight:0,outline:`none`},children:c},o)})})}export{c as StepTransition};
1
+ "use client";import{useEffect as e,useLayoutEffect as t,useRef as n}from"react";import{jsx as r}from"react/jsx-runtime";import{AnimatePresence as i,motion as a}from"motion/react";const o=[.3,0,.06,1],s={enter:e=>({opacity:0,x:e>=0?16:-16,filter:`blur(6px)`}),center:{opacity:1,x:0,filter:`blur(0px)`,transition:{duration:.22,delay:.12,ease:o}},exit:e=>({opacity:0,x:e>=0?-16:16,filter:`blur(6px)`,transition:{duration:.14,ease:o}})};function c({stateKey:o,children:c}){let l=n([]),u=n(null),d=l.current,f=d[d.length-1],p=0;o!==f&&(p=d.indexOf(o)>=0?-1:1);let m=n(null),h=n(o),g=n(null),_=n(null);return e(()=>{let e=l.current;if(e[e.length-1]===o)return;let t=e.indexOf(o);l.current=t>=0?e.slice(0,t+1):[...e,o]},[o]),t(()=>{let e=u.current;if(!e)return;let t=e.getBoundingClientRect().height;if(h.current===o){m.current=t;return}let n=m.current;if(h.current=o,m.current=t,n===null||n===t||document.visibilityState===`hidden`)return;let r=e.style.transition;e.style.transition=`none`,e.style.height=`${n}px`,e.offsetHeight,e.style.transition=r,_.current!==null&&window.cancelAnimationFrame(_.current),_.current=window.requestAnimationFrame(()=>{_.current=null,u.current&&(u.current.style.height=`${t}px`)}),g.current!==null&&window.clearTimeout(g.current),g.current=window.setTimeout(()=>{g.current=null;let e=u.current;e&&(e.style.height=``)},320)}),e(()=>{let e=()=>{if(document.visibilityState!==`hidden`)return;_.current!==null&&(window.cancelAnimationFrame(_.current),_.current=null),g.current!==null&&(window.clearTimeout(g.current),g.current=null);let e=u.current;e&&(e.style.height=``)};return document.addEventListener(`visibilitychange`,e),()=>{document.removeEventListener(`visibilitychange`,e),g.current!==null&&(window.clearTimeout(g.current),g.current=null),_.current!==null&&(window.cancelAnimationFrame(_.current),_.current=null)}},[]),r(`div`,{ref:u,style:{position:`relative`,overflow:`hidden`,transition:`height 260ms cubic-bezier(0.3, 0, 0.06, 1)`,flex:`0 1 auto`,minHeight:0,display:`flex`,flexDirection:`column`},children:r(i,{mode:`popLayout`,custom:p,initial:!1,children:r(a.div,{custom:p,variants:s,initial:`enter`,animate:`center`,exit:`exit`,tabIndex:-1,style:{display:`flex`,flexDirection:`column`,flex:`1 1 auto`,minHeight:0,outline:`none`},children:c},o)})})}export{c as StepTransition};
@@ -6,9 +6,10 @@
6
6
  * public `@stridge/kit/<flow>/driver` surface.
7
7
  */
8
8
  /**
9
- * On-chain transaction reference. Drivers return one of these from any imperative wallet action
10
- * (`submitDeposit`, `submitWithdrawal`); the orchestrator stamps it on the FSM's `tx` slot until
11
- * the matching settlement entity catches up and exposes a richer `txHash` / `txExplorerUrl` pair.
9
+ * On-chain transaction reference. The deposit driver returns one from `submitDeposit`; the
10
+ * withdraw flow's host-supplied `onSubmit` surfaces one via `actions.beginProcessing({ hash })`
11
+ * or `actions.setTxHash`. The orchestrator stamps it on the FSM's `tx` slot until the matching
12
+ * settlement entity catches up and exposes a richer `txHash` / `txExplorerUrl` pair.
12
13
  */
13
14
  interface TxRef {
14
15
  hash: string;
@@ -11,8 +11,8 @@
11
11
  * @example
12
12
  *
13
13
  * ```ts
14
- * shortenAddress("0xCA8779a5FD7cEAf54211177A2b22dB5E0480685c");
15
- * // → "0x…685c"
14
+ * shortenAddress("0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266");
15
+ * // → "0x…2266"
16
16
  *
17
17
  * shortenAddress("0xa15b11eb774cfac27b369f3d1908b0d1d8aa48b893d7a1e89612d8438920650f");
18
18
  * // → "0x…650f"
@@ -18,8 +18,8 @@
18
18
  * };
19
19
  *
20
20
  * const address: FormattedField<string> = {
21
- * value: "0xCA8779a5FD7cEAf54211177A2b22dB5E0480685c",
22
- * formatted: "0x…685c",
21
+ * value: "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
22
+ * formatted: "0x…2266",
23
23
  * };
24
24
  * ```
25
25
  */
@@ -3,21 +3,24 @@ import { ReactNode } from "react";
3
3
  import * as _$react_jsx_runtime0 from "react/jsx-runtime";
4
4
 
5
5
  //#region src/shared/i18n/KitI18nProvider.d.ts
6
- interface Props extends KitI18nConfig {
7
- children: ReactNode;
8
- }
9
6
  /**
10
7
  * Mounts a per-request Lingui `I18n` instance into React context. Re-creates the instance only
11
- * when `locale` or the identity of `catalogs` changes — same render-stable pattern as the kit's
12
- * other context providers, and the SSR-safe alternative to mutating a module-level singleton.
8
+ * when `locale` or the identity of `messages` changes — same render-stable pattern as the
9
+ * kit's other context providers, and the SSR-safe alternative to mutating a module-level
10
+ * singleton.
13
11
  *
14
12
  * Used internally by `KitProvider`. Hosts don't mount this directly; they pass a single
15
- * `i18n={{ locale, catalogs }}` prop on `<KitProvider>` and the kit handles the wiring.
13
+ * `i18n={{ locale, messages }}` prop on `<KitProvider>` and the kit handles the wiring.
16
14
  */
17
15
  declare function KitI18nProvider({
18
16
  locale,
19
- catalogs,
17
+ messages,
20
18
  children
21
- }: Props): _$react_jsx_runtime0.JSX.Element;
19
+ }: KitI18nProvider.Props): _$react_jsx_runtime0.JSX.Element;
20
+ declare namespace KitI18nProvider {
21
+ interface Props extends KitI18nConfig {
22
+ children: ReactNode;
23
+ }
24
+ }
22
25
  //#endregion
23
26
  export { KitI18nProvider };
@@ -1 +1 @@
1
- "use client";import{createKitI18n as e}from"./createKitI18n.js";import{useMemo as t}from"react";import{jsx as n}from"react/jsx-runtime";import{I18nProvider as r}from"@lingui/react";function i({locale:i=`en`,catalogs:a,children:o}){return n(r,{i18n:t(()=>e({locale:i,catalogs:a}),[i,a]),children:o})}export{i as KitI18nProvider};
1
+ "use client";import{createKitI18n as e}from"./createKitI18n.js";import{useMemo as t}from"react";import{jsx as n}from"react/jsx-runtime";import{I18nProvider as r}from"@lingui/react";function i({locale:i=`en`,messages:a,children:o}){return n(r,{i18n:t(()=>e({locale:i,messages:a}),[i,a]),children:o})}export{i as KitI18nProvider};
@@ -1,33 +1,96 @@
1
+ import { SupportedLocale } from "./locales.js";
2
+ import { KitTranslatableKey } from "../../i18n/locales/source-keys.js";
1
3
  import { I18n, Messages } from "@lingui/core";
2
4
 
3
5
  //#region src/shared/i18n/createKitI18n.d.ts
4
6
  /**
5
- * Map of locale codes to message catalogs. Keyed by the locale string the host activates
6
- * (`"en"`, `"es"`, etc.). Values are plain `{ [id]: translation }` maps; ICU placeholders and
7
- * plurals are compiled at runtime by {@link compileMessage}.
7
+ * Locale codes the kit's i18n surface accepts. Autocompletes on the locales the kit ships
8
+ * catalogs for ({@link SupportedLocale} — `"en"`, `"es"`, `"ar"`) while still accepting any
9
+ * other BCP-47 tag, so hosts who add their own catalogs via `defineMessages` aren't fenced
10
+ * out of the type.
11
+ *
12
+ * The `(string & {})` intersection is the standard escape hatch for "literal union + open
13
+ * string with autocomplete": without it, TypeScript collapses `Supported | string` to plain
14
+ * `string` and the editor loses the autocomplete suggestions for the named literals.
15
+ */
16
+ type KitLocale = SupportedLocale | (string & {});
17
+ /**
18
+ * Map of locale codes to compiled message catalogs. Values are lingui `Messages` —
19
+ * content-hash-keyed `{ [id]: translation }` maps where ICU placeholders and plurals are
20
+ * compiled at runtime by {@link compileMessage}.
21
+ *
22
+ * Shipped locales (`@stridge/kit/i18n/locales/<code>`) export `Messages` directly. For hosts
23
+ * authoring their own translations, the recommended path is {@link defineMessages}, which
24
+ * takes a plain English-keyed map and emits the same hash-keyed shape — so shipped and
25
+ * host-authored translations slot into the same prop without different shapes.
8
26
  */
9
- type KitCatalogs = Partial<Record<string, Messages>>;
27
+ type KitMessages = Partial<Record<KitLocale, Messages>>;
28
+ /**
29
+ * Hash a plain English-keyed translation map into the lingui `Messages` shape, ready to drop
30
+ * into `<KitProvider i18n={{ messages: { … } }}>`. Use this whenever you want to author
31
+ * translations by hand — adding a locale the kit doesn't ship, overriding a single key on a
32
+ * shipped locale, or tweaking the source English copy.
33
+ *
34
+ * Keys are constrained to {@link KitTranslatableKey} — the literal union of every English
35
+ * source the kit actually translates. Editors autocomplete on every valid key, and typos /
36
+ * stale keys fail at compile time via excess-property checks on the object literal. The union
37
+ * is codegened from `en.po` at `pnpm i18n:compile` time.
38
+ *
39
+ * Hashing runs once per call (typically at module load), not on every render. ICU placeholders
40
+ * (`{symbol}`) and plurals (`{count, plural, one {# item} other {# items}}`) are supported in
41
+ * both keys and values; the kit's runtime compiler handles ICU on access.
42
+ *
43
+ * @example
44
+ * ```tsx
45
+ * import { messages as es } from "@stridge/kit/i18n/locales/es";
46
+ * import { defineMessages } from "@stridge/kit/i18n";
47
+ *
48
+ * const fr = defineMessages({
49
+ * Continue: "Suivant",
50
+ * "Deposit {symbol}": "Dépôt de {symbol}",
51
+ * "{count, plural, one {# item} other {# items}}":
52
+ * "{count, plural, one {# article} other {# articles}}",
53
+ * });
54
+ *
55
+ * // Add a brand-new locale:
56
+ * <KitProvider i18n={{ locale: "fr", messages: { fr } }} />;
57
+ *
58
+ * // Override one key on a shipped locale (spread to preserve the rest):
59
+ * <KitProvider i18n={{ locale: "es", messages: { es: { ...es, ...defineMessages({ Continue: "Adelante" }) } } }} />;
60
+ *
61
+ * // Override source English:
62
+ * <KitProvider i18n={{ locale: "en", messages: { en: defineMessages({ Deposit: "Top up" }) } }} />;
63
+ * ```
64
+ */
65
+ declare function defineMessages(translations: Partial<Record<KitTranslatableKey, string>>): Messages;
10
66
  /**
11
67
  * Public-facing i18n configuration. Pass the whole object to `<KitProvider i18n={…}>` —
12
- * `locale` selects the active locale, `catalogs` lists the catalogs the kit can resolve
13
- * against. Locales not present in `catalogs` fall back to the source English string per leaf.
68
+ * `locale` selects the active locale, `messages` lists the catalogs the kit can resolve
69
+ * against. Locales not present in `messages` fall back to the source English string per leaf.
14
70
  */
15
71
  interface KitI18nConfig {
16
- /** Active locale code. Defaults to `"en"`. */
17
- locale?: string;
18
72
  /**
19
- * Locale catalogs the kit can resolve against. Deep-import the locales you ship from
20
- * `@stridge/kit/i18n/locales/<code>` and pass them as a map (e.g. `{ es: esMessages }`).
21
- * Tree-shaken: locales not referenced here aren't bundled.
73
+ * Active locale code. Defaults to `"en"`. Autocompletes on shipped locales (`"en"`, `"es"`,
74
+ * `"ar"`) but accepts any other BCP-47 tag for host-supplied catalogs.
75
+ */
76
+ locale?: KitLocale;
77
+ /**
78
+ * Locale catalogs the kit can resolve against. Each value is a hash-keyed lingui
79
+ * `Messages` map — either deep-imported from `@stridge/kit/i18n/locales/<code>` (shipped
80
+ * locales: `en`, `es`, `ar`) or produced by {@link defineMessages} from a plain
81
+ * English-keyed map (host-authored locales and per-key overrides). Same-locale entries
82
+ * merge per-key — spread a shipped catalog and overlay specific keys via `defineMessages`
83
+ * to override individual phrases without touching the rest.
22
84
  */
23
- catalogs?: KitCatalogs;
85
+ messages?: KitMessages;
24
86
  }
25
87
  /**
26
88
  * Build a fresh {@link I18n} instance for one render tree (one `KitProvider` mount, one SSR
27
- * request). Loads `catalogs`, registers the runtime message compiler, and activates `locale`.
89
+ * request). Loads each entry of `messages`, registers the runtime message compiler, and
90
+ * activates `locale`.
28
91
  *
29
92
  * Per-request instances are the SSR-safe alternative to mutating a process-wide singleton. The
30
- * kit's {@link KitProvider} calls this on every render that changes `locale` or `catalogs`.
93
+ * kit's {@link KitProvider} calls this on every render that changes `locale` or `messages`.
31
94
  *
32
95
  * `setupI18n` ships its own no-op compiler in production builds; we override with the real
33
96
  * `compileMessage` so ICU placeholders (`{symbol}`) and plurals (`{count, plural, one {…}
@@ -35,7 +98,7 @@ interface KitI18nConfig {
35
98
  */
36
99
  declare function createKitI18n({
37
100
  locale,
38
- catalogs
101
+ messages
39
102
  }?: KitI18nConfig): I18n;
40
103
  //#endregion
41
- export { KitCatalogs, KitI18nConfig, createKitI18n };
104
+ export { KitI18nConfig, KitLocale, KitMessages, createKitI18n, defineMessages };
@@ -1 +1 @@
1
- import{setupI18n as e}from"@lingui/core";import{compileMessage as t}from"@lingui/message-utils/compileMessage";function n({locale:n=`en`,catalogs:r}={}){let i=e();if(i.setMessagesCompiler(t),i.load(`en`,{}),r)for(let[e,t]of Object.entries(r))t&&i.load(e,t);return i.activate(n),i}export{n as createKitI18n};
1
+ import{setupI18n as e}from"@lingui/core";import{compileMessage as t}from"@lingui/message-utils/compileMessage";import{generateMessageId as n}from"@lingui/message-utils/generateMessageId";function r(e){let t={};for(let[r,i]of Object.entries(e))!r||typeof i!=`string`||(t[n(r)]=i);return t}function i({locale:n=`en`,messages:r}={}){let i=e();if(i.setMessagesCompiler(t),i.load(`en`,{}),r)for(let[e,t]of Object.entries(r))t&&i.load(e,t);return i.activate(n),i}export{i as createKitI18n,r as defineMessages};
@@ -2,7 +2,15 @@ import { ComponentType } from "react";
2
2
  import { I18n } from "@lingui/core";
3
3
 
4
4
  //#region src/shared/i18n/useLingui.d.ts
5
- interface LinguiContextValue {
5
+ /**
6
+ * Shape of the value returned by the kit's {@link useLingui}. Mirrors Lingui's own
7
+ * `LinguiContextValue` (`{ i18n, _, defaultComponent? }`) so the macro's rewrite of `` t`…` ``
8
+ * into `_({ id, message })` calls type-checks against this surface.
9
+ *
10
+ * Exported alongside {@link useLingui} so power users wrapping the hook can name the return
11
+ * type without reaching back into Lingui internals.
12
+ */
13
+ interface KitLinguiContextValue {
6
14
  i18n: I18n;
7
15
  defaultComponent?: ComponentType<{
8
16
  id: string;
@@ -30,6 +38,6 @@ interface LinguiContextValue {
30
38
  * Callers shouldn't import this directly — they should write `import { useLingui } from
31
39
  * "@lingui/react/macro"` and let the build pipeline rewire the runtime target.
32
40
  */
33
- declare function useLingui(): LinguiContextValue;
41
+ declare function useLingui(): KitLinguiContextValue;
34
42
  //#endregion
35
- export { useLingui };
43
+ export { KitLinguiContextValue, useLingui };
@@ -0,0 +1,13 @@
1
+ import { SVGProps } from "react";
2
+ import * as _$react_jsx_runtime0 from "react/jsx-runtime";
3
+
4
+ //#region src/shared/icons/LogoIcon.d.ts
5
+ /**
6
+ * Stridge brand mark. Path is the optimized 18×18 variant used in social cards, scaled to
7
+ * whatever `width`/`height` the caller passes (defaults to 14×14 for inline use). Decorative
8
+ * when paired with the "Stridge" wordmark — mark it `aria-hidden` in those compositions so
9
+ * screen readers announce the wordmark only once.
10
+ */
11
+ declare function LogoIcon(props: SVGProps<SVGSVGElement>): _$react_jsx_runtime0.JSX.Element;
12
+ //#endregion
13
+ export { LogoIcon };
@@ -0,0 +1 @@
1
+ import{jsx as e}from"react/jsx-runtime";function t(t){return e(`svg`,{fill:`currentColor`,height:`14`,viewBox:`0 0 18 18`,width:`14`,xmlns:`http://www.w3.org/2000/svg`,...t,children:e(`path`,{clipRule:`evenodd`,d:`M0 9a9 9 0 0 0 9 9A9 9 0 1 0 9 0a9 9 0 0 0-9 9Zm11.675 1.953a.88.88 0 0 0-.742.198 5.311 5.311 0 0 1-3.998 1.807C-.985 12.958.955 1.742 9 1.742a7.24 7.24 0 0 1 5.374 2.379 7.042 7.042 0 0 0-3.309-.82A7.048 7.048 0 0 0 5.76 5.697.879.879 0 0 0 7.068 6.85a5.31 5.31 0 0 1 3.998-1.807c7.92 0 5.98 11.216-2.066 11.216a7.237 7.237 0 0 1-5.373-2.379 7.035 7.035 0 0 0 3.308.821 7.044 7.044 0 0 0 5.306-2.398.878.878 0 0 0-.566-1.349Z`,fillRule:`evenodd`})})}export{t as LogoIcon};
@@ -1 +1 @@
1
- import{useEffect as e}from"react";function t(t,n){let r=n?.hash;e(()=>{if(!n)return;let e=new AbortController;return t.watchSettlement({tx:n},()=>void 0,e.signal),()=>e.abort()},[r,t])}export{t as useSettlementWatcher};
1
+ import{useEffect as e,useRef as t}from"react";function n(n,r,i){let a=t(r);a.current=r,e(()=>{let e=a.current;if(e==null)return;let t=new AbortController;return n.watchSettlement(e,()=>void 0,t.signal),()=>t.abort()},[n,i])}export{n as useSettlementWatcher};
@@ -1 +1 @@
1
- "use client";import{ExternalLinkIcon as e}from"../../icons/ExternalLinkIcon.js";import"../../../icons/index.js";import{toSafeHref as t}from"../../ui/ExternalLink/toSafeHref.js";import{ExternalLink as n}from"../../ui/ExternalLink/ExternalLink.js";import"../../ui/ExternalLink/index.js";import{LtrAtom as r}from"../../ui/LtrAtom/LtrAtom.js";import"../../ui/LtrAtom/index.js";import{text as i}from"../../ui/Text/Text.js";import"../../ui/Text/index.js";import{TX_HASH_VALUE_SLOTS as a}from"./TxHashValue.slots.js";import{styles as o}from"./TxHashValue.styles.js";import{jsx as s}from"react/jsx-runtime";import*as c from"@stylexjs/stylex";function l({hash:l,explorerUrl:u,linkColor:d=`var(--stridge-kit-primary)`}){let f=t(u),p=c.props(o.root),m=s(i.span,{size:`meta`,fontWeight:`medium`,leading:`tight`,tracking:`normal`,font:`mono`,color:`inherit`,children:s(r,{children:l})});return f?s(n,{dir:`ltr`,href:f,suffix:s(e,{"aria-hidden":!0}),"data-stridge-slot":a.root,className:p.className,style:{...p.style,color:d},children:m}):s(`span`,{dir:`ltr`,"data-stridge-slot":a.root,className:p.className,style:p.style,children:m})}export{l as TxHashValue};
1
+ "use client";import{toSafeHref as e}from"../../ui/ExternalLink/toSafeHref.js";import{ExternalLink as t}from"../../ui/ExternalLink/ExternalLink.js";import"../../ui/ExternalLink/index.js";import{ExternalLinkIcon as n}from"../../icons/ExternalLinkIcon.js";import"../../../icons/index.js";import{LtrAtom as r}from"../../ui/LtrAtom/LtrAtom.js";import"../../ui/LtrAtom/index.js";import{text as i}from"../../ui/Text/Text.js";import"../../ui/Text/index.js";import{TX_HASH_VALUE_SLOTS as a}from"./TxHashValue.slots.js";import{styles as o}from"./TxHashValue.styles.js";import{jsx as s}from"react/jsx-runtime";import*as c from"@stylexjs/stylex";function l({hash:l,explorerUrl:u,linkColor:d=`var(--stridge-kit-primary)`}){let f=e(u),p=c.props(o.root),m=s(i.span,{size:`xs`,fontWeight:`medium`,leading:`tight`,tracking:`normal`,font:`mono`,color:`inherit`,children:s(r,{children:l})});return f?s(t,{dir:`ltr`,href:f,suffix:s(n,{"aria-hidden":!0}),"data-stridge-slot":a.root,className:p.className,style:{...p.style,color:d},children:m}):s(`span`,{dir:`ltr`,"data-stridge-slot":a.root,className:p.className,style:p.style,children:m})}export{l as TxHashValue};
@@ -0,0 +1 @@
1
+ import { ComponentProps, ReactNode } from "react";
@@ -0,0 +1 @@
1
+ "use client";import{styles as e}from"../ui/ExternalLink/ExternalLink.styles.js";import{joinClassNames as t}from"../utils/joinClassNames.js";import{cloneElement as n,isValidElement as r}from"react";import{jsx as i,jsxs as a}from"react/jsx-runtime";import*as o from"@stylexjs/stylex";function s({children:n,suffix:r,className:s,style:d,...f}){let p=r!=null&&r!==!1,m=o.props(e.root,l.button),h=t(m.className,s),g=o.props(e.iconSlot,e.suffixSpacing);return a(`button`,{"data-stridge-slot":u.root,type:`button`,...f,className:h,style:{...m.style,...d},children:[n,p?i(`span`,{"data-icon":`inline-end`,...g,children:c(r)}):null]})}function c(t){if(!r(t))return t;let i=o.props(e.iconSvg);return n(t,{className:[t.props.className,i.className].filter(Boolean).join(` `),style:{...t.props.style,...i.style}})}const l={button:{"SupportButton__supportButtonStyles.button":`SupportButton__supportButtonStyles.button`,"appearance-kysU6D":`xjyslct`,"padding-kmVPX3":`x1717udv`,"font-kVVagm":`xln7xf2`,"color-kMwMTN":`x1heor9g`,"cursor-kkrTdU":`x1ypdohk`,"textAlign-k9WMMc":`x16tdsg8`,$$css:`@stridge/kit:src/shared/support/SupportButton.tsx:52`}},u={root:`support-button`};export{s as SupportButton};
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1 @@
1
+ "use client";import{createContext as e,use as t}from"react";const n=e({config:void 0,merchantContext:null});n.displayName=`SupportConfigContext`;function r(){return t(n)}export{n as SupportConfigContext,r as useSupportConfig};
@@ -0,0 +1 @@
1
+ import { CSSProperties, MouseEventHandler, ReactNode } from "react";
@@ -0,0 +1 @@
1
+ "use client";import{useSupportConfig as e}from"./SupportConfigContext.js";import{resolveSupport as t}from"./resolveSupport.js";import{SupportButton as n}from"./SupportButton.js";import{BRAND_LINKS as r}from"../constants/brand-links.js";import{ExternalLink as i}from"../ui/ExternalLink/ExternalLink.js";import"../ui/ExternalLink/index.js";import{SupportSpinner as a}from"./SupportSpinner.js";import{useSupportTrigger as o}from"./useSupportTrigger.js";import{useCallback as s}from"react";import{jsx as c}from"react/jsx-runtime";const l={cursor:`not-allowed`,opacity:.6,pointerEvents:`none`};function u(n){let{config:r,merchantContext:i}=e(),a=t(r);return a.kind===`stridge`?c(d,{...n}):a.kind===`url`?c(f,{...n,url:a.url}):c(p,{...n,url:a.url,onOpen:a.onOpen,merchantContext:i})}function d({children:e,suffix:t,onClick:n,style:u,...d}){let f=o(),p=f.status===`loading`,m=s(e=>{n?.(e),!e.defaultPrevented&&e.button===0&&(e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||(e.preventDefault(),f.open()))},[f,n]),h=p?{...u,...l}:u;return c(i,{...d,href:r.support,suffix:p?c(a,{}):t,onClick:m,"aria-busy":p||void 0,"aria-disabled":p||void 0,style:h,children:e})}function f({url:e,children:t,...n}){return c(i,{...n,href:e,children:t})}function p({url:e,onOpen:t,merchantContext:r,children:a,suffix:o,onClick:l,...u}){let d=s(e=>{l?.(e),!e.defaultPrevented&&e.button===0&&(e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||(e.preventDefault(),t({event:e,...m(r)})))},[l,t,r]),f=s(e=>{l?.(e),!e.defaultPrevented&&t({event:e,...m(r)})},[l,t,r]);return e?c(i,{...u,href:e,suffix:o,onClick:d,children:a}):c(n,{...u,suffix:o,onClick:f,children:a})}function m(e){return e??{gatewayKey:``,environment:``,assetChain:``,assetSymbol:``}}export{u as SupportLink};
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1 @@
1
+ import{LoaderIcon as e}from"../icons/LoaderIcon.js";import"../../icons/index.js";import{jsx as t}from"react/jsx-runtime";function n(){return t(e,{"aria-hidden":!0,role:`img`,"aria-label":`Loading`,className:`SupportSpinner__styles.spinning x1aerksh xof6966 x1esw782 xa4qsjk x1g0ag68 x1764fhq`,"data-style-src":`@stridge/kit:src/shared/support/SupportSpinner.tsx:12`})}export{n as SupportSpinner};
@@ -0,0 +1,2 @@
1
+ import { IntercomMerchantContext } from "./useIntercomMerchantContext.js";
2
+ import { SupportConfig, SupportOpenContext } from "./types.js";
@@ -0,0 +1 @@
1
+ import"./SupportConfigContext.js";import"./intercom-loader.js";import"./resolveSupport.js";import"./SupportButton.js";import"./SupportSpinner.js";import"./useSupportTrigger.js";import"./SupportLink.js";import"./useIntercomMerchantContext.js";import"./useIntercomShutdownOnUnmount.js";import"./useMerchantContext.js";
@@ -0,0 +1,17 @@
1
+ //#region src/shared/support/intercom-loader.d.ts
2
+ /**
3
+ * Messenger command dispatcher exposed at `window.Intercom`. The vendor accepts arbitrary
4
+ * command tuples (`["boot", settings]`, `["onShow", callback]`, `["show"]`, …); our calls
5
+ * are funneled through {@link openIntercom} / {@link shutdownIntercom}.
6
+ */
7
+ type IntercomFn = (...args: unknown[]) => void;
8
+ declare global {
9
+ interface Window {
10
+ Intercom?: IntercomFn;
11
+ intercomSettings?: Record<string, unknown>;
12
+ }
13
+ }
14
+ /**
15
+ * Returns `true` when the vendor's real dispatcher is mounted on `window.Intercom`. Used by
16
+ * {@link useSupportTrigger} as a hint for whether a subsequent click can skip the spinner.
17
+ */
@@ -0,0 +1 @@
1
+ import{BRAND_INTERCOM as e}from"../constants/brand-intercom.js";const t=`__stridgeKitShim__`;let n=null,r=!1;function i(e){return e[t]===!0}function a(){if(typeof window>`u`)return!1;let t=window.intercomSettings?.app_id,n=!1;if(typeof t==`string`&&t!==e.appId)n=!0;else{let e=window.Intercom;typeof e==`function`&&!i(e)&&t===void 0&&(n=!0)}return n&&o(),n}function o(){r||process.env.NODE_ENV!==`production`&&(r=!0,console.warn("[@stridge/kit] Detected a foreign Intercom workspace already mounted on this page. The kit's support link will fall back to opening the static support URL in a new tab. Configure `<StridgeProvider support={{ url: '...' }} />` or `<StridgeProvider support={{ onOpen: ... }} />` to silence this warning and customize the behavior."))}function s(){let e=window;if(typeof e.Intercom==`function`)return e.Intercom;let n=[],r=Object.assign((...e)=>{n.push(e)},{q:n,c:e=>{n.push(e)},[t]:!0});return e.Intercom=r,r}function c(){return n||(typeof document>`u`?Promise.reject(Error(`Intercom can only load in a browser`)):(n=new Promise((t,r)=>{let a=document.createElement(`script`);a.type=`text/javascript`,a.async=!0,a.src=`https://widget.intercom.io/widget/${e.appId}`,a.dataset.stridgeIntercom=`true`,a.addEventListener(`load`,()=>t()),a.addEventListener(`error`,()=>{n=null,a.remove(),typeof window<`u`&&window.Intercom&&i(window.Intercom)&&delete window.Intercom,r(Error(`Failed to load Intercom widget script`))}),document.head.appendChild(a)}),n))}function l(){if(typeof window>`u`)return!1;let e=window.Intercom;return typeof e==`function`&&!i(e)}function u(){return typeof window>`u`?Promise.reject(Error(`Intercom can only load in a browser`)):a()?Promise.reject(Error(`Another Intercom workspace is already mounted; falling back to web link`)):new Promise((t,n)=>{let r=window;r.intercomSettings={...r.intercomSettings,app_id:e.appId,hide_default_launcher:!0};let i=s(),a=!1,o,l=e=>{a||(a=!0,o!==void 0&&clearTimeout(o),e())};i(`boot`,{...r.intercomSettings,app_id:e.appId,hide_default_launcher:!0}),i(`onShow`,()=>{l(()=>t())}),i(`onHide`,()=>{d()}),i(`show`),o=setTimeout(()=>{l(()=>n(Error(`Intercom messenger did not display within timeout`)))},1e4),c().catch(e=>{l(()=>n(e))})})}function d(){if(typeof window>`u`)return;let e=window.Intercom;if(typeof e==`function`&&!i(e))try{e(`shutdown`)}catch{}}export{l as isIntercomReady,u as openIntercom,d as shutdownIntercom};
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1 @@
1
+ function e(e){return e?.onOpen?e.url?{kind:`custom`,onOpen:e.onOpen,url:e.url}:{kind:`custom`,onOpen:e.onOpen}:e?.url?{kind:`url`,url:e.url}:{kind:`stridge`}}export{e as resolveSupport};