PageSourceSearch

https://ordinalswallet.com/_next/static/chunks/05g.k~q6p-_.g.js

js ordinalswallet.com collected 2026-10-03 20:14:11 UTC 26,174 bytes, 3 lines download raw bytes

1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,302747,e=>{"use strict";var t=e.i(657941),s=e.i(975157);e.s(["Skeleton",0,function({className:e,...r}){return(0,t.jsx)("div",{className:(0,s.cn)("animate-pulse rounded-md bg-foreground/[0.08] dark:bg-foreground/[0.12]",e),...r})}])},834042,e=>{e.v({root:"UserIconStatic-module__enfgya__root"})},838456,e=>{"use strict";var t=e.i(657941),s=e.i(958922),r=e.i(264458),a=e.i(231270),l=e.i(430494),i=e.i(834042);let n=({src:e})=>e;e.s(["default",0,e=>{let{size:o,inscription:u,borderSize:d,defaultGradientId:c,className:f}=e,[m,p]=s.default.useState(!1),x=s.default.useMemo(()=>o||30,[o]),g=s.default.useMemo(()=>e?.src?e.src:u&&u?.id?`${l.CDN_URL}/${u?.id}`:"/default-pfp.png",[e.src,u]),h=d?x+d:x;return(0,t.jsx)("div",{className:(0,r.default)(i.default.root,{[e.className??""]:!!f}),style:{height:`${h}px`,minHeight:`${h}px`,minWidth:`${h}px`},children:g&&!m&&(0,t.jsx)(a.default,{alt:"Icon",loader:n,className:e.iconClassName,height:x,width:x,src:g,unoptimized:!0,priority:!0,onError:()=>p(!0)})})}])},106990,e=>{"use strict";var t=e.i(657941),s=e.i(265358);e.s(["default",0,e=>(0,t.jsx)("svg",{onClick:e.onClick,viewBox:"0 0 24 24",fill:"none",className:e.className,width:e.width,height:e.height,role:e.onClick?"button":void 0,tabIndex:e.onClick?0:void 0,onKeyDown:(0,s.onKeyboardClick)(e.onClick),children:(0,t.jsx)("path",{d:"M12 20H21M16.5 3.5C16.9 3.1 17.44 2.88 18 2.88C18.28 2.88 18.55 2.93 18.81 3.04C19.07 3.15 19.3 3.3 19.5 3.5C19.7 3.7 19.85 3.93 19.96 4.19C20.07 4.45 20.12 4.72 20.12 5C20.12 5.28 20.07 5.55 19.96 5.81C19.85 6.07 19.7 6.3 19.5 6.5L7 19L3 20L4 16L16.5 3.5Z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})])},819222,e=>{"use strict";let t=(0,e.i(157205).default)("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);e.s(["Clock",0,t],819222)},740514,369929,835827,e=>{"use strict";var t=e.i(657941),s=e.i(958922),r=e.i(650653),a=e.i(178252),l=e.i(264458),i=e.i(793479),n=e.i(317056),o=e.i(914525),u=e.i(467746),d=e.i(640299),c=e.i(430494),f=e.i(741787),m=e.i(922140),p=e.i(998031),x=e.i(964410),g=e.i(734580),h=e.i(911315),b=e.i(692557),v=e.i(355864),w=e.i(268888),j=e.i(190381),N=e.i(361664),y=e.i(689932),S=e.i(779363),k=e.i(79885);e.s(["default",0,e=>{let{onClose:C}=e,{toast:$}=(0,m.useToast)(),{exchangeRate:F}=(0,d.default)(),_=f.default.getTaprootAddress(),{data:I,isLoading:T}=(0,x.default)(),[E,z]=s.default.useState(null),[P,L]=s.default.useState({}),{data:O,isLoading:R}=(0,a.default)(_?`${c.API_URL}/wallet/${_}/import-listings`:null,async e=>{try{let{data:t}=await r.default.get(e);return t}catch(e){return z(e?.response?.data?.message||e?.message||"Failed to fetch listings"),null}},{revalidateOnFocus:!1}),A=s.default.useMemo(()=>O?.listings||[],[O]),M=I?.inscriptions,U=s.default.useMemo(()=>{if(!M||!A.length)return[];let e=new Map;for(let t of M)e.set(t.id,t);let t=[];for(let s of A){let r=e.get(s.id);r&&t.push({listing:s,inscription:r})}return t},[M,A]);s.default.useEffect(()=>{if(!U.length)return;let e={};for(let{listing:t}of U)e[t.id]=t.price/1e8;requestAnimationFrame(()=>{L(e)})},[U]);let B=s.default.useMemo(()=>U.map(e=>e.listing.id),[U]),{selected:W,setSelected:D,onSelect:K,onSelectAll:V,allSelected:X}=(0,b.default)(B);s.default.useEffect(()=>{B.length>0&&requestAnimationFrame(()=>{D(new Set(B))})},[B,D]);let q=s.default.useCallback(e=>t=>{let s=t.target.value;L(t=>({...t,[e]:parseFloat(s)||0}))},[]),{selectedCount:Y,totalPrice:G,totalPriceUsd:H}=s.default.useMemo(()=>{let e=0,t=0;for(let[s]of Array.from(W.entries()))e+=1e8*(P[s]||0),t++;return{selectedCount:t,totalPrice:(0,u.formatSatoshis)(e),totalPriceUsd:(0,o.default)((e/1e8*F)?.toFixed(2))}},[W,P,F]),J=(0,N.useSnipeProtection)("ordinal",null),Z=s.default.useCallback(async()=>{try{let e=[],t=[];for(let[s]of Array.from(W.entries()))e.push(s),t.push(parseInt((1e8*(P[s]||0)).toFixed(0)));let s=U.filter(({listing:e})=>W.has(e.id)),a={inscriptionIds:s.map(e=>e.inscription?.id||e.listing.id),collectionSlugs:s.map(e=>e.inscription?.collection?.slug||e.listing.collection)};if(J.enabled){let s=await (0,S.listSecureItems)(e.map((e,s)=>
1({inscriptionId:e,priceSats:t[s],protocol:(0,j.protocolFromInscription)(U.find(t=>t.listing.id===e)?.inscription||{})}))),r=(0,S.describeSecureListingResult)(s,"inscriptions");(0,k.toastListingSuccess)({title:r.title,description:r.description,...r.failed?{variant:"destructive"}:{},isolate:(0,S.isolateTargetForFailures)(s.failures,e.map(e=>{let t=U.find(t=>t.listing.id===e);return{inscriptionId:t?.inscription?.id||e,outpoint:t?.inscription?.outpoint}}),a.collectionSlugs?.[0]??null),count:s.listed,...a}),r.failed||C();return}let l=await f.default.getEscrows(e,t,{forceBulk:(0,p.default)("app::disable_bulk")}),i=0,n=0,u=[];if(Array.isArray(l))for(let e of l){let{rawtx:t}=await f.default.signEscrow(e),{data:s}=await r.default.post(`${c.API_URL}/market/escrow-bulk`,{psbt:t}),a=f.default.assertEscrowResponse(s);i+=a.createdEscrows,n+=a.skippedInputsCount,u=u.concat(a.skippedInputs||[])}else{let{rawtx:e}=await f.default.signEscrow(l),{data:t}=await r.default.post(`${c.API_URL}/market/escrow-bulk`,{psbt:e}),s=f.default.assertEscrowResponse(t);i+=s.createdEscrows,n+=s.skippedInputsCount,u=u.concat(s.skippedInputs||[])}if(i<=0)throw Error("No escrows were created");if(n>0){let e=f.default.formatEscrowSkips(u);(0,k.toastListingSuccess)({title:"Partially Listed",description:`Created ${(0,o.default)(i)} escrows. Skipped ${(0,o.default)(n)} inputs${e?`: ${e}`:"."}.`,count:i,...a})}else(0,k.toastListingSuccess)({title:"Success!",description:`You listed ${(0,o.default)(Y)} inscriptions`,count:Y,...a});C()}catch(e){$({title:"Error",description:e?.response?.data?.message||e?.message||"Unable to list item",variant:"destructive"})}},[C,W,P,$,Y,U,J.enabled]),Q="0"===G,ee=s.default.useCallback(({listing:e,inscription:s})=>{let r=W.has(e.id),a=P[e.id];return(0,t.jsx)(n.CommandItem,{value:e.id,onSelect:()=>K(e.id),className:"data=[cmdk-item]:py-0.5",children:(0,t.jsxs)("div",{className:"flex justify-between w-full",children:[(0,t.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,t.jsx)(v.default,{onSelect:()=>K(e.id),selected:r}),(0,t.jsx)(g.default,{inscription:s,className:"size-6"}),s?.meta?.name||s?.collection?.name||`#${s?.num}`]}),(0,t.jsx)("div",{className:"flex gap-2 items-center",children:(0,t.jsx)(i.Input,{value:r&&a?a:"",placeholder:"--",onClick:e=>r&&e.stopPropagation(),onKeyDown:e=>r&&e.stopPropagation(),onChange:q(e.id),type:"number",step:1e-4,className:(0,l.default)("text-xs py-0 px-2 h-7 w-24 [appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none",{"text-muted-foreground":!a})})})]})},e.id)},[W,P,K,q]);return R||T?(0,t.jsx)("div",{className:"flex justify-center pt-8",children:(0,t.jsx)(h.Loading,{size:16})}):E?(0,t.jsx)("p",{className:"text-xs text-red-500 text-center pt-8",children:E}):0===U.length?(0,t.jsx)("p",{className:"text-xs text-muted-foreground text-center pt-8",children:"No external listings found."}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"flex justify-between items-center px-2 py-3",children:[(0,t.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,t.jsx)(v.default,{selected:X,onSelect:V}),(0,t.jsxs)("p",{className:"text-xs text-muted-foreground select-none",children:[U.length," external listing",1!==U.length?"s":""]})]}),(0,t.jsxs)("p",{className:"text-xs text-muted-foreground select-none",children:["Price (",c.NETWORK,")"]})]}),U.map(ee),(0,t.jsx)(w.default,{open:W.size>0,onSubmit:Z,disabled:Q,action:Q?"Please set a price":`List ${(0,o.default)(Y)} inscriptions`,items:[{title:"You Receive",value:`${G} ${c.NETWORK} / $${H}`},...(0,y.snipeProtectionInvoiceItem)(J.offered)]})]})}],740514);var C=e.i(459855),$=e.i(205536),F=e.i(424539),_=e.i(772401),I=e.i(721291),T=e.i(819222),E=e.i(367692),z=e.i(917157),P=e.i(673635),L=e.i(504857),O=e.i(106990),R=e.i(265358);function A(e){return/^(bc1p|tb1p|bcrt1p)/.test(e)?43:/^(bc1|tb1|bcrt1)/.test(e)?e.length>44?43:31:/^[32]/.test(e)?32:34}let M=/insufficient funds:\s*(\d+)\s*sat available of\s*(\d+)\s*sat needed/i;function U(e){var t;return Math.ceil((e.inputCount*(t=e.from,/^(bc1p|tb1p|bcrt1p)/.test(t)?61:/^(bc1|tb1|bcrt1)/.test(t)?t.length>44?110:72:/^[32]/.test(t)?95:152)+e.numOutputs*A(e.toAddress)+A(e.from)+31+11)*e.feeRate)+2500+e.dustLimit}
1class B extends Error{shortBy;constructor(e,t){super(e),this.shortBy=t,this.name="InsufficientFundsError"}}async function W(e){let{totalValue:t,numOutputs:s,toAddress:r,from:a,dustLimit:l,build:i,psbtFee:n,psbtOutputValueTo:o,maxAttempts:u=6}=e,d=l*s;if(t<=d)throw new B(`Not enough balance to fund ${s} output${1!==s?"s":""} — select more UTXOs or use fewer outputs`,d-t);let c=Math.max(d,t-U(e)),f=null,m=!1,p=0,x=null;for(let e=0;e<u;e++){let t;p++;try{t=await i(function(e,t,s){let r=Math.floor(t/s),a=t-r*s;return Array(s).fill(null).map((t,s)=>[e,r+(0===s?a:0)])}(r,c,s))}catch(s){x=s;let e=function(e){let t=M.exec(String(e??""));if(!t)return null;let s=Number(t[2])-Number(t[1]);return Number.isFinite(s)&&s>0?s:null}(s?.message);if(null===e){if(f)break;throw s}let t=c-e;if(t<d){if(f)break;throw new B(`Not enough balance to cover fees at this rate — need ~${(d-t).toLocaleString()} more sats`,d-t)}c=t,m=!0;continue}if(f={psbt:t.psbt,outputValue:c},m)break;let l=o(t.psbt,a)-(r===a?c:0);if(l>0&&e<u-1){c+=l;continue}break}if(!f){if(x)throw x;throw new B("Could not build transaction",null)}let g=n(f.psbt);return{psbt:f.psbt,outputValue:f.outputValue,networkFee:g,serviceFee:Math.max(0,t-f.outputValue-g),attempts:p}}function D(e){return e&&Number.isFinite(e)&&e>1e3?Math.ceil(100/e*1e8):12e4}e.i(503762);let K=new Set(["bc1p57msm5hvxfhsf0hqers4vg5nr42ytpx2s4j8kg57dz9awqvmez9sj92gc3","bc1p38khw2e6pl8324n9styk6ch2u4spu4a893azt6l5fhywmspeqzjsvgjmfm"]),V="ow:split-prompt-source";function X(){try{let e=sessionStorage.getItem(V);return sessionStorage.removeItem(V),e}catch{return null}}function q(e,t){return`ow:split-prompt:${e}:${t}`}async function Y(e){try{let t=await fetch(`${c.API_URL}/site/split-prompt/seen/${encodeURIComponent(e)}`);
1if(!t.ok)return 404!==t.status;let s=await t.json();return!1!==s.seen}catch{return!0}}let G=/^[0-9a-f]{7,40}$/.test(String("01fd35a081d39990f297554b39c820c7c9e69a58"))?String("01fd35a081d39990f297554b39c820c7c9e69a58").slice(0,7):"";function H(e,t,s={},r={}){try{fetch(`${c.API_URL}/site/split-prompt`,{method:"POST",headers:{"content-type":"application/json"},keepalive:!0,body:JSON.stringify({address:t,kind:e,largest_sats:Math.round(s.largestSats||0),total_sats:Math.round(s.totalSats||0),utxo_count:s.utxoCount||0,wallet:r.wallet||"",build:G,txid:r.txid||""})}).catch(()=>{})}catch{}}e.s(["SPLIT_PROMPT_FLAG",0,"wallet::split_prompt","claimDailyMeasure",0,function(e,t=new Date){let s=t.toISOString().slice(0,10);try{if(localStorage.getItem(q("measured",e))===s)return!1;localStorage.setItem(q("measured",e),s)}catch{}return!0},"isSnoozed",0,function(e,t=Date.now()){try{let s=Number(localStorage.getItem(q("snoozed",e)));return Number.isFinite(s)&&s>t}catch{return!1}},"isSplitPromptTester",0,function(e){return!!e&&K.has(e.toLowerCase())},"markSeen",0,function(e){try{localStorage.setItem(q("seen",e),"1")}catch{}},"markSplitFromPrompt",0,function(e){try{sessionStorage.setItem(V,e)}catch{}},"measureUtxos",0,function(e){let t=(e||[]).map(e=>Number(e?.value)).filter(e=>Number.isFinite(e)&&e>0);return{largestSats:t.reduce((e,t)=>t>e?t:e,0),totalSats:t.reduce((e,t)=>e+t,0),utxoCount:t.length,usableCount:t.filter(e=>e>=1e4).length}},"recordSplitPrompt",0,H,"shouldPromptSplit",0,function(e,t=12e4){return e.largestSats>=t&&e.usableCount<4},"snooze",0,function(e,t=Date.now()){try{localStorage.setItem(q("snoozed",e),String(t+6048e5))}catch{}},"takeSplitPromptSource",0,X,"thresholdSats",0,D,"wasSeenLocally",0,function(e){try{return"1"===localStorage.getItem(q("seen",e))}catch{return!1}},"wasSeenRemotely",0,Y],369929);var J=e.i(660187);let Z=({onClose:e,embedded:i=!1})=>{let{toast:n}=(0,m.useToast)(),{exchangeRate:p}=(0,d.default)(),[x,g]=s.default.useState(1),{data:h,isLoading:b}=(0,a.default)(`${c.API_URL}/wallet/${f.default.balanceAddress()}/all-utxos`,z.fetcher),[v,j]=s.default.useState("biggest"),[N,y]=s.default.useState(!1),S=s.default.useRef(null),[k,A]=s.default.useState(10),[M,B]=s.default.useState(new Set),[K,V]=s.default.useState(0),[q,Y]=s.default.useState(0),[G,Z]=s.default.useState(0),Q=s.default.useMemo(()=>{let e=[...(h?.utxos||[]).map(e=>({...e,pending:!1})),...(h?.mempool||[]).map(e=>({...e,pending:!0}))].sort((e,t)=>"biggest"===v?t.value-e.value:e.value-t.value).map(e=>({...e,outpoint:`${e.txid}:${e.vout}`}));if(!i)return e;let t=D(p),s=e.filter(e=>!e.pending&&e.value>=t);if(s.length>0)return s;let r=e.filter(e=>!e.pending).reduce((e,t)=>!e||t.value>e.value?t:e,null);return r?[r]:[]},[h,v,i,p]),{selectedUtxos:ee,inputSats:et}=s.default.useMemo(()=>{let e=Array.from(M.values()).flatMap(e=>{let t=Q.find(t=>t.outpoint===e);return t?[t]:[]}),t=e.reduce((e,t)=>t.value+e,0);return{selectedUtxos:e,inputSats:t}},[M,Q]),es=s.default.useCallback(e=>{if(Q.find(t=>t.outpoint===e)?.pending)return;let t=new Set(M);t.has(e)?t.delete(e):t.add(e),B(t),V(t.size)},[M,Q]),er=s.default.useCallback(([e])=>{V(e);let t=new Set;for(let s=0;s<e&&s<Q.length;s++)t.add(Q[s].outpoint);B(t)},[Q]),ea=s.default.useCallback(e=>{j(e),y(!1)},[]);s.default.useEffect(()=>{if(!N)return;let e=e=>{S.current&&!S.current.contains(e.target)&&y(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[N]),s.default.useEffect(()=>{if(K>0&&Q.length>0){let e=new Set;for(let t=0;t<K&&t<Q.length;t++)e.add(Q[t].outpoint);requestAnimationFrame(()=>{B(e)})}},[K,v,Q]),s.default.useEffect(()=>{if(0===M.size&&Q.length>0){let e=Q[0];e&&requestAnimationFrame(()=>{B(new Set([e.outpoint])),V(1)})}},[M.size,Q]);let el=s.default.useCallback(e=>{let t=parseInt(e.target.value,10);isNaN(t)||t<1?A(1):A(t)},[]),ei=s.default.useCallback(async(e,t)=>{let[s,a,l]=e;if(0===s.size)return null;let i=Array.from(s.values()).flatMap(e=>{let t=Q.find(t=>t.outpoint===e);return t?[t]:[]});if(!i.length)return null;let n=f.default.balanceAddress(),o=l||n,u="BTC"===c.NETWORK?546:1e6,d=e=>e.reduce((e,t)=>
1e+t.value,0),m=e=>u*a+U({inputCount:e.length,numOutputs:a,toAddress:o,from:n,feeRate:t,dustLimit:u}),p=[...i];if(d(p)<m(p)){for(let e of Q.filter(e=>!s.has(e.outpoint)).sort((e,t)=>t.value-e.value)){if(d(p)>=m(p))break;p.push(e)}if(p.length>i.length){let e=new Set(p.map(e=>e.outpoint));B(e),V(e.size)}}let x=p.map(e=>[e.txid,e.vout,e.value]),g=d(p),h=await W({totalValue:g,inputCount:p.length,numOutputs:a,toAddress:o,from:n,feeRate:t,dustLimit:u,psbtFee:e=>Number(f.default.getPSBTFee(e)),psbtOutputValueTo:(e,t)=>f.default.getPSBTOutputValue(e,t),build:async e=>{try{let{data:s}=await r.default.post(`${c.API_URL}/wallet/build`,{outputs:e,public_key:f.default.getPublicKey(),from:n,utxos:x,fee_rate:t,purpose:"utxo_split"});return{psbt:s.psbt}}catch(t){let e=t?.response?.data?.message||t?.response?.data||t?.message;throw Error("string"==typeof e?e:String(e??t))}}});return Z(h.outputValue),Y(h.serviceFee),{psbt:h.psbt,fee:BigInt(h.networkFee)}},[Q]),en=s.default.useCallback(async s=>{let a,l,i=(0,J.providerSlug)(f.default.display_name()||f.default.type()),o={item_count_bucket:k<=1?"1":k<=5?"2-5":k<=10?"6-10":"11+",...(0,J.telemetryPath)()?{path:(0,J.telemetryPath)()}:{}},u=e=>({...o,error_category:(0,J.classifyWalletError)(e),provider_error_code:e&&"object"==typeof e&&"string"==typeof e.code?String(e.code).slice(0,32):void 0,...(0,J.errorDetail)(e)?{error_detail:(0,J.errorDetail)(e)}:{}}),d=(0,J.beginWalletFlow)("utxo_split",i,"utxo_manager","sign_psbt",o);try{a=await f.default.signPSBTExtractTx(s)}catch(e){throw(0,J.finishWalletFlow)(d,"sign_psbt","user_rejected"===(0,J.classifyWalletError)(e)?"cancelled":"failure",u(e)),e}(0,J.finishWalletFlow)(d,"sign_psbt","success",o);let m=(0,J.beginWalletFlow)("utxo_split",i,"utxo_manager","broadcast",o);try{({data:l}=await r.default.post(`${c.API_URL}/wallet/broadcast`,{rawtx:a}))}catch(e){throw(0,J.finishWalletFlow)(m,"broadcast","failure",u(e)),e}if(l.error)(0,J.finishWalletFlow)(m,"broadcast","failure",{...u(Error(String(l.error.message||"broadcast rejected"))),error_category:"invalid_response"}),n({title:"Failed to broadcast",description:(0,C.friendlyTxError)(l.error.message)});else{(0,J.finishWalletFlow)(m,"broadcast","success",o);let e=X();e&&H("split_broadcast",e,{},{wallet:String(f.default.type()||""),txid:String(l.result||"")}),n({title:"UTXOs created successfully",description:`Split into ${k} outputs`,action:(0,t.jsx)(P.ToastAction,{altText:"View Transaction",onClick:()=>window.open(`${c.EXPLORER_URL}/tx/${l.result}`,"_blank"),children:"View Transaction"})})}e()},[k,e,n]),eo=s.default.useMemo(()=>[{title:"Output",valueFunc:({building:e,psbt:t})=>e||!t?"--":`${(0,u.formatSatoshis)(G)} ${c.NETWORK} / $${(0,o.default)((G/1e8*p)?.toFixed(2))}`},{title:"Total",valueFunc:({building:e,fee:t,psbt:s})=>{if(e||!s)return"--";let r=Number(t)+q;return`${(0,u.formatSatoshis)(r)} ${c.NETWORK} / $${(0,o.default)((r/1e8*p)?.toFixed(2))}`}},{title:"Service Fee",valueFunc:({building:e,psbt:t})=>e||!t?"--":`${(0,u.formatSatoshis)(q)} ${c.NETWORK} / $${(0,o.default)((q/1e8*p)?.toFixed(2))}`},{title:"Network Fee"}],[p,q,G]),eu=s.default.useMemo(()=>[M,k,""],[M,k,""]);return(0,t.jsxs)("div",{className:i?"px-3 py-3 sm:px-4":void 0,children:[1===x&&(0,t.jsxs)(t.Fragment,{children:[!i&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground px-2 mb-2",children:"Split large UTXOs into smaller ones to make multiple purchases at once, or consolidate small UTXOs into fewer, larger ones."}),Q.length>0&&(0,t.jsxs)("div",{className:"flex items-center gap-2 px-2 mb-2",children:[(0,t.jsxs)("span",{className:"text-[10px] text-muted-foreground shrink-0",children:[M.size,"/",Q.length]}),(0,t.jsx)("div",{className:"flex-1",children:(0,t.jsx)(E.Slider,{defaultValue:[K],value:[K],max:Q.length,step:1,onValueChange:er,className:"[&_[role=slider]]:size-3.5"})}),(0,t.jsxs)("div",{className:"relative shrink-0",ref:S,children:[(0,t.jsxs)("button",{onClick:()=>y(!N),className:"flex items-center gap-1 h-7 px-2 text-xs text-muted-foreground bg-transparent border border-border rounded-md hover:border-border transition-colors",children:["biggest"===v?"Biggest":"Smallest",(0,t.jsx)(I.ChevronDown,{className:(0,l.default)("size-3 transition-transform",N&&"rotate-180")}
1)]}),N&&(0,t.jsxs)("div",{className:"absolute right-0 top-full mt-1 z-50 bg-card border border-border rounded-md shadow-lg overflow-hidden min-w-[120px]",children:[(0,t.jsx)("button",{onClick:()=>ea("biggest"),className:(0,l.default)("w-full text-left px-3 py-1.5 text-xs transition-colors","biggest"===v?"text-foreground bg-accent":"text-muted-foreground hover:bg-accent hover:text-foreground"),children:"Biggest first"}),(0,t.jsx)("button",{onClick:()=>ea("smallest"),className:(0,l.default)("w-full text-left px-3 py-1.5 text-xs transition-colors","smallest"===v?"text-foreground bg-accent":"text-muted-foreground hover:bg-accent hover:text-foreground"),children:"Smallest first"})]})]})]}),b&&(0,t.jsx)("div",{className:"flex justify-center py-8",children:(0,t.jsx)("div",{className:"size-4 border-2 border-foreground/20 border-t-foreground rounded-full animate-spin"})}),!b&&Number(h?.private_pending?.incoming)>0&&(0,t.jsxs)("p",{className:"mx-2 mb-2 rounded-lg border border-[#9E77ED]/30 bg-[#9E77ED]/[0.07] px-3 py-2 text-[11px] leading-relaxed text-[#B692F6]",children:[(0,u.formatSatoshis)(Number(h.private_pending.incoming))," BTC is still settling through the private relay and will appear here once that purchase is mined."]}),!b&&0===Q.length&&(0,t.jsx)("div",{className:"flex justify-center py-8",children:(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:"No UTXOs found"})}),Q.length>0&&(0,t.jsx)("div",{className:"max-h-[300px] overflow-y-auto mx-2 rounded-lg border border-border",children:Q.map(e=>{let s=M.has(e.outpoint),r=p?(e.value/1e8*p).toFixed(2):"0";return(0,t.jsxs)("div",{onClick:()=>es(e.outpoint),className:(0,l.default)("flex items-center gap-3 px-3 py-2.5 transition-colors border-b border-border/50 last:border-b-0",e.pending?"cursor-default opacity-80":s?"cursor-pointer bg-violet-500/10":"cursor-pointer hover:bg-accent/50"),role:"button","aria-disabled":e.pending||void 0,tabIndex:0,onKeyDown:(0,R.onKeyboardClick)(()=>es(e.outpoint)),children:[e.pending?(0,t.jsx)(T.Clock,{className:"size-5 stroke-amber-500 shrink-0","aria-hidden":!0}):s?(0,t.jsx)(_.CircleCheck,{className:"size-5 stroke-violet-500 shrink-0"}):(0,t.jsx)(F.CirclePlus,{className:"size-5 stroke-zinc-500 shrink-0"}),(0,t.jsxs)("div",{className:"flex min-w-0 items-baseline gap-2",children:[(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-base font-semibold tabular-nums text-foreground",children:[(0,t.jsx)(L.default,{className:"size-4 text-orange-500"}),(0,u.formatSatoshis)(e.value)]}),(0,t.jsxs)("span",{className:"text-sm tabular-nums text-muted-foreground",children:["$",r]})]}),e.pending&&(0,t.jsx)("span",{className:"ml-auto shrink-0 text-xs font-medium text-amber-500",children:"Pending"})]},e.outpoint)})}),Q.length>0&&M.size>0&&(0,t.jsx)("div",{className:"mx-2 mt-2 rounded-lg border border-border",children:(0,t.jsxs)("div",{className:"flex items-center justify-between px-3 py-2",children:[(0,t.jsxs)("span",{className:"text-xs text-muted-foreground",children:[M.size," UTXO",1!==M.size?"s":""," selected"]}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)(L.default,{className:"size-3 text-orange-500"}),(0,t.jsx)("span",{className:"text-xs font-medium text-foreground",children:(0,u.formatSatoshis)(et)}),(0,t.jsxs)("span",{className:"text-[10px] text-muted-foreground",children:["($",p?(et/1e8*p).toFixed(2):"0",")"]})]})]})}),Q.length>0&&(0,t.jsxs)("div",{className:"px-2 mt-3 mb-3",children:[(0,t.jsx)("button",{disabled:0===M.size,onClick:()=>g(2),className:"w-full h-10 rounded-lg bg-violet-600 hover:bg-violet-500 disabled:opacity-40 disabled:cursor-not-allowed text-white text-sm font-medium transition-colors",children:"Next"}),(0,t.jsxs)("p",{className:"text-xxs text-muted-foreground select-none mt-2",children:["By clicking the button above you agree to the",(0,t.jsx)($.default,{target:"_blank",href:"/terms",className:"ml-1 underline",children:"Terms of Service"}),"."]})]})]}),2===x&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"mx-2 mb-3 rounded-lg border border-border",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between px-3 py-2 border-b border-border/50",children:[(0,t.jsx)("span",{className:"text-xs font-semibold text-muted-foreground",children:"Selected Inputs"}),(0,t.jsx)("button",{onClick:()=>g(1),className:"text-violet-700 dark:text-violet-400 hover:text-violet-700 dark:text-violet-300 transition-colors",children:(0,t.jsx)(O.default,{className:"size-4"})})]}),(0,t.jsx)("div",{className:"max-h-[150px] overflow-y-auto",children:ee.map(e=>{let s=p?(e.value/1e8*p).toFixed(2):"0";return(0,t.jsx)("div",{className:"flex items-center justify-between px-3 py-2 border-b border-border/50 last:border-b-0",children:(0,t.jsxs)("div",{className:"flex items-baseline gap-2",children:[(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-base font-semibold tabular-nums text-foreground",children:[(0,t.jsx)(L.default,{className:"size-4 text-orange-500"}),(0,u.formatSatoshis)(e.value)]}),(0,t.jsxs)("span",{className:"text-sm tabular-nums text-muted-foreground",children:["$",s]})]})},e.outpoint)})})]}),(0,t.jsx)("div",{className:"flex flex-col gap-2 px-2 mb-3",children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-xs text-muted-foreground shrink-0",children:"Outputs"}),(0,t.jsx)("div",{className:"flex-1",children:(0,t.jsx)(E.Slider,{defaultValue:[k],value:[Math.min(k,10)],min:1,max:10,step:1,onValueChange:([e])=>A(e),className:"[&_[role=slider]]:size-3.5"})}),(0,t.jsx)("input",{type:"number",min:1,value:k,onChange:el,className:"w-12 h-7 text-center text-xs font-medium text-foreground bg-background border border-border rounded focus:outline-none focus:border-border transition-colors [appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none"})]})}),(0,t.jsxs)("div",{className:"mx-2 mb-3 rounded-lg border border-border",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between px-3 py-2 border-b border-border/50",children:[(0,t.jsxs)("span",{className:"text-xs font-semibold text-muted-foreground",children:["You will receive ",k," UTXO",1!==k?"s":""]}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:"back to your payment address"})]}),(0,t.jsx)("div",{className:"max-h-[220px] overflow-y-auto",children:Array.from({length:Math.max(1,k)},(e,s)=>{let r=G>0?Math.floor(G/k):0,a=r+(0===s?G-r*k:0),l=p&&a?(a/1e8*p).toFixed(2):null;return(0,t.jsxs)("div",{className:"flex items-center justify-between px-3 py-2 border-b border-border/50 last:border-b-0",children:[(0,t.jsxs)("span",{className:"text-sm text-muted-foreground tabular-nums",children:["#",s+1]}),(0,t.jsxs)("div",{className:"flex items-baseline gap-2",children:[(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-base font-semibold tabular-nums text-foreground",children:[(0,t.jsx)(L.default,{className:"size-4 text-orange-500"}),a>0?(0,u.formatSatoshis)(a):"—"]}),(0,t.jsx)("span",{className:"text-sm tabular-nums text-muted-foreground",children:l?`$${l}`:""})]})]},s)})})]}),(0,t.jsx)(w.default,{open:M.size>0,onBuild:ei,buildDeps:eu,onSubmit:en,action:({building:e})=>e?"Calculating...":`Create ${k} UTXO${1!==k?"s":""}`,items:eo,inline:i})]})]})};e.s(["default",0,e=>{let{onClose:s}=e,r=!!e.args?.embedded;return(0,t.jsx)(Z,{onClose:s,embedded:r})}],835827)}]);
2
3//# sourceMappingURL=0-2xyjril5fcn.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.