1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,807458,e=>{"use strict";var t=e.i(351748),i=e.i(212180),n=e.i(172380),s=e.i(168309);let a=["borrowAmount","collateralAmount","maxLtv","asset"];function r(e){let t=new URLSearchParams(e),i=a.flatMap(e=>{let i=t.get(e);return null===i?[]:[`${e}=${i}`]});return i.length>0?i.join("&"):null}e.s(["getLoanPrefillSignature",0,r,"useLoanQuotes",0,function({stablecoin:e,enabled:a}={}){let l=(0,n.useLoanStore)(e=>e.ltv),o=(0,n.useLoanStore)(e=>e.selectedLoanAsset),u=(0,n.useLoanStore)(e=>e.resolvedLoanPrefillSignature),c=function(){let{borrowUSDAmount:e,collateralBTCAmount:s}=(0,n.useLoanStore)(),a=(0,t.useMemo)(()=>({borrowUSDAmount:e,collateralBTCAmount:s}),[e,s]),r=(0,t.useRef)(a);(r.current.borrowUSDAmount!==a.borrowUSDAmount||r.current.collateralBTCAmount!==a.collateralBTCAmount)&&(r.current=a);let[l]=(0,i.useDebounce)(r.current,300,{equalityFn:(e,t)=>e.borrowUSDAmount===t.borrowUSDAmount&&e.collateralBTCAmount===t.collateralBTCAmount});return l}(),d=r(window.location.search),m=(0,s.useQuote)({collateralAmount:`${c.collateralBTCAmount}`,loanAmount:`${c.borrowUSDAmount}`,maxLtv:`${l}`,stablecoin:e??o??void 0,enabled:(null===d||d===u)&&a});return{...m,allQuotes:m.data?.allQuotes??[],bestQuote:m.data?.bestQuote,quoteInputAmounts:c}}],807458)},896401,e=>{"use strict";var t=e.i(446408),i=e.i(351748),n=e.i(810777);e.i(700804);var s=e.i(763112),a=e.i(165144),r=e.i(507647),l=e.i(653314),o=e.i(824514),u=e.i(466691),c=e.i(282879),d=e.i(984505),m=e.i(603190),h=e.i(927710),p=e.i(101485),f=e.i(152236),x=e.i(499919),g=e.i(510636),v=e.i(866203),b=e.i(566346);let w={[v.ChainType.STARKNET]:"STRK"};function y({quote:e,assetSymbol:n,children:s}){let[a,r]=(0,i.useState)(!1);return(0,p.useMediaQuery)("(min-width: 768px)")?(0,t.jsxs)(c.Dialog,{open:a,onOpenChange:r,children:[(0,t.jsx)(c.DialogTrigger,{asChild:!0,children:s}),(0,t.jsx)(c.DialogContent,{showCloseButton:!1,className:"gap-0 rounded-[10px] p-0 sm:max-w-[730px]",children:(0,t.jsx)("div",{className:"max-h-[85dvh] overflow-y-auto",children:(0,t.jsx)(j,{quote:e,assetSymbol:n,onClose:()=>r(!1),TitleSlot:c.DialogTitle,DescriptionSlot:c.DialogDescription,className:"gap-[30px] p-[30px]"})})})]}):(0,t.jsxs)(d.Drawer,{open:a,onOpenChange:r,children:[(0,t.jsx)(d.DrawerTrigger,{asChild:!0,children:s}),(0,t.jsx)(d.DrawerContent,{children:(0,t.jsx)("div",{className:"overflow-y-auto px-5 pb-8 pt-2",children:(0,t.jsx)(j,{quote:e,assetSymbol:n,onClose:()=>r(!1),TitleSlot:d.DrawerTitle,DescriptionSlot:d.DrawerDescription,className:"gap-[25px]"})})})]})}function j({quote:e,assetSymbol:i,onClose:n,TitleSlot:s,DescriptionSlot:a,className:r}){let l=(0,b.useTranslations)(),{monthlyInterestUsd:o,monthlyNetUsd:c,monthlyRewardsUsd:d,rewardsExceedInterest:p}=(0,g.getMonthlyRewardsBreakdown)(e),v=w[e.chain],y=(0,g.getBtcFiBorrowRewardsAprPercent)(e)>0,C=(0,g.getBtcFiSupplyRewardsAprPercent)(e)>0,A=v?l(C&&!y?"qGZxPY":y&&!C?"2DWUv4":"JGl7CX",{token:v}):l("mnTjEi");return(0,t.jsxs)("div",{className:(0,f.cn)("flex flex-col",r),children:[(0,t.jsxs)("div",{className:"flex flex-col gap-[12px]",children:[(0,t.jsx)(s,{asChild:!0,children:(0,t.jsx)(h.Text,{variant:"h3",className:"font-bold leading-[135%] text-zinc-950",children:l("XB6173")})}),(0,t.jsx)(a,{asChild:!0,children:(0,t.jsx)(h.Text,{variant:"body-large",className:"text-muted-foreground leading-[135%]",children:l(p?"+F3/q6":"bZTKzI")})})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-5",children:[(0,t.jsx)(N,{number:"01",title:l("rXI7t9"),description:l("69htKz",{rate:(0,g.getAprPercent)(e).toFixed(2),asset:i})}),(0,t.jsx)(m.Separator,{}),(0,t.jsx)(N,{number:"02",title:l("ILsnBE"),description:A}),(0,t.jsx)(m.Separator,{}),(0,t.jsx)(N,{number:"03",title:l(p?"HvIu5P":"4QdOKm"),description:l(p?"gxDalW":"NdfcSV")})]}
1),(0,t.jsxs)("div",{className:"flex w-full flex-col gap-4 rounded-[5px] bg-zinc-50 p-5",children:[(0,t.jsx)(S,{className:"text-zinc-950",label:l("Q1w3Ri"),value:l("wpSgk5",{amount:`$${(0,x.formatUsd)(o)}`})}),(0,t.jsx)(S,{className:"text-green-500",label:l("0wIGT/"),value:l("wpSgk5",{amount:`$${(0,x.formatUsd)(d)}`})}),p?(0,t.jsx)(S,{className:"text-green-500",label:l("GLLdS2"),value:l("wpSgk5",{amount:`+$${(0,x.formatUsd)(-c)}`})}):(0,t.jsx)(S,{className:"text-orange-500",label:l("IZzPc4"),value:l("wpSgk5",{amount:`$${(0,x.formatUsd)(Math.max(c,0))}`})})]}),(0,t.jsxs)("div",{className:"flex items-center gap-5",children:[(0,t.jsx)(u.Button,{onClick:n,className:"uppercase tracking-[0.9px]",children:l("rbrahO")}),(0,t.jsx)(h.Text,{variant:"body-small",className:"text-muted-foreground flex-1",children:l("3yP3/n",{asset:i})})]})]})}function N({number:e,title:i,description:n}){return(0,t.jsxs)("div",{className:"flex items-center gap-5",children:[(0,t.jsx)(h.Text,{variant:"terminal-heading",className:"text-orange-500",children:e}),(0,t.jsxs)("div",{className:"flex flex-1 flex-col gap-2",children:[(0,t.jsx)(h.Text,{variant:"h5",className:"text-zinc-950",children:i}),(0,t.jsx)(h.Text,{variant:"body-default",className:"text-muted-foreground",children:n})]})]})}function S({label:e,value:i,className:n}){return(0,t.jsxs)("div",{className:(0,f.cn)("flex items-center justify-between",n),children:[(0,t.jsx)(h.Text,{variant:"terminal-small",children:e}),(0,t.jsx)(h.Text,{variant:"terminal-small",children:i})]})}var C=e.i(527620),A=e.i(525650),T=e.i(534792),L=e.i(419902),_=e.i(172380);function U(e,t,i=1e-8){return Math.abs(e-t)>i}function k(e){return Number.isFinite(e)?String(Math.round(100*e)/100):""}var R=e.i(807458),$=e.i(442367),F=e.i(295087),E=e.i(10878),D=e.i(207653);let z=D.z.object({borrowUSDAmount:D.z.number().finite("Loan amount must be a valid number"),collateralBTCAmount:D.z.number().min(1e-4,"Collateral amount must be at least 0.0001 BTC").finite("Collateral amount must be a valid number"),ltv:D.z.number().positive("LTV must be greater than 0").finite("LTV must be a valid number"),maxLtv:D.z.number().positive().finite(),minLoanAmount:D.z.number().nonnegative().finite().optional()}).refine(e=>e.ltv<=e.maxLtv,{message:"LTV cannot exceed maximum LTV",path:["ltv"]}).superRefine((e,t)=>{null!=e.minLoanAmount&&e.borrowUSDAmount<e.minLoanAmount&&t.addIssue({code:D.z.ZodIssueCode.custom,message:`Minimum borrow amount is $${e.minLoanAmount}`,path:["borrowUSDAmount"]})});var P=e.i(478899),M=e.i(704599),I=e.i(561008),B=e.i(592574),O=e.i(837257),V=e.i(895309);let W=(0,e.i(168896).default)("move-right",[["path",{d:"M18 8L22 12L18 16",key:"1r0oui"}],["path",{d:"M2 12H22",key:"1m8cig"}]]);function X({loanAmountUsd:e,feeBps:t,fallbackFeeUsd:i}){return Number.isFinite(e)&&e>0&&"number"==typeof t&&Number.isFinite(t)?e*t/1e4:i}let q=({iconSrc:e,label:i,alt:s,hasBorder:a=!0})=>(0,t.jsxs)("div",{className:(0,f.cn)("flex shrink-0 items-center gap-2.5 rounded-[5px]",a&&"border-[0.5px] p-2.5"),children:[(0,t.jsx)("div",{className:"relative size-[2.188rem]",children:(0,t.jsx)("div",{className:"relative size-[2.188rem] overflow-hidden rounded-full",children:(0,t.jsx)(n.default,{width:35,height:35,loading:"lazy",src:e,alt:s})})}),(0,t.jsx)(h.Text,{variant:"body-default",className:"text-foreground",children:i})]});function Q({onClick:e,className:i,disabled:n}){let s=(0,b.useTranslations)();return(0,t.jsx)(u.Button,{onClick:e,className:(0,f.cn)("disabled:bg-primary disabled:text-primary-foreground disabled:hover:bg-primary uppercase tracking-[0.9px] disabled:pointer-events-auto disabled:cursor-not-allowed",i),disabled:n,children:s("acrOoz")})}function H({quote:e,totalFeeUsd:i,isPending:n,isFeeUnavailable:a,unavailableFeeLabel:l,youReceiveUsd:o,campaignInfo:u}){let c=(0,b.useTranslations)(),d=(0,g.getAprPercent)(e),{monthlyInterestUsd:m,monthlyRewardsUsd:p,hasRewards:f}=(0,g.getMonthlyRewardsBreakdown)(e),v=w[e.chain],y=a?l??c("UpwcFd"):`$${(0,x.formatUsd)(i)}`;return(0,t.jsxs)("div",{className:"flex w-full min-w-0 items-start gap-2.5",children:[(0,t.jsx)(G,{label:c("Llo9R/"),value:c("wpSgk5",{amount:`$${(0,x.formatUsd)(m)}`}),subtext:f?c("gcCAOy",{rate:d.toFixed(2)}):void 0}),f?(0,t.jsx)(G,{label:c("1xS8CJ"),value:c("wpSgk5",{amount:`$${(0,x.formatUsd)(p)}`}),valueClassName:"text-green-500",subtext:v?c("O9XKl4",{token:v}):void 0}):(0,t.jsx)(G,{label:c("c0b5XV"),value:c("gcCAOy",{rate:d.toFixed(2)})}),(0,t.jsx)(G,{label:c("I6AYRs"),value:y,valueClassName:a&&null==l?"text-red-500":void 0,pending:n,subtextNode:f?n?(0,t.jsx)(T.Skeleton,{"aria-busy":!0,className:"h-[1.1rem] w-24"}):null!=o?(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsx)(h.Text,{as:"span",variant:"body-small",className:"text-muted-foreground",children:c("wGcfYX",{amount:`$${(0,x.formatUsd)(o)}`})}),u&&(0,t.jsx)(r.default,{heading:c("pTUvhZ"),description:c("9r1FjR",{amount:(0,x.formatUsd)(u.amountUsd),campaignName:u.name}),children:(0,t.jsx)("button",{type:"button","aria-label":c("VldDk4"),className:"text-muted-foreground inline-flex size-4 items-center justify-center hover:text-zinc-700",children:(0,t.jsx)(s.InfoIcon,{className:"size-3.5"})})})]}):null:null})]})}function G({label:e,value:i,valueClassName:n,subtext:s,subtextNode:a,pe
1nding:r}){return(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col items-start gap-[5px]",children:[(0,t.jsx)(h.Text,{variant:"body-default",className:"text-muted-foreground",children:e}),r?(0,t.jsx)(T.Skeleton,{"aria-busy":!0,className:"w-full max-w-24",children:(0,t.jsx)(h.Text,{as:"span",variant:"body-large","aria-hidden":!0,className:"invisible block",children:"0"})}):(0,t.jsx)(h.Text,{variant:"body-large",className:(0,f.cn)("text-zinc-800",n),children:i}),a??(s?(0,t.jsx)(h.Text,{variant:"body-small",className:"text-muted-foreground",children:s}):null)]})}function Z({className:e,...i}){let n=(0,b.useTranslations)();return(0,t.jsx)(u.Button,{variant:"secondary",className:(0,f.cn)("border-zinc-200 bg-transparent uppercase tracking-[0.9px] text-zinc-800 hover:bg-zinc-50",e),...i,children:n("NCtrNU")})}function J({className:e}){let{bestQuote:i}=(0,R.useLoanQuotes)(),n=(0,_.useLoanStore)(e=>e.borrowUSDAmount);if(!i||n<=0)return null;let{monthlyNetUsd:s,rewardsExceedInterest:a}=(0,g.getMonthlyRewardsBreakdown)(i);return a?(0,t.jsx)(K,{amountUsd:-s,className:e}):null}function K({amountUsd:e,className:i}){let n=(0,b.useTranslations)();return(0,t.jsxs)("div",{className:(0,f.cn)("flex items-center gap-5 rounded-lg bg-green-500/5 px-[1.875rem] py-5 text-green-500",i),children:[(0,t.jsx)("svg",{viewBox:"0 0 20 19",fill:"currentColor","aria-hidden":"true",className:"h-[19px] w-[20px] shrink-0",children:(0,t.jsx)("path",{d:"M3.825 19L5.45 11.975L0 7.25L7.2 6.625L10 0L12.8 6.625L20 7.25L14.55 11.975L16.175 19L10 15.275L3.825 19Z"})}),(0,t.jsx)(h.Text,{variant:"terminal-small",children:n("GBFaVW",{amount:`$${(0,x.formatUsd)(e)}`})})]})}function Y(){return(0,t.jsx)("div",{className:"flex w-full min-w-0 items-start gap-2.5",children:[0,1,2].map(e=>(0,t.jsxs)("div",{className:"flex flex-1 flex-col items-start gap-[5px]",children:[(0,t.jsx)(T.Skeleton,{"aria-busy":!0,className:"w-16",children:(0,t.jsx)(h.Text,{as:"span",variant:"body-default","aria-hidden":!0,className:"invisible block",children:"0"})}),(0,t.jsx)(T.Skeleton,{"aria-busy":!0,className:"w-20",children:(0,t.jsx)(h.Text,{as:"span",variant:"body-large","aria-hidden":!0,className:"invisible block",children:"0"})}),(0,t.jsx)(T.Skeleton,{"aria-busy":!0,className:"w-14",children:(0,t.jsx)(h.Text,{as:"span",variant:"body-small","aria-hidden":!0,className:"invisible block",children:"0"})})]},e))})}function ee({dataUpdatedAt:e,isFetching:n}){let s=(0,b.useTranslations)(),[a,r]=(0,i.useState)(()=>Date.now()),[l,o]=(0,i.useState)(()=>Date.now()),u=(0,i.useRef)(e);(0,i.useEffect)(()=>{let e=window.setInterval(()=>r(Date.now()),1e3);return()=>window.clearInterval(e)},[]),(0,i.useEffect)(()=>{e<=0||e===u.current||(u.current=e,o(Date.now()),r(Date.now()))},[e]);let c=Math.max(0,Math.floor((a-l)/1e3));return(0,t.jsxs)("div",{className:"flex items-center gap-2.5 font-mono text-sm leading-[1.35] tracking-[-0.03em] text-zinc-950",children:[(0,t.jsxs)("span",{"aria-hidden":!0,className:"relative inline-flex size-[5px] shrink-0",children:[(0,t.jsx)("span",{className:"absolute inset-0 rounded-full bg-green-500 motion-safe:animate-ping"}),(0,t.jsx)("span",{className:"relative size-full rounded-full bg-green-500"})]}),(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5 tabular-nums",children:[s("Dn82AL")," â¢"," ",n?(0,t.jsx)("span",{role:"status","aria-label":s("crQQNC"),className:"inline-block size-3 animate-spin rounded-full border border-zinc-300 border-t-green-500"}):(0,t.jsxs)("span",{children:[c,"s"]})]})]})}let et=({message:e})=>(0,t.jsxs)("div",{className:"flex items-center gap-2.5 rounded-sm bg-red-50 p-3",children:[(0,t.jsx)(O.AlertTriangle,{className:"size-5 shrink-0 text-red-600"}),(0,t.jsx)(h.Text,{variant:"body-default",className:"text-red-700",children:e})]});function ei(){let e=(0,b.useTranslations)();return(0,t.jsx)(en,{title:e("082/LU"),description:e("nOhFTG")})}function en({title:e,description:i,action:n}){return(0,t.jsxs)("div",{className:"flex flex-col gap-1.5 rounded-md bg-amber-50 px-4 py-3.5",children:[(0,t.jsx)(h.Text,{variant:"body-small",className:"font-semibold text-amber-900",children:e}),(0,t.jsx)(h.Text,{variant:"body-small",className:"text-amber-900/70",children:i}),n?(0,t.jsxs)("a",{href:n.href,target:"_blank",rel:"noopener noreferrer",className:"mt-1 inline-flex w-fit items-center gap-1 underline decoration-amber-900/30 underline-offset-4 transition-colors hover:decoration-amber-900",children:[(0,t.jsx)(h.Text,{as:"span",variant:"body-small",className:"font-semibold text-amber-900",children:n.label}
1),(0,t.jsx)(V.ArrowUpRight,{"aria-hidden":!0,className:"size-3.5 text-amber-900"})]}):null]})}e.s(["ComposerRewardsBanner",0,J,"default",0,function({variant:e="landing"}){let n,u=(0,b.useTranslations)(),c=(0,$.useRouter)(),{user:d}=(0,I.usePrivy)(),p=d?.email?.address??null,{preload:f}=(n=(0,i.useRef)(!1),{preload:(0,i.useCallback)(()=>{n.current||(n.current=!0,fetch("/lotties/LoadingGreen.lottie",{priority:"low"}).catch(()=>{n.current=!1}))},[])}),[w,j]=(0,i.useState)(null),[N,S]=(0,i.useState)(null),[D,O]=(0,i.useState)(null),V=(0,_.useLoanStore)(e=>e.borrowUSDAmount),G=(0,_.useLoanStore)(e=>e.collateralBTCAmount),K=(0,_.useLoanStore)(e=>e.ltv),es=(0,_.useLoanStore)(e=>e.lastModified),ea=(0,_.useLoanStore)(e=>e.selectedLoanAsset),er=(0,_.useLoanStore)(e=>e.setSelectedLoanAsset),el=(0,_.useLoanStore)(e=>e.setResolvedLoanPrefillSignature),{setLockedOffer:eo}=(0,M.useLockedOffer)(),eu=(0,P.useAuthDialog)(e=>e.isOpen),ec=(0,P.useAuthDialog)(e=>e.lastCloseReason),ed=(0,i.useRef)(null),em=(0,i.useRef)(null),eh=(0,i.useRef)(null),[ep,ef]=(0,i.useState)(K),[ex,eg]=(0,i.useState)(!1),ev=(0,i.useRef)(!1);(0,i.useEffect)(()=>{ef(K)},[K]);let{bestQuote:eb,isFetching:ew,isError:ey,dataUpdatedAt:ej,isFetched:eN}=(0,R.useLoanQuotes)(),eS=(0,i.useRef)(eb),eC=(0,i.useRef)(!1);(0,i.useEffect)(()=>{eS.current=eb},[eb]);let eA=eb?.loanAssetSymbol??ea??v.SupportedAssets.USDC,eT=eb?(0,g.getMonthlyRewardsBreakdown)(eb):null,eL=eT?.hasRewards??!1,{data:e_,isPending:eU,isError:ek}=function(e,{enabled:t=!0}={}){return(0,i.useMemo)(()=>t?e?{data:e.fees,isPending:!1,isError:!e.fees}:{data:void 0,isPending:!0,isError:!1}:{data:void 0,isPending:!1,isError:!1},[t,e])}(eb),{loanInputValue:eR,onLoanChange:e$,onLtvChange:eF,onCollateralUsdChange:eE,collateralUsdInputValue:eD,btcPrice:ez}=function({collateralFeeUsd:e=0}={}){let t=(0,b.useTranslations)(),{activeView:n,borrowUSDAmount:s,setBorrowUSDAmount:a,collateralBTCAmount:r,setCollateralBTCAmount:l,ltv:o,setLtv:u,lastModified:c,setLastModified:d,priceAtLastUserInput:m,setPriceAtLastUserInput:h}=(0,_.useLoanStore)(),{data:p}=(0,L.useBitcoinPrice)(),[f,x]=(0,i.useState)(()=>0===s),[g,v]=(0,i.useState)(()=>0===r),[w,y]=(0,i.useState)(()=>0===o),[j,N]=(0,i.useState)("");(0,i.useEffect)(()=>{s>0&&x(!1)},[s]),(0,i.useEffect)(()=>{r>0&&v(!1)},[r]),(0,i.useEffect)(()=>{o>0&&y(!1)},[o]);let S=(0,i.useRef)(!1),C=(0,i.useRef)(c),A=(0,i.useRef)({btcPrice:p,borrowUSDAmount:s,collateralBTCAmount:r,ltv:o,lastModified:c,collateralFeeUsd:e});(0,i.useEffect)(()=>{C.current=c},[c]),(0,i.useEffect)(()=>{null===m&&"number"==typeof p&&Number.isFinite(p)&&(s>0||r>0)&&h(p)},[p,s,r,m,h]),(0,i.useEffect)(()=>{let t=m??("number"==typeof p&&Number.isFinite(p)?p:void 0);if(void 0===t||t<=0||S.current){A.current={btcPrice:p,borrowUSDAmount:s,collateralBTCAmount:r,ltv:o,lastModified:c,collateralFeeUsd:e};return}let i=A.current;if(void 0!==i.btcPrice&&i.btcPrice!==p&&i.borrowUSDAmount===s&&i.collateralBTCAmount===r&&i.ltv===o&&i.lastModified===c&&i.collateralFeeUsd===e){A.current={btcPrice:p,borrowUSDAmount:s,collateralBTCAmount:r,ltv:o,lastModified:c,collateralFeeUsd:e};return}let n=Number.isFinite(s)?s:0,u=Number.isFinite(r)?r:0,d=Number.isFinite(o)?o:0,h=Number.isFinite(e)&&e>0?e:0,f=C.current,g=e=>{N(t=>t===e?t:e)};S.current=!0;try{if("loan"===f)if(n>0&&d>0){let e=(n/(d/100)+h)/t;Number.isFinite(e)&&U(e,u)&&l(e),v(0===e);let i=e>0?k(e*t):"";g(i)}else 0!==u&&l(0),v(!0),g("");else if("btc"===f)if(u>0&&d>0){let e=Math.max(u*t-h,0),i=d/100*e;Number.isFinite(i)&&U(i,n,.01)&&a(i),x(0===i);let s=k(u*t);g(s)}else 0!==n&&a(0),x(!0);else if("ltv"===f)if(n>0&&d>0){let e=(n/(d/100)+h)/t;Number.isFinite(e)&&U(e,u)&&l(e),v(0===e);let i=e>0?k(e*t):"";g(i)}else if(u>0&&d>0){let e=Math.max(u*t-h,0),i=d/100*e;Number.isFinite(i)&&U(i,n,.01)&&a(i),x(0===i);let s=k(u*t);g(s)}else d>0&&(0!==n&&a(0),0!==u&&l(0),x(!0),v(!0),g(""))}finally{S.current=!1,A.current={btcPrice:p,borrowUSDAmount:s,collateralBTCAmount:r,ltv:o,lastModified:c,collateralFeeUsd:e}}},[p,m,s,r,o,c,e,a,l]);let T=f||!Number.isFinite(s)?"":k(s),R=g||!Number.isFinite(r)?"":"btc"===c?String(r):(Math.round(1e8*r)/1e8).toFixed(8),$=w||!Number.isFinite(o)?"":String(o),F=(0,i.useCallback)(e=>{C.current="loan",x(""===e);let t=""===e?0:Number.parseFloat(e),i=Number.isNaN(t)||t<0?0:t;""===e?h(null):"number"==typeof p&&Number.isFinite(p)&&h(p),a(i),d("loan")},[p,a,d,h]),E=(0,i.useCallback)(e=>{C.current="btc",v(""===e);let t=""===e?0:Number.parseFloat(e),i=Number.isNaN(t)||t<0?0:t;if(""===e?h(null):"number"==typeof p&&Number.isFinite(p)&&h(p),l(i),""===e)N("");else if(p){let e=k(i*p);N(t=>t===e?t:e)}d("btc")},[p,l,d,h]),D=(0,i.useCallback)(e=>{if(C.current="btc",v(""===e),""===e){h(null),l(0),N(""),d("btc");return}if(!p)return;let t=Number.parseFloat(e),i=Number.isNaN(t)||t<0?0:t;Number.isFinite(p)&&h(p);let n=k(i);N(e=>e===n?e:n),l(i/p),d("btc")},[p,l,d,h]),z=(0,i.useCallback)(e=>{C.current="ltv",y(""===e);let t=""===e?0:Number.parseFloat(e);u(Number.isNaN(t)||t<0?0:t),d("ltv")},[u,d]),P=(0,i.useCallback)(()=>{_.useLoanStore.setState({activeView:"USDC"===n?"BTC":"USDC"})},[n]),M=(0,i.useMemo)(()=>{let e=m??("number"==typeof p?p:void 0);if(!e)return t("pXjinr");let i=r*e;
1return Number.isFinite(i)?`â $${i.toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2})}`:t("pXjinr")},[p,m,r,t]);return{activeView:n,loanInputValue:T,collateralInputValue:R,ltvInputValue:$,collateralUsdInputValue:j,isLoanInputEmpty:f,isCollateralInputEmpty:g,isLtvInputEmpty:w,onLoanChange:F,onCollateralChange:E,onCollateralUsdChange:D,onLtvChange:z,toggleActiveView:P,btcPrice:p,collateralUsdDisplay:M}}({collateralFeeUsd:ek?0:(0,g.getPreviewBridgeFeeUsd)(e_)}),eP=u("obeal7"),eM=u("yn2I87"),eI=!("number"==typeof ez&&Number.isFinite(ez));(0,i.useEffect)(()=>{if(ev.current)return;ev.current=!0;let e=(0,R.getLoanPrefillSignature)(window.location.search),t=new URLSearchParams(window.location.search),i=t.get("borrowAmount"),n=t.get("collateralAmount"),s=t.get("maxLtv"),a=t.get("asset")?.toUpperCase(),r=a===v.SupportedAssets.USDC||a===v.SupportedAssets.USDT||a===v.SupportedAssets.CASH?a:null;if(s){let e=Number(s);Number.isFinite(e)&&e>0&&e<=100&&eF(s)}t.has("asset")&&er(r),i?e$(i):n&&(eE(n),eg(!0));let l=["borrowAmount","collateralAmount","maxLtv","asset"];if(l.some(e=>t.has(e))){l.forEach(e=>t.delete(e));let e=t.toString(),i=`${window.location.pathname}${e?`?${e}`:""}${window.location.hash}`;window.history.replaceState({},"",i)}el(e)},[e$,eE,eF,el,er]);let eB=()=>{w&&(j(null),S(null))},eO=eN&&!ew&&!eb&&!ey,eV=!eb;function eW(){let e=eS.current;e&&((0,F.trackLoanContinueToReview)({offer:e,borrowUSDAmount:V,collateralBTCAmount:G,ltv:K,selectionSource:"best",userLoggedIn:!0,userEmail:p}),eo({...e,loanAmount:String(V),collateralAmount:String(G),requestedLtv:String(K)}),c.push("/borrow/review",{scroll:!0}))}(0,i.useEffect)(()=>{if(eC.current&&d&&eS.current&&!eu){if("dismissed"===ec){eC.current=!1;return}eC.current=!1,eW()}},[d,eb,eu,ec]),(0,i.useEffect)(()=>{!eC.current||eu||d||"dismissed"!==ec||(eC.current=!1)},[eu,d,ec]);let eX=(0,g.getPreviewPlatformFeeUsd)(e_),eq=(0,g.getPreviewWaivedPlatformFeeUsd)(e_),eQ=X({loanAmountUsd:V,feeBps:e_?.borrowFees?.appliedDisbursementFeeBps,fallbackFeeUsd:eX}),eH=X({loanAmountUsd:V,feeBps:e_?.borrowFees?.defaultDisbursementFeeBps,fallbackFeeUsd:eX+eq}),eG=Math.max(eH-eQ,0),eZ=(0,g.getPreviewDisbursementBridgeCostUsd)(e_),eJ=(0,g.getPreviewEstimatedAmountReceivedUsd)(e_),eK=Math.max(e_?.borrowFees?.estimatedAmountReceived!=null?eJ:V-eQ-eZ,0),eY=(0,g.getPreviewTotalFeeUsd)(e_),e0=eG>0,e1=Math.max(V-eH-eZ,0),e5=e_?.borrowFees?.netLoanAmount!=null,e9=ek||!!e_&&!e5;(0,i.useEffect)(()=>{"fee-preview"!==D||e9||O(null)},[D,e9]);let e2=V>0,e8=e2&&!e9&&e5,e6=(0,g.getPreviewFeeSource)(e_),e4=(0,g.getPreviewCampaignSlug)(e_),e7=e0&&"campaign"===e6&&!!e4,e3=e4?(0,g.normalizeCampaignSlug)(e4):"",te=e2&&eU&&!e9,tt=te&&"loan"===es,ti=!!eb&&V>0,tn=V>0&&!ey&&(ew||!eN),ts=(0,t.jsxs)("div",{className:"flex flex-col gap-[5px]",children:[(0,t.jsxs)(C.CurrencyField,{size:ex?"medium":"large",mutedLabel:ex,children:[(0,t.jsx)(C.CurrencyField.Label,{children:eP}),(0,t.jsx)(C.CurrencyField.Control,{value:eR,onChange:e=>{eB(),el(null),e$(e)},inputRef:em,hasError:"borrowUSDAmount"===N,loadingValue:te&&"btc"===es,trailing:(0,t.jsx)(q,{iconSrc:(0,B.getTokenIcon)(eA),label:eA,alt:eA,hasBorder:!1})})]}),!eL&&!!eb&&e2&&(e8||eU)&&(0,t.jsx)("div",{className:"flex h-[1rem] items-center gap-1.5",children:e8?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(h.Text,{variant:"body-small",className:"italic text-zinc-400",children:e0?u.rich("aoMiFo",{previous:`$${(0,x.formatUsd)(e1)}`,net:`$${(0,x.formatUsd)(eK)}`,strike:e=>(0,t.jsx)("span",{className:"line-through",children:e}),highlight:e=>(0,t.jsx)("span",{className:"not-italic text-zinc-700",children:e})}):eZ>0?u.rich("32Tpdg",{net:`$${(0,x.formatUsd)(eK)}`,highlight:e=>(0,t.jsx)("span",{className:"not-italic text-zinc-700",children:e})}):u("d9RJoo",{net:`$${(0,x.formatUsd)(eK)}`,fee:`$${(0,x.formatUsd)(eQ)}`})}),e7&&(0,t.jsx)(r.default,{heading:u("pTUvhZ"),description:u("9r1FjR",{amount:(0,x.formatUsd)(eG),campaignName:e3}),children:(0,t.jsx)("button",{type:"button","aria-label":u("VldDk4"),className:"text-muted-foreground inline-flex size-4 items-center justify-center hover:text-zinc-700",children:(0,t.jsx)(s.InfoIcon,{className:"size-3.5"})})})]}):eU?(0,t.jsx)(T.Skeleton,{"aria-busy":!0,className:"h-[1.1rem] w-
156"}):null})]}),ta=(0,t.jsx)("div",{className:"flex flex-col gap-[5px]",children:(0,t.jsxs)(C.CurrencyField,{size:ex?"large":"medium",mutedLabel:!ex,children:[(0,t.jsx)(C.CurrencyField.Label,{children:eM}),(0,t.jsx)(C.CurrencyField.Control,{value:eD,onChange:e=>{eB(),el(null),eE(e)},inputRef:eh,hasError:"collateralBTCAmount"===N,shrinkToContent:!0,loadingValue:eI||tt,loadingSubtitle:eI||tt,subtitle:`â ${(0,x.formatBtc)(G,{minimumFractionDigits:8})} BTC`,subtitleClassName:"text-zinc-500",trailing:(0,t.jsx)(q,{iconSrc:(0,B.getChainIcon)(v.ChainType.BITCOIN),label:"BTC",alt:"BTC",hasBorder:!1})})]})});return(0,t.jsxs)("div",{className:"flex min-w-0 flex-col gap-[25px]",children:[(0,t.jsxs)(o.default,{ref:ed,onMouseEnter:f,children:[(0,t.jsxs)(o.AsideHeader,{children:[(0,t.jsx)(o.AsideTitle,{children:u("oSNG8c")}),"landing"===e?(0,t.jsx)(ee,{dataUpdatedAt:ej,isFetching:ew}):(0,t.jsx)(o.AsideActions,{role:"button",children:(0,t.jsx)(a.default,{onClick:()=>eg(!ex),className:"size-5 cursor-pointer text-zinc-800 transition-colors hover:text-zinc-950"})})]}),(0,t.jsx)(o.AsideContent,{children:(0,t.jsxs)("div",{className:"flex min-w-0 max-w-full flex-col gap-[1.875rem] overflow-hidden",children:[ex?ta:ts,(0,t.jsx)(A.LtvSlider,{value:ep,max:100,onChangeTemp:e=>ef(e),onCommit:e=>{eB(),el(null),eF(String(e))}}),ex?ts:ta,ey&&(0,t.jsx)(ei,{}),eO&&(0,t.jsx)(en,{title:u("sTesGq"),description:u("c3+508")}),"fee-preview"===D&&(0,t.jsx)(en,{title:u("uoRhq3"),description:u("EIMRs0")}),w&&(0,t.jsx)(et,{message:w}),(0,t.jsxs)("div",{className:"flex w-full min-w-0 flex-col",children:[(0,t.jsx)(m.Separator,{}),(0,t.jsxs)("div",{className:"flex w-full min-w-0 flex-col gap-5 pt-5 lg:gap-[1.875rem] lg:pt-[1.875rem]",children:[(ti||tn)&&(eb?(0,t.jsx)(H,{quote:eb,totalFeeUsd:e9?0:eY,isPending:eU,isFeeUnavailable:e9,unavailableFeeLabel:"â",youReceiveUsd:e8?eK:null,campaignInfo:e7?{amountUsd:eG,name:e3}:null}):(0,t.jsx)(Y,{})),"landing"===e&&(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-5 max-[576px]:flex-col max-[576px]:items-stretch",children:[(0,t.jsx)(l.ActionsBar,{revealRef:ed,children:(0,t.jsx)(Q,{onClick:function(){if((()=>{let e=z.safeParse({borrowUSDAmount:V,collateralBTCAmount:G,ltv:K,maxLtv:100,minLoanAmount:eb?.minLoanAmount?Number(eb.minLoanAmount):void 0});if(!e.success){let t=e.error.issues[0],i=t.path[0];return j(((e,t)=>{switch(e){case"Loan amount must be a valid number":return u("jeO9A7");case"Collateral amount must be at least 0.0001 BTC":return u("w0V+YS");case"Collateral amount must be a valid number":return u("iB5fbm");case"LTV must be greater than 0":return u("j2/bua");case"LTV must be a valid number":return u("5W6wbJ");case"LTV cannot exceed maximum LTV":return u("oS5JpT")}return"borrowUSDAmount"===t&&eb?.minLoanAmount?u("H5DX91",{amount:String(Number(eb.minLoanAmount))}):e})(t.message,i)),S(i),"borrowUSDAmount"===i?em.current?.focus():"collateralBTCAmount"===i&&eh.current?.focus(),!1}return j(null),S(null),!0})()&&eb){if(e9)return void O("fee-preview");if(O(null),(0,F.trackLoanFunnelStart)({borrowUSDAmount:V,collateralBTCAmount:G,ltv:K,userEmail:p}),!d){eC.current=!0,(0,E.login)();return}eW()}},disabled:eV,className:"max-[576px]:w-full"})}),V>0&&eb&&eT?.hasRewards&&(0,t.jsx)(y,{quote:eb,assetSymbol:eA,children:(0,t.jsx)(Z,{className:"max-[576px]:w-full"})})]})]})]})]})}),"borrow"===e&&(0,t.jsxs)(o.AsideFooter,{children:[(0,t.jsx)(h.Text,{variant:"terminal-small",className:"text-zinc-400",children:u("AZZUH9")}),(0,t.jsx)(W,{"aria-hidden":!0,className:"size-5 text-zinc-400"})]})]}),(0,t.jsx)(J,{className:"lg:hidden"})]})}],896401)},841756,e=>{"use strict";var t=e.i(446408),i=e.i(309382),n=e.i(534792),s=e.i(807458),a=e.i(510636),r=e.i(566346);e.s(["BestRateWave",0,function(){let e=(0,r.useTranslations)(),{bestQuote:l,isFetching:o,isFetched:u}=(0,s.useLoanQuotes)(),c=null!=l?`${(0,a.getAprPercent)(l).toFixed(2)}%`:null,d=null==c&&(!u||o);return(0,t.jsxs)("div",{className:"flex h-[47px] w-[min(56vw,896px)] max-w-none items-center gap-5 overflow-visible max-lg:w-full",children:[(0,t.jsxs)("div",{className:"flex h-full min-w-[9.25rem] shrink-0 flex-col justify-center gap-1 border-l border-green-500 pl-5 font-mono text-green-500",children:[(0,t.jsx)("span",{className:"flex h-5 min-w-[5.25rem] items-center text-xl tabular-nums leading-none tracking-[-0.03em]",children:d?(0,t.jsx)(n.Skeleton,{"aria-busy":!0,className:"h-5 w-[5.25rem]"}):c??"â%"}),(0,t.jsx)("span",{className:"flex h-5 items-center whitespace-nowrap text-base leading-none tracking-[-0.03em]",children:e("21iAiY")})]}),(0,t.jsx)("div",{className:"h-full min-w-[180px] flex-1 overflow-hidden",children:(0,t.jsx)(i.DotGridWave,{dotSize:2,spacing:10,waveColor:"#22c55e",baseColor:"#e4e4e4",backgroundColor:"#ffffff",direction:"left-to-right",waveSpeed:5,waveWidth:20,className:"h-full w-full"})})]})}])},922967,e=>{"use strict";var t=e.i(446408),i=e.i(896401);e.s(["LandingLoanComposer",0,function(){return(0,t.jsx)("div",{className:"relative z-10 min-w-0",children:(0,t.jsx)(i.default,{})})}])},504228,e=>{"use strict";var t=e.i(446408),i=e.i(351748),n=e.i(152236);e.s(["LazyStepVideo",0,function({src:e,label:s,topOffsetPct:a,playbackRate:r=1.5,className:l}){let o=(0,i.useRef)(null),u=(0,i.useRef)(!1);return(0,i.useEffect)(()=>{let e=o.current;if(!e)return;e.load(),e.playbackRate=r,u.current=!1;let t=()=>{e.playbackRate=r},i=()=>{u.current=!0};e.addEventListener("loadedmetadata",t),e.addEventListener("ended",i);let n=new IntersectionObserver(t=>{let i=t[0];if(i){if(i.isIntersecting&&i.intersectionRatio>=.5)return void(()=>
1{if(u.current||e.ended)return;e.playbackRate=r;let t=e.play();t&&t.catch(()=>{})})();e.pause()}},{threshold:[0,.25,.5,.75,1]});return n.observe(e),()=>{n.disconnect(),e.removeEventListener("loadedmetadata",t),e.removeEventListener("ended",i)}},[r,e]),(0,t.jsx)("video",{ref:o,src:e,"aria-label":s,muted:!0,playsInline:!0,preload:"auto",className:(0,n.cn)("mx-auto block h-auto w-full max-w-[522px] align-bottom lg:mr-0 lg:ml-auto lg:[transform:translate(4%,_var(--video-y))]",l),style:{"--video-y":`-${a}%`,clipPath:"inset(0 0 3px 0)"}})}])},880901,e=>{"use strict";var t=e.i(446408),i=e.i(351748);e.s(["DotGridRipple",0,function({dotSize:e,spacing:n,waveColor:s,baseColor:a,centerColor:r,waveSpeed:l,waveWidth:o,centerRadius:u,className:c}){let d=(0,i.useRef)(null),m=(0,i.useRef)(0),h=(0,i.useRef)(0),p=e+n;return(0,i.useEffect)(()=>{let t=d.current;if(!t)return;let i=t.getContext("2d");if(!i)return;let n=()=>{let e=t.parentElement;e&&(t.width=e.clientWidth,t.height=e.clientHeight)};n(),window.addEventListener("resize",n);let c=()=>{if(!t||!i)return;let n=Math.ceil(t.width/p)+1,d=Math.ceil(t.height/p)+1,f=t.width/2,x=t.height/2,g=Math.sqrt(f*f+x*x);i.clearRect(0,0,t.width,t.height);let v=parseInt(a.slice(1,3),16),b=parseInt(a.slice(3,5),16),w=parseInt(a.slice(5,7),16),y=parseInt(s.slice(1,3),16),j=parseInt(s.slice(3,5),16),N=parseInt(s.slice(5,7),16),S=parseInt(r.slice(1,3),16),C=parseInt(r.slice(3,5),16),A=parseInt(r.slice(5,7),16);for(let t=0;t<d;t++)for(let s=0;s<n;s++){let n,a,r,l=s*p+p/2,c=t*p+p/2,d=l-f,m=c-x,g=Math.sqrt(d*d+m*m);if(g<=u)n=S,a=C,r=A;else{let e=h.current,t=o*p,i=g-u-e,s=0;i>=-t&&i<=0&&(s=Math.sin((i+t)/t*Math.PI*.5)),n=Math.round(v+(y-v)*s),a=Math.round(b+(j-b)*s),r=Math.round(w+(N-w)*s)}i.beginPath(),i.arc(l,c,e/2,0,2*Math.PI),i.fillStyle=`rgb(${n}, ${a}, ${r})`,i.fill()}h.current+=2*l,h.current>g&&(h.current=0),m.current=requestAnimationFrame(c)};return c(),()=>{window.removeEventListener("resize",n),cancelAnimationFrame(m.current)}},[e,n,p,s,a,r,l,o,u]),(0,t.jsx)("canvas",{ref:d,className:c})}])},466486,e=>{"use strict";var t=e.i(446408),i=e.i(534792),n=e.i(807458),s=e.i(510636),a=e.i(351748);let r=(e,t,i)=>{let n=document.createElement(e),[s,a]=Array.isArray(t)?[void 0,t]:[t,i];return s&&Object.assign(n,s),null==a||a.forEach(e=>n.appendChild(e)),n},l=String.raw,o=(()=>{try{document.createElement("div").animate({opacity:0}
1,{easing:"linear(0, 1)"})}catch{return!1}return!0})(),u="u">typeof CSS&&CSS.supports&&CSS.supports("line-height","mod(1,1)"),c="u">typeof matchMedia?matchMedia("(prefers-reduced-motion: reduce)"):null,d="--_number-flow-d-opacity",m="--_number-flow-d-width",h="--_number-flow-dx",p="--_number-flow-d",f=(()=>{try{return CSS.registerProperty({name:d,syntax:"<number>",inherits:!1,initialValue:"0"}),CSS.registerProperty({name:h,syntax:"<length>",inherits:!0,initialValue:"0px"}),CSS.registerProperty({name:m,syntax:"<number>",inherits:!1,initialValue:"0"}),CSS.registerProperty({name:p,syntax:"<number>",inherits:!0,initialValue:"0"}),!0}catch{return!1}})(),x="var(--number-flow-char-height, 1em)",g="var(--number-flow-mask-height, 0.25em)",v=`calc(${g} / 2)`,b="var(--number-flow-mask-width, 0.5em)",w=`calc(${b} / var(--scale-x))`,y="#000 0, transparent 71%",j=l`:host{display:inline-block;direction:ltr;white-space:nowrap;isolation:isolate;line-height:${x} !important}.number,.number__inner{display:inline-block;transform-origin:left top}:host([data-will-change]) :is(.number,.number__inner,.section,.digit,.digit__num,.symbol){will-change:transform}.number{--scale-x:calc(1 + var(${m}) / var(--width));transform:translateX(var(${h})) scaleX(var(--scale-x));margin:0 calc(-1 * ${b});position:relative;-webkit-mask-image:linear-gradient(to right,transparent 0,#000 ${w},#000 calc(100% - ${w}),transparent ),linear-gradient(to bottom,transparent 0,#000 ${g},#000 calc(100% - ${g}),transparent 100% ),radial-gradient(at bottom right,${y}),radial-gradient(at bottom left,${y}),radial-gradient(at top left,${y}),radial-gradient(at top right,${y});-webkit-mask-size:100% calc(100% - ${g} * 2),calc(100% - ${w} * 2) 100%,${w} ${g},${w} ${g},${w} ${g},${w} ${g};-webkit-mask-position:center,center,top left,top right,bottom right,bottom left;-webkit-mask-repeat:no-repeat}.number__inner{padding:${v} ${b};transform:scaleX(calc(1 / var(--scale-x))) translateX(calc(-1 * var(${h})))}:host > :not(.number){z-index:5}.section,.symbol{display:inline-block;position:relative;isolation:isolate}.section::after{content:'\200b';display:inline-block}.section--justify-left{transform-origin:center left}.section--justify-right{transform-origin:center right}.section > [inert],.symbol > [inert]{margin:0 !important;position:absolute !important;z-index:-1}.digit{display:inline-block;position:relative;--c:var(--current) + var(${p})}.digit__num,.number .section::after{padding:${v} 0}.digit__num{display:inline-block;--offset-raw:mod(var(--length) + var(--n) - mod(var(--c),var(--length)),var(--length));--offset:calc( var(--offset-raw) - var(--length) * round(down,var(--offset-raw) / (var(--length) / 2),1) );--y:clamp(-100%,var(--offset) * 100%,100%);transform:translateY(var(--y))}.digit__num[inert]{position:absolute;top:0;left:50%;transform:translateX(-50%) translateY(var(--y))}.digit:not(.is-spinning) .digit__num[inert]{display:none}.symbol__value{display:inline-block;mix-blend-mode:plus-lighter;white-space:pre}.section--justify-left .symbol > [inert]{left:0}.section--justify-right .symbol > [inert]{right:0}.animate-presence{opacity:calc(1 + var(${d}))}`,N=HTMLElement,S=(l`:host{display:inline-block;direction:ltr;white-space:nowrap;line-height:${x} !important}span{display:inline-block}:host([data-will-change]) span{will-change:transform}.number,.digit{padding:${v} 0}.symbol{white-space:pre}`,u&&o&&f);class C extends N{constructor(){super(),this.created=!1,this.batched=!1;const{animated:e,...t}=this.constructor.defaultProps;this._animated=this.computedAnimated=e,Object.assign(this,t)}get animated(){return this._animated}set animated(e){var t;this.animated!==e&&(this._animated=e,null==(t=this.shadowRoot)||t.getAnimations().forEach(e=>e.finish()))}set data(e){var t;if(null==e)return;let{pre:i,integer:n,fraction:s,post:a,value:r}=e;if(this.created){let l=this._data;this._data=e,this.computedTrend="function"==typeof this.trend?this.trend(l.value,r):this.trend,this.computedAnimated=S&&this._animated&&(!this.respectMotionPreference||!(null!=c&&c.matches))&&this.offsetWidth>0&&this.offsetHeight>0,null==(t=this.plugins)||t.forEach(t=>{var i;return null==(i=t.onUpdate)?void 0:i.call(t,e,l,this)}),this.batched||this.willUpdate(),this._pre.update(i),this._num.update({integer:n,fraction:s}),this._post.update(a),this.batched||this.didUpdate()}else{this._data=e,this.attachShadow({mode:"open"});try{this._internals??(this._internals=this.attachInternals()),this._internals.role="img"}catch{}let t=document.createElement("style");t.textContent=j,this.shadowRoot.appendChild(t),this._pre=new _(this,i,{justify:"right",part:"left"}),this.shadowRoot.appendChild(this._pre.el),this._num=new A(this,n,s),this.shadowRoot.appendChild(this._num.el),this._post=new _(this,a,{justify:"left",part:"right"}),this.shadowRoot.appendChild(this._post.el),this.created=!0}try{this._internals.ariaLabel=e.valueAsString}catch{}}willUpdate(){this._pre.willUpdate(),this._num.willUpdate(),this._post.
1willUpdate()}didUpdate(){if(!this.computedAnimated)return;this._abortAnimationsFinish?this._abortAnimationsFinish.abort():this.dispatchEvent(new Event("animationsstart")),this._pre.didUpdate(),this._num.didUpdate(),this._post.didUpdate();let e=new AbortController;Promise.all(this.shadowRoot.getAnimations().map(e=>e.finished)).then(()=>{e.signal.aborted||(this.dispatchEvent(new Event("animationsfinish")),this._abortAnimationsFinish=void 0)}),this._abortAnimationsFinish=e}}C.defaultProps={transformTiming:{duration:900,easing:"linear(0,.005,.019,.039,.066,.096,.129,.165,.202,.24,.278,.316,.354,.39,.426,.461,.494,.526,.557,.586,.614,.64,.665,.689,.711,.731,.751,.769,.786,.802,.817,.831,.844,.856,.867,.877,.887,.896,.904,.912,.919,.925,.931,.937,.942,.947,.951,.955,.959,.962,.965,.968,.971,.973,.976,.978,.98,.981,.983,.984,.986,.987,.988,.989,.99,.991,.992,.992,.993,.994,.994,.995,.995,.996,.996,.9963,.9967,.9969,.9972,.9975,.9977,.9979,.9981,.9982,.9984,.9985,.9987,.9988,.9989,1)"},spinTiming:void 0,opacityTiming:{duration:450,easing:"ease-out"},animated:!0,trend:(e,t)=>Math.sign(t-e),respectMotionPreference:!0,plugins:void 0,digits:void 0};class A{constructor(e,t,i,{className:n,...s}={}){this.flow=e,this._integer=new L(e,t,{justify:"right",part:"integer"}),this._fraction=new L(e,i,{justify:"left",part:"fraction"}),this._inner=r("span",{className:"number__inner"},[this._integer.el,this._fraction.el]),this.el=r("span",{...s,part:"number",className:`number ${n??""}`},[this._inner])}willUpdate(){this._prevWidth=this.el.offsetWidth,this._prevLeft=this.el.getBoundingClientRect().left,this._integer.willUpdate(),this._fraction.willUpdate()}update({integer:e,fraction:t}){this._integer.update(e),this._fraction.update(t)}didUpdate(){let e=this.el.getBoundingClientRect();this._integer.didUpdate(),this._fraction.didUpdate();let t=this._prevLeft-e.left,i=this.el.offsetWidth,n=this._prevWidth-i;this.el.style.setProperty("--width",String(i)),this.el.animate({[h]:[`${t}px`,"0px"],[m]:[n,0]},{...this.flow.transformTiming,composite:"accumulate"})}}class T{constructor(e,t,{justify:i,className:n,...s},a){this.flow=e,this.children=new Map,this.onCharRemove=e=>()=>{this.children.delete(e)},this.justify=i;const l=t.map(e=>this.addChar(e).el);this.el=r("span",{...s,className:`section section--justify-${i} ${n??""}`},a?a(l):l)}addChar(e,{startDigitsAtZero:t=!1,...i}={}){let n="integer"===e.type||"fraction"===e.type?new R(this,e.type,t?0:e.value,e.pos,{...i,onRemove:this.onCharRemove(e.key)}):new $(this,e.type,e.value,{...i,onRemove:this.onCharRemove(e.key)});return this.children.set(e.key,n),n}unpop(e){e.el.removeAttribute("inert"),e.el.style.top="",e.el.style[this.justify]=""}pop(e){e.forEach(e=>{var t,i;e.el.style.top=`${e.el.offsetTop}px`,e.el.style[this.justify]=`${t=e.el,"left"===this.justify?t.offsetLeft:((null==(i=t.offsetParent instanceof HTMLElement?t.offsetParent:null)?void 0:i.offsetWidth)??0)-t.offsetWidth-t.offsetLeft}px`}),e.forEach(e=>{e.el.setAttribute("inert",""),e.present=!1})}addNewAndUpdateExisting(e){let t=new Map,i=new Map,n="left"===this.justify,s=n?"prepend":"append";if(function(e,t,{reverse:i=!1}={}){let n=e.length;for(let s=i?n-1:0;i?s>=0:s<n;i?s--:s++)t(e[s],s)}(e,e=>{let n;this.children.has(e.key)?(n=this.children.get(e.key),i.set(e,n),this.unpop(n),n.present=!0):(n=this.addChar(e,{startDigitsAtZero:!0,animateIn:!0}),t.set(e,n)),this.el[s](n.el)},{reverse:n}),this.flow.computedAnimated){let e=this.el.getBoundingClientRect();t.forEach(t=>{t.willUpdate(e)})}t.forEach((e,t)=>{e.update(t.value)}),i.forEach((e,t)=>{e.update(t.value)})}willUpdate(){let e=this.el.getBoundingClientRect();this._prevOffset=e[this.justify],this.children.forEach(t=>t.willUpdate(e))}didUpdate(){let e=this.el.getBoundingClientRect();this.children.forEach(t=>t.didUpdate(e));let t=e[this.justify],i=this._prevOffset-t;i&&this.children.size&&this.el.animate({transform:[`translateX(${i}px)`,"none"]},{...this.flow.transformTiming,composite:"accumulate"})}}class L extends T{update(e){let t=new Map;this.children.forEach((i,n)=>{e.find(e=>e.key===n)||t.set(n,i),this.unpop(i)}
1),this.addNewAndUpdateExisting(e),t.forEach(e=>{e instanceof R&&e.update(0)}),this.pop(t)}}class _ extends T{update(e){let t=new Map;this.children.forEach((i,n)=>{e.find(e=>e.key===n)||t.set(n,i)}),this.pop(t),this.addNewAndUpdateExisting(e)}}class U{constructor(e,t,{onRemove:i,animateIn:n=!1}={}){this.flow=e,this.el=t,this._present=!0,this._remove=()=>{var e;this.el.remove(),null==(e=this._onRemove)||e.call(this)},this.el.classList.add("animate-presence"),this.flow.computedAnimated&&n&&this.el.animate({[d]:[-.9999,0]},{...this.flow.opacityTiming,composite:"accumulate"}),this._onRemove=i}get present(){return this._present}set present(e){if(this._present!==e){if(this._present=e,e?this.el.removeAttribute("inert"):this.el.setAttribute("inert",""),!this.flow.computedAnimated){e||this._remove();return}this.el.style.setProperty("--_number-flow-d-opacity",e?"0":"-.999"),this.el.animate({[d]:e?[-.9999,0]:[.999,0]},{...this.flow.opacityTiming,composite:"accumulate"}),e?this.flow.removeEventListener("animationsfinish",this._remove):this.flow.addEventListener("animationsfinish",this._remove,{once:!0})}}}class k extends U{constructor(e,t,i,n){super(e.flow,i,n),this.section=e,this.value=t,this.el=i}}class R extends k{constructor(e,t,i,n,s){var a,l;const o=((null==(l=null==(a=e.flow.digits)?void 0:a[n])?void 0:l.max)??9)+1,u=Array.from({length:o}).map((e,t)=>{let n=r("span",{className:"digit__num"},[document.createTextNode(String(t))]);return t!==i&&n.setAttribute("inert",""),n.style.setProperty("--n",String(t)),n}),c=r("span",{part:`digit ${t}-digit`,className:"digit"},u);c.style.setProperty("--current",String(i)),c.style.setProperty("--length",String(o)),super(e,i,c,s),this.pos=n,this._onAnimationsFinish=()=>{this.el.classList.remove("is-spinning")},this._numbers=u,this.length=o}willUpdate(e){let t=this.el.getBoundingClientRect();this._prevValue=this.value;let i=t[this.section.justify]-e[this.section.justify],n=t.width/2;this._prevCenter="left"===this.section.justify?i+n:i-n}update(e){this.el.style.setProperty("--current",String(e)),this._numbers.forEach((t,i)=>i===e?t.removeAttribute("inert"):t.setAttribute("inert","")),this.value=e}didUpdate(e){let t=this.el.getBoundingClientRect(),i=t[this.section.justify]-e[this.section.justify],n=t.width/2,s="left"===this.section.justify?i+n:i-n,a=this._prevCenter-s;a&&this.el.animate({transform:[`translateX(${a}px)`,"none"]},{...this.flow.transformTiming,composite:"accumulate"});let r=this.getDelta();r&&(this.el.classList.add("is-spinning"),this.el.animate({[p]:[-r,0]},{...this.flow.spinTiming??this.flow.transformTiming,composite:"accumulate"}),this.flow.addEventListener("animationsfinish",this._onAnimationsFinish,{once:!0}))}getDelta(){var e;if(this.flow.plugins)for(let t of this.flow.plugins){let i=null==(e=t.getDelta)?void 0:e.call(t,this.value,this._prevValue,this);if(null!=i)return i}let t=this.value-this._prevValue,i=this.flow.computedTrend||Math.sign(t);return i<0&&this.value>this._prevValue?this.value-this.length-this._prevValue:i>0&&this.value<this._prevValue?this.length-this._prevValue+this.value:t}}class $ extends k{constructor(e,t,i,n){const s=r("span",{className:"symbol__value",textContent:i});super(e,i,r("span",{part:`symbol ${t}`,className:"symbol"},[s]),n),this.type=t,this._children=new Map,this._onChildRemove=e=>()=>{this._children.delete(e)},this._children.set(i,new U(this.flow,s,{onRemove:this._onChildRemove(i)}))}willUpdate(e){if("decimal"===this.type)return;let t=this.el.getBoundingClientRect();this._prevOffset=t[this.section.justify]-e[this.section.justify]}update(e){if(this.value!==e){let t=this._children.get(this.value);t&&(t.present=!1);let i=this._children.get(e);if(i)i.present=!0;else{let t=r("span",{className:"symbol__value",textContent:e});this.el.appendChild(t),this._children.set(e,new U(this.flow,t,{animateIn:!0,onRemove:this._onChildRemove(e)}))}}this.value=e}didUpdate(e){if("decimal"===this.type)return;let t=this.el.getBoundingClientRect()[this.section.justify]-e[this.section.justify],i=this._prevOffset-t;i&&this.el.animate({transform:[`translateX(${i}px)`,"none"]},{...this.flow.transformTiming,composite:"accumulate"})}}var F=a;let E=parseInt(F.version.match(/^(\d+)\./)?.[1])>=19;class D extends C{attributeChangedCallback(e,t,i){this[e]=JSON.parse(i)}}D.observedAttributes=E?[]:["data","digits"],customElements.get("number-flow-react")||customElements.define("number-flow-react",D);let z={},P=E?e=>e:JSON.stringify;function M(e){let{transformTiming:t,spinTiming:i,opacityTiming:n,animated:s,respectMotionPreference:a,trend:r,plugins:l,...o}=e;return[{transformTiming:t,spinTiming:i,opacityTiming:n,animated:s,respectMotionPreference:a,trend:r,plugins:l},o]}
1class I extends F.Component{updateProperties(e){if(!this.el)return;this.el.batched=!this.props.isolate;let[t]=M(this.props);Object.entries(t).forEach(([e,t])=>{this.el[e]=t??D.defaultProps[e]}),e?.onAnimationsStart&&this.el.removeEventListener("animationsstart",e.onAnimationsStart),this.props.onAnimationsStart&&this.el.addEventListener("animationsstart",this.props.onAnimationsStart),e?.onAnimationsFinish&&this.el.removeEventListener("animationsfinish",e.onAnimationsFinish),this.props.onAnimationsFinish&&this.el.addEventListener("animationsfinish",this.props.onAnimationsFinish)}componentDidMount(){this.updateProperties(),E&&this.el&&(this.el.digits=this.props.digits,this.el.data=this.props.data)}getSnapshotBeforeUpdate(e){if(this.updateProperties(e),e.data!==this.props.data){if(this.props.group)return this.props.group.willUpdate(),()=>this.props.group?.didUpdate();if(!this.props.isolate)return this.el?.willUpdate(),()=>this.el?.didUpdate()}return null}componentDidUpdate(e,t,i){i?.()}handleRef(e){this.props.innerRef&&(this.props.innerRef.current=e),this.el=e}render(){let[e,{innerRef:t,className:i,data:n,willChange:s,isolate:a,group:r,digits:l,onAnimationsStart:o,onAnimationsFinish:u,...c}]=M(this.props);return F.createElement("number-flow-react",{ref:this.handleRef,"data-will-change":s?"":void 0,class:i,...c,dangerouslySetInnerHTML:{__html:""},suppressHydrationWarning:!0,digits:P(l),data:P(n)})}constructor(e){super(e),this.handleRef=this.handleRef.bind(this)}}let B=F.forwardRef(function({value:e,locales:t,format:i,prefix:n,suffix:s,...a},r){F.useImperativeHandle(r,()=>l.current,[]);let l=F.useRef(),o=F.useContext(O);o?.useRegister(l);let u=F.useMemo(()=>t?JSON.stringify(t):"",[t]),c=F.useMemo(()=>i?JSON.stringify(i):"",[i]),d=F.useMemo(()=>(function(e,t,i,n){let s=t.formatToParts(e);i&&s.unshift({type:"prefix",value:i}),n&&s.push({type:"suffix",value:n});let a=[],r=[],l=[],o=[],u={},c=e=>`${e}:${u[e]=(u[e]??-1)+1}`,d="",m=!1,h=!1;for(let e of s){d+=e.value;let t="minusSign"===e.type||"plusSign"===e.type?"sign":e.type;"integer"===t?(m=!0,r.push(...e.value.split("").map(e=>({type:t,value:parseInt(e)})))):"group"===t?r.push({type:t,value:e.value}):"decimal"===t?(h=!0,l.push({type:t,value:e.value,key:c(t)})):"fraction"===t?l.push(...e.value.split("").map(e=>({type:t,value:parseInt(e),key:c(t),pos:-1-u[t]}))):(m||h?o:a).push({type:t,value:e.value,key:c(t)})}let p=[];for(let e=r.length-1;e>=0;e--){let t=r[e];p.unshift("integer"===t.type?{...t,key:c(t.type),pos:u[t.type]}:{...t,key:c(t.type)})}return{pre:a,integer:p,fraction:l,post:o,valueAsString:d,value:"string"==typeof e?parseFloat(e):e}})(e,z[`${u}:${c}
1`]??=new Intl.NumberFormat(t,i),n,s),[e,u,c,n,s]);return F.createElement(I,{...a,group:o,data:d,innerRef:l})}),O=F.createContext(void 0),V="font-mono text-[44px] font-medium leading-[1] tracking-[-0.03em] text-green-500 sm:text-[48px] md:text-[56px] lg:text-[60px] xl:text-[70px]";e.s(["AnimatedStatValue",0,function({value:e,format:a,source:r}){let{bestQuote:l,isFetching:o}=(0,n.useLoanQuotes)(),u="lowest-apy"===r&&null!=l?(0,s.getAprPercent)(l):e,c="lowest-apy"===r?`${V} inline-block whitespace-nowrap`:V;return"lowest-apy"===r&&o&&null==l?(0,t.jsx)(i.Skeleton,{"aria-busy":!0,className:c,children:(0,t.jsx)("span",{"aria-hidden":!0,className:"invisible",children:"0.00"})}):(0,t.jsx)(B,{value:u,format:a,className:c})}],466486)},948165,e=>{"use strict";var t=e.i(446408),i=e.i(351748),n=e.i(810777);let s={active:!0,breakpoints:{},delay:4e3,jump:!1,playOnInit:!0,stopOnFocusIn:!0,stopOnInteraction:!0,stopOnMouseEnter:!1,stopOnLastSnap:!1,rootNode:null};function a(e={}){let t,i,n,r,l=null,o=0,u=!1,c=!1,d=!1,m=!1;function h(){if(!n){if(x()){d=!0;return}u||i.emit("autoplay:play"),function(){let{ownerWindow:e}=i.internalEngine();e.clearTimeout(o),o=e.setTimeout(y,r[i.selectedScrollSnap()]),l=new Date().getTime(),i.emit("autoplay:timerset")}(),u=!0}}function p(){n||(u&&i.emit("autoplay:stop"),function(){let{ownerWindow:e}=i.internalEngine();e.clearTimeout(o),o=0,l=null,i.emit("autoplay:timerstopped")}(),u=!1)}function f(){if(x())return d=u,p();d&&h()}function x(){let{ownerDocument:e}=i.internalEngine();return"hidden"===e.visibilityState}function g(){c||p()}function v(){c||h()}function b(){c=!0,p()}function w(){c=!1,h()}function y(){let{index:e}=i.internalEngine(),n=e.clone().add(1).get(),s=i.scrollSnapList().length-1,a=t.stopOnLastSnap&&n===s;if(i.canScrollNext()?i.scrollNext(m):i.scrollTo(0,m),i.emit("autoplay:select"),a)return p();h()}return{name:"autoplay",options:e,init:function(l,o){var u,c,d,x;let y,j;i=l;let{mergeOptions:N,optionsAtMedia:S}=o,C=N(s,a.globalOptions);if(t=S(N(C,e)),i.scrollSnapList().length<=1)return;m=t.jump,n=!1,u=i,c=t.delay,y=u.scrollSnapList(),r="number"==typeof c?y.map(()=>c):c(y,u);let{eventStore:A,ownerDocument:T}=i.internalEngine(),L=!!i.internalEngine().options.watchDrag,_=(d=i,x=t.rootNode,j=d.rootNode(),x&&x(j)||j);A.add(T,"visibilitychange",f),L&&i.on("pointerDown",g),L&&!t.stopOnInteraction&&i.on("pointerUp",v),t.stopOnMouseEnter&&A.add(_,"mouseenter",b),t.stopOnMouseEnter&&!t.stopOnInteraction&&A.add(_,"mouseleave",w),t.stopOnFocusIn&&i.on("slideFocusStart",p),t.stopOnFocusIn&&!t.stopOnInteraction&&A.add(i.containerNode(),"focusout",h),t.playOnInit&&h()},destroy:function(){i.off("pointerDown",g).off("pointerUp",v).off("slideFocusStart",p),p(),n=!0,u=!1},play:function(e){void 0!==e&&(m=e),h()},stop:function(){u&&p()},reset:function(){u&&h()},isPlaying:function(){return u},timeUntilNext:function(){return l?r[i.selectedScrollSnap()]-(new Date().getTime()-l):null}}}a.globalOptions=void 0;var r=e.i(927710),l=e.i(466866);e.s(["TestimonialsCarousel",0,function({title:e,items:s}){let o=(0,i.useRef)(a({delay:3e3,stopOnInteraction:!1,stopOnMouseEnter:!0}));return(0,t.jsxs)(l.Carousel,{opts:{align:"start",loop:!0},plugins:[o.current],className:"mt-12 sm:mt-16 lg:mt-[100px]",children:[(0,t.jsxs)("div",{className:"flex items-end justify-between gap-6",children:[(0,t.jsx)(r.Text,{as:"h2",variant:"h3",className:"text-zinc-950 lg:h-[49px]",children:e}),(0,t.jsxs)("div",{className:"relative flex shrink-0 gap-3",children:[(0,t.jsx)(l.CarouselPrevious,{className:"static translate-y-0 size-10"}),(0,t.jsx)(l.CarouselNext,{className:"static translate-y-0 size-10"})]})]}),(0,t.jsx)(l.CarouselContent,{className:"mt-10 -ml-5 sm:mt-12 lg:mt-16",children:s.map(e=>(0,t.jsx)(l.CarouselItem,{className:"pl-5 sm:basis-1/2 lg:basis-1/3",children:(0,t.jsxs)("article",{className:"flex h-full flex-col rounded-2xl border-[0.5px] border-zinc-200 p-6 lg:p-8",children:[(0,t.jsx)(r.Text,{variant:"body-default",className:"text-zinc-700",children:e.quote}),(0,t.jsxs)("div",{className:"mt-[30px] flex items-center gap-5 pt-[30px] lg:mt-auto",children:[(0,t.jsx)(n.default,{src:e.avatar,alt:"",width:50,height:50,quality:90,sizes:"50px",className:"size-[50px] rounded-full object-cover"}),(0,t.jsxs)("div",{children:[(0,t.jsx)(r.Text,{variant:"body-default",className:"text-zinc-950",children:e.name}),(0,t.jsx)(r.Text,{variant:"body-small",className:"text-zinc-500",children:e.handle})]})]})]})},e.name))})]})}],948165)}]);
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.