@payai/x402-solana-react 1.0.2 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -50,7 +50,20 @@ import '@payai/x402-solana-react/styles';
50
50
  import '@solana/wallet-adapter-react-ui/styles.css';
51
51
  ```
52
52
 
53
- ### 2. Wallet Provider Setup (Optional)
53
+ ### 2. Environment Variables (Optional - Recommended for Production)
54
+
55
+ For production use, configure a custom RPC endpoint to avoid rate limiting on public RPCs:
56
+
57
+ Create a `.env` file (you can copy from the included `.env.example`) and set your RPC URL:
58
+
59
+ ```
60
+ # Your Helius/QuickNode/Alchemy RPC URL
61
+ VITE_SOLANA_RPC_URL=https://mainnet.helius-rpc.com/?api-key=your_api_key_here
62
+ ```
63
+
64
+ Restart the dev server after changing `.env` so Vite picks up updates.
65
+
66
+ ### 3. Wallet Provider Setup (Optional)
54
67
 
55
68
  **Option A: Auto-Setup (Recommended)** 🎉
56
69
 
@@ -1 +1 @@
1
- {"version":3,"file":"X402Paywall.d.ts","sourceRoot":"","sources":["../../src/components/X402Paywall.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAyB/B,OAAO,EAAE,gBAAgB,EAAiB,MAAM,SAAS,CAAC;AA27C1D,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAsClD,CAAC"}
1
+ {"version":3,"file":"X402Paywall.d.ts","sourceRoot":"","sources":["../../src/components/X402Paywall.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AA4B/B,OAAO,EAAE,gBAAgB,EAAiB,MAAM,SAAS,CAAC;AA0oD1D,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CA2ClD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"App.d.ts","sourceRoot":"","sources":["../../src/demo/App.tsx"],"names":[],"mappings":"AAYA,OAAO,4CAA4C,CAAC;AAmHpD,iBAAS,GAAG,4CAEX;AAED,eAAe,GAAG,CAAC"}
1
+ {"version":3,"file":"App.d.ts","sourceRoot":"","sources":["../../src/demo/App.tsx"],"names":[],"mappings":"AAYA,OAAO,4CAA4C,CAAC;AA0HpD,iBAAS,GAAG,4CAEX;AAED,eAAe,GAAG,CAAC"}
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";var Ke=Object.defineProperty;var Oe=(r,a,n)=>a in r?Ke(r,a,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[a]=n;var ke=(r,a,n)=>Oe(r,typeof a!="symbol"?a+"":a,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),A=require("react"),ce=require("@solana/wallet-adapter-react"),Te=require("@solana/wallet-adapter-react-ui"),ve=require("@solana/wallet-adapter-base"),ye=require("@solana/wallet-adapter-wallets"),T=require("@solana/web3.js"),U=require("@solana/spl-token");function _e(r){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const n in r)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(r,n);Object.defineProperty(a,n,o.get?o:{enumerable:!0,get:()=>r[n]})}}return a.default=r,Object.freeze(a)}const C=_e(A);function We(r){return r==="solana"?"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v":"4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU"}function Ve(r){return r==="solana"?`https://mainnet.helius-rpc.com/?api-key=${process.env.VITE_HELIUS_API_KEY}`:"https://api.devnet.solana.com"}async function He(r,a,n){try{const o=n||Ve(a),i=new T.Connection(o,"confirmed"),l=new T.PublicKey(r),c=new T.PublicKey(We(a)),u=await U.getAssociatedTokenAddress(c,l),e=await U.getAccount(i,u);return(Number(e.amount)/1e6).toFixed(2)}catch(o){return console.error("Error fetching USDC balance:",o),"0.00"}}function Ee(r){var a,n,o="";if(typeof r=="string"||typeof r=="number")o+=r;else if(typeof r=="object")if(Array.isArray(r)){var i=r.length;for(a=0;a<i;a++)r[a]&&(n=Ee(r[a]))&&(o&&(o+=" "),o+=n)}else for(n in r)r[n]&&(o&&(o+=" "),o+=n);return o}function Pe(){for(var r,a,n=0,o="",i=arguments.length;n<i;n++)(r=arguments[n])&&(a=Ee(r))&&(o&&(o+=" "),o+=a);return o}const be="-",Xe=r=>{const a=qe(r),{conflictingClassGroups:n,conflictingClassGroupModifiers:o}=r;return{getClassGroupId:c=>{const u=c.split(be);return u[0]===""&&u.length!==1&&u.shift(),De(u,a)||Se(c)},getConflictingClassGroupIds:(c,u)=>{const e=n[c]||[];return u&&o[c]?[...e,...o[c]]:e}}},De=(r,a)=>{var c;if(r.length===0)return a.classGroupId;const n=r[0],o=a.nextPart.get(n),i=o?De(r.slice(1),o):void 0;if(i)return i;if(a.validators.length===0)return;const l=r.join(be);return(c=a.validators.find(({validator:u})=>u(l)))==null?void 0:c.classGroupId},je=/^\[(.+)\]$/,Se=r=>{if(je.test(r)){const a=je.exec(r)[1],n=a==null?void 0:a.substring(0,a.indexOf(":"));if(n)return"arbitrary.."+n}},qe=r=>{const{theme:a,prefix:n}=r,o={nextPart:new Map,validators:[]};return Ye(Object.entries(r.classGroups),n).forEach(([l,c])=>{ue(c,o,l,a)}),o},ue=(r,a,n,o)=>{r.forEach(i=>{if(typeof i=="string"){const l=i===""?a:Ne(a,i);l.classGroupId=n;return}if(typeof i=="function"){if(Je(i)){ue(i(o),a,n,o);return}a.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([l,c])=>{ue(c,Ne(a,l),n,o)})})},Ne=(r,a)=>{let n=r;return a.split(be).forEach(o=>{n.nextPart.has(o)||n.nextPart.set(o,{nextPart:new Map,validators:[]}),n=n.nextPart.get(o)}),n},Je=r=>r.isThemeGetter,Ye=(r,a)=>a?r.map(([n,o])=>{const i=o.map(l=>typeof l=="string"?a+l:typeof l=="object"?Object.fromEntries(Object.entries(l).map(([c,u])=>[a+c,u])):l);return[n,i]}):r,Ze=r=>{if(r<1)return{get:()=>{},set:()=>{}};let a=0,n=new Map,o=new Map;const i=(l,c)=>{n.set(l,c),a++,a>r&&(a=0,o=n,n=new Map)};return{get(l){let c=n.get(l);if(c!==void 0)return c;if((c=o.get(l))!==void 0)return i(l,c),c},set(l,c){n.has(l)?n.set(l,c):i(l,c)}}},ze="!",Qe=r=>{const{separator:a,experimentalParseClassName:n}=r,o=a.length===1,i=a[0],l=a.length,c=u=>{const e=[];let g=0,p=0,b;for(let h=0;h<u.length;h++){let y=u[h];if(g===0){if(y===i&&(o||u.slice(h,h+l)===a)){e.push(u.slice(p,h)),p=h+l;continue}if(y==="/"){b=h;continue}}y==="["?g++:y==="]"&&g--}const s=e.length===0?u:u.substring(p),v=s.startsWith(ze),N=v?s.substring(1):s,w=b&&b>p?b-p:void 0;return{modifiers:e,hasImportantModifier:v,baseClassName:N,maybePostfixModifierPosition:w}};return n?u=>n({className:u,parseClassName:c}):c},er=r=>{if(r.length<=1)return r;const a=[];let n=[];return r.forEach(o=>{o[0]==="["?(a.push(...n.sort(),o),n=[]):n.push(o)}),a.push(...n.sort()),a},rr=r=>({cache:Ze(r.cacheSize),parseClassName:Qe(r),...Xe(r)}),tr=/\s+/,nr=(r,a)=>{const{parseClassName:n,getClassGroupId:o,getConflictingClassGroupIds:i}=a,l=[],c=r.trim().split(tr);let u="";for(let e=c.length-1;e>=0;e-=1){const g=c[e],{modifiers:p,hasImportantModifier:b,baseClassName:s,maybePostfixModifierPosition:v}=n(g);let N=!!v,w=o(N?s.substring(0,v):s);if(!w){if(!N){u=g+(u.length>0?" "+u:u);continue}if(w=o(s),!w){u=g+(u.length>0?" "+u:u);continue}N=!1}const h=er(p).join(":"),y=b?h+ze:h,M=y+w;if(l.includes(M))continue;l.push(M);const m=i(w,N);for(let x=0;x<m.length;++x){const z=m[x];l.push(y+z)}u=g+(u.length>0?" "+u:u)}return u};function ar(){let r=0,a,n,o="";for(;r<arguments.length;)(a=arguments[r++])&&(n=Ie(a))&&(o&&(o+=" "),o+=n);return o}const Ie=r=>{if(typeof r=="string")return r;let a,n="";for(let o=0;o<r.length;o++)r[o]&&(a=Ie(r[o]))&&(n&&(n+=" "),n+=a);return n};function or(r,...a){let n,o,i,l=c;function c(e){const g=a.reduce((p,b)=>b(p),r());return n=rr(g),o=n.cache.get,i=n.cache.set,l=u,u(e)}function u(e){const g=o(e);if(g)return g;const p=nr(e,n);return i(e,p),p}return function(){return l(ar.apply(null,arguments))}}const j=r=>{const a=n=>n[r]||[];return a.isThemeGetter=!0,a},Re=/^\[(?:([a-z-]+):)?(.+)\]$/i,sr=/^\d+\/\d+$/,ir=new Set(["px","full","screen"]),lr=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,dr=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,cr=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,ur=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,br=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,$=r=>S(r)||ir.has(r)||sr.test(r),_=r=>q(r,"length",kr),S=r=>!!r&&!Number.isNaN(Number(r)),de=r=>q(r,"number",S),Y=r=>!!r&&Number.isInteger(Number(r)),xr=r=>r.endsWith("%")&&S(r.slice(0,-1)),f=r=>Re.test(r),W=r=>lr.test(r),gr=new Set(["length","size","percentage"]),pr=r=>q(r,gr,Le),fr=r=>q(r,"position",Le),hr=new Set(["image","url"]),wr=r=>q(r,hr,yr),mr=r=>q(r,"",vr),Z=()=>!0,q=(r,a,n)=>{const o=Re.exec(r);return o?o[1]?typeof a=="string"?o[1]===a:a.has(o[1]):n(o[2]):!1},kr=r=>dr.test(r)&&!cr.test(r),Le=()=>!1,vr=r=>ur.test(r),yr=r=>br.test(r),jr=()=>{const r=j("colors"),a=j("spacing"),n=j("blur"),o=j("brightness"),i=j("borderColor"),l=j("borderRadius"),c=j("borderSpacing"),u=j("borderWidth"),e=j("contrast"),g=j("grayscale"),p=j("hueRotate"),b=j("invert"),s=j("gap"),v=j("gradientColorStops"),N=j("gradientColorStopPositions"),w=j("inset"),h=j("margin"),y=j("opacity"),M=j("padding"),m=j("saturate"),x=j("scale"),z=j("sepia"),R=j("skew"),P=j("space"),E=j("translate"),L=()=>["auto","contain","none"],G=()=>["auto","hidden","clip","visible","scroll"],I=()=>["auto",f,a],k=()=>[f,a],D=()=>["",$,_],K=()=>["auto",S,f],ne=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],V=()=>["solid","dashed","dotted","double","none"],ae=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],H=()=>["start","end","center","between","around","evenly","stretch"],O=()=>["","0",f],le=()=>["auto","avoid","all","avoid-page","page","left","right","column"],F=()=>[S,f];return{cacheSize:500,separator:":",theme:{colors:[Z],spacing:[$,_],blur:["none","",W,f],brightness:F(),borderColor:[r],borderRadius:["none","","full",W,f],borderSpacing:k(),borderWidth:D(),contrast:F(),grayscale:O(),hueRotate:F(),invert:O(),gap:k(),gradientColorStops:[r],gradientColorStopPositions:[xr,_],inset:I(),margin:I(),opacity:F(),padding:k(),saturate:F(),scale:F(),sepia:O(),skew:F(),space:k(),translate:k()},classGroups:{aspect:[{aspect:["auto","square","video",f]}],container:["container"],columns:[{columns:[W]}],"break-after":[{"break-after":le()}],"break-before":[{"break-before":le()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...ne(),f]}],overflow:[{overflow:G()}],"overflow-x":[{"overflow-x":G()}],"overflow-y":[{"overflow-y":G()}],overscroll:[{overscroll:L()}],"overscroll-x":[{"overscroll-x":L()}],"overscroll-y":[{"overscroll-y":L()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[w]}],"inset-x":[{"inset-x":[w]}],"inset-y":[{"inset-y":[w]}],start:[{start:[w]}],end:[{end:[w]}],top:[{top:[w]}],right:[{right:[w]}],bottom:[{bottom:[w]}],left:[{left:[w]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Y,f]}],basis:[{basis:I()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",f]}],grow:[{grow:O()}],shrink:[{shrink:O()}],order:[{order:["first","last","none",Y,f]}],"grid-cols":[{"grid-cols":[Z]}],"col-start-end":[{col:["auto",{span:["full",Y,f]},f]}],"col-start":[{"col-start":K()}],"col-end":[{"col-end":K()}],"grid-rows":[{"grid-rows":[Z]}],"row-start-end":[{row:["auto",{span:[Y,f]},f]}],"row-start":[{"row-start":K()}],"row-end":[{"row-end":K()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",f]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",f]}],gap:[{gap:[s]}],"gap-x":[{"gap-x":[s]}],"gap-y":[{"gap-y":[s]}],"justify-content":[{justify:["normal",...H()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...H(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...H(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[M]}],px:[{px:[M]}],py:[{py:[M]}],ps:[{ps:[M]}],pe:[{pe:[M]}],pt:[{pt:[M]}],pr:[{pr:[M]}],pb:[{pb:[M]}],pl:[{pl:[M]}],m:[{m:[h]}],mx:[{mx:[h]}],my:[{my:[h]}],ms:[{ms:[h]}],me:[{me:[h]}],mt:[{mt:[h]}],mr:[{mr:[h]}],mb:[{mb:[h]}],ml:[{ml:[h]}],"space-x":[{"space-x":[P]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[P]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",f,a]}],"min-w":[{"min-w":[f,a,"min","max","fit"]}],"max-w":[{"max-w":[f,a,"none","full","min","max","fit","prose",{screen:[W]},W]}],h:[{h:[f,a,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[f,a,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[f,a,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[f,a,"auto","min","max","fit"]}],"font-size":[{text:["base",W,_]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",de]}],"font-family":[{font:[Z]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",f]}],"line-clamp":[{"line-clamp":["none",S,de]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",$,f]}],"list-image":[{"list-image":["none",f]}],"list-style-type":[{list:["none","disc","decimal",f]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[r]}],"placeholder-opacity":[{"placeholder-opacity":[y]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[r]}],"text-opacity":[{"text-opacity":[y]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...V(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",$,_]}],"underline-offset":[{"underline-offset":["auto",$,f]}],"text-decoration-color":[{decoration:[r]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:k()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",f]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",f]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[y]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...ne(),fr]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",pr]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},wr]}],"bg-color":[{bg:[r]}],"gradient-from-pos":[{from:[N]}],"gradient-via-pos":[{via:[N]}],"gradient-to-pos":[{to:[N]}],"gradient-from":[{from:[v]}],"gradient-via":[{via:[v]}],"gradient-to":[{to:[v]}],rounded:[{rounded:[l]}],"rounded-s":[{"rounded-s":[l]}],"rounded-e":[{"rounded-e":[l]}],"rounded-t":[{"rounded-t":[l]}],"rounded-r":[{"rounded-r":[l]}],"rounded-b":[{"rounded-b":[l]}],"rounded-l":[{"rounded-l":[l]}],"rounded-ss":[{"rounded-ss":[l]}],"rounded-se":[{"rounded-se":[l]}],"rounded-ee":[{"rounded-ee":[l]}],"rounded-es":[{"rounded-es":[l]}],"rounded-tl":[{"rounded-tl":[l]}],"rounded-tr":[{"rounded-tr":[l]}],"rounded-br":[{"rounded-br":[l]}],"rounded-bl":[{"rounded-bl":[l]}],"border-w":[{border:[u]}],"border-w-x":[{"border-x":[u]}],"border-w-y":[{"border-y":[u]}],"border-w-s":[{"border-s":[u]}],"border-w-e":[{"border-e":[u]}],"border-w-t":[{"border-t":[u]}],"border-w-r":[{"border-r":[u]}],"border-w-b":[{"border-b":[u]}],"border-w-l":[{"border-l":[u]}],"border-opacity":[{"border-opacity":[y]}],"border-style":[{border:[...V(),"hidden"]}],"divide-x":[{"divide-x":[u]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[u]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[y]}],"divide-style":[{divide:V()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...V()]}],"outline-offset":[{"outline-offset":[$,f]}],"outline-w":[{outline:[$,_]}],"outline-color":[{outline:[r]}],"ring-w":[{ring:D()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[r]}],"ring-opacity":[{"ring-opacity":[y]}],"ring-offset-w":[{"ring-offset":[$,_]}],"ring-offset-color":[{"ring-offset":[r]}],shadow:[{shadow:["","inner","none",W,mr]}],"shadow-color":[{shadow:[Z]}],opacity:[{opacity:[y]}],"mix-blend":[{"mix-blend":[...ae(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":ae()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[o]}],contrast:[{contrast:[e]}],"drop-shadow":[{"drop-shadow":["","none",W,f]}],grayscale:[{grayscale:[g]}],"hue-rotate":[{"hue-rotate":[p]}],invert:[{invert:[b]}],saturate:[{saturate:[m]}],sepia:[{sepia:[z]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[o]}],"backdrop-contrast":[{"backdrop-contrast":[e]}],"backdrop-grayscale":[{"backdrop-grayscale":[g]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[p]}],"backdrop-invert":[{"backdrop-invert":[b]}],"backdrop-opacity":[{"backdrop-opacity":[y]}],"backdrop-saturate":[{"backdrop-saturate":[m]}],"backdrop-sepia":[{"backdrop-sepia":[z]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[c]}],"border-spacing-x":[{"border-spacing-x":[c]}],"border-spacing-y":[{"border-spacing-y":[c]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",f]}],duration:[{duration:F()}],ease:[{ease:["linear","in","out","in-out",f]}],delay:[{delay:F()}],animate:[{animate:["none","spin","ping","pulse","bounce",f]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[x]}],"scale-x":[{"scale-x":[x]}],"scale-y":[{"scale-y":[x]}],rotate:[{rotate:[Y,f]}],"translate-x":[{"translate-x":[E]}],"translate-y":[{"translate-y":[E]}],"skew-x":[{"skew-x":[R]}],"skew-y":[{"skew-y":[R]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",f]}],accent:[{accent:["auto",r]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",f]}],"caret-color":[{caret:[r]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":k()}],"scroll-mx":[{"scroll-mx":k()}],"scroll-my":[{"scroll-my":k()}],"scroll-ms":[{"scroll-ms":k()}],"scroll-me":[{"scroll-me":k()}],"scroll-mt":[{"scroll-mt":k()}],"scroll-mr":[{"scroll-mr":k()}],"scroll-mb":[{"scroll-mb":k()}],"scroll-ml":[{"scroll-ml":k()}],"scroll-p":[{"scroll-p":k()}],"scroll-px":[{"scroll-px":k()}],"scroll-py":[{"scroll-py":k()}],"scroll-ps":[{"scroll-ps":k()}],"scroll-pe":[{"scroll-pe":k()}],"scroll-pt":[{"scroll-pt":k()}],"scroll-pr":[{"scroll-pr":k()}],"scroll-pb":[{"scroll-pb":k()}],"scroll-pl":[{"scroll-pl":k()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",f]}],fill:[{fill:[r,"none"]}],"stroke-w":[{stroke:[$,_,de]}],stroke:[{stroke:[r,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},Nr=or(jr);function d(...r){return Nr(Pe(r))}const ee=C.forwardRef(({className:r,...a},n)=>t.jsx("div",{ref:n,className:d("rounded-xl border bg-card text-card-foreground shadow",r),...a}));ee.displayName="Card";const oe=C.forwardRef(({className:r,...a},n)=>t.jsx("div",{ref:n,className:d("flex flex-col space-y-1.5 p-6",r),...a}));oe.displayName="CardHeader";const se=C.forwardRef(({className:r,...a},n)=>t.jsx("div",{ref:n,className:d("font-semibold leading-none tracking-tight",r),...a}));se.displayName="CardTitle";const ie=C.forwardRef(({className:r,...a},n)=>t.jsx("div",{ref:n,className:d("text-sm text-muted-foreground",r),...a}));ie.displayName="CardDescription";const re=C.forwardRef(({className:r,...a},n)=>t.jsx("div",{ref:n,className:d("p-6 pt-0",r),...a}));re.displayName="CardContent";const Cr=C.forwardRef(({className:r,...a},n)=>t.jsx("div",{ref:n,className:d("flex items-center p-6 pt-0",r),...a}));Cr.displayName="CardFooter";function Ce(r,a){if(typeof r=="function")return r(a);r!=null&&(r.current=a)}function Fr(...r){return a=>{let n=!1;const o=r.map(i=>{const l=Ce(i,a);return!n&&typeof l=="function"&&(n=!0),l});if(n)return()=>{for(let i=0;i<o.length;i++){const l=o[i];typeof l=="function"?l():Ce(r[i],null)}}}}function Ar(r){const a=Tr(r),n=C.forwardRef((o,i)=>{const{children:l,...c}=o,u=C.Children.toArray(l),e=u.find(Pr);if(e){const g=e.props.children,p=u.map(b=>b===e?C.Children.count(g)>1?C.Children.only(null):C.isValidElement(g)?g.props.children:null:b);return t.jsx(a,{...c,ref:i,children:C.isValidElement(g)?C.cloneElement(g,void 0,p):null})}return t.jsx(a,{...c,ref:i,children:l})});return n.displayName=`${r}.Slot`,n}var Mr=Ar("Slot");function Tr(r){const a=C.forwardRef((n,o)=>{const{children:i,...l}=n;if(C.isValidElement(i)){const c=zr(i),u=Dr(l,i.props);return i.type!==C.Fragment&&(u.ref=o?Fr(o,c):c),C.cloneElement(i,u)}return C.Children.count(i)>1?C.Children.only(null):null});return a.displayName=`${r}.SlotClone`,a}var Er=Symbol("radix.slottable");function Pr(r){return C.isValidElement(r)&&typeof r.type=="function"&&"__radixId"in r.type&&r.type.__radixId===Er}function Dr(r,a){const n={...a};for(const o in a){const i=r[o],l=a[o];/^on[A-Z]/.test(o)?i&&l?n[o]=(...u)=>{const e=l(...u);return i(...u),e}:i&&(n[o]=i):o==="style"?n[o]={...i,...l}:o==="className"&&(n[o]=[i,l].filter(Boolean).join(" "))}return{...r,...n}}function zr(r){var o,i;let a=(o=Object.getOwnPropertyDescriptor(r.props,"ref"))==null?void 0:o.get,n=a&&"isReactWarning"in a&&a.isReactWarning;return n?r.ref:(a=(i=Object.getOwnPropertyDescriptor(r,"ref"))==null?void 0:i.get,n=a&&"isReactWarning"in a&&a.isReactWarning,n?r.props.ref:r.props.ref||r.ref)}const Fe=r=>typeof r=="boolean"?`${r}`:r===0?"0":r,Ae=Pe,Be=(r,a)=>n=>{var o;if((a==null?void 0:a.variants)==null)return Ae(r,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:i,defaultVariants:l}=a,c=Object.keys(i).map(g=>{const p=n==null?void 0:n[g],b=l==null?void 0:l[g];if(p===null)return null;const s=Fe(p)||Fe(b);return i[g][s]}),u=n&&Object.entries(n).reduce((g,p)=>{let[b,s]=p;return s===void 0||(g[b]=s),g},{}),e=a==null||(o=a.compoundVariants)===null||o===void 0?void 0:o.reduce((g,p)=>{let{class:b,className:s,...v}=p;return Object.entries(v).every(N=>{let[w,h]=N;return Array.isArray(h)?h.includes({...l,...u}[w]):{...l,...u}[w]===h})?[...g,b,s]:g},[]);return Ae(r,c,e,n==null?void 0:n.class,n==null?void 0:n.className)},Ir=Be("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),xe=C.forwardRef(({className:r,variant:a,size:n,asChild:o=!1,...i},l)=>{const c=o?Mr:"button";return t.jsx(c,{className:d(Ir({variant:a,size:n,className:r})),ref:l,...i})});xe.displayName="Button";const te=C.forwardRef(({className:r,size:a="md",variant:n="default",...o},i)=>{const l={sm:"h-4 w-4",md:"h-6 w-6",lg:"h-8 w-8"},c={default:"border-gray-200 border-t-gray-900",solana:"border-gray-200 border-t-solana-primary"};return t.jsx("div",{ref:i,className:d("inline-block animate-spin rounded-full border-2",l[a],c[n],r),role:"status","aria-label":"Loading",...o,children:t.jsx("span",{className:"sr-only",children:"Loading..."})})});te.displayName="Spinner";const Q=C.forwardRef(({amount:r,description:a,onClick:n,disabled:o=!1,loading:i=!1,className:l,style:c,customText:u,...e},g)=>{const p=b=>new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2}).format(b);return t.jsx(xe,{ref:g,onClick:n,disabled:o||i,className:d("w-full hover:opacity-90 text-white font-normal shadow-lg hover:shadow-xl transition-all duration-200 transform hover:scale-[1.02] rounded-xl",!c&&"bg-solana-gradient",o||i?"opacity-50 cursor-not-allowed":"",l),style:c,...e,children:i?t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(te,{size:"sm",variant:"default",className:"border-white/30 border-t-white"}),t.jsx("span",{children:"Processing Payment..."})]}):t.jsx("span",{children:u||`Pay ${p(r)} USDC`})})});Q.displayName="PaymentButton";const Rr=Be("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function ge({className:r,variant:a,...n}){return t.jsx("div",{className:d(Rr({variant:a}),r),...n})}const pe=({wallet:r,balance:a,network:n,showBalance:o=!0,onDisconnect:i,theme:l,className:c,style:u})=>{var b;const e=((b=r==null?void 0:r.publicKey)==null?void 0:b.toString())||(r==null?void 0:r.address),g=s=>`${s.slice(0,4)}...${s.slice(-4)}`,p=()=>n==="solana"?"Mainnet":"Devnet";return!r||!e?t.jsx(ee,{className:d("border-dashed",c),style:u,children:t.jsx(re,{className:"p-4 text-center text-muted-foreground",children:t.jsx("p",{className:"text-sm",children:"No wallet connected"})})}):t.jsx("div",{className:d("rounded-lg p-4 border",l==="seeker"||l==="seeker-2"?"border-[#FFFFFF1F]":"bg-slate-50 border-slate-200",c),style:u,children:t.jsxs("div",{className:"space-y-3",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("div",{className:"w-10 h-10 bg-gradient-to-r from-blue-500 to-purple-500 rounded-full flex items-center justify-center",children:t.jsx("span",{className:"text-white font-semibold text-sm",children:e.slice(0,2).toUpperCase()})}),t.jsxs("div",{children:[t.jsx("div",{className:d("text-xs font-medium drop-shadow-sm shadow-sm",l==="light"||l==="solana-light"?"text-[#71717A]":"text-[#FFFFFF66]"),children:"Connected Wallet"}),t.jsx("div",{className:d("text-sm font-mono",l==="light"||l==="solana-light"?"text-black":"text-white"),children:g(e)})]})]}),t.jsx("button",{onClick:i,className:d("text-sm font-medium transition-colors",l==="light"||l==="solana-light"?"text-red-500 hover:text-red-700":"text-[#FFFFFF66] hover:opacity-80"),children:"Disconnect"})]}),o&&a&&t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("span",{className:"text-sm font-medium text-slate-600",children:"USDC Balance"}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{className:"text-lg font-bold text-slate-900",children:a}),t.jsx("span",{className:"text-xs font-semibold text-slate-500 bg-slate-200 px-2 py-1 rounded-md",children:"USDC"})]})]}),n&&t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("span",{className:"text-sm font-medium text-slate-600",children:"Network"}),t.jsx(ge,{variant:"outline",className:"text-xs border-slate-300 text-slate-700",children:p()})]})]})})};pe.displayName="WalletSection";function Lr(r,a,n){const o=Buffer.from(r.serialize()).toString("base64"),i={x402Version:n,scheme:a.scheme,network:a.network,payload:{transaction:o}};return Buffer.from(JSON.stringify(i)).toString("base64")}function Br(r){if(r==="solana")return"https://api.mainnet-beta.solana.com";if(r==="solana-devnet")return"https://api.devnet.solana.com";throw new Error(`Unexpected network: ${r}`)}async function $r(r,a,n,o){var E,L,G;const i=new T.Connection(o,"confirmed"),l=(E=n==null?void 0:n.extra)==null?void 0:E.feePayer;if(typeof l!="string"||!l)throw new Error("Missing facilitator feePayer in payment requirements (extra.feePayer).");const c=new T.PublicKey(l),u=((L=r==null?void 0:r.publicKey)==null?void 0:L.toString())||(r==null?void 0:r.address);if(!u)throw new Error("Missing connected Solana wallet address or publicKey");const e=new T.PublicKey(u);if(!(n!=null&&n.payTo))throw new Error("Missing payTo in payment requirements");const g=new T.PublicKey(n.payTo),p=[];if(p.push(T.ComputeBudgetProgram.setComputeUnitLimit({units:4e4})),p.push(T.ComputeBudgetProgram.setComputeUnitPrice({microLamports:1})),!n.asset)throw new Error("Missing token mint for SPL transfer");const b=new T.PublicKey(n.asset),s=await i.getAccountInfo(b,"confirmed"),v=((G=s==null?void 0:s.owner)==null?void 0:G.toBase58())===U.TOKEN_2022_PROGRAM_ID.toBase58()?U.TOKEN_2022_PROGRAM_ID:U.TOKEN_PROGRAM_ID,N=await U.getMint(i,b,void 0,v),w=await U.getAssociatedTokenAddress(b,e,!1,v),h=await U.getAssociatedTokenAddress(b,g,!1,v);if(!await i.getAccountInfo(w,"confirmed"))throw new Error(`User does not have an Associated Token Account for ${n.asset}. Please create one first or ensure you have the required token.`);if(!await i.getAccountInfo(h,"confirmed")){const I=new T.PublicKey("ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"),k=new T.TransactionInstruction({keys:[{pubkey:c,isSigner:!0,isWritable:!0},{pubkey:h,isSigner:!1,isWritable:!0},{pubkey:g,isSigner:!1,isWritable:!1},{pubkey:b,isSigner:!1,isWritable:!1},{pubkey:T.SystemProgram.programId,isSigner:!1,isWritable:!1},{pubkey:v,isSigner:!1,isWritable:!1}],programId:I,data:Buffer.from([0])});p.push(k)}const m=BigInt(n.maxAmountRequired);p.push(U.createTransferCheckedInstruction(w,b,h,e,m,N.decimals,[],v));const{blockhash:x}=await i.getLatestBlockhash("confirmed"),z=new T.TransactionMessage({payerKey:c,recentBlockhash:x,instructions:p}).compileToV0Message(),R=new T.VersionedTransaction(z);if(typeof(r==null?void 0:r.signTransaction)!="function")throw new Error("Connected wallet does not support signTransaction");const P=await r.signTransaction(R);return Lr(P,n,a)}function Ur(r,a,n,o=BigInt(0)){return async(i,l)=>{const c=await r(i,l);if(c.status!==402)return c;const u=await c.json(),e=u.x402Version,g=u.accepts||[],p=g.find(v=>v.scheme==="exact"&&(v.network==="solana-devnet"||v.network==="solana"));if(!p)throw console.error("❌ No suitable Solana payment requirements found. Available networks:",g.map(v=>v.network)),new Error("No suitable Solana payment requirements found");if(o>BigInt(0)&&BigInt(p.maxAmountRequired)>o)throw new Error("Payment amount exceeds maximum allowed");const b=await $r(a,e,p,n),s={...l,headers:{...(l==null?void 0:l.headers)||{},"X-PAYMENT":b,"Access-Control-Expose-Headers":"X-PAYMENT-RESPONSE"}};return await r(i,s)}}var Gr=class{constructor(r){ke(this,"paymentFetch");const a=r.rpcUrl||Br(r.network);this.paymentFetch=Ur(fetch.bind(window),r.wallet,a,r.maxPaymentAmount||BigInt(0))}async fetch(r,a){return this.paymentFetch(r,a)}};function Kr(r){return new Gr(r)}function $e(r){const[a,n]=A.useState("idle"),[o,i]=A.useState(null),[l,c]=A.useState(null),[u,e]=A.useState(!1),g=A.useCallback(()=>{n("idle"),i(null),c(null),e(!1)},[]);return{pay:A.useCallback(async(b,s)=>{var v;try{if(e(!0),n("pending"),i(null),r.maxPaymentAmount&&b>r.maxPaymentAmount)throw new Error(`Payment amount ${b} exceeds maximum allowed ${r.maxPaymentAmount}`);const N=((v=r.wallet.publicKey)==null?void 0:v.toString())||r.wallet.address;if(!N)throw new Error("Wallet not connected");const w=Kr({wallet:r.wallet,network:r.network,rpcUrl:r.rpcUrl,maxPaymentAmount:r.maxPaymentAmount?BigInt(Math.floor(r.maxPaymentAmount*1e6)):void 0}),h="https://x402.payai.network/api/solana/paid-content",y=r.apiEndpoint||h;console.log("Initiating x402 payment:",{endpoint:y,isDemo:y===h,amount:b,description:s,wallet:N,network:r.network});const m=await w.fetch(y,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:s,amount:b})});if(!m.ok)throw new Error(`Payment request failed: ${m.statusText}`);let x;const z=m.headers.get("content-type");z&&z.includes("application/json")?x=await m.json():x={content:await m.text()},console.log("Payment successful:",x);const R=m.headers.get("X-PAYMENT-RESPONSE");let P=`tx_${Date.now()}`;if(R)try{const E=JSON.parse(atob(R));P=E.transactionId||E.signature||P,console.log("Payment details:",E)}catch(E){console.warn("Could not decode payment response:",E)}return c(P),n("success"),e(!1),P}catch(N){const w=N instanceof Error?N:new Error("Payment failed");return i(w),n("error"),e(!1),null}},[r]),isLoading:u,status:a,error:o,transactionId:l,reset:g}}const Me=({amount:r,description:a,wallet:n,network:o="solana-devnet",rpcUrl:i,apiEndpoint:l,treasuryAddress:c,facilitatorUrl:u,theme:e="solana-light",showPaymentDetails:g=!0,onDisconnect:p,classNames:b,customStyles:s,maxPaymentAmount:v,onPaymentStart:N,onPaymentSuccess:w,onPaymentError:h,onWalletConnect:y,children:M})=>{var fe,he,we;const m=ce.useWallet(),x=A.useMemo(()=>n||{publicKey:m.publicKey?{toString:()=>m.publicKey.toString()}:void 0,signTransaction:m.signTransaction},[n,m.publicKey,m.signTransaction]),[z,R]=A.useState(!1),[P,E]=A.useState("0.00"),L=A.useRef(null),{pay:G,isLoading:I,status:k,error:D,transactionId:K,reset:ne}=$e({wallet:x,network:o,rpcUrl:i,apiEndpoint:l,treasuryAddress:c,facilitatorUrl:u,maxPaymentAmount:v}),V=()=>{p?p():!n&&m.disconnect&&m.disconnect()},ae=n?n.publicKey||n.address:m.connected&&m.publicKey;A.useEffect(()=>(document.body.className=document.body.className.replace(/wallet-modal-theme-\w+/g,"").replace(/\s+/g," ").trim(),e&&(document.body.className+=` wallet-modal-theme-${e}`),()=>{document.body.className=document.body.className.replace(/wallet-modal-theme-\w+/g,"").replace(/\s+/g," ").trim()}),[e]),A.useEffect(()=>{var B,X;const J=((B=m.publicKey)==null?void 0:B.toString())||((X=n==null?void 0:n.publicKey)==null?void 0:X.toString())||(n==null?void 0:n.address);J&&m.connected&&(console.log("Wallet connected:",J),y==null||y(J),He(J,o,i).then(E)),!m.connected&&!n&&E("0.00")},[m.publicKey,m.connected,m.connecting,n,o,i,y]),A.useEffect(()=>{k==="success"&&K&&(R(!0),w==null||w(K))},[k,K,w]),A.useEffect(()=>{D&&(h==null||h(D))},[D,h]);const H=async()=>{N==null||N(),await G(r,a)};if(z)return t.jsx(t.Fragment,{children:M});const O=D&&(e==="dark"||e==="solana-dark"||e==="light"||e==="solana-light"||e==="seeker"||e==="seeker-2"),F=(()=>{switch(e){case"solana-dark":return{container:"",card:"!bg-[#171719] border-0 text-white rounded-xl",icon:"bg-slate-600",title:"",button:"bg-solana-gradient hover:opacity-90 text-white rounded-full",paymentDetails:"bg-[#0000001F] border-slate-600 text-white rounded-lg",walletSection:"bg-[#0000001F] border-slate-600 text-white rounded-lg",notice:"bg-amber-900/50 border-amber-700 text-white rounded-lg",securityMessage:"text-slate-400",helperText:"text-white",helperLink:void 0};case"seeker":return{container:"",card:"backdrop-blur-sm border-emerald-200 rounded-xl",icon:"bg-gradient-to-r from-emerald-500 to-teal-500",title:"text-white",button:"bg-gradient-to-r from-emerald-500 to-teal-500 hover:from-emerald-600 hover:to-teal-600 text-white rounded-full",paymentDetails:"rounded-lg",notice:"bg-cyan-50 border-cyan-200 text-cyan-800 rounded-lg",securityMessage:"text-white",helperText:"text-white"};case"seeker-2":return{container:"",card:"backdrop-blur-sm border-emerald-200 rounded-xl",icon:"bg-gradient-to-r from-emerald-500 to-teal-500",title:"text-white",button:"bg-gradient-to-r from-emerald-500 to-teal-500 hover:from-emerald-600 hover:to-teal-600 text-white rounded-full",paymentDetails:"rounded-lg",notice:"bg-cyan-50 border-cyan-200 text-cyan-800 rounded-lg",securityMessage:"text-white",helperText:"text-white"};case"terminal":return{container:"bg-gradient-to-br from-gray-900 via-black to-gray-800",card:"bg-black/90 backdrop-blur-sm border-green-400/30 text-green-400 rounded-xl",icon:"bg-green-400 text-black",title:"text-green-400 font-mono",button:"bg-green-400 text-black hover:bg-green-300 font-mono rounded-full",paymentDetails:"bg-gray-900/50 border-green-400/20 text-green-300 rounded-lg",notice:"bg-yellow-900/50 border-yellow-400/30 text-yellow-300 rounded-lg"};case"solana-light":return{container:"bg-gradient-to-b from-white via-pink-50 via-purple-50 via-blue-50 to-cyan-50",card:"bg-white/95 backdrop-blur-sm border border-slate-200 shadow-2xl rounded-2xl",icon:"bg-gradient-to-r from-blue-600 to-purple-600",title:"text-slate-900",button:"bg-solana-gradient hover:opacity-90 text-white font-light rounded-full",paymentDetails:"bg-slate-50 border border-slate-200 rounded-xl",notice:"text-slate-600",walletSection:"bg-slate-50 border border-slate-200 rounded-xl",securityMessage:"text-slate-600",helperText:"text-slate-600",helperLink:"text-purple-600 underline"};case"dark":return{container:"",card:"!bg-[#171719] border-slate-700 text-white rounded-xl",icon:"bg-slate-600",title:"",button:"bg-slate-600 hover:bg-slate-700 rounded-full",paymentDetails:"bg-[#0000001F] border-slate-600 text-white rounded-lg",walletSection:"bg-[#0000001F] border-slate-600 text-white rounded-lg",notice:"bg-amber-900/50 border-amber-700 text-white rounded-lg",securityMessage:"text-slate-400",helperText:"text-white",helperLink:void 0};case"light":return{container:"bg-gradient-to-b from-white via-pink-50 via-purple-50 via-blue-50 to-cyan-50",card:"bg-white/95 backdrop-blur-sm border border-slate-200 shadow-2xl rounded-2xl",icon:"bg-gradient-to-r from-blue-600 to-purple-600",title:"text-slate-900",button:"bg-black hover:bg-gray-800 text-white font-light rounded-full",paymentDetails:"bg-slate-50 border border-slate-200 rounded-xl",notice:"text-slate-600",walletSection:"bg-slate-50 border border-slate-200 rounded-xl",securityMessage:"text-slate-600",helperText:"text-slate-600",helperLink:"text-purple-600 underline"};default:return{container:"bg-gradient-to-br from-slate-900 via-slate-800 to-slate-900",card:"bg-white/95 backdrop-blur-sm rounded-xl",icon:"bg-slate-600",title:"text-slate-900",button:"bg-slate-600 hover:bg-slate-700 text-white rounded-full",paymentDetails:"bg-slate-50 border-slate-200 rounded-lg",notice:"bg-amber-50 border-amber-200 text-amber-800 rounded-lg"}}})();if(!ae){const B=(()=>{switch(e){case"solana-dark":return{container:"",card:"!bg-[#171719] border-0 text-white rounded-xl",button:"bg-solana-gradient hover:opacity-90 text-white rounded-full",paymentDetails:"bg-[#0000001F] border-slate-600 text-white rounded-lg",securityMessage:"text-slate-400",helperText:"text-white"};case"seeker":return{container:"",card:"backdrop-blur-sm border-emerald-200 rounded-xl",button:"bg-gradient-to-r from-emerald-500 to-teal-500 hover:from-emerald-600 hover:to-teal-600 text-white rounded-full",paymentDetails:"rounded-lg",securityMessage:"text-white",helperText:"text-white"};case"seeker-2":return{container:"",card:"backdrop-blur-sm border-emerald-200 rounded-xl",button:"bg-gradient-to-r from-emerald-500 to-teal-500 hover:from-emerald-600 hover:to-teal-600 text-white rounded-full",paymentDetails:"rounded-lg",securityMessage:"text-white",helperText:"text-white"};case"terminal":return{container:"bg-gradient-to-br from-gray-900 via-black to-gray-800",card:"bg-black/90 backdrop-blur-sm border-green-400/30 text-green-400 rounded-xl",button:"bg-green-400 text-black hover:bg-green-300 font-mono rounded-full",paymentDetails:"bg-gray-900/50 border-green-400/20 text-green-300 rounded-lg",securityMessage:"text-green-300",helperText:"text-green-300"};case"solana-light":return{container:"bg-gradient-to-b from-white via-pink-50 via-purple-50 via-blue-50 to-cyan-50",card:"bg-white/95 backdrop-blur-sm border border-slate-200 shadow-2xl rounded-2xl",button:"bg-solana-gradient hover:opacity-90 text-white font-light rounded-full",paymentDetails:"bg-slate-50 border border-slate-200 rounded-xl",securityMessage:"text-slate-600",helperText:"text-slate-600"};case"dark":return{container:"",card:"!bg-[#171719] border-slate-700 text-white rounded-xl",button:"bg-slate-600 hover:bg-slate-700 rounded-full",paymentDetails:"bg-[#0000001F] border-slate-600 text-white rounded-lg",securityMessage:"text-slate-400",helperText:"text-white"};case"light":return{container:"bg-gradient-to-b from-white via-pink-50 via-purple-50 via-blue-50 to-cyan-50",card:"bg-white/95 backdrop-blur-sm border border-slate-200 shadow-2xl rounded-2xl",button:"bg-black hover:bg-gray-800 text-white font-light rounded-full",paymentDetails:"bg-slate-50 border border-slate-200 rounded-xl",securityMessage:"text-slate-600",helperText:"text-slate-600"};default:return{container:"bg-gradient-to-b from-white via-pink-50 via-purple-50 via-blue-50 to-cyan-50",card:"bg-white/95 backdrop-blur-sm border border-slate-200 shadow-2xl rounded-2xl",button:"bg-solana-gradient hover:opacity-90 text-white font-light rounded-full",paymentDetails:"bg-slate-50 border border-slate-200 rounded-xl",securityMessage:"text-slate-600",helperText:"text-slate-600"}}})();return t.jsx("div",{className:d("flex items-center justify-center min-h-screen p-4",B.container,b==null?void 0:b.container),style:e==="dark"?{background:"linear-gradient(to bottom left, #db2777 0%, #9333ea 50%, #1e40af 100%)",...s==null?void 0:s.container}:e==="light"?{background:"linear-gradient(135deg, rgba(255, 255, 255, 0.6) 0%, rgba(236, 72, 153, 0.4) 33%, rgba(147, 51, 234, 0.4) 66%, rgba(34, 211, 238, 0.4) 100%)",...s==null?void 0:s.container}:e==="seeker"?{background:"radial-gradient(25% 200% at 50% 50%, #6CCEC6 0%, rgba(19, 77, 128, 0) 30%), radial-gradient(20% 20% at 50% 100%, rgba(66, 202, 189, 0.8) 0%, rgba(33, 100, 94, 0.8) 0%), linear-gradient(180deg, #001214 5%, #0D2734 100%)",...s==null?void 0:s.container}:e==="seeker-2"?{background:"radial-gradient(25% 200% at 50% 50%, #6CCEC6 0%, rgba(19, 77, 128, 0) 30%), radial-gradient(20% 20% at 50% 100%, rgba(66, 202, 189, 0.8) 0%, rgba(33, 100, 94, 0.8) 0%), linear-gradient(180deg, #001214 5%, #0D2734 100%)",...s==null?void 0:s.container}:s==null?void 0:s.container,children:t.jsxs(ee,{className:d("w-full max-w-lg shadow-2xl border-0",B.card,b==null?void 0:b.card),style:e==="seeker"?{backgroundColor:"#171719",...s==null?void 0:s.card}:e==="seeker-2"?{backgroundColor:"rgba(29, 35, 35, 1)",backdropFilter:"blur(12px)",...s==null?void 0:s.card}:s==null?void 0:s.card,children:[t.jsxs(oe,{className:"pb-6",children:[t.jsxs("div",{className:"flex items-center space-x-4 mb-6",children:[t.jsx("div",{className:"w-auto h-auto rounded-full p-[2px] flex items-center justify-center overflow-hidden",children:t.jsx("div",{className:"w-full h-full rounded-full flex items-center justify-center",children:t.jsx("img",{src:"/src/components/ui/SolanaLogo.svg",alt:"Solana",className:"w-12 h-auto"})})}),t.jsxs("div",{children:[t.jsx(se,{className:d("text-l fw-bold pb-1",e==="dark"||e==="solana-dark"||e==="seeker"||e==="seeker-2"?"text-white":e==="terminal"?"text-green-400 font-mono":"text-slate-900",b==null?void 0:b.text),children:"Premium Content XYZ"}),t.jsx(ie,{className:d("text-sm font-light",e==="terminal"?"text-green-300":e==="seeker"||e==="seeker-2"||e==="dark"||e==="solana-dark"?"text-white":"text-[#71717A]",b==null?void 0:b.text),children:"content.xyz"})]})]}),t.jsx("div",{className:d("border-b mb-6",e==="dark"||e==="solana-dark"?"border-slate-600":e==="seeker"||e==="seeker-2"?"":"border-slate-200"),style:e==="seeker"||e==="seeker-2"?{borderBottom:"1px solid #FFFFFF1F"}:void 0}),t.jsxs("div",{className:"text-center",children:[t.jsx("h2",{className:d("text-2xl font-normal mb-2",e==="dark"||e==="solana-dark"||e==="seeker"||e==="seeker-2"?"text-white":e==="terminal"?"text-green-400 font-mono":"text-slate-900"),children:"Payment Required"}),t.jsxs("p",{className:d("text-sm font-light",e==="dark"||e==="solana-dark"||e==="seeker"||e==="seeker-2"?"text-white":e==="terminal"?"text-green-300":"text-slate-600"),children:["Access to protected content. To access this content, please pay $",r.toFixed(2)," USDC"]})]})]}),t.jsxs(re,{className:"space-y-6",children:[t.jsxs("div",{className:d("p-6",B.paymentDetails),style:e==="seeker"||e==="seeker-2"?{backgroundColor:"rgba(0, 0, 0, 0.12)"}:e==="dark"||e==="solana-dark"?{boxShadow:"0px 0px 16px 4px #000000 inset"}:void 0,children:[t.jsxs("div",{className:"flex items-center justify-between mb-4",children:[t.jsx("span",{className:d("text-sm",e==="dark"||e==="solana-dark"||e==="seeker"||e==="seeker-2"?"text-white":e==="terminal"?"text-green-300":"text-slate-900"),children:"Amount"}),t.jsxs("div",{className:d("text-xl font-bold",e==="light"||e==="solana-light"?"text-purple-600":e==="seeker"||e==="seeker-2"?"":e==="terminal"?"text-green-400":"text-[#21ECAB]"),style:e==="seeker"||e==="seeker-2"?{color:"#95D2E6"}:void 0,children:["$",r.toFixed(2)]})]}),t.jsx("div",{className:d("border-t mb-4",e==="dark"||e==="solana-dark"?"border-slate-600":e==="seeker"||e==="seeker-2"?"":e==="terminal"?"border-green-400/20":"border-slate-200"),style:e==="seeker"||e==="seeker-2"?{borderTop:"1px solid #FFFFFF1F"}:void 0}),t.jsxs("div",{className:"space-y-3",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("span",{className:d("text-sm",e==="dark"||e==="solana-dark"||e==="seeker"||e==="seeker-2"?"text-white":e==="terminal"?"text-green-300":"text-slate-900"),children:"Currency"}),t.jsx("div",{className:d("text-sm",e==="dark"||e==="solana-dark"||e==="seeker"||e==="seeker-2"?"text-white":e==="terminal"?"text-green-300":"text-slate-900"),children:"USDC"})]}),t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("span",{className:d("text-sm",e==="dark"||e==="solana-dark"||e==="seeker"||e==="seeker-2"?"text-white":e==="terminal"?"text-green-300":"text-slate-900"),children:"Network"}),t.jsxs("div",{className:"flex items-center space-x-2",children:[t.jsx("div",{className:"w-2 h-2 rounded-full bg-green-500"}),t.jsx("span",{className:d("text-sm",e==="dark"||e==="solana-dark"||e==="seeker"||e==="seeker-2"?"text-white":e==="terminal"?"text-green-300":"text-slate-900"),children:o==="solana"?"Mainnet":"Devnet"})]})]})]})]}),t.jsxs("div",{className:"flex items-center justify-center space-x-2",children:[t.jsxs("svg",{className:"w-4 h-4 text-green-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:"2",children:[t.jsx("path",{d:"M12 1L3 5v6c0 5.55 3.84 10.74 9 12 5.16-1.26 9-6.45 9-12V5l-9-4z"}),t.jsx("path",{d:"M9 12l2 2 4-4",strokeLinecap:"round",strokeLinejoin:"round"})]}),t.jsx("span",{className:d("text-sm",B.securityMessage),children:"Secure payment powered by Solana"})]}),t.jsxs("div",{className:"relative",children:[t.jsx("div",{ref:L,className:"absolute opacity-0 pointer-events-none -z-10",children:t.jsx(Te.WalletMultiButton,{})}),t.jsx(Q,{amount:r,description:a,customText:"Connect Wallet",onClick:()=>{var me;const X=(me=L.current)==null?void 0:me.querySelector("button");X==null||X.click()},className:d("w-full h-12",B.button),style:e==="dark"?{backgroundColor:"#FFFFFF1F",boxShadow:"0 1px 0 0 rgba(255, 255, 255, 0.3) inset"}:e==="seeker"||e==="seeker-2"?{background:"linear-gradient(0deg, #39A298, #39A298), radial-gradient(101.17% 101.67% at 50.28% 134.17%, rgba(255, 255, 255, 0.6) 0%, rgba(22, 188, 174, 0.6) 100%)",backgroundColor:"transparent"}:void 0})]}),t.jsx("div",{className:"text-center",children:t.jsxs("p",{className:d("text-sm",B.helperText),children:["Don't have USDC?"," ",t.jsxs("a",{href:"#",className:"font-medium text-[#4ADE80] underline",children:["Get it here",t.jsx("svg",{className:"inline w-3 h-3 ml-1 text-[#4ADE80]",fill:"currentColor",viewBox:"0 0 20 20",children:t.jsx("path",{fillRule:"evenodd",d:"M10.293 3.293a1 1 0 011.414 0l6 6a1 1 0 010 1.414l-6 6a1 1 0 01-1.414-1.414L14.586 11H3a1 1 0 110-2h11.586l-4.293-4.293a1 1 0 010-1.414z",clipRule:"evenodd"})})]})]})})]})]})})}return t.jsx("div",{className:d("flex items-center justify-center min-h-screen p-4",F.container,b==null?void 0:b.container),style:e==="dark"?{background:"radial-gradient(circle at center, #ec4899 0%, #3b82f6 50%, #9333ea 100%)",...s==null?void 0:s.container}:e==="light"?{background:"linear-gradient(135deg, rgba(255, 255, 255, 0.6) 0%, rgba(236, 72, 153, 0.4) 33%, rgba(147, 51, 234, 0.4) 66%, rgba(34, 211, 238, 0.4) 100%)",...s==null?void 0:s.container}:e==="seeker"?{background:"radial-gradient(25% 200% at 50% 50%, #6CCEC6 0%, rgba(19, 77, 128, 0) 30%), radial-gradient(20% 20% at 50% 100%, rgba(66, 202, 189, 0.8) 0%, rgba(33, 100, 94, 0.8) 0%), linear-gradient(180deg, #001214 5%, #0D2734 100%)",...s==null?void 0:s.container}:e==="seeker-2"?{background:"radial-gradient(25% 200% at 50% 50%, #6CCEC6 0%, rgba(19, 77, 128, 0) 30%), radial-gradient(20% 20% at 50% 100%, rgba(66, 202, 189, 0.8) 0%, rgba(33, 100, 94, 0.8) 0%), linear-gradient(180deg, #001214 5%, #0D2734 100%)",...s==null?void 0:s.container}:s==null?void 0:s.container,children:t.jsxs(ee,{className:d("w-full max-w-lg shadow-2xl border-0",F.card,b==null?void 0:b.card),style:e==="seeker"?{backgroundColor:"#171719",...s==null?void 0:s.card}:e==="seeker-2"?{backgroundColor:"rgba(29, 35, 35, 1)",backdropFilter:"blur(12px)",...s==null?void 0:s.card}:s==null?void 0:s.card,children:[t.jsxs(oe,{className:"pb-6",children:[t.jsxs("div",{className:"flex items-center space-x-4 mb-6",children:[t.jsx("div",{className:"w-auto h-auto rounded-full p-[2px] flex items-center justify-center overflow-hidden",children:t.jsx("div",{className:"w-full h-full rounded-full flex items-center justify-center",children:t.jsx("img",{src:"/src/components/ui/SolanaLogo.svg",alt:"Solana",className:"w-12 h-auto"})})}),t.jsxs("div",{children:[t.jsx(se,{className:d("text-l fw-bold pb-1",F.title,b==null?void 0:b.text),style:s==null?void 0:s.text,children:"Premium Content XYZ"}),t.jsx(ie,{className:d("text-sm font-light",e==="terminal"?"text-green-300":e==="seeker"||e==="seeker-2"?"text-white":"text-[#71717A]"),children:"content.xyz"})]})]}),t.jsx("div",{className:d("border-b mb-6",e==="dark"||e==="solana-dark"?"border-slate-600":e==="seeker"||e==="seeker-2"?"":"border-slate-200"),style:e==="seeker"?{borderBottom:"1px solid #FFFFFF1F"}:e==="seeker-2"?{borderBottom:"1px solid #FFFFFF1F"}:void 0}),!O&&t.jsxs("div",{className:"text-center",children:[t.jsx("h2",{className:d("text-2xl font-normal mb-2",e==="dark"||e==="solana-dark"||e==="seeker"||e==="seeker-2"?"text-white":"text-slate-900"),children:"Payment Required"}),t.jsx("p",{className:d("text-sm font-light",e==="dark"||e==="solana-dark"||e==="seeker"||e==="seeker-2"?"text-white":"text-slate-600"),children:"Access to protected content on base-sepolia. To access this content, please pay $0.01 Base Sepolia USDC"})]})]}),t.jsx(re,{className:"space-y-6",children:O?t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"flex justify-center mb-4",children:t.jsx("div",{className:"w-16 h-16 rounded-full bg-red-500 flex items-center justify-center",children:t.jsx("svg",{className:"w-8 h-8 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:"3",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})}),t.jsx("div",{className:"text-center mb-2",children:t.jsx("h3",{className:d("text-2xl font-semibold",e==="dark"||e==="solana-dark"||e==="seeker"||e==="seeker-2"?"text-white":"text-slate-900"),children:"Payment Failed"})}),t.jsx("p",{className:d("text-center text-sm mb-6",e==="dark"||e==="solana-dark"||e==="seeker"||e==="seeker-2"?"text-gray-400":"text-slate-600"),children:(D==null?void 0:D.message)||"It looks like your wallet doesn't have enough funds or the transaction was declined. Please review the details and try again."}),t.jsx("div",{className:d("rounded-lg p-6",e==="dark"||e==="solana-dark"?"bg-[#0000001F] border border-slate-600":e==="seeker"||e==="seeker-2"?"bg-[rgba(0,0,0,0.12)] border border-white/10":"bg-slate-50 border border-slate-200"),children:t.jsxs("div",{className:"space-y-3",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("span",{className:d("text-sm",e==="dark"||e==="solana-dark"||e==="seeker"||e==="seeker-2"?"text-white":"text-slate-900"),children:"Amount Paid"}),t.jsxs("span",{className:d("text-sm font-semibold",e==="light"||e==="solana-light"?"text-purple-600":"text-green-500"),children:["$",r.toFixed(2)]})]}),t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("span",{className:d("text-sm",e==="dark"||e==="solana-dark"||e==="seeker"||e==="seeker-2"?"text-white":"text-slate-900"),children:"Wallet"}),t.jsx("span",{className:d("text-sm",e==="dark"||e==="solana-dark"||e==="seeker"||e==="seeker-2"?"text-white":"text-slate-900"),children:(fe=x==null?void 0:x.publicKey)!=null&&fe.toString()?`${x.publicKey.toString().slice(0,6)}...${x.publicKey.toString().slice(-4)}`:x!=null&&x.address?`${x.address.slice(0,6)}...${x.address.slice(-4)}`:"Not connected"})]}),t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("span",{className:d("text-sm",e==="dark"||e==="solana-dark"||e==="seeker"||e==="seeker-2"?"text-white":"text-slate-900"),children:"Available Balance"}),t.jsxs("span",{className:d("text-sm",e==="dark"||e==="solana-dark"||e==="seeker"||e==="seeker-2"?"text-white":"text-slate-900"),children:["$",P]})]}),t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("span",{className:d("text-sm",e==="dark"||e==="solana-dark"||e==="seeker"||e==="seeker-2"?"text-white":"text-slate-900"),children:"Currency"}),t.jsx("span",{className:d("text-sm",e==="dark"||e==="solana-dark"||e==="seeker"||e==="seeker-2"?"text-white":"text-slate-900"),children:"USDC"})]}),t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("span",{className:d("text-sm",e==="dark"||e==="solana-dark"||e==="seeker"||e==="seeker-2"?"text-white":"text-slate-900"),children:"Network"}),t.jsxs("div",{className:"flex items-center space-x-2",children:[t.jsx("div",{className:"w-2 h-2 rounded-full bg-green-500"}),t.jsx("span",{className:d("text-sm",e==="dark"||e==="solana-dark"||e==="seeker"||e==="seeker-2"?"text-white":"text-slate-900"),children:"Solana"})]})]})]})}),t.jsxs("div",{className:d("rounded-lg p-4 flex items-start space-x-3",e==="dark"||e==="solana-dark"||e==="seeker"||e==="seeker-2"?"bg-orange-900/50 border border-orange-700":"bg-orange-50 border border-orange-200"),children:[t.jsx("div",{className:"flex-shrink-0",children:t.jsx("div",{className:"w-6 h-6 rounded-full bg-orange-500 flex items-center justify-center",children:t.jsx("svg",{className:"w-4 h-4 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:"2",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})})})}),t.jsx("p",{className:d("text-sm",e==="dark"||e==="solana-dark"||e==="seeker"||e==="seeker-2"?"text-white":"text-orange-800"),children:"Make sure your Solana wallet has enough USDC to cover the amount before retrying the transaction."})]}),t.jsx(Q,{amount:r,description:a,onClick:()=>{ne(),H()},loading:I,disabled:I||!(x!=null&&x.publicKey),className:d("w-full h-12",e==="dark"||e==="solana-dark"?e==="dark"?"bg-[#FFFFFF1F] rounded-full":"bg-solana-gradient rounded-full":e==="light"?"bg-black hover:bg-gray-800 text-white font-light rounded-full":e==="solana-light"?"bg-solana-gradient hover:opacity-90 text-white font-light rounded-full":e==="seeker"||e==="seeker-2"?"bg-gradient-to-r from-emerald-500 to-teal-500 hover:from-emerald-600 hover:to-teal-600 text-white rounded-full":"bg-solana-gradient rounded-full",b==null?void 0:b.button),style:e==="dark"?{backgroundColor:"#FFFFFF1F",boxShadow:"0 1px 0 0 rgba(255, 255, 255, 0.3) inset",...s==null?void 0:s.button}:e==="light"||e==="solana-light"?s==null?void 0:s.button:e==="seeker"?{background:"linear-gradient(0deg, #39A298, #39A298), radial-gradient(101.17% 101.67% at 50.28% 134.17%, rgba(255, 255, 255, 0.6) 0%, rgba(22, 188, 174, 0.6) 100%)",backgroundColor:"transparent",...s==null?void 0:s.button}:e==="seeker-2"?{background:"linear-gradient(0deg, #39A298, #39A298), radial-gradient(101.17% 101.67% at 50.28% 134.17%, rgba(255, 255, 255, 0.6) 0%, rgba(22, 188, 174, 0.6) 100%)",backgroundColor:"transparent",...s==null?void 0:s.button}:s==null?void 0:s.button,customText:"Try Again"}),t.jsx("div",{className:"text-center",children:t.jsxs("p",{className:d("text-sm",e==="dark"||e==="solana-dark"||e==="seeker"||e==="seeker-2"?"text-white":"text-slate-900"),children:[t.jsx("span",{className:d(e==="dark"||e==="solana-dark"||e==="seeker"||e==="seeker-2"?"text-gray-400":"text-slate-600"),children:"Don't have USDC? "}),t.jsxs("a",{href:"https://www.coinbase.com/how-to-buy/usdc",target:"_blank",rel:"noopener noreferrer",className:d("font-medium hover:opacity-80",e==="light"||e==="solana-light"?"text-purple-600":"text-green-400 hover:text-green-300"),children:["Get it here",t.jsx("svg",{className:d("inline w-3 h-3 ml-1",e==="light"||e==="solana-light"?"text-purple-600":"text-green-400"),fill:"currentColor",viewBox:"0 0 20 20",children:t.jsx("path",{fillRule:"evenodd",d:"M10.293 3.293a1 1 0 011.414 0l6 6a1 1 0 010 1.414l-6 6a1 1 0 01-1.414-1.414L14.586 11H3a1 1 0 110-2h11.586l-4.293-4.293a1 1 0 010-1.414z",clipRule:"evenodd"})})]})]})})]}):t.jsxs(t.Fragment,{children:[t.jsx(pe,{wallet:x,onDisconnect:V,theme:e,className:d("mb-4",(e==="dark"||e==="solana-dark")&&"bg-[#0000001F] border-slate-600 text-white"),style:e==="dark"||e==="solana-dark"?{boxShadow:"0px 0px 16px 4px #000000 inset"}:void 0}),g&&(e==="seeker"||e==="seeker-2"?t.jsxs("div",{className:d("p-6",F.paymentDetails),style:{backgroundColor:"rgba(0, 0, 0, 0.12)"},children:[t.jsxs("div",{className:"flex items-center justify-between mb-4",children:[t.jsx("span",{className:"text-sm text-white",children:"Amount"}),t.jsx("div",{className:"text-xl font-bold",style:{color:"#95D2E6"},children:r.toFixed(2)})]}),t.jsx("div",{className:"border-t mb-4",style:{borderTop:"1px solid #FFFFFF1F"}}),t.jsxs("div",{className:"space-y-3",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("span",{className:"text-sm text-white",children:"Wallet"}),t.jsx("div",{className:"text-sm text-white",children:(he=x==null?void 0:x.publicKey)!=null&&he.toString()?`${x.publicKey.toString().slice(0,6)}...${x.publicKey.toString().slice(-4)}`:x!=null&&x.address?`${x.address.slice(0,6)}...${x.address.slice(-4)}`:"Not connected"})]}),t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("span",{className:"text-sm text-white",children:"Available Balance"}),t.jsxs("div",{className:"text-sm text-white",children:["$",P]})]}),t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("span",{className:"text-sm text-white",children:"Currency"}),t.jsx("div",{className:"text-sm text-white",children:"USDC"})]}),t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("span",{className:"text-sm text-white",children:"Network"}),t.jsxs("div",{className:"flex items-center space-x-2",children:[t.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:"#95D2E6"}}),t.jsx("span",{className:"text-sm text-white",children:"Solana"})]})]})]})]}):t.jsxs("div",{className:d("p-6",F.paymentDetails),style:e==="dark"||e==="solana-dark"?{boxShadow:"0px 0px 16px 4px #000000 inset"}:void 0,children:[t.jsxs("div",{className:"flex items-center justify-between mb-4",children:[t.jsx("span",{className:d("text-sm",e==="dark"||e==="solana-dark"?"text-white":"text-black"),children:"Amount"}),t.jsxs("div",{className:d("text-xl font-bold",e==="light"||e==="solana-light"?"text-purple-600":"text-[#21ECAB]"),children:["$",r.toFixed(2)]})]}),t.jsx("div",{className:d("border-t mb-4",e==="dark"||e==="solana-dark"?"border-slate-600":"border-slate-200")}),t.jsxs("div",{className:"space-y-3",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("span",{className:d("text-sm",e==="dark"||e==="solana-dark"?"text-white":"text-black"),children:"Wallet"}),t.jsx("div",{className:d("text-sm",e==="dark"||e==="solana-dark"?"text-white":"text-slate-900"),children:(we=x==null?void 0:x.publicKey)!=null&&we.toString()?`${x.publicKey.toString().slice(0,6)}...${x.publicKey.toString().slice(-4)}`:x!=null&&x.address?`${x.address.slice(0,6)}...${x.address.slice(-4)}`:"Not connected"})]}),t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("span",{className:d("text-sm",e==="dark"||e==="solana-dark"?"text-white":"text-black"),children:"Available Balance"}),t.jsxs("div",{className:d("text-sm",e==="dark"||e==="solana-dark"?"text-white":"text-slate-900"),children:["$",P]})]}),t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("span",{className:d("text-sm",e==="dark"||e==="solana-dark"?"text-white":"text-black"),children:"Currency"}),t.jsx("div",{className:d("text-sm",e==="dark"||e==="solana-dark"?"text-white":"text-slate-900"),children:"USDC"})]}),t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("span",{className:d("text-sm",e==="dark"||e==="solana-dark"?"text-white":"text-black"),children:"Network"}),t.jsxs("div",{className:"flex items-center space-x-2",children:[t.jsx("div",{className:d("w-2 h-2 rounded-full","bg-green-500")}),t.jsx("span",{className:d("text-sm",e==="dark"||e==="solana-dark"?"text-white":"text-slate-900"),children:"Solana"})]})]})]})]})),t.jsxs("div",{className:"flex items-center justify-center space-x-2",children:[t.jsxs("svg",{className:"w-4 h-4 text-green-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:"2",children:[t.jsx("path",{d:"M12 1L3 5v6c0 5.55 3.84 10.74 9 12 5.16-1.26 9-6.45 9-12V5l-9-4z"}),t.jsx("path",{d:"M9 12l2 2 4-4",strokeLinecap:"round",strokeLinejoin:"round"})]}),t.jsx("span",{className:d("text-sm",F.securityMessage),style:e==="seeker"?{color:"#FFFFFF66"}:e==="seeker-2"?{color:"#FFFFFF66"}:void 0,children:"Secure payment powered by Solana"})]}),t.jsx(Q,{amount:r,description:a,onClick:H,loading:I,disabled:I||!(x!=null&&x.publicKey),className:d("w-full h-12",e==="dark"||e==="solana-dark"?e==="dark"?"bg-[#FFFFFF1F] rounded-full":"bg-solana-gradient rounded-full":F.button,b==null?void 0:b.button),style:e==="dark"?{backgroundColor:"#FFFFFF1F",boxShadow:"0 1px 0 0 rgba(255, 255, 255, 0.3) inset",...s==null?void 0:s.button}:e==="seeker"?{background:"linear-gradient(0deg, #39A298, #39A298), radial-gradient(101.17% 101.67% at 50.28% 134.17%, rgba(255, 255, 255, 0.6) 0%, rgba(22, 188, 174, 0.6) 100%)",backgroundColor:"transparent",...s==null?void 0:s.button}:e==="seeker-2"?{background:"linear-gradient(0deg, #39A298, #39A298), radial-gradient(101.17% 101.67% at 50.28% 134.17%, rgba(255, 255, 255, 0.6) 0%, rgba(22, 188, 174, 0.6) 100%)",backgroundColor:"transparent",...s==null?void 0:s.button}:s==null?void 0:s.button}),D&&t.jsx("div",{className:"bg-red-50 border border-red-200 rounded-lg p-4",children:t.jsxs("p",{className:"text-sm text-red-800 text-center",children:[t.jsx("span",{className:"font-semibold",children:"Payment Error:"})," ",D.message]})}),t.jsx("div",{className:"text-center",children:t.jsxs("p",{className:d("text-sm",F.helperText),children:[t.jsxs("span",{style:e==="seeker"?{color:"#FFFFFF66"}:e==="seeker-2"?{color:"#FFFFFF66"}:void 0,children:["Don't have USDC?"," "]}),t.jsxs("a",{href:"#",className:d("font-medium",e==="seeker"||e==="seeker-2"?"text-[#4ADE80]":F.helperLink||"text-[#4ADE80]"),style:e==="seeker"?{color:"#4ADE80"}:e==="seeker-2"?{color:"#4ADE80"}:void 0,children:["Get it here",t.jsx("svg",{className:d("inline w-3 h-3 ml-1",e==="light"?"text-purple-600":"text-[#4ADE80]"),fill:"currentColor",viewBox:"0 0 20 20",children:t.jsx("path",{fillRule:"evenodd",d:"M10.293 3.293a1 1 0 011.414 0l6 6a1 1 0 010 1.414l-6 6a1 1 0 01-1.414-1.414L14.586 11H3a1 1 0 110-2h11.586l-4.293-4.293a1 1 0 010-1.414z",clipRule:"evenodd"})})]})]})})]})})]})})},Ue=({autoSetupProviders:r=!0,providerNetwork:a,providerEndpoint:n,...o})=>{const i=a??(o.network==="solana"?ve.WalletAdapterNetwork.Mainnet:ve.WalletAdapterNetwork.Devnet);if(r){const l=A.useMemo(()=>n||o.rpcUrl||T.clusterApiUrl(i),[n,o.rpcUrl,i]),c=A.useMemo(()=>[new ye.PhantomWalletAdapter,new ye.SolflareWalletAdapter],[]);return t.jsx(ce.ConnectionProvider,{endpoint:l,children:t.jsx(ce.WalletProvider,{wallets:c,autoConnect:!1,children:t.jsx(Te.WalletModalProvider,{children:t.jsx(Me,{...o})})})})}return t.jsx(Me,{...o})};Ue.displayName="X402Paywall";const Ge=({status:r,message:a,progress:n,className:o,style:i})=>{const c=(()=>{switch(r){case"idle":return{label:"Ready",color:"bg-gray-100 text-gray-800",icon:null};case"connecting":return{label:"Connecting",color:"bg-blue-100 text-blue-800",icon:t.jsx(te,{size:"sm",variant:"default"})};case"pending":return{label:"Processing",color:"bg-yellow-100 text-yellow-800",icon:t.jsx(te,{size:"sm",variant:"solana"})};case"success":return{label:"Paid",color:"bg-green-100 text-green-800",icon:t.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})})};case"error":return{label:"Failed",color:"bg-red-100 text-red-800",icon:t.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})};default:return{label:"Unknown",color:"bg-gray-100 text-gray-800",icon:null}}})();return t.jsxs("div",{className:d("flex flex-col gap-2",o),style:i,children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsxs(ge,{className:d("flex items-center gap-1.5",c.color),children:[c.icon,t.jsx("span",{children:c.label})]}),a&&t.jsx("span",{className:"text-sm text-muted-foreground",children:a})]}),n!==void 0&&n>0&&t.jsx("div",{className:"w-full bg-gray-200 rounded-full h-2 overflow-hidden",children:t.jsx("div",{className:"bg-solana-gradient h-full transition-all duration-300",style:{width:`${n}%`}})})]})};Ge.displayName="PaymentStatus";exports.Badge=ge;exports.Button=xe;exports.Card=ee;exports.CardContent=re;exports.CardDescription=ie;exports.CardHeader=oe;exports.CardTitle=se;exports.PaymentButton=Q;exports.PaymentStatus=Ge;exports.Spinner=te;exports.WalletSection=pe;exports.X402Paywall=Ue;exports.cn=d;exports.useX402Payment=$e;
1
+ "use strict";var _e=Object.defineProperty;var Oe=(r,a,n)=>a in r?_e(r,a,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[a]=n;var ve=(r,a,n)=>Oe(r,typeof a!="symbol"?a+"":a,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),A=require("react"),ue=require("@solana/wallet-adapter-react"),Pe=require("@solana/wallet-adapter-react-ui"),ye=require("@solana/wallet-adapter-base"),je=require("@solana/wallet-adapter-wallets"),P=require("@solana/web3.js"),K=require("@solana/spl-token");function We(r){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const n in r)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(r,n);Object.defineProperty(a,n,o.get?o:{enumerable:!0,get:()=>r[n]})}}return a.default=r,Object.freeze(a)}const N=We(A);function Ve(r){return r==="solana"?"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v":"4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU"}function He(r){return r==="solana"?`https://mainnet.helius-rpc.com/?api-key=${process.env.VITE_HELIUS_API_KEY}`:"https://api.devnet.solana.com"}async function Xe(r,a,n){try{const o=n||He(a),i=new P.Connection(o,"confirmed"),l=new P.PublicKey(r),c=new P.PublicKey(Ve(a)),u=await K.getAssociatedTokenAddress(c,l),e=await K.getAccount(i,u);return(Number(e.amount)/1e6).toFixed(2)}catch(o){return console.error("Error fetching USDC balance:",o),"0.00"}}function Ee(r){var a,n,o="";if(typeof r=="string"||typeof r=="number")o+=r;else if(typeof r=="object")if(Array.isArray(r)){var i=r.length;for(a=0;a<i;a++)r[a]&&(n=Ee(r[a]))&&(o&&(o+=" "),o+=n)}else for(n in r)r[n]&&(o&&(o+=" "),o+=n);return o}function De(){for(var r,a,n=0,o="",i=arguments.length;n<i;n++)(r=arguments[n])&&(a=Ee(r))&&(o&&(o+=" "),o+=a);return o}const xe="-",qe=r=>{const a=Se(r),{conflictingClassGroups:n,conflictingClassGroupModifiers:o}=r;return{getClassGroupId:c=>{const u=c.split(xe);return u[0]===""&&u.length!==1&&u.shift(),ze(u,a)||Je(c)},getConflictingClassGroupIds:(c,u)=>{const e=n[c]||[];return u&&o[c]?[...e,...o[c]]:e}}},ze=(r,a)=>{var c;if(r.length===0)return a.classGroupId;const n=r[0],o=a.nextPart.get(n),i=o?ze(r.slice(1),o):void 0;if(i)return i;if(a.validators.length===0)return;const l=r.join(xe);return(c=a.validators.find(({validator:u})=>u(l)))==null?void 0:c.classGroupId},Ne=/^\[(.+)\]$/,Je=r=>{if(Ne.test(r)){const a=Ne.exec(r)[1],n=a==null?void 0:a.substring(0,a.indexOf(":"));if(n)return"arbitrary.."+n}},Se=r=>{const{theme:a,prefix:n}=r,o={nextPart:new Map,validators:[]};return Ze(Object.entries(r.classGroups),n).forEach(([l,c])=>{be(c,o,l,a)}),o},be=(r,a,n,o)=>{r.forEach(i=>{if(typeof i=="string"){const l=i===""?a:Ce(a,i);l.classGroupId=n;return}if(typeof i=="function"){if(Ye(i)){be(i(o),a,n,o);return}a.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([l,c])=>{be(c,Ce(a,l),n,o)})})},Ce=(r,a)=>{let n=r;return a.split(xe).forEach(o=>{n.nextPart.has(o)||n.nextPart.set(o,{nextPart:new Map,validators:[]}),n=n.nextPart.get(o)}),n},Ye=r=>r.isThemeGetter,Ze=(r,a)=>a?r.map(([n,o])=>{const i=o.map(l=>typeof l=="string"?a+l:typeof l=="object"?Object.fromEntries(Object.entries(l).map(([c,u])=>[a+c,u])):l);return[n,i]}):r,Qe=r=>{if(r<1)return{get:()=>{},set:()=>{}};let a=0,n=new Map,o=new Map;const i=(l,c)=>{n.set(l,c),a++,a>r&&(a=0,o=n,n=new Map)};return{get(l){let c=n.get(l);if(c!==void 0)return c;if((c=o.get(l))!==void 0)return i(l,c),c},set(l,c){n.has(l)?n.set(l,c):i(l,c)}}},Ie="!",er=r=>{const{separator:a,experimentalParseClassName:n}=r,o=a.length===1,i=a[0],l=a.length,c=u=>{const e=[];let x=0,f=0,p;for(let w=0;w<u.length;w++){let y=u[w];if(x===0){if(y===i&&(o||u.slice(w,w+l)===a)){e.push(u.slice(f,w)),f=w+l;continue}if(y==="/"){p=w;continue}}y==="["?x++:y==="]"&&x--}const b=e.length===0?u:u.substring(f),s=b.startsWith(Ie),C=s?b.substring(1):b,m=p&&p>f?p-f:void 0;return{modifiers:e,hasImportantModifier:s,baseClassName:C,maybePostfixModifierPosition:m}};return n?u=>n({className:u,parseClassName:c}):c},rr=r=>{if(r.length<=1)return r;const a=[];let n=[];return r.forEach(o=>{o[0]==="["?(a.push(...n.sort(),o),n=[]):n.push(o)}),a.push(...n.sort()),a},tr=r=>({cache:Qe(r.cacheSize),parseClassName:er(r),...qe(r)}),nr=/\s+/,ar=(r,a)=>{const{parseClassName:n,getClassGroupId:o,getConflictingClassGroupIds:i}=a,l=[],c=r.trim().split(nr);let u="";for(let e=c.length-1;e>=0;e-=1){const x=c[e],{modifiers:f,hasImportantModifier:p,baseClassName:b,maybePostfixModifierPosition:s}=n(x);let C=!!s,m=o(C?b.substring(0,s):b);if(!m){if(!C){u=x+(u.length>0?" "+u:u);continue}if(m=o(b),!m){u=x+(u.length>0?" "+u:u);continue}C=!1}const w=rr(f).join(":"),y=p?w+Ie:w,F=y+m;if(l.includes(F))continue;l.push(F);const M=i(m,C);for(let k=0;k<M.length;++k){const g=M[k];l.push(y+g)}u=x+(u.length>0?" "+u:u)}return u};function or(){let r=0,a,n,o="";for(;r<arguments.length;)(a=arguments[r++])&&(n=Re(a))&&(o&&(o+=" "),o+=n);return o}const Re=r=>{if(typeof r=="string")return r;let a,n="";for(let o=0;o<r.length;o++)r[o]&&(a=Re(r[o]))&&(n&&(n+=" "),n+=a);return n};function sr(r,...a){let n,o,i,l=c;function c(e){const x=a.reduce((f,p)=>p(f),r());return n=tr(x),o=n.cache.get,i=n.cache.set,l=u,u(e)}function u(e){const x=o(e);if(x)return x;const f=ar(e,n);return i(e,f),f}return function(){return l(or.apply(null,arguments))}}const j=r=>{const a=n=>n[r]||[];return a.isThemeGetter=!0,a},Le=/^\[(?:([a-z-]+):)?(.+)\]$/i,ir=/^\d+\/\d+$/,lr=new Set(["px","full","screen"]),dr=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,cr=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,ur=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,br=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,xr=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,U=r=>J(r)||lr.has(r)||ir.test(r),O=r=>S(r,"length",vr),J=r=>!!r&&!Number.isNaN(Number(r)),ce=r=>S(r,"number",J),ee=r=>!!r&&Number.isInteger(Number(r)),gr=r=>r.endsWith("%")&&J(r.slice(0,-1)),h=r=>Le.test(r),W=r=>dr.test(r),pr=new Set(["length","size","percentage"]),fr=r=>S(r,pr,Be),hr=r=>S(r,"position",Be),wr=new Set(["image","url"]),mr=r=>S(r,wr,jr),kr=r=>S(r,"",yr),re=()=>!0,S=(r,a,n)=>{const o=Le.exec(r);return o?o[1]?typeof a=="string"?o[1]===a:a.has(o[1]):n(o[2]):!1},vr=r=>cr.test(r)&&!ur.test(r),Be=()=>!1,yr=r=>br.test(r),jr=r=>xr.test(r),Nr=()=>{const r=j("colors"),a=j("spacing"),n=j("blur"),o=j("brightness"),i=j("borderColor"),l=j("borderRadius"),c=j("borderSpacing"),u=j("borderWidth"),e=j("contrast"),x=j("grayscale"),f=j("hueRotate"),p=j("invert"),b=j("gap"),s=j("gradientColorStops"),C=j("gradientColorStopPositions"),m=j("inset"),w=j("margin"),y=j("opacity"),F=j("padding"),M=j("saturate"),k=j("scale"),g=j("sepia"),I=j("skew"),z=j("space"),T=j("translate"),R=()=>["auto","contain","none"],L=()=>["auto","hidden","clip","visible","scroll"],B=()=>["auto",h,a],v=()=>[h,a],V=()=>["",U,O],H=()=>["auto",J,h],E=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],_=()=>["solid","dashed","dotted","double","none"],se=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Y=()=>["start","end","center","between","around","evenly","stretch"],X=()=>["","0",h],Z=()=>["auto","avoid","all","avoid-page","page","left","right","column"],D=()=>[J,h];return{cacheSize:500,separator:":",theme:{colors:[re],spacing:[U,O],blur:["none","",W,h],brightness:D(),borderColor:[r],borderRadius:["none","","full",W,h],borderSpacing:v(),borderWidth:V(),contrast:D(),grayscale:X(),hueRotate:D(),invert:X(),gap:v(),gradientColorStops:[r],gradientColorStopPositions:[gr,O],inset:B(),margin:B(),opacity:D(),padding:v(),saturate:D(),scale:D(),sepia:X(),skew:D(),space:v(),translate:v()},classGroups:{aspect:[{aspect:["auto","square","video",h]}],container:["container"],columns:[{columns:[W]}],"break-after":[{"break-after":Z()}],"break-before":[{"break-before":Z()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...E(),h]}],overflow:[{overflow:L()}],"overflow-x":[{"overflow-x":L()}],"overflow-y":[{"overflow-y":L()}],overscroll:[{overscroll:R()}],"overscroll-x":[{"overscroll-x":R()}],"overscroll-y":[{"overscroll-y":R()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[m]}],"inset-x":[{"inset-x":[m]}],"inset-y":[{"inset-y":[m]}],start:[{start:[m]}],end:[{end:[m]}],top:[{top:[m]}],right:[{right:[m]}],bottom:[{bottom:[m]}],left:[{left:[m]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",ee,h]}],basis:[{basis:B()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",h]}],grow:[{grow:X()}],shrink:[{shrink:X()}],order:[{order:["first","last","none",ee,h]}],"grid-cols":[{"grid-cols":[re]}],"col-start-end":[{col:["auto",{span:["full",ee,h]},h]}],"col-start":[{"col-start":H()}],"col-end":[{"col-end":H()}],"grid-rows":[{"grid-rows":[re]}],"row-start-end":[{row:["auto",{span:[ee,h]},h]}],"row-start":[{"row-start":H()}],"row-end":[{"row-end":H()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",h]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",h]}],gap:[{gap:[b]}],"gap-x":[{"gap-x":[b]}],"gap-y":[{"gap-y":[b]}],"justify-content":[{justify:["normal",...Y()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...Y(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...Y(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[F]}],px:[{px:[F]}],py:[{py:[F]}],ps:[{ps:[F]}],pe:[{pe:[F]}],pt:[{pt:[F]}],pr:[{pr:[F]}],pb:[{pb:[F]}],pl:[{pl:[F]}],m:[{m:[w]}],mx:[{mx:[w]}],my:[{my:[w]}],ms:[{ms:[w]}],me:[{me:[w]}],mt:[{mt:[w]}],mr:[{mr:[w]}],mb:[{mb:[w]}],ml:[{ml:[w]}],"space-x":[{"space-x":[z]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[z]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",h,a]}],"min-w":[{"min-w":[h,a,"min","max","fit"]}],"max-w":[{"max-w":[h,a,"none","full","min","max","fit","prose",{screen:[W]},W]}],h:[{h:[h,a,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[h,a,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[h,a,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[h,a,"auto","min","max","fit"]}],"font-size":[{text:["base",W,O]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",ce]}],"font-family":[{font:[re]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",h]}],"line-clamp":[{"line-clamp":["none",J,ce]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",U,h]}],"list-image":[{"list-image":["none",h]}],"list-style-type":[{list:["none","disc","decimal",h]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[r]}],"placeholder-opacity":[{"placeholder-opacity":[y]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[r]}],"text-opacity":[{"text-opacity":[y]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[..._(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",U,O]}],"underline-offset":[{"underline-offset":["auto",U,h]}],"text-decoration-color":[{decoration:[r]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:v()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",h]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",h]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[y]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...E(),hr]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",fr]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},mr]}],"bg-color":[{bg:[r]}],"gradient-from-pos":[{from:[C]}],"gradient-via-pos":[{via:[C]}],"gradient-to-pos":[{to:[C]}],"gradient-from":[{from:[s]}],"gradient-via":[{via:[s]}],"gradient-to":[{to:[s]}],rounded:[{rounded:[l]}],"rounded-s":[{"rounded-s":[l]}],"rounded-e":[{"rounded-e":[l]}],"rounded-t":[{"rounded-t":[l]}],"rounded-r":[{"rounded-r":[l]}],"rounded-b":[{"rounded-b":[l]}],"rounded-l":[{"rounded-l":[l]}],"rounded-ss":[{"rounded-ss":[l]}],"rounded-se":[{"rounded-se":[l]}],"rounded-ee":[{"rounded-ee":[l]}],"rounded-es":[{"rounded-es":[l]}],"rounded-tl":[{"rounded-tl":[l]}],"rounded-tr":[{"rounded-tr":[l]}],"rounded-br":[{"rounded-br":[l]}],"rounded-bl":[{"rounded-bl":[l]}],"border-w":[{border:[u]}],"border-w-x":[{"border-x":[u]}],"border-w-y":[{"border-y":[u]}],"border-w-s":[{"border-s":[u]}],"border-w-e":[{"border-e":[u]}],"border-w-t":[{"border-t":[u]}],"border-w-r":[{"border-r":[u]}],"border-w-b":[{"border-b":[u]}],"border-w-l":[{"border-l":[u]}],"border-opacity":[{"border-opacity":[y]}],"border-style":[{border:[..._(),"hidden"]}],"divide-x":[{"divide-x":[u]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[u]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[y]}],"divide-style":[{divide:_()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",..._()]}],"outline-offset":[{"outline-offset":[U,h]}],"outline-w":[{outline:[U,O]}],"outline-color":[{outline:[r]}],"ring-w":[{ring:V()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[r]}],"ring-opacity":[{"ring-opacity":[y]}],"ring-offset-w":[{"ring-offset":[U,O]}],"ring-offset-color":[{"ring-offset":[r]}],shadow:[{shadow:["","inner","none",W,kr]}],"shadow-color":[{shadow:[re]}],opacity:[{opacity:[y]}],"mix-blend":[{"mix-blend":[...se(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":se()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[o]}],contrast:[{contrast:[e]}],"drop-shadow":[{"drop-shadow":["","none",W,h]}],grayscale:[{grayscale:[x]}],"hue-rotate":[{"hue-rotate":[f]}],invert:[{invert:[p]}],saturate:[{saturate:[M]}],sepia:[{sepia:[g]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[o]}],"backdrop-contrast":[{"backdrop-contrast":[e]}],"backdrop-grayscale":[{"backdrop-grayscale":[x]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[f]}],"backdrop-invert":[{"backdrop-invert":[p]}],"backdrop-opacity":[{"backdrop-opacity":[y]}],"backdrop-saturate":[{"backdrop-saturate":[M]}],"backdrop-sepia":[{"backdrop-sepia":[g]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[c]}],"border-spacing-x":[{"border-spacing-x":[c]}],"border-spacing-y":[{"border-spacing-y":[c]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",h]}],duration:[{duration:D()}],ease:[{ease:["linear","in","out","in-out",h]}],delay:[{delay:D()}],animate:[{animate:["none","spin","ping","pulse","bounce",h]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[k]}],"scale-x":[{"scale-x":[k]}],"scale-y":[{"scale-y":[k]}],rotate:[{rotate:[ee,h]}],"translate-x":[{"translate-x":[T]}],"translate-y":[{"translate-y":[T]}],"skew-x":[{"skew-x":[I]}],"skew-y":[{"skew-y":[I]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",h]}],accent:[{accent:["auto",r]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",h]}],"caret-color":[{caret:[r]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":v()}],"scroll-mx":[{"scroll-mx":v()}],"scroll-my":[{"scroll-my":v()}],"scroll-ms":[{"scroll-ms":v()}],"scroll-me":[{"scroll-me":v()}],"scroll-mt":[{"scroll-mt":v()}],"scroll-mr":[{"scroll-mr":v()}],"scroll-mb":[{"scroll-mb":v()}],"scroll-ml":[{"scroll-ml":v()}],"scroll-p":[{"scroll-p":v()}],"scroll-px":[{"scroll-px":v()}],"scroll-py":[{"scroll-py":v()}],"scroll-ps":[{"scroll-ps":v()}],"scroll-pe":[{"scroll-pe":v()}],"scroll-pt":[{"scroll-pt":v()}],"scroll-pr":[{"scroll-pr":v()}],"scroll-pb":[{"scroll-pb":v()}],"scroll-pl":[{"scroll-pl":v()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",h]}],fill:[{fill:[r,"none"]}],"stroke-w":[{stroke:[U,O,ce]}],stroke:[{stroke:[r,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},Cr=sr(Nr);function d(...r){return Cr(De(r))}const ne=N.forwardRef(({className:r,...a},n)=>t.jsx("div",{ref:n,className:d("rounded-xl border bg-card text-card-foreground shadow",r),...a}));ne.displayName="Card";const ie=N.forwardRef(({className:r,...a},n)=>t.jsx("div",{ref:n,className:d("flex flex-col space-y-1.5 p-6",r),...a}));ie.displayName="CardHeader";const le=N.forwardRef(({className:r,...a},n)=>t.jsx("div",{ref:n,className:d("font-semibold leading-none tracking-tight",r),...a}));le.displayName="CardTitle";const de=N.forwardRef(({className:r,...a},n)=>t.jsx("div",{ref:n,className:d("text-sm text-muted-foreground",r),...a}));de.displayName="CardDescription";const ae=N.forwardRef(({className:r,...a},n)=>t.jsx("div",{ref:n,className:d("p-6 pt-0",r),...a}));ae.displayName="CardContent";const Fr=N.forwardRef(({className:r,...a},n)=>t.jsx("div",{ref:n,className:d("flex items-center p-6 pt-0",r),...a}));Fr.displayName="CardFooter";function Fe(r,a){if(typeof r=="function")return r(a);r!=null&&(r.current=a)}function Ar(...r){return a=>{let n=!1;const o=r.map(i=>{const l=Fe(i,a);return!n&&typeof l=="function"&&(n=!0),l});if(n)return()=>{for(let i=0;i<o.length;i++){const l=o[i];typeof l=="function"?l():Fe(r[i],null)}}}}function Mr(r){const a=Pr(r),n=N.forwardRef((o,i)=>{const{children:l,...c}=o,u=N.Children.toArray(l),e=u.find(Dr);if(e){const x=e.props.children,f=u.map(p=>p===e?N.Children.count(x)>1?N.Children.only(null):N.isValidElement(x)?x.props.children:null:p);return t.jsx(a,{...c,ref:i,children:N.isValidElement(x)?N.cloneElement(x,void 0,f):null})}return t.jsx(a,{...c,ref:i,children:l})});return n.displayName=`${r}.Slot`,n}var Tr=Mr("Slot");function Pr(r){const a=N.forwardRef((n,o)=>{const{children:i,...l}=n;if(N.isValidElement(i)){const c=Ir(i),u=zr(l,i.props);return i.type!==N.Fragment&&(u.ref=o?Ar(o,c):c),N.cloneElement(i,u)}return N.Children.count(i)>1?N.Children.only(null):null});return a.displayName=`${r}.SlotClone`,a}var Er=Symbol("radix.slottable");function Dr(r){return N.isValidElement(r)&&typeof r.type=="function"&&"__radixId"in r.type&&r.type.__radixId===Er}function zr(r,a){const n={...a};for(const o in a){const i=r[o],l=a[o];/^on[A-Z]/.test(o)?i&&l?n[o]=(...u)=>{const e=l(...u);return i(...u),e}:i&&(n[o]=i):o==="style"?n[o]={...i,...l}:o==="className"&&(n[o]=[i,l].filter(Boolean).join(" "))}return{...r,...n}}function Ir(r){var o,i;let a=(o=Object.getOwnPropertyDescriptor(r.props,"ref"))==null?void 0:o.get,n=a&&"isReactWarning"in a&&a.isReactWarning;return n?r.ref:(a=(i=Object.getOwnPropertyDescriptor(r,"ref"))==null?void 0:i.get,n=a&&"isReactWarning"in a&&a.isReactWarning,n?r.props.ref:r.props.ref||r.ref)}const Ae=r=>typeof r=="boolean"?`${r}`:r===0?"0":r,Me=De,$e=(r,a)=>n=>{var o;if((a==null?void 0:a.variants)==null)return Me(r,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:i,defaultVariants:l}=a,c=Object.keys(i).map(x=>{const f=n==null?void 0:n[x],p=l==null?void 0:l[x];if(f===null)return null;const b=Ae(f)||Ae(p);return i[x][b]}),u=n&&Object.entries(n).reduce((x,f)=>{let[p,b]=f;return b===void 0||(x[p]=b),x},{}),e=a==null||(o=a.compoundVariants)===null||o===void 0?void 0:o.reduce((x,f)=>{let{class:p,className:b,...s}=f;return Object.entries(s).every(C=>{let[m,w]=C;return Array.isArray(w)?w.includes({...l,...u}[m]):{...l,...u}[m]===w})?[...x,p,b]:x},[]);return Me(r,c,e,n==null?void 0:n.class,n==null?void 0:n.className)},Rr=$e("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),ge=N.forwardRef(({className:r,variant:a,size:n,asChild:o=!1,...i},l)=>{const c=o?Tr:"button";return t.jsx(c,{className:d(Rr({variant:a,size:n,className:r})),ref:l,...i})});ge.displayName="Button";const oe=N.forwardRef(({className:r,size:a="md",variant:n="default",...o},i)=>{const l={sm:"h-4 w-4",md:"h-6 w-6",lg:"h-8 w-8"},c={default:"border-gray-200 border-t-gray-900",solana:"border-gray-200 border-t-solana-primary"};return t.jsx("div",{ref:i,className:d("inline-block animate-spin rounded-full border-2",l[a],c[n],r),role:"status","aria-label":"Loading",...o,children:t.jsx("span",{className:"sr-only",children:"Loading..."})})});oe.displayName="Spinner";const te=N.forwardRef(({amount:r,description:a,onClick:n,disabled:o=!1,loading:i=!1,className:l,style:c,customText:u,...e},x)=>{const f=p=>new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2}).format(p);return t.jsx(ge,{ref:x,onClick:n,disabled:o||i,className:d("w-full hover:opacity-90 text-white font-normal shadow-lg hover:shadow-xl transition-all duration-200 transform hover:scale-[1.02] rounded-xl",!c&&"bg-solana-gradient",o||i?"opacity-50 cursor-not-allowed":"",l),style:c,...e,children:i?t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(oe,{size:"sm",variant:"default",className:"border-white/30 border-t-white"}),t.jsx("span",{children:"Processing Payment..."})]}):t.jsx("span",{children:u||`Pay ${f(r)} USDC`})})});te.displayName="PaymentButton";const Lr=$e("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function pe({className:r,variant:a,...n}){return t.jsx("div",{className:d(Lr({variant:a}),r),...n})}const fe=({wallet:r,balance:a,network:n,showBalance:o=!0,onDisconnect:i,theme:l,className:c,style:u})=>{var p;const e=((p=r==null?void 0:r.publicKey)==null?void 0:p.toString())||(r==null?void 0:r.address),x=b=>`${b.slice(0,4)}...${b.slice(-4)}`,f=()=>n==="solana"?"Mainnet":"Devnet";return!r||!e?t.jsx(ne,{className:d("border-dashed",c),style:u,children:t.jsx(ae,{className:"p-4 text-center text-muted-foreground",children:t.jsx("p",{className:"text-sm",children:"No wallet connected"})})}):t.jsx("div",{className:d("rounded-lg p-4 border",l==="seeker"||l==="seeker-2"?"border-[#FFFFFF1F]":"bg-slate-50 border-slate-200",c),style:u,children:t.jsxs("div",{className:"space-y-3",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("div",{className:"w-10 h-10 bg-gradient-to-r from-blue-500 to-purple-500 rounded-full flex items-center justify-center",children:t.jsx("span",{className:"text-white font-semibold text-sm",children:e.slice(0,2).toUpperCase()})}),t.jsxs("div",{children:[t.jsx("div",{className:d("text-xs font-medium drop-shadow-sm shadow-sm",l==="light"||l==="solana-light"?"text-[#71717A]":"text-[#FFFFFF66]"),children:"Connected Wallet"}),t.jsx("div",{className:d("text-sm font-mono",l==="light"||l==="solana-light"?"text-black":"text-white"),children:x(e)})]})]}),t.jsx("button",{onClick:i,className:d("text-sm font-medium transition-colors",l==="light"||l==="solana-light"?"text-red-500 hover:text-red-700":"text-[#FFFFFF66] hover:opacity-80"),children:"Disconnect"})]}),o&&a&&t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("span",{className:"text-sm font-medium text-slate-600",children:"USDC Balance"}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{className:"text-lg font-bold text-slate-900",children:a}),t.jsx("span",{className:"text-xs font-semibold text-slate-500 bg-slate-200 px-2 py-1 rounded-md",children:"USDC"})]})]}),n&&t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("span",{className:"text-sm font-medium text-slate-600",children:"Network"}),t.jsx(pe,{variant:"outline",className:"text-xs border-slate-300 text-slate-700",children:f()})]})]})})};fe.displayName="WalletSection";function Br(r,a,n){const o=Buffer.from(r.serialize()).toString("base64"),i={x402Version:n,scheme:a.scheme,network:a.network,payload:{transaction:o}};return Buffer.from(JSON.stringify(i)).toString("base64")}function $r(r){if(r==="solana")return"https://api.mainnet-beta.solana.com";if(r==="solana-devnet")return"https://api.devnet.solana.com";throw new Error(`Unexpected network: ${r}`)}async function Gr(r,a,n,o){var T,R,L;const i=new P.Connection(o,"confirmed"),l=(T=n==null?void 0:n.extra)==null?void 0:T.feePayer;if(typeof l!="string"||!l)throw new Error("Missing facilitator feePayer in payment requirements (extra.feePayer).");const c=new P.PublicKey(l),u=((R=r==null?void 0:r.publicKey)==null?void 0:R.toString())||(r==null?void 0:r.address);if(!u)throw new Error("Missing connected Solana wallet address or publicKey");const e=new P.PublicKey(u);if(!(n!=null&&n.payTo))throw new Error("Missing payTo in payment requirements");const x=new P.PublicKey(n.payTo),f=[];if(f.push(P.ComputeBudgetProgram.setComputeUnitLimit({units:4e4})),f.push(P.ComputeBudgetProgram.setComputeUnitPrice({microLamports:1})),!n.asset)throw new Error("Missing token mint for SPL transfer");const p=new P.PublicKey(n.asset),b=await i.getAccountInfo(p,"confirmed"),s=((L=b==null?void 0:b.owner)==null?void 0:L.toBase58())===K.TOKEN_2022_PROGRAM_ID.toBase58()?K.TOKEN_2022_PROGRAM_ID:K.TOKEN_PROGRAM_ID,C=await K.getMint(i,p,void 0,s),m=await K.getAssociatedTokenAddress(p,e,!1,s),w=await K.getAssociatedTokenAddress(p,x,!1,s);if(!await i.getAccountInfo(m,"confirmed"))throw new Error(`User does not have an Associated Token Account for ${n.asset}. Please create one first or ensure you have the required token.`);if(!await i.getAccountInfo(w,"confirmed")){const B=new P.PublicKey("ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"),v=new P.TransactionInstruction({keys:[{pubkey:c,isSigner:!0,isWritable:!0},{pubkey:w,isSigner:!1,isWritable:!0},{pubkey:x,isSigner:!1,isWritable:!1},{pubkey:p,isSigner:!1,isWritable:!1},{pubkey:P.SystemProgram.programId,isSigner:!1,isWritable:!1},{pubkey:s,isSigner:!1,isWritable:!1}],programId:B,data:Buffer.from([0])});f.push(v)}const M=BigInt(n.maxAmountRequired);f.push(K.createTransferCheckedInstruction(m,p,w,e,M,C.decimals,[],s));const{blockhash:k}=await i.getLatestBlockhash("confirmed"),g=new P.TransactionMessage({payerKey:c,recentBlockhash:k,instructions:f}).compileToV0Message(),I=new P.VersionedTransaction(g);if(typeof(r==null?void 0:r.signTransaction)!="function")throw new Error("Connected wallet does not support signTransaction");const z=await r.signTransaction(I);return Br(z,n,a)}function Ur(r,a,n,o=BigInt(0)){return async(i,l)=>{const c=await r(i,l);if(c.status!==402)return c;const u=await c.json(),e=u.x402Version,x=u.accepts||[],f=x.find(s=>s.scheme==="exact"&&(s.network==="solana-devnet"||s.network==="solana"));if(!f)throw console.error("❌ No suitable Solana payment requirements found. Available networks:",x.map(s=>s.network)),new Error("No suitable Solana payment requirements found");if(o>BigInt(0)&&BigInt(f.maxAmountRequired)>o)throw new Error("Payment amount exceeds maximum allowed");const p=await Gr(a,e,f,n),b={...l,headers:{...(l==null?void 0:l.headers)||{},"X-PAYMENT":p,"Access-Control-Expose-Headers":"X-PAYMENT-RESPONSE"}};return await r(i,b)}}var Kr=class{constructor(r){ve(this,"paymentFetch");const a=r.rpcUrl||$r(r.network);this.paymentFetch=Ur(fetch.bind(window),r.wallet,a,r.maxPaymentAmount||BigInt(0))}async fetch(r,a){return this.paymentFetch(r,a)}};function _r(r){return new Kr(r)}function Ge(r){const[a,n]=A.useState("idle"),[o,i]=A.useState(null),[l,c]=A.useState(null),[u,e]=A.useState(!1),x=A.useCallback(()=>{n("idle"),i(null),c(null),e(!1)},[]);return{pay:A.useCallback(async(p,b)=>{var s;try{if(e(!0),n("pending"),i(null),r.maxPaymentAmount&&p>r.maxPaymentAmount)throw new Error(`Payment amount ${p} exceeds maximum allowed ${r.maxPaymentAmount}`);const C=((s=r.wallet.publicKey)==null?void 0:s.toString())||r.wallet.address;if(!C)throw new Error("Wallet not connected");const m=_r({wallet:r.wallet,network:r.network,rpcUrl:r.rpcUrl,maxPaymentAmount:r.maxPaymentAmount?BigInt(Math.floor(r.maxPaymentAmount*1e6)):void 0}),w="https://x402.payai.network/api/solana/paid-content",y=r.apiEndpoint||w;console.log("Initiating x402 payment:",{endpoint:y,isDemo:y===w,amount:p,description:b,wallet:C,network:r.network});const M=await m.fetch(y,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:b,amount:p})});if(!M.ok)throw new Error(`Payment request failed: ${M.statusText}`);let k;const g=M.headers.get("content-type");g&&g.includes("application/json")?k=await M.json():k={content:await M.text()},console.log("Payment successful:",k);const I=M.headers.get("X-PAYMENT-RESPONSE");let z=`tx_${Date.now()}`;if(I)try{const T=JSON.parse(atob(I));z=T.transactionId||T.signature||z,console.log("Payment details:",T)}catch(T){console.warn("Could not decode payment response:",T)}return c(z),n("success"),e(!1),z}catch(C){const m=C instanceof Error?C:new Error("Payment failed");return i(m),n("error"),e(!1),null}},[r]),isLoading:u,status:a,error:o,transactionId:l,reset:x}}const Te=({amount:r,description:a,wallet:n,network:o="solana-devnet",rpcUrl:i,apiEndpoint:l,treasuryAddress:c,facilitatorUrl:u,theme:e="solana-light",logoUrl:x="https://raw.githubusercontent.com/PayAINetwork/x402-solana-react/main/src/components/ui/SolanaLogo.svg",showPaymentDetails:f=!0,onDisconnect:p,classNames:b,customStyles:s,maxPaymentAmount:C,onPaymentStart:m,onPaymentSuccess:w,onPaymentError:y,onWalletConnect:F,children:M})=>{var he,we,me;const k=ue.useWallet(),g=A.useMemo(()=>n||{publicKey:k.publicKey?{toString:()=>k.publicKey.toString()}:void 0,signTransaction:k.signTransaction},[n,k.publicKey,k.signTransaction]),[I,z]=A.useState(!1),[T,R]=A.useState("0.00"),L=A.useRef(null),B=o==="solana"?"Mainnet":"Devnet",{pay:v,isLoading:V,status:H,error:E,transactionId:_,reset:se}=Ge({wallet:g,network:o,rpcUrl:i,apiEndpoint:l,treasuryAddress:c,facilitatorUrl:u,maxPaymentAmount:C}),Y=()=>{p?p():!n&&k.disconnect&&k.disconnect()},X=n?!!(n.publicKey||n.address):!!(k.connected||k.publicKey);A.useEffect(()=>(document.body.className=document.body.className.replace(/wallet-modal-theme-\w+/g,"").replace(/\s+/g," ").trim(),e&&(document.body.className+=` wallet-modal-theme-${e}`),()=>{document.body.className=document.body.className.replace(/wallet-modal-theme-\w+/g,"").replace(/\s+/g," ").trim()}),[e]),A.useEffect(()=>{var G,q;const Q=((G=k.publicKey)==null?void 0:G.toString())||((q=n==null?void 0:n.publicKey)==null?void 0:q.toString())||(n==null?void 0:n.address);Q&&k.connected&&(console.log("Wallet connected:",Q),F==null||F(Q),Xe(Q,o,i).then(R)),!k.connected&&!n&&R("0.00")},[k.publicKey,k.connected,k.connecting,n,o,i,F]),A.useEffect(()=>{H==="success"&&_&&(z(!0),w==null||w(_))},[H,_,w]),A.useEffect(()=>{E&&(y==null||y(E))},[E,y]);const Z=async()=>{m==null||m(),await v(r,a)};if(I)return t.jsx(t.Fragment,{children:M});const D=E&&(e==="dark"||e==="solana-dark"||e==="light"||e==="solana-light"||e==="seeker"||e==="seeker-2"),$=(()=>{switch(e){case"solana-dark":return{container:"",card:"!bg-[#171719] border-0 text-white rounded-xl",icon:"bg-slate-600",title:"",button:"bg-solana-gradient hover:opacity-90 text-white rounded-full",paymentDetails:"bg-[#0000001F] border-slate-600 text-white rounded-lg",walletSection:"bg-[#0000001F] border-slate-600 text-white rounded-lg",notice:"bg-amber-900/50 border-amber-700 text-white rounded-lg",securityMessage:"text-slate-400",helperText:"text-white",helperLink:void 0};case"seeker":return{container:"",card:"backdrop-blur-sm border-emerald-200 rounded-xl",icon:"bg-gradient-to-r from-emerald-500 to-teal-500",title:"text-white",button:"bg-gradient-to-r from-emerald-500 to-teal-500 hover:from-emerald-600 hover:to-teal-600 text-white rounded-full",paymentDetails:"rounded-lg",notice:"bg-cyan-50 border-cyan-200 text-cyan-800 rounded-lg",securityMessage:"text-white",helperText:"text-white"};case"seeker-2":return{container:"",card:"backdrop-blur-sm border-emerald-200 rounded-xl",icon:"bg-gradient-to-r from-emerald-500 to-teal-500",title:"text-white",button:"bg-gradient-to-r from-emerald-500 to-teal-500 hover:from-emerald-600 hover:to-teal-600 text-white rounded-full",paymentDetails:"rounded-lg",notice:"bg-cyan-50 border-cyan-200 text-cyan-800 rounded-lg",securityMessage:"text-white",helperText:"text-white"};case"terminal":return{container:"bg-gradient-to-br from-gray-900 via-black to-gray-800",card:"bg-black/90 backdrop-blur-sm border-green-400/30 text-green-400 rounded-xl",icon:"bg-green-400 text-black",title:"text-green-400 font-mono",button:"bg-green-400 text-black hover:bg-green-300 font-mono rounded-full",paymentDetails:"bg-gray-900/50 border-green-400/20 text-green-300 rounded-lg",notice:"bg-yellow-900/50 border-yellow-400/30 text-yellow-300 rounded-lg"};case"solana-light":return{container:"bg-gradient-to-b from-white via-pink-50 via-purple-50 via-blue-50 to-cyan-50",card:"bg-white/95 backdrop-blur-sm border border-slate-200 shadow-2xl rounded-2xl",icon:"bg-gradient-to-r from-blue-600 to-purple-600",title:"text-slate-900",button:"bg-solana-gradient hover:opacity-90 text-white font-light rounded-full",paymentDetails:"bg-slate-50 border border-slate-200 rounded-xl",notice:"text-slate-600",walletSection:"bg-slate-50 border border-slate-200 rounded-xl",securityMessage:"text-slate-600",helperText:"text-slate-600",helperLink:"text-purple-600 underline"};case"dark":return{container:"",card:"!bg-[#171719] border-slate-700 text-white rounded-xl",icon:"bg-slate-600",title:"",button:"bg-slate-600 hover:bg-slate-700 rounded-full",paymentDetails:"bg-[#0000001F] border-slate-600 text-white rounded-lg",walletSection:"bg-[#0000001F] border-slate-600 text-white rounded-lg",notice:"bg-amber-900/50 border-amber-700 text-white rounded-lg",securityMessage:"text-slate-400",helperText:"text-white",helperLink:void 0};case"light":return{container:"bg-gradient-to-b from-white via-pink-50 via-purple-50 via-blue-50 to-cyan-50",card:"bg-white/95 backdrop-blur-sm border border-slate-200 shadow-2xl rounded-2xl",icon:"bg-gradient-to-r from-blue-600 to-purple-600",title:"text-slate-900",button:"bg-black hover:bg-gray-800 text-white font-light rounded-full",paymentDetails:"bg-slate-50 border border-slate-200 rounded-xl",notice:"text-slate-600",walletSection:"bg-slate-50 border border-slate-200 rounded-xl",securityMessage:"text-slate-600",helperText:"text-slate-600",helperLink:"text-purple-600 underline"};default:return{container:"bg-gradient-to-br from-slate-900 via-slate-800 to-slate-900",card:"bg-white/95 backdrop-blur-sm rounded-xl",icon:"bg-slate-600",title:"text-slate-900",button:"bg-slate-600 hover:bg-slate-700 text-white rounded-full",paymentDetails:"bg-slate-50 border-slate-200 rounded-lg",notice:"bg-amber-50 border-amber-200 text-amber-800 rounded-lg"}}})();if(!X){const G=(()=>{switch(e){case"solana-dark":return{container:"",card:"!bg-[#171719] border-0 text-white rounded-xl",button:"bg-solana-gradient hover:opacity-90 text-white rounded-full",paymentDetails:"bg-[#0000001F] border-slate-600 text-white rounded-lg",securityMessage:"text-slate-400",helperText:"text-white"};case"seeker":return{container:"",card:"backdrop-blur-sm border-emerald-200 rounded-xl",button:"bg-gradient-to-r from-emerald-500 to-teal-500 hover:from-emerald-600 hover:to-teal-600 text-white rounded-full",paymentDetails:"rounded-lg",securityMessage:"text-white",helperText:"text-white"};case"seeker-2":return{container:"",card:"backdrop-blur-sm border-emerald-200 rounded-xl",button:"bg-gradient-to-r from-emerald-500 to-teal-500 hover:from-emerald-600 hover:to-teal-600 text-white rounded-full",paymentDetails:"rounded-lg",securityMessage:"text-white",helperText:"text-white"};case"terminal":return{container:"bg-gradient-to-br from-gray-900 via-black to-gray-800",card:"bg-black/90 backdrop-blur-sm border-green-400/30 text-green-400 rounded-xl",button:"bg-green-400 text-black hover:bg-green-300 font-mono rounded-full",paymentDetails:"bg-gray-900/50 border-green-400/20 text-green-300 rounded-lg",securityMessage:"text-green-300",helperText:"text-green-300"};case"solana-light":return{container:"bg-gradient-to-b from-white via-pink-50 via-purple-50 via-blue-50 to-cyan-50",card:"bg-white/95 backdrop-blur-sm border border-slate-200 shadow-2xl rounded-2xl",button:"bg-solana-gradient hover:opacity-90 text-white font-light rounded-full",paymentDetails:"bg-slate-50 border border-slate-200 rounded-xl",securityMessage:"text-slate-600",helperText:"text-slate-600"};case"dark":return{container:"",card:"!bg-[#171719] border-slate-700 text-white rounded-xl",button:"bg-slate-600 hover:bg-slate-700 rounded-full",paymentDetails:"bg-[#0000001F] border-slate-600 text-white rounded-lg",securityMessage:"text-slate-400",helperText:"text-white"};case"light":return{container:"bg-gradient-to-b from-white via-pink-50 via-purple-50 via-blue-50 to-cyan-50",card:"bg-white/95 backdrop-blur-sm border border-slate-200 shadow-2xl rounded-2xl",button:"bg-black hover:bg-gray-800 text-white font-light rounded-full",paymentDetails:"bg-slate-50 border border-slate-200 rounded-xl",securityMessage:"text-slate-600",helperText:"text-slate-600"};default:return{container:"bg-gradient-to-b from-white via-pink-50 via-purple-50 via-blue-50 to-cyan-50",card:"bg-white/95 backdrop-blur-sm border border-slate-200 shadow-2xl rounded-2xl",button:"bg-solana-gradient hover:opacity-90 text-white font-light rounded-full",paymentDetails:"bg-slate-50 border border-slate-200 rounded-xl",securityMessage:"text-slate-600",helperText:"text-slate-600"}}})();return t.jsx("div",{className:d("flex items-center justify-center min-h-screen p-4",G.container,b==null?void 0:b.container),style:e==="dark"?{background:"linear-gradient(to bottom left, #db2777 0%, #9333ea 50%, #1e40af 100%)",...s==null?void 0:s.container}:e==="light"?{background:"linear-gradient(135deg, rgba(255, 255, 255, 0.6) 0%, rgba(236, 72, 153, 0.4) 33%, rgba(147, 51, 234, 0.4) 66%, rgba(34, 211, 238, 0.4) 100%)",...s==null?void 0:s.container}:e==="seeker"?{background:"radial-gradient(25% 200% at 50% 50%, #6CCEC6 0%, rgba(19, 77, 128, 0) 30%), radial-gradient(20% 20% at 50% 100%, rgba(66, 202, 189, 0.8) 0%, rgba(33, 100, 94, 0.8) 0%), linear-gradient(180deg, #001214 5%, #0D2734 100%)",...s==null?void 0:s.container}:e==="seeker-2"?{background:"radial-gradient(25% 200% at 50% 50%, #6CCEC6 0%, rgba(19, 77, 128, 0) 30%), radial-gradient(20% 20% at 50% 100%, rgba(66, 202, 189, 0.8) 0%, rgba(33, 100, 94, 0.8) 0%), linear-gradient(180deg, #001214 5%, #0D2734 100%)",...s==null?void 0:s.container}:s==null?void 0:s.container,children:t.jsxs(ne,{className:d("w-full max-w-lg shadow-2xl border-0",G.card,b==null?void 0:b.card),style:e==="seeker"?{backgroundColor:"#171719",...s==null?void 0:s.card}:e==="seeker-2"?{backgroundColor:"rgba(29, 35, 35, 1)",backdropFilter:"blur(12px)",...s==null?void 0:s.card}:s==null?void 0:s.card,children:[t.jsxs(ie,{className:"pb-6",children:[t.jsxs("div",{className:"flex items-center space-x-4 mb-6",children:[t.jsx("div",{className:"w-auto h-auto rounded-full p-[2px] flex items-center justify-center overflow-hidden",children:t.jsx("div",{className:"w-full h-full rounded-full flex items-center justify-center",children:t.jsx("img",{src:x,alt:"Logo",className:"w-12 h-auto"})})}),t.jsxs("div",{children:[t.jsx(le,{className:d("text-l fw-bold pb-1",e==="dark"||e==="solana-dark"||e==="seeker"||e==="seeker-2"?"text-white":e==="terminal"?"text-green-400 font-mono":"text-slate-900",b==null?void 0:b.text),children:"Premium Content XYZ"}),t.jsx(de,{className:d("text-sm font-light",e==="terminal"?"text-green-300":e==="seeker"||e==="seeker-2"||e==="dark"||e==="solana-dark"?"text-white":"text-[#71717A]",b==null?void 0:b.text),children:"content.xyz"})]})]}),t.jsx("div",{className:d("border-b mb-6",e==="dark"||e==="solana-dark"?"border-slate-600":e==="seeker"||e==="seeker-2"?"":"border-slate-200"),style:e==="seeker"||e==="seeker-2"?{borderBottom:"1px solid #FFFFFF1F"}:void 0}),t.jsxs("div",{className:"text-center",children:[t.jsx("h2",{className:d("text-2xl font-normal mb-2",e==="dark"||e==="solana-dark"||e==="seeker"||e==="seeker-2"?"text-white":e==="terminal"?"text-green-400 font-mono":"text-slate-900"),children:"Payment Required"}),t.jsxs("p",{className:d("text-sm font-light",e==="dark"||e==="solana-dark"||e==="seeker"||e==="seeker-2"?"text-white":e==="terminal"?"text-green-300":"text-slate-600"),children:["Access to protected content. To access this content, please pay $",r.toFixed(2)," USDC"]})]})]}),t.jsxs(ae,{className:"space-y-6",children:[t.jsxs("div",{className:d("p-6",G.paymentDetails),style:e==="seeker"||e==="seeker-2"?{backgroundColor:"rgba(0, 0, 0, 0.12)"}:e==="dark"||e==="solana-dark"?{boxShadow:"0px 0px 16px 4px #000000 inset"}:void 0,children:[t.jsxs("div",{className:"flex items-center justify-between mb-4",children:[t.jsx("span",{className:d("text-sm",e==="dark"||e==="solana-dark"||e==="seeker"||e==="seeker-2"?"text-white":e==="terminal"?"text-green-300":"text-slate-900"),children:"Amount"}),t.jsxs("div",{className:d("text-xl font-bold",e==="light"||e==="solana-light"?"text-purple-600":e==="seeker"||e==="seeker-2"?"":e==="terminal"?"text-green-400":"text-[#21ECAB]"),style:e==="seeker"||e==="seeker-2"?{color:"#95D2E6"}:void 0,children:["$",r.toFixed(2)]})]}),t.jsx("div",{className:d("border-t mb-4",e==="dark"||e==="solana-dark"?"border-slate-600":e==="seeker"||e==="seeker-2"?"":e==="terminal"?"border-green-400/20":"border-slate-200"),style:e==="seeker"||e==="seeker-2"?{borderTop:"1px solid #FFFFFF1F"}:void 0}),t.jsxs("div",{className:"space-y-3",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("span",{className:d("text-sm",e==="dark"||e==="solana-dark"||e==="seeker"||e==="seeker-2"?"text-white":e==="terminal"?"text-green-300":"text-slate-900"),children:"Currency"}),t.jsx("div",{className:d("text-sm",e==="dark"||e==="solana-dark"||e==="seeker"||e==="seeker-2"?"text-white":e==="terminal"?"text-green-300":"text-slate-900"),children:"USDC"})]}),t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("span",{className:d("text-sm",e==="dark"||e==="solana-dark"||e==="seeker"||e==="seeker-2"?"text-white":e==="terminal"?"text-green-300":"text-slate-900"),children:"Network"}),t.jsxs("div",{className:"flex items-center space-x-2",children:[t.jsx("div",{className:"w-2 h-2 rounded-full bg-green-500"}),t.jsx("span",{className:d("text-sm",e==="dark"||e==="solana-dark"||e==="seeker"||e==="seeker-2"?"text-white":e==="terminal"?"text-green-300":"text-slate-900"),children:o==="solana"?"Mainnet":"Devnet"})]})]})]})]}),t.jsxs("div",{className:"flex items-center justify-center space-x-2",children:[t.jsxs("svg",{className:"w-4 h-4 text-green-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:"2",children:[t.jsx("path",{d:"M12 1L3 5v6c0 5.55 3.84 10.74 9 12 5.16-1.26 9-6.45 9-12V5l-9-4z"}),t.jsx("path",{d:"M9 12l2 2 4-4",strokeLinecap:"round",strokeLinejoin:"round"})]}),t.jsx("span",{className:d("text-sm",G.securityMessage),children:"Secure payment powered by Solana"})]}),t.jsxs("div",{className:"relative",children:[t.jsx("div",{ref:L,className:"absolute opacity-0 pointer-events-none -z-10",children:t.jsx(Pe.WalletMultiButton,{})}),t.jsx(te,{amount:r,description:a,customText:"Connect Wallet",onClick:()=>{var ke;const q=(ke=L.current)==null?void 0:ke.querySelector("button");q==null||q.click()},className:d("w-full h-12",G.button),style:e==="dark"?{backgroundColor:"#FFFFFF1F",boxShadow:"0 1px 0 0 rgba(255, 255, 255, 0.3) inset"}:e==="seeker"||e==="seeker-2"?{background:"linear-gradient(0deg, #39A298, #39A298), radial-gradient(101.17% 101.67% at 50.28% 134.17%, rgba(255, 255, 255, 0.6) 0%, rgba(22, 188, 174, 0.6) 100%)",backgroundColor:"transparent"}:void 0})]}),t.jsx("div",{className:"text-center",children:t.jsxs("p",{className:d("text-sm",G.helperText),children:["Don't have USDC?"," ",t.jsxs("a",{href:"#",className:"font-medium text-[#4ADE80] underline",children:["Get it here",t.jsx("svg",{className:"inline w-3 h-3 ml-1 text-[#4ADE80]",fill:"currentColor",viewBox:"0 0 20 20",children:t.jsx("path",{fillRule:"evenodd",d:"M10.293 3.293a1 1 0 011.414 0l6 6a1 1 0 010 1.414l-6 6a1 1 0 01-1.414-1.414L14.586 11H3a1 1 0 110-2h11.586l-4.293-4.293a1 1 0 010-1.414z",clipRule:"evenodd"})})]})]})})]})]})})}return t.jsx("div",{className:d("flex items-center justify-center min-h-screen p-4",$.container,b==null?void 0:b.container),style:e==="dark"?{background:"radial-gradient(circle at center, #ec4899 0%, #3b82f6 50%, #9333ea 100%)",...s==null?void 0:s.container}:e==="light"?{background:"linear-gradient(135deg, rgba(255, 255, 255, 0.6) 0%, rgba(236, 72, 153, 0.4) 33%, rgba(147, 51, 234, 0.4) 66%, rgba(34, 211, 238, 0.4) 100%)",...s==null?void 0:s.container}:e==="seeker"?{background:"radial-gradient(25% 200% at 50% 50%, #6CCEC6 0%, rgba(19, 77, 128, 0) 30%), radial-gradient(20% 20% at 50% 100%, rgba(66, 202, 189, 0.8) 0%, rgba(33, 100, 94, 0.8) 0%), linear-gradient(180deg, #001214 5%, #0D2734 100%)",...s==null?void 0:s.container}:e==="seeker-2"?{background:"radial-gradient(25% 200% at 50% 50%, #6CCEC6 0%, rgba(19, 77, 128, 0) 30%), radial-gradient(20% 20% at 50% 100%, rgba(66, 202, 189, 0.8) 0%, rgba(33, 100, 94, 0.8) 0%), linear-gradient(180deg, #001214 5%, #0D2734 100%)",...s==null?void 0:s.container}:s==null?void 0:s.container,children:t.jsxs(ne,{className:d("w-full max-w-lg shadow-2xl border-0",$.card,b==null?void 0:b.card),style:e==="seeker"?{backgroundColor:"#171719",...s==null?void 0:s.card}:e==="seeker-2"?{backgroundColor:"rgba(29, 35, 35, 1)",backdropFilter:"blur(12px)",...s==null?void 0:s.card}:s==null?void 0:s.card,children:[t.jsxs(ie,{className:"pb-6",children:[t.jsxs("div",{className:"flex items-center space-x-4 mb-6",children:[t.jsx("div",{className:"w-auto h-auto rounded-full p-[2px] flex items-center justify-center overflow-hidden",children:t.jsx("div",{className:"w-full h-full rounded-full flex items-center justify-center",children:t.jsx("img",{src:x,alt:"Logo",className:"w-12 h-auto"})})}),t.jsxs("div",{children:[t.jsx(le,{className:d("text-l fw-bold pb-1",$.title,b==null?void 0:b.text),style:s==null?void 0:s.text,children:"Premium Content XYZ"}),t.jsx(de,{className:d("text-sm font-light",e==="terminal"?"text-green-300":e==="seeker"||e==="seeker-2"?"text-white":"text-[#71717A]"),children:"content.xyz"})]})]}),t.jsx("div",{className:d("border-b mb-6",e==="dark"||e==="solana-dark"?"border-slate-600":e==="seeker"||e==="seeker-2"?"":"border-slate-200"),style:e==="seeker"?{borderBottom:"1px solid #FFFFFF1F"}:e==="seeker-2"?{borderBottom:"1px solid #FFFFFF1F"}:void 0}),!D&&t.jsxs("div",{className:"text-center",children:[t.jsx("h2",{className:d("text-2xl font-normal mb-2",e==="dark"||e==="solana-dark"||e==="seeker"||e==="seeker-2"?"text-white":"text-slate-900"),children:"Payment Required"}),t.jsx("p",{className:d("text-sm font-light",e==="dark"||e==="solana-dark"||e==="seeker"||e==="seeker-2"?"text-white":"text-slate-600"),children:"Access to protected content on base-sepolia. To access this content, please pay $0.01 Base Sepolia USDC"})]})]}),t.jsx(ae,{className:"space-y-6",children:D?t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"flex justify-center mb-4",children:t.jsx("div",{className:"w-16 h-16 rounded-full bg-red-500 flex items-center justify-center",children:t.jsx("svg",{className:"w-8 h-8 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:"3",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})}),t.jsx("div",{className:"text-center mb-2",children:t.jsx("h3",{className:d("text-2xl font-semibold",e==="dark"||e==="solana-dark"||e==="seeker"||e==="seeker-2"?"text-white":"text-slate-900"),children:"Payment Failed"})}),t.jsx("p",{className:d("text-center text-sm mb-6",e==="dark"||e==="solana-dark"||e==="seeker"||e==="seeker-2"?"text-gray-400":"text-slate-600"),children:(E==null?void 0:E.message)||"It looks like your wallet doesn't have enough funds or the transaction was declined. Please review the details and try again."}),t.jsx("div",{className:d("rounded-lg p-6",e==="dark"||e==="solana-dark"?"bg-[#0000001F] border border-slate-600":e==="seeker"||e==="seeker-2"?"bg-[rgba(0,0,0,0.12)] border border-white/10":"bg-slate-50 border border-slate-200"),children:t.jsxs("div",{className:"space-y-3",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("span",{className:d("text-sm",e==="dark"||e==="solana-dark"||e==="seeker"||e==="seeker-2"?"text-white":"text-slate-900"),children:"Amount Paid"}),t.jsxs("span",{className:d("text-sm font-semibold",e==="light"||e==="solana-light"?"text-purple-600":"text-green-500"),children:["$",r.toFixed(2)]})]}),t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("span",{className:d("text-sm",e==="dark"||e==="solana-dark"||e==="seeker"||e==="seeker-2"?"text-white":"text-slate-900"),children:"Wallet"}),t.jsx("span",{className:d("text-sm",e==="dark"||e==="solana-dark"||e==="seeker"||e==="seeker-2"?"text-white":"text-slate-900"),children:(he=g==null?void 0:g.publicKey)!=null&&he.toString()?`${g.publicKey.toString().slice(0,6)}...${g.publicKey.toString().slice(-4)}`:g!=null&&g.address?`${g.address.slice(0,6)}...${g.address.slice(-4)}`:"Not connected"})]}),t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("span",{className:d("text-sm",e==="dark"||e==="solana-dark"||e==="seeker"||e==="seeker-2"?"text-white":"text-slate-900"),children:"Available Balance"}),t.jsxs("span",{className:d("text-sm",e==="dark"||e==="solana-dark"||e==="seeker"||e==="seeker-2"?"text-white":"text-slate-900"),children:["$",T]})]}),t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("span",{className:d("text-sm",e==="dark"||e==="solana-dark"||e==="seeker"||e==="seeker-2"?"text-white":"text-slate-900"),children:"Currency"}),t.jsx("span",{className:d("text-sm",e==="dark"||e==="solana-dark"||e==="seeker"||e==="seeker-2"?"text-white":"text-slate-900"),children:"USDC"})]}),t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("span",{className:d("text-sm",e==="dark"||e==="solana-dark"||e==="seeker"||e==="seeker-2"?"text-white":"text-slate-900"),children:"Network"}),t.jsxs("div",{className:"flex items-center space-x-2",children:[t.jsx("div",{className:"w-2 h-2 rounded-full bg-green-500"}),t.jsx("span",{className:d("text-sm",e==="dark"||e==="solana-dark"||e==="seeker"||e==="seeker-2"?"text-white":"text-slate-900"),children:B})]})]})]})}),t.jsxs("div",{className:d("rounded-lg p-4 flex items-start space-x-3",e==="dark"||e==="solana-dark"||e==="seeker"||e==="seeker-2"?"bg-orange-900/50 border border-orange-700":"bg-orange-50 border border-orange-200"),children:[t.jsx("div",{className:"flex-shrink-0",children:t.jsx("div",{className:"w-6 h-6 rounded-full bg-orange-500 flex items-center justify-center",children:t.jsx("svg",{className:"w-4 h-4 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:"2",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})})})}),t.jsx("p",{className:d("text-sm",e==="dark"||e==="solana-dark"||e==="seeker"||e==="seeker-2"?"text-white":"text-orange-800"),children:"Make sure your Solana wallet has enough USDC to cover the amount before retrying the transaction."})]}),t.jsx(te,{amount:r,description:a,onClick:()=>{se(),Z()},loading:V,disabled:V||!(g!=null&&g.publicKey),className:d("w-full h-12",e==="dark"||e==="solana-dark"?e==="dark"?"bg-[#FFFFFF1F] rounded-full":"bg-solana-gradient rounded-full":e==="light"?"bg-black hover:bg-gray-800 text-white font-light rounded-full":e==="solana-light"?"bg-solana-gradient hover:opacity-90 text-white font-light rounded-full":e==="seeker"||e==="seeker-2"?"bg-gradient-to-r from-emerald-500 to-teal-500 hover:from-emerald-600 hover:to-teal-600 text-white rounded-full":"bg-solana-gradient rounded-full",b==null?void 0:b.button),style:e==="dark"?{backgroundColor:"#FFFFFF1F",boxShadow:"0 1px 0 0 rgba(255, 255, 255, 0.3) inset",...s==null?void 0:s.button}:e==="light"||e==="solana-light"?s==null?void 0:s.button:e==="seeker"?{background:"linear-gradient(0deg, #39A298, #39A298), radial-gradient(101.17% 101.67% at 50.28% 134.17%, rgba(255, 255, 255, 0.6) 0%, rgba(22, 188, 174, 0.6) 100%)",backgroundColor:"transparent",...s==null?void 0:s.button}:e==="seeker-2"?{background:"linear-gradient(0deg, #39A298, #39A298), radial-gradient(101.17% 101.67% at 50.28% 134.17%, rgba(255, 255, 255, 0.6) 0%, rgba(22, 188, 174, 0.6) 100%)",backgroundColor:"transparent",...s==null?void 0:s.button}:s==null?void 0:s.button,customText:"Try Again"}),t.jsx("div",{className:"text-center",children:t.jsxs("p",{className:d("text-sm",e==="dark"||e==="solana-dark"||e==="seeker"||e==="seeker-2"?"text-white":"text-slate-900"),children:[t.jsxs("span",{className:d(e==="dark"||e==="solana-dark"||e==="seeker"||e==="seeker-2"?"text-gray-400":"text-slate-600"),children:["Don't have USDC?"," "]}),t.jsxs("a",{href:"https://www.coinbase.com/how-to-buy/usdc",target:"_blank",rel:"noopener noreferrer",className:d("font-medium hover:opacity-80",e==="light"||e==="solana-light"?"text-purple-600":"text-green-400 hover:text-green-300"),children:["Get it here",t.jsx("svg",{className:d("inline w-3 h-3 ml-1",e==="light"||e==="solana-light"?"text-purple-600":"text-green-400"),fill:"currentColor",viewBox:"0 0 20 20",children:t.jsx("path",{fillRule:"evenodd",d:"M10.293 3.293a1 1 0 011.414 0l6 6a1 1 0 010 1.414l-6 6a1 1 0 01-1.414-1.414L14.586 11H3a1 1 0 110-2h11.586l-4.293-4.293a1 1 0 010-1.414z",clipRule:"evenodd"})})]})]})})]}):t.jsxs(t.Fragment,{children:[t.jsx(fe,{wallet:g,onDisconnect:Y,theme:e,className:d("mb-4",(e==="dark"||e==="solana-dark")&&"bg-[#0000001F] border-slate-600 text-white"),style:e==="dark"||e==="solana-dark"?{boxShadow:"0px 0px 16px 4px #000000 inset"}:void 0}),f&&(e==="seeker"||e==="seeker-2"?t.jsxs("div",{className:d("p-6",$.paymentDetails),style:{backgroundColor:"rgba(0, 0, 0, 0.12)"},children:[t.jsxs("div",{className:"flex items-center justify-between mb-4",children:[t.jsx("span",{className:"text-sm text-white",children:"Amount"}),t.jsx("div",{className:"text-xl font-bold",style:{color:"#95D2E6"},children:r.toFixed(2)})]}),t.jsx("div",{className:"border-t mb-4",style:{borderTop:"1px solid #FFFFFF1F"}}),t.jsxs("div",{className:"space-y-3",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("span",{className:"text-sm text-white",children:"Wallet"}),t.jsx("div",{className:"text-sm text-white",children:(we=g==null?void 0:g.publicKey)!=null&&we.toString()?`${g.publicKey.toString().slice(0,6)}...${g.publicKey.toString().slice(-4)}`:g!=null&&g.address?`${g.address.slice(0,6)}...${g.address.slice(-4)}`:"Not connected"})]}),t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("span",{className:"text-sm text-white",children:"Available Balance"}),t.jsxs("div",{className:"text-sm text-white",children:["$",T]})]}),t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("span",{className:"text-sm text-white",children:"Currency"}),t.jsx("div",{className:"text-sm text-white",children:"USDC"})]}),t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("span",{className:"text-sm text-white",children:"Network"}),t.jsxs("div",{className:"flex items-center space-x-2",children:[t.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:"#95D2E6"}}),t.jsx("span",{className:"text-sm text-white",children:B})]})]})]})]}):t.jsxs("div",{className:d("p-6",$.paymentDetails),style:e==="dark"||e==="solana-dark"?{boxShadow:"0px 0px 16px 4px #000000 inset"}:void 0,children:[t.jsxs("div",{className:"flex items-center justify-between mb-4",children:[t.jsx("span",{className:d("text-sm",e==="dark"||e==="solana-dark"?"text-white":"text-black"),children:"Amount"}),t.jsxs("div",{className:d("text-xl font-bold",e==="light"||e==="solana-light"?"text-purple-600":"text-[#21ECAB]"),children:["$",r.toFixed(2)]})]}),t.jsx("div",{className:d("border-t mb-4",e==="dark"||e==="solana-dark"?"border-slate-600":"border-slate-200")}),t.jsxs("div",{className:"space-y-3",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("span",{className:d("text-sm",e==="dark"||e==="solana-dark"?"text-white":"text-black"),children:"Wallet"}),t.jsx("div",{className:d("text-sm",e==="dark"||e==="solana-dark"?"text-white":"text-slate-900"),children:(me=g==null?void 0:g.publicKey)!=null&&me.toString()?`${g.publicKey.toString().slice(0,6)}...${g.publicKey.toString().slice(-4)}`:g!=null&&g.address?`${g.address.slice(0,6)}...${g.address.slice(-4)}`:"Not connected"})]}),t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("span",{className:d("text-sm",e==="dark"||e==="solana-dark"?"text-white":"text-black"),children:"Available Balance"}),t.jsxs("div",{className:d("text-sm",e==="dark"||e==="solana-dark"?"text-white":"text-slate-900"),children:["$",T]})]}),t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("span",{className:d("text-sm",e==="dark"||e==="solana-dark"?"text-white":"text-black"),children:"Currency"}),t.jsx("div",{className:d("text-sm",e==="dark"||e==="solana-dark"?"text-white":"text-slate-900"),children:"USDC"})]}),t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("span",{className:d("text-sm",e==="dark"||e==="solana-dark"?"text-white":"text-black"),children:"Network"}),t.jsxs("div",{className:"flex items-center space-x-2",children:[t.jsx("div",{className:d("w-2 h-2 rounded-full","bg-green-500")}),t.jsx("span",{className:d("text-sm",e==="dark"||e==="solana-dark"?"text-white":"text-slate-900"),children:B})]})]})]})]})),t.jsxs("div",{className:"flex items-center justify-center space-x-2",children:[t.jsxs("svg",{className:"w-4 h-4 text-green-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:"2",children:[t.jsx("path",{d:"M12 1L3 5v6c0 5.55 3.84 10.74 9 12 5.16-1.26 9-6.45 9-12V5l-9-4z"}),t.jsx("path",{d:"M9 12l2 2 4-4",strokeLinecap:"round",strokeLinejoin:"round"})]}),t.jsx("span",{className:d("text-sm",$.securityMessage),style:e==="seeker"?{color:"#FFFFFF66"}:e==="seeker-2"?{color:"#FFFFFF66"}:void 0,children:"Secure payment powered by Solana"})]}),t.jsx(te,{amount:r,description:a,onClick:Z,loading:V,disabled:V||!(g!=null&&g.publicKey),className:d("w-full h-12",e==="dark"||e==="solana-dark"?e==="dark"?"bg-[#FFFFFF1F] rounded-full":"bg-solana-gradient rounded-full":$.button,b==null?void 0:b.button),style:e==="dark"?{backgroundColor:"#FFFFFF1F",boxShadow:"0 1px 0 0 rgba(255, 255, 255, 0.3) inset",...s==null?void 0:s.button}:e==="seeker"?{background:"linear-gradient(0deg, #39A298, #39A298), radial-gradient(101.17% 101.67% at 50.28% 134.17%, rgba(255, 255, 255, 0.6) 0%, rgba(22, 188, 174, 0.6) 100%)",backgroundColor:"transparent",...s==null?void 0:s.button}:e==="seeker-2"?{background:"linear-gradient(0deg, #39A298, #39A298), radial-gradient(101.17% 101.67% at 50.28% 134.17%, rgba(255, 255, 255, 0.6) 0%, rgba(22, 188, 174, 0.6) 100%)",backgroundColor:"transparent",...s==null?void 0:s.button}:s==null?void 0:s.button}),E&&t.jsx("div",{className:"bg-red-50 border border-red-200 rounded-lg p-4",children:t.jsxs("p",{className:"text-sm text-red-800 text-center",children:[t.jsx("span",{className:"font-semibold",children:"Payment Error:"})," ",E.message]})}),t.jsx("div",{className:"text-center",children:t.jsxs("p",{className:d("text-sm",$.helperText),children:[t.jsxs("span",{style:e==="seeker"?{color:"#FFFFFF66"}:e==="seeker-2"?{color:"#FFFFFF66"}:void 0,children:["Don't have USDC?"," "]}),t.jsxs("a",{href:"#",className:d("font-medium",e==="seeker"||e==="seeker-2"?"text-[#4ADE80]":$.helperLink||"text-[#4ADE80]"),style:e==="seeker"?{color:"#4ADE80"}:e==="seeker-2"?{color:"#4ADE80"}:void 0,children:["Get it here",t.jsx("svg",{className:d("inline w-3 h-3 ml-1",e==="light"?"text-purple-600":"text-[#4ADE80]"),fill:"currentColor",viewBox:"0 0 20 20",children:t.jsx("path",{fillRule:"evenodd",d:"M10.293 3.293a1 1 0 011.414 0l6 6a1 1 0 010 1.414l-6 6a1 1 0 01-1.414-1.414L14.586 11H3a1 1 0 110-2h11.586l-4.293-4.293a1 1 0 010-1.414z",clipRule:"evenodd"})})]})]})})]})})]})})},Ue=({autoSetupProviders:r=!0,providerNetwork:a,providerEndpoint:n,...o})=>{const i=a??(o.network==="solana"?ye.WalletAdapterNetwork.Mainnet:ye.WalletAdapterNetwork.Devnet),l=A.useMemo(()=>n||o.rpcUrl||P.clusterApiUrl(i),[n,o.rpcUrl,i]),c=A.useMemo(()=>[new je.PhantomWalletAdapter,new je.SolflareWalletAdapter],[]);return r?t.jsx(ue.ConnectionProvider,{endpoint:l,children:t.jsx(ue.WalletProvider,{wallets:c,autoConnect:!0,children:t.jsx(Pe.WalletModalProvider,{children:t.jsx(Te,{...o})})})}):t.jsx(Te,{...o})};Ue.displayName="X402Paywall";const Ke=({status:r,message:a,progress:n,className:o,style:i})=>{const c=(()=>{switch(r){case"idle":return{label:"Ready",color:"bg-gray-100 text-gray-800",icon:null};case"connecting":return{label:"Connecting",color:"bg-blue-100 text-blue-800",icon:t.jsx(oe,{size:"sm",variant:"default"})};case"pending":return{label:"Processing",color:"bg-yellow-100 text-yellow-800",icon:t.jsx(oe,{size:"sm",variant:"solana"})};case"success":return{label:"Paid",color:"bg-green-100 text-green-800",icon:t.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})})};case"error":return{label:"Failed",color:"bg-red-100 text-red-800",icon:t.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})};default:return{label:"Unknown",color:"bg-gray-100 text-gray-800",icon:null}}})();return t.jsxs("div",{className:d("flex flex-col gap-2",o),style:i,children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsxs(pe,{className:d("flex items-center gap-1.5",c.color),children:[c.icon,t.jsx("span",{children:c.label})]}),a&&t.jsx("span",{className:"text-sm text-muted-foreground",children:a})]}),n!==void 0&&n>0&&t.jsx("div",{className:"w-full bg-gray-200 rounded-full h-2 overflow-hidden",children:t.jsx("div",{className:"bg-solana-gradient h-full transition-all duration-300",style:{width:`${n}%`}})})]})};Ke.displayName="PaymentStatus";exports.Badge=pe;exports.Button=ge;exports.Card=ne;exports.CardContent=ae;exports.CardDescription=de;exports.CardHeader=ie;exports.CardTitle=le;exports.PaymentButton=te;exports.PaymentStatus=Ke;exports.Spinner=oe;exports.WalletSection=fe;exports.X402Paywall=Ue;exports.cn=d;exports.useX402Payment=Ge;
2
2
  //# sourceMappingURL=index.js.map