1 2!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="cfaeecad-b040-551a-848d-443d47c12da3")}catch(e){}}(); 3!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};e._sentryModuleMetadata=e._sentryModuleMetadata||{},e._sentryModuleMetadata[(new e.Error).stack]=function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];if(null!=s)for(var r in s)s.hasOwnProperty(r)&&(e[r]=s[r])}return e}({},e._sentryModuleMetadata[(new e.Error).stack],{"_sentryBundlerPluginAppKey:gensyn_ai_delphi":!0})}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7620],{2733:(e,t,s)=>{s.d(t,{M:()=>D});var r=s(1480),l=s(11845),a=s(33683),n=s(28539),i=s(81760),o=s.n(i),c=s(53764),d=s(51992),x=s(82085),u=s(63923),m=s(70903),p=s(13768),f=s(40288),h=s(36172),g=function(e){return e.MarketNotOpen="MarketNotOpen",e.GatewayNotInitialized="GatewayNotInitialized",e.MarketProxyNotDeployedByFactory="MarketProxyNotDeployedByFactory",e.TokensInExceedsMax="TokensInExceedsMax",e.TokensOutBelowMin="TokensOutBelowMin",e.TokensInBelowMin="TokensInBelowMin",e.SharesOutBelowMinDelta="SharesOutBelowMinDelta",e.SharesInBelowMinDelta="SharesInBelowMinDelta",e.SharesInExceedSupply="SharesInExceedSupply",e.OutcomeSupplyBelowMinDelta="OutcomeSupplyBelowMinDelta",e.WrongMarketStatus="WrongMarketStatus",e.RedeemZeroShares="RedeemZeroShares",e.RedeemZeroTokensOut="RedeemZeroTokensOut",e.MarketCreationSharesAlreadyLiquidated="MarketCreationSharesAlreadyLiquidated",e}({}),b=s(31383),v=s(52121),j=s(17044);let w=2n**256n-1n;var y=s(572),N=s(42380),k=s(11188);let M={crypto:"/categories/crypto.jpg",culture:"/categories/culture.jpg",economics:"/categories/economics.jpg",finance:"/categories/finance.jpg",miscellaneous:"/categories/miscellaneous.jpg",politics:"/categories/politics.jpg",sports:"/categories/sports.jpg",tech:"/categories/tech.jpg"},C=M.miscellaneous;var S=s(61541),L=s(99095),P=s(59877),E=s(65711),O=s(52914),$=s(65168),z=s(21189);function I(e){let t=(0,N.useGateValue)(k.ay),s=function({omniboxEnabled:e,category:t}){return e?M[t]??C:void 0}({omniboxEnabled:(0,N.useGateValue)(k.KH),category:e.category}),l=(0,y.Q)(e.gateway),a=(0,x.U)(e.address,e.outcomes,l),n=function(e,t){let{data:s,isLoading:r,isError:l,error:a,refetch:n}=(0,b.Q)({address:e,abi:"lmsr"===t?j.p:v.p,functionName:"getMarket",query:{enabled:!!e,select:e=>({winningOutcomeIndex:e.winningOutcomeIdx===w?null:e.winningOutcomeIdx})}});return{data:s,isLoading:r,isError:l,error:a,refetch:n}}(e.address,e.mechanismType),i={probabilities:{data:a.probabilities,isLoading:a.isLoading,isError:a.isError,error:a.error,refetch:()=>{a.refetch()}},resolution:{winningOutcomeIndex:n.data?.winningOutcomeIndex??null,isLoading:n.isLoading,isError:n.isError,error:n.error,refetch:()=>{n.refetch()}}};return(0,r.jsx)(T,{...e,lmsrEnabled:t,categoryImage:s,live:i})}function T(e){let{probabilities:t,resolution:s}=e.live,i=(0,c.useMemo)(()=>(0,S.jq)(BigInt(e.liquidity)),[e.liquidity]),x=(0,c.useMemo)(()=>void 0===e.volume?void 0:(0,S.jq)(e.volume),[e.volume]),u=(0,$.Sq)(e.settlementType),m=e.lmsrEnabled&&"lmsr"===e.mechanismType,p=e.lmsrEnabled,f=(0,P.S)(e),h=()=>{(0,E.sx)("select_market",{...(0,O.CV)(e),source_surface:e.surface??"home"})},g=(0,S.Y7)({username:e.creator?.username,ens:e.creator?.ens,walletAddress:e.creatorEoa}),b=e.isOmnibox?(0,r.jsx)(o(),{href:L.Zo,className:"relative z-[2] hover:underline",children:L.Ut}):e.creator?(0,r.jsx)(o(),{href:`/profile/${e.creator.id}`,className:"relative z-[2] hover:underline",children:g}):g,v=(0,r.jsx)(o(),{title:e.question,className:"hover:underline cursor-pointer overflow-hidden text-ellipsis [display:-webkit-box] [-webkit-line-clamp:2] [-webkit-box-orient:vertical] after:absolute after:inset-0 after:z-[1]",href:f,onClick:h,children:e.question});return(0,r.jsxs)("article",{className:"relative box-border flex h-[335px] min-h-0 flex-col gap-lg rounded-sm border-[0.5px] border-[transparent] bg-surface-card p-[16px] hover:border-[0.5px] hover:border-border-card hover:bg-surface-card-hover",children:[(0,r.jsxs)("header",{className:"flex shrink-0 flex-col gap-y-lg",children:[(0,r.jsx)("section",{className:"flex flex-row justify-end",children:(0,r.jsx)("div",{className:`flex flex-row justify-end font-detail ${(0,z._)(e.status)}`,children:(0,z.a)(e.status)})}),(0,r.jsxs)("section",{className:"flex flex-col gap-y-md",children:[e.categoryImage?(0,r.jsxs)("div",{className:"flex w-full items-center gap-sm",children:[(0,r.jsx)(n.e,{src:e.categoryImage,size:42,rounded:"sm"}),(0,r.jsx)("h2",{className:"min-w-0 flex-1 text-[18px]/[24px] font-sans break-words text-text-primary",children:v})]}):e.creator&&!e.isOmnibox?(0,r.jsxs)("div",{className:"flex w-full items-center gap-sm",children:[(0,r.jsx)(o(),{href:`/profile/${e.creator.id}`,className:"relative z-[2] shrink-0",title:e.creator.username??e.creatorEoa,children:(0,r.jsx)(n.e,{src:e.creator.avatarUrl,size:42})}),(0,r.jsx)("h2",{className:"min-w-0 flex-1 text-[18px]/[24px] font-sans break-words text-text-primary",children:v})]}):(0,r.jsx)("h2",{className:"text-[18px]/[24px] font-sans break-words text-text-primary",children:v}),(0,r.jsx)("h3",{className:"font-detail text-[12px]/[12px] text-nowrap text-ellipsis text-text-muted overflow-hidden",children:(0,r.jsxs)("span",{title:e.isOmnibox?void 0:e.creatorEoa,className:"relative z-[2]",children:["by ",b]})})]}),(0,r.jsxs)("section",{className:"flex flex-row gap-sm items-center",children:[(0,r.jsx)("p",{className:"font-sans border-[0.5px] border-border-card rounded-xs text-text-muted px-[4px] capitalize",children:d.CP[e.category]}),p&&(0,r.jsx)("p",{className:`flex h-[16px] shrink-0 items-center font-detail text-[12px]/[12px] rounded-xs px-[8px] ${m?"bg-surface-inverted text-brand-white":"border-[0.5px] border-border-card text-text-muted"}`,children:m?"LMSR":"DPM"}),u&&(0,r.jsx)("p",{className:"text-status-auto text-[12px]/[12px] font-detail",children:"Automated"}),!u&&e.reproducible&&(0,r.jsx)("p",{className:"text-semantic-info text-[12px]/[12px] font-detail",children:"Verifiable"})]}),"settled"===e.status?(0,r.jsx)(R,{marketId:e.id,outcomes:e.outcomes,resolution:s}):null]}),(0,r.jsxs)("section",{className:"flex min-h-0 flex-1 flex-col items-start justify-end gap-lg",children:[(0,r.jsx)(q,{marketId:e.id,marketPath:f,status:e.status,mechanismType:e.lmsrEnabled?e.mechanismType:void 0,outcomes:e.outcomes,liveProbabilities:t,liveResolution:s,onSelect:h}),(0,r.jsxs)("footer",{className:"flex shrink-0 gap-lg font-sans text-[12px]/[12px] text-text-muted",children:[(0,r.jsx)("p",{children:void 0===x?`Liquidity ${i}`:`Vol: ${x}`}),(0,r.jsxs)("p",{children:[(0,l.d)(e.resolvesAt,new Date)?"Closes":"Closed"," ",(0,a.GP)(e.resolvesAt,"MMM dd, yyyy")]})]})]})]})}function R({marketId:e,outcomes:t,resolution:s}){let{winningOutcomeIndex:l,isLoading:a,isError:n,refetch:i}=s;if(a)return(0,r.jsxs)("div",{className:"flex flex-row items-center gap-sm font-detail text-[12px]/[12px] text-text-muted",children:[(0,r.jsx)(u.y,{}),(0,r.jsx)("span",{children:"Loading resolutionâ¦"})]});if(n)return(0,r.jsxs)("div",{className:"flex flex-col gap-xs font-detail text-[12px]/[12px] text-text-muted",children:[(0,r.jsx)("p",{children:"Resolution unavailable"}),(0,r.jsx)("button",{type:"button",onClick:()=>i(),className:"relative z-[2] text-left font-sans underline w-fit text-text-muted",children:"Retry"})]});if(2!==t.length||null==l)return null;let o=t[Number(l)]??"Unknown",c=(0,d.IQ)(t)?(0,d.R)(e,t)[o]:void 0;return(0,r.jsxs)("p",{className:"font-detail flex w-full min-w-0 items-center gap-1 text-[12px]/[12px] text-text-muted",children:[(0,r.jsx)("span",{className:"shrink-0 font-sans capitalize",children:"Final resolution:"}),(0,r.jsxs)("span",{className:"flex min-w-0 flex-1 items-center justify-start gap-xs",children:[(0,r.jsx)("span",{className:"min-w-0 shrink truncate uppercase",style:c?{color:c}:void 0,children:o}),(0,r.jsx)("span",{className:"shrink-0 text-border-outcome-selected",children:(0,r.jsx)(p.M,{className:"shrink-0"})})]})]})}
3function q({marketId:e,marketPath:t,status:s,mechanismType:l,outcomes:a,liveProbabilities:n,liveResolution:i,onSelect:b}){var v,j;let{data:w,isLoading:y,isError:N,error:k,refetch:M}=n,C="lmsr"===l?"Probability":"Sentiment",{winningOutcomeIndex:S,isLoading:L,isError:P}=i,E="settled"!==s||!(a.length>2)||L||P||null==S?null:a[Number(S)]??null,O=(0,c.useMemo)(()=>{let t=(0,d.R)(e,a);return a.map(e=>{let s=w?.find(t=>t.name===e),r=s?.probability??(0,x.B)(0);return{name:e,color:t[e],probability:r,displayProbability:s?.displayProbability??"0"}})},[w,a,e]),$=(0,c.useMemo)(()=>O.toSorted((e,t)=>t.probability-e.probability),[O]);return"canceled"===s?(0,r.jsxs)("div",{className:"w-full bg-surface-subcard text-[12px]/[14.4px] rounded-sm p-[16px] gap-md flex flex-col text-text-muted mb-auto",children:[(0,r.jsx)("h3",{className:"uppercase font-detail",children:"No outcome"}),(0,r.jsx)("p",{className:"font-sans",children:"No winning outcome was declared. Positions are paid at final market prices."})]}):y?(0,r.jsxs)("div",{className:"w-full bg-surface-subcard rounded-sm p-[16px] gap-md flex flex-col",children:[(0,r.jsx)("h3",{className:"uppercase text-[12px]/[12px] font-detail text-text-muted",children:C}),(0,r.jsxs)("div",{className:"flex flex-row items-center justify-center gap-xs",children:[(0,r.jsx)(u.y,{}),(0,r.jsx)("p",{className:"text-text-muted text-[12px]/[12px] font-sans",children:"Loading probabilities..."})]})]}):N?(0,r.jsxs)("div",{className:"w-full bg-surface-subcard rounded-sm p-[16px] gap-md flex flex-col",children:[(0,r.jsxs)("h3",{className:"uppercase text-[12px]/[12px] font-detail text-text-muted",children:[C," unavailable"]}),(0,r.jsx)("p",{className:"text-text-muted text-[12px]/[12px] font-sans",children:(v=k,j=C,"MarketProxyNotDeployedByFactory"===function(e){if(!e||!(e instanceof f.C))return null;let t=e.walk(e=>e instanceof h.M);if(t instanceof h.M){let e=t.data?.errorName;if(e&&e in g)return e}return null}(v)?"This market address is not recognized.":`Unable to load ${j.toLowerCase()} right now.`)}),(0,r.jsx)("button",{onClick:()=>M(),className:"relative z-[2] text-text-muted text-[12px]/[12px] font-sans underline",children:"Retry"})]}):2===O.length?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"w-full bg-surface-subcard rounded-sm p-[16px] gap-md flex flex-col",children:[(0,r.jsx)("h3",{className:"uppercase text-[12px]/[12px] font-detail text-text-muted",children:"settled"===s?"Outcome":C}),(0,r.jsxs)("div",{className:"flex flex-col gap-sm",children:[(0,r.jsxs)("div",{className:"relative w-full",children:[(0,r.jsx)("div",{style:{backgroundColor:O[1].color},className:"rounded-full w-full h-[5px]"}),(0,r.jsx)("div",{style:{backgroundColor:O[0].color,width:`${Math.round(100*O[0].probability)}%`},className:"top-0 left-0 rounded-full h-[5px] absolute"})]}),(0,r.jsx)("div",{className:"flex justify-between gap-2 text-text-muted text-[12px]/[12px] font-detail",children:O.map(({name:e,displayProbability:t},s)=>(0,r.jsx)("div",{className:`flex min-w-0 flex-1 items-center gap-xs capitalize ${1===s?"justify-end":"justify-start"}`,children:(0,r.jsxs)("span",{title:e,className:`relative z-[2] min-w-0 truncate ${1===s?"text-right":"text-left"}`,children:[t,"% ",e]})},e))})]})]}),"active"===s?(0,r.jsx)("div",{className:"h-[24px] flex flex-row items-center justify-between gap-sm w-full",children:O.map(({name:e,color:s},l)=>(0,r.jsx)(o(),{href:{pathname:t,query:{selectedOutcomeIndex:l}},onClick:b,style:{"--color":s},className:"relative z-[2] cursor-pointer flex min-w-0 items-center justify-center overflow-hidden h-[24px] font-sans text-[14px]/[20px] text-text-secondary capitalize w-1/2 py-[10px] px-[8px] rounded-sm border-[0.5px] hover:text-white hover:bg-[var(--color)] border-[var(--color)]",children:(0,r.jsxs)("span",{className:"inline-flex min-w-0 max-w-full items-center justify-center gap-xs",children:[(0,r.jsx)("span",{className:"min-w-0 truncate",title:e,children:e}),e===$[0].name?(0,r.jsx)("span",{className:"shrink-0",children:(0,r.jsx)(m.D,{size:16})}):null]})},e))}):(0,r.jsx)("div",{className:"h-[24px] w-full"})]}):(0,r.jsxs)("div",{className:"w-full bg-surface-subcard rounded-sm p-[16px] gap-md flex flex-col",children:[(0,r.jsxs)("div",{className:"flex flex-row items-center justify-between",children:[(0,r.jsx)("h3",{className:"uppercase text-[12px]/[12px] font-detail text-text-muted",children:"settled"===s?"Outcome":C}),(0,r.jsxs)("p",{className:"font-mono text-[12px]/[12px] text-text-muted",children:["(+",a.length-2," More)"]})]}),(0,r.jsx)("div",{className:"flex flex-col gap-lg",children:$.slice(0,2).map(({name:e,color:t,displayProbability:s})=>(0,r.jsxs)("div",{className:"relative w-full",children:[(0,r.jsx)("div",{className:"rounded-full w-full h-[5px] bg-surface-button-disabled"}),(0,r.jsx)("div",{className:"top-0 left-0 rounded-full h-[5px] absolute",style:{backgroundColor:t,width:`${s}%`}}),(0,r.jsxs)("div",{className:"mt-[4px] flex min-w-0 flex-row items-center gap-xs font-detail text-[12px]/[12px] text-text-muted",children:[(0,r.jsxs)("span",{className:"inline-flex min-w-0 max-w-full flex-1 items-center gap-xs capitalize",children:[(0,r.jsx)("span",{className:"relative z-[2] min-w-0 truncate",title:e,children:e}),E===e?(0,r.jsx)("span",{className:"shrink-0 text-border-outcome-selected",children:(0,r.jsx)(p.M,{className:"shrink-0"})}):null]}),(0,r.jsxs)("span",{className:"shrink-0",children:[s,"%"]})]})]},e))})]})}var A=s(9099),B=s(71368),_=s(69525);function D({initialData:e,pageSize:t,creator:s,category:l,orderBy:a,status:n,settlement:i,search:o,source:c,surface:d}){let{data:x,isFetchingNextPage:u,error:m,hasNextPage:p,fetchNextPage:f}=(0,B.q)(_.H.markets.list.infiniteOptions({input:e=>({limit:t,cursor:e,status:n,search:o,...s?{creator:s}:{},...l?{category:l}:{},...a?{orderBy:a}:{},...i?{settlement:i}:{},...c?{source:c}:{}}),initialData:{pages:[e],pageParams:[void 0]}
3,initialPageParam:void 0,getNextPageParam:({cursor:e})=>e??void 0,staleTime:3e4}));return 0===x.pages.flatMap(({items:e})=>e).length?(0,r.jsx)("div",{className:"flex justify-center pt-[80px] pb-[240px]",children:(0,r.jsx)("p",{className:"text-[16px]/[26px] text-text-secondary uppercase",children:"No Markets"})}):(0,r.jsxs)("div",{className:"flex flex-col gap-3xl",children:[(0,r.jsx)("ul",{className:"grid grid-cols-1 gap-x-lg gap-y-lg font-sans md:grid-cols-2 lg:grid-cols-3",children:x.pages.flatMap(({items:e})=>e).map(e=>(0,r.jsx)("li",{children:(0,r.jsx)(I,{address:e.address,gateway:e.gateway,category:e.category,liquidity:e.liquidity,volume:e.volume,resolvesAt:e.resolvesAt,creatorEoa:e.creatorEoa,creator:e.creator??void 0,id:e.id,outcomes:e.outcomes,question:e.question,reproducible:e.reproducible,settlementType:e.settlementType,mechanismType:e.mechanismType,isOmnibox:e.isOmnibox,status:e.status,surface:d})},`market-${e.id}`))}),(0,r.jsx)(A.e,{hasNextPage:!!p,isFetchingNextPage:u,errorMessage:m?"There was an issue fetching more markets.":void 0,onLoadMore:()=>f()})]})}},9099:(e,t,s)=>{s.d(t,{e:()=>n});var r=s(1480),l=s(53972),a=s(32852);function n({hasNextPage:e,isFetchingNextPage:t,errorMessage:s,onLoadMore:n}){return e||s?(0,r.jsxs)(r.Fragment,{children:[s?(0,r.jsx)("div",{className:"mx-auto w-full max-w-[360px]",children:(0,r.jsx)(l.K,{message:s})}):null,e?(0,r.jsx)("div",{className:"mx-auto w-fit min-w-[160px]",children:(0,r.jsx)(a.$,{width:"full",isPending:t,onClick:n,children:t?"Loading...":"Load More"})}):null]}):null}},13768:(e,t,s)=>{s.d(t,{M:()=>l});var r=s(1480);function l({className:e,...t}){return(0,r.jsx)("svg",{className:e,width:12,height:12,viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":!0,...t,children:(0,r.jsx)("path",{d:"M10 3L4.5 8.5L2 6",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}},24755:(e,t,s)=>{s.d(t,{n:()=>o,v:()=>i});var r=s(1480),l=s(75236);let a=Object.entries({all:"All markets",active:"Active",pending:"Pending",settled:"Settled",canceled:"No outcome"}).map(([e,t])=>({value:e,label:t})),n=new Set(a.map(e=>e.value));function i(e){return e&&n.has(e)?e:void 0}function o({value:e,onValueChange:t,variant:s}){return(0,r.jsx)(l.n,{label:"Market status",value:e,options:a,onValueChange:t,variant:s})}},53972:(e,t,s)=>{s.d(t,{K:()=>l});var r=s(1480);function l({message:e}){return(0,r.jsx)("div",{className:"p-[6px] text-[13px]/[14px] flex gap-md items-center text-[#AF3639] w-full",children:(0,r.jsx)("span",{className:"inline-block align-baseline",children:e})})}},59877:(e,t,s)=>{s.d(t,{C:()=>l,S:()=>a});let r=new Set(["settle"]);function l(e){let t=function(e){if(e.length<=80)return e;let t=e.slice(0,80),s=t.lastIndexOf("-");return s>0?t.slice(0,s):t}(e.normalize("NFKD").replace(/[\u0300-\u036f]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,""));return r.has(t)?`${t}-market`:t}function a(e){let t=l(e.question);return t?`/market/${e.id}/${t}`:`/market/${e.id}`}},70903:(e,t,s)=>{s.d(t,{D:()=>l});var r=s(1480);function l({size:e}){return(0,r.jsxs)("svg",{width:e,height:e,viewBox:`0 0 ${e} ${e}`,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,r.jsx)("path",{d:"M7 11.3748V2.62354",stroke:"currentColor",strokeWidth:"0.8",strokeLinecap:"round",strokeLinejoin:"round"}),(0,r.jsx)("path",{d:"M2.625 6.99919L7.00065 2.62354L11.3763 6.99919",stroke:"currentColor",strokeWidth:"0.8",strokeLinecap:"round",strokeLinejoin:"round"})]})}},74092:(e,t,s)=>{s.d(t,{P:()=>l});var r=s(1480);function l({height:e}){return(0,r.jsx)("svg",{width:`${2*e}px`,height:`${e}px`,viewBox:`0 0 ${2*e} ${e}`,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,r.jsx)("path",{d:"M0.5 0.5L6.5 6.5L12.5 0.5",stroke:"currentColor",strokeWidth:"1",strokeLinecap:"round",strokeLinejoin:"round"})})}},75236:(e,t,s)=>{s.d(t,{n:()=>c});var r=s(1480),l=s(53764),a=s(78809),n=s(74092);let i={default:"","full-width":"w-full md:w-auto"},o="group h-[36px] min-w-[14ch] items-center justify-between gap-sm whitespace-nowrap rounded-lg bg-surface-card px-[16px] py-[8px] font-sans text-[14px]/[10px] text-text-secondary focus:outline-none focus:ring-1 focus:ring-border-card";function c({label:e,value:t,options:s,onValueChange:l,variant:c="default"}){return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(a.bL,{value:t,onValueChange:e=>{let t=s.find(t=>t.value===e);t&&l(t.value)},children:[(0,r.jsxs)(a.l9,{className:["hidden md:flex",o,i[c]].filter(
3Boolean).join(" "),children:[(0,r.jsx)(a.WT,{}),(0,r.jsx)(a.In,{className:"transition-transform group-data-[state=open]:rotate-180",children:(0,r.jsx)(n.P,{height:7})})]}),(0,r.jsx)(a.ZL,{children:(0,r.jsx)(a.UC,{className:"z-50 min-w-[var(--radix-select-trigger-width)] overflow-hidden rounded-md border-[0.5px] border-border-wallet bg-[#343434]",position:"popper",sideOffset:8,children:(0,r.jsx)(a.LM,{className:"p-[4px]",children:s.map(e=>(0,r.jsx)(a.q7,{value:e.value,className:"relative flex cursor-pointer select-none items-center rounded-md bg-[#343434] px-[12px] py-[9px] font-sans text-[14px]/[14px] text-white focus:bg-[#343434] focus:text-white focus:outline-none data-[highlighted]:bg-[#343434] data-[highlighted]:text-white",children:(0,r.jsx)(a.p4,{children:e.label})},e.value))})})})]}),(0,r.jsx)(d,{label:e,value:t,options:s,onValueChange:l,variant:c})]})}function d({label:e,value:t,options:s,onValueChange:a,variant:c="default"}){let[d,x]=(0,l.useState)(!1),u=(0,l.useRef)(null),m=(0,l.useRef)(null),p=s.find(e=>e.value===t);return(0,l.useEffect)(()=>{if(!d)return;let e=e=>{if("Escape"===e.key){x(!1),u.current?.focus();return}if("Tab"===e.key){let t=Array.from(m.current?.querySelectorAll('[role="option"]')??[]);if(0===t.length)return;e.preventDefault();let s=t.indexOf(document.activeElement),r=e.shiftKey?(s-1+t.length)%t.length:(s+1)%t.length;t[r].focus()}};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[d]),(0,l.useEffect)(()=>{if(!d)return;let e=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}},[d]),(0,r.jsxs)("div",{className:"md:hidden",children:[(0,r.jsxs)("button",{type:"button",ref:u,"aria-haspopup":"listbox","aria-expanded":d,onClick:()=>x(!0),className:["flex",o,i[c]].filter(Boolean).join(" "),children:[p?.label,(0,r.jsx)(n.P,{height:7})]}),d?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("button",{type:"button","aria-label":"Close",tabIndex:-1,onClick:()=>{x(!1),u.current?.focus()},className:"fixed inset-0 z-50 bg-black/40"}),(0,r.jsx)("div",{ref:m,role:"listbox","aria-label":e,className:"fixed inset-x-0 bottom-0 z-50 flex max-h-[50vh] flex-col gap-xl overflow-y-auto rounded-t-[14px] bg-surface-inverted p-[24px]",children:s.map(e=>(0,r.jsx)("button",{type:"button",role:"option","aria-selected":e.value===t,autoFocus:e.value===t,onClick:()=>{a(e.value),x(!1),u.current?.focus()},className:"w-full border-b border-dashed border-border-divider pb-[24px] text-left font-sans text-[14px]/[20px] text-white last:border-b-0 last:pb-0",children:e.label},e.value))})]}):null]})}},86688:(e,t,s)=>{s.d(t,{MarketFilters:()=>v});var r=s(1480),l=s(81760),a=s.n(l),n=s(90405),i=s(53764),o=s(51992),c=s(34606),d=s(24755),x=s(75236);function u({selected:e=!1,children:t}){return(0,r.jsx)("div",{className:`flex h-[30px] cursor-pointer items-center rounded-xs border-[0.5px] border-border-card px-[8px] font-sans text-[14px] hover:border-border-card-deep ${e?"bg-brand-cta-bg text-brand-cta-text":"bg-surface-card text-text-secondary"}`,children:t})}var m=s(76879);function p(e,t=100){let[s,r]=(0,i.useState)(e);return(0,i.useEffect)(()=>{let s=setTimeout(()=>r(e),t);return()=>clearTimeout(s)},[e,t]),s}var f=s(65711);function h({initialQuery:e}){let t=(0,n.useRouter)(),s=(0,n.usePathname)(),l=(0,n.useSearchParams)(),[a,o]=(0,i.useState)(e??""),c=p(a),d=p(a,1200),x=(0,i.useRef)(e?.trim()??null),u=(0,i.useRef)(a);return u.current=a,(0,i.useEffect)(()=>{let e=new URLSearchParams(l.toString()),r=c.trim();if(!r){e.delete("search"),t.push(s+"?"+e.toString(),{scroll:!1});return}e.set("search",r),t.push(s+"?"+e.toString(),{scroll:!1})},[c,t,s,l]),(0,i.useEffect)(()=>{let e=d.trim();if(!e){x.current=null;return}e!==x.current&&(x.current=e,(0,f.sx)("search",{search_term:e}))},[d]),(0,i.useEffect)(()=>()=>{let e=u.current.trim();e&&e!==x.current&&(0,f.sx)("search",{search_term:e})},[]),(0,r.jsxs)("div",{className:"flex w-full justify-between rounded-lg border border-solid border-border-input bg-surface-search px-[16px] font-sans text-[14px]/[20px] md:max-w-[500px]",children:[(0,r.jsx)("input",{type:"text",className:"w-full focus:outline-none py-[8px] text-text-primary bg-transparent",placeholder:"Search Markets...",value:a,onChange:e=>o(e.target.value)}),a?(0,r.jsx)("button",{onClick:()=>o(""),children:(0,r.jsx)(m.b,{size:24})}):null]})}function g({size:e}){return(0,r.jsx)("svg",{width:`${e}`,height:`${e}`,viewBox:`0 0 ${e} ${e}`,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,r.jsx)("path",{d:"M21.25 12H8.895M4.534 12H2.75M4.534 12C4.534 11.4218 4.76368 10.8673 5.17251 10.4585C5.58134 10.0497 6.13583 9.82001 6.714 9.82001C7.29217 9.82001 7.84666 10.0497 8.25549 10.4585C8.66432 10.8673 8.894 11.4218 8.894 12C8.894 12.5782 8.66432 13.1327 8.25549 13.5415C7.84666 13.9503 7.29217 14.18 6.714 14.18C6.13583 14.18 5.58134 13.9503 5.17251 13.5415C4.76368 13.1327 4.534 12.5782 4.534 12ZM21.25 18.607H15.502M15.502 18.607C15.502 19.1853 15.2718 19.7404 14.8628 20.1494C14.4539 20.5583 13.8993 20.788 13.321 20.788C12.7428 20.788 12.1883 20.5573 11.7795 20.1485C11.3707 19.7397 11.141 19.1852 11.141 18.607M15.502 18.607C15.502 18.0287 15.2718 17.4746 14.8628 17.0657C14.4539 16.6567 13.8993 16.427 13.321 16.427C12.7428 16.427 12.1883 16.6567 11.7795 17.0655C11.3707 17.4743 11.141 18.0288 11.141 18.607M11.141 18.607H2.75M21.25 5.39301H18.145M13.784 5.39301H2.75M13.784 5.39301C13.784 4.81484 14.0137 4.26035 14.4225 3.85152C14.8313 3.44269 15.3858 3.21301 15.964 3.21301C16.2503 3.21301 16.5338 3.2694 16.7983 3.37896C17.0627 3.48851 17.3031 3.64909 17.50
355 3.85152C17.7079 4.05395 17.8685 4.29427 17.9781 4.55876C18.0876 4.82325 18.144 5.10673 18.144 5.39301C18.144 5.67929 18.0876 5.96277 17.9781 6.22726C17.8685 6.49175 17.7079 6.73207 17.5055 6.93451C17.3031 7.13694 17.0627 7.29751 16.7983 7.40707C16.5338 7.51663 16.2503 7.57301 15.964 7.57301C15.3858 7.57301 14.8313 7.34333 14.4225 6.93451C14.0137 6.52568 13.784 5.97118 13.784 5.39301Z",stroke:"var(--color-border-wallet)",strokeMiterlimit:"10",strokeLinecap:"round"})})}var b=s(21312);function v({category:e,orderBy:t,status:s,settlement:l,search:o}){let x=(0,n.useRouter)(),u=(0,n.usePathname)(),m=(0,n.useSearchParams)(),p=(0,b.a)(),[v,j]=(0,i.useState)(!1),y=e=>{let t=new URLSearchParams(m.toString());return"All"!==e?t.set("category",e):t.delete("category"),u+"?"+t.toString()},M=(e,t)=>{(0,f.sx)("filter_markets",{filter_type:e,filter_value:t})};return(0,r.jsx)("div",{className:"overflow-x-auto md:overflow-visible",children:(0,r.jsxs)("div",{className:"flex flex-col gap-lg md:gap-2xl md:min-w-0",children:[(0,r.jsxs)("ul",{className:"flex overflow-x-auto flex-row flex-nowrap items-center gap-sm md:min-w-0 md:flex-wrap",children:[(0,r.jsx)("li",{className:"shrink-0",children:(0,r.jsx)(a(),{href:y("All"),scroll:!1,onClick:()=>M("category","All"),children:(0,r.jsx)(k,{category:"All",selected:!e})})}),Object.values(c.s3).map(t=>(0,r.jsx)("li",{className:"shrink-0",children:(0,r.jsx)(a(),{href:y(t),scroll:!1,onClick:()=>M("category",t),children:(0,r.jsx)(k,{category:t,selected:t===e})})},t))]}),(0,r.jsxs)("div",{className:"flex flex-col md:flex-row justify-between gap-lg md:gap-sm",children:[(0,r.jsxs)("div",{className:"flex justify-between gap-sm grow-1",children:[(0,r.jsx)(h,{initialQuery:o}),p?(0,r.jsx)("div",{className:"p-[4px] border-[1px] border-border-input bg-surface-card rounded-sm flex-1 flex justify-center align-center",children:(0,r.jsx)("button",{className:"flex justify-center items-center",onClick:()=>j(!v),children:(0,r.jsx)(g,{size:24})})}):null]}),!p||v?(0,r.jsxs)("ul",{className:"flex min-w-max flex-col md:flex-row flex-nowrap items-center gap-sm md:min-w-0",children:[(0,r.jsx)("li",{className:"shrink-0 w-full md:w-auto",children:(0,r.jsx)(w,{value:t||"liquidity"})}),(0,r.jsx)("li",{className:"shrink-0 w-full md:w-auto",children:(0,r.jsx)(d.n,{value:s,variant:"full-width",onValueChange:e=>{M("status",e);let t=new URLSearchParams(m.toString());t.set("status",e),x.push(u+"?"+t.toString(),{scroll:!1})}})}),(0,r.jsx)("li",{className:"shrink-0 w-full md:w-auto",children:(0,r.jsx)(N,{value:l})})]}):null]})]})})}let j=[{value:"liquidity",label:"Most liquidity"},{value:"volume",label:"Highest volume"},{value:"created",label:"Most recent"},{value:"resolvesAt",label:"Closing earliest"}];function w({value:e}){let t=(0,n.useRouter)(),s=(0,n.useSearchParams)(),l=(0,n.usePathname)();return(0,r.jsx)(x.n,{label:"Sort by",variant:"full-width",value:e,options:j,onValueChange:e=>{(0,f.sx)("filter_markets",{filter_type:"sort",filter_value:e});let r=new URLSearchParams(s.toString());r.set("orderBy",e),t.push(l+"?"+r.toString(),{scroll:!1})}})}let y=[{value:"all",label:"All settlement types"},{value:"non-verifiable",label:"Non verifiable"},{value:"verifiable",label:"Verifiable"},{value:"automated",label:"Automated"}];function N({value:e}){let t=(0,n.useRouter)(),s=(0,n.useSearchParams)(),l=(0,n.usePathname)();return(0,r.jsx)(x.n,{label:"Settlement type",variant:"full-width",value:e??"all",options:y,onValueChange:e=>{let r=new URLSearchParams(s.toString());"all"===e?r.delete("settlement"):r.set("settlement",e),t.push(l+"?"+r.toString(),{scroll:!1})}})}function k({category:e,selected:t=!1}){return(0,r.jsx)(u,{selected:t,children:"All"===e?"All":o.CP[e]})}}}]); 4//# debugId=cfaeecad-b040-551a-848d-443d47c12da3
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.