1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[981],{1539:(e,s,t)=>{"use strict";t.d(s,{A:()=>a});let a=(0,t(9946).A)("zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]])},3109:(e,s,t)=>{"use strict";t.d(s,{A:()=>a});let a=(0,t(9946).A)("trending-up",[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]])},4139:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>w});var a=t(5155),n=t(9683),l=t(285),i=t(6695),r=t(2523),d=t(5057),o=t(9409),c=t(8539),m=t(1539),x=t(7580),u=t(3109),h=t(9946);let p=(0,h.A)("tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);var g=t(4186),f=t(5868);let j=(0,h.A)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);var v=t(2115);function N(){let{createBet:e}=(0,n.lQ)(),s={description:"",optionA:"",optionB:"",endTime:"",category:"",minBetAmount:"0.0001",maxBetAmount:"100"},[t,h]=(0,v.useState)(s),N=e=>{let{id:s,value:t}=e.target;h(e=>({...e,[s]:t}))},b=async()=>{let{description:a,optionA:n,optionB:l,endTime:i,category:r,minBetAmount:d,maxBetAmount:o}=t;if(!a||!n||!l||!i||!r)return;let c=new Date(i).getTime();await e.mutateAsync({description:a.trim(),optionA:n.trim(),optionB:l.trim(),endTime:c,category:r.trim(),minBetAmount:1e9*parseFloat(d),maxBetAmount:1e9*parseFloat(o)}),h(s)};return(0,a.jsx)("div",{className:"min-h-screen bg-background",children:(0,a.jsx)("div",{className:"container mx-auto px-4 py-8 max-w-4xl",children:(0,a.jsxs)(i.Zp,{className:"border-border shadow-lg",children:[(0,a.jsx)(i.aR,{className:"space-y-1",children:(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"w-10 h-10 bg-muted rounded-lg flex items-center justify-center",children:(0,a.jsx)(m.A,{className:"w-5 h-5 text-foreground"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)(i.ZB,{className:"text-2xl",children:"Create the Bet"}),(0,a.jsx)(i.BT,{children:"Configure your prediction market parameters"})]})]})}),(0,a.jsxs)(i.Wu,{className:"space-y-8",children:[(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsxs)(d.J,{htmlFor:"description",className:"text-sm font-medium flex items-center gap-2",children:[(0,a.jsx)(x.A,{className:"w-4 h-4"}),"Description"]}),(0,a.jsx)(c.T,{id:"description",value:t.description,onChange:N,placeholder:"What is this bet about? Provide a clear description of the market...",className:"min-h-[120px] resize-none",required:!0}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:"Be specific and clear about what you're betting on"})]}),(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)(d.J,{className:"text-sm font-medium flex items-center gap-2",children:[(0,a.jsx)(u.A,{className:"w-4 h-4"}),"Betting Options"]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(d.J,{htmlFor:"optionA",className:"text-sm text-muted-foreground",children:"Option A"}),(0,a.jsx)(r.p,{id:"optionA",value:t.optionA,onChange:N,placeholder:"First outcome",className:"h-11",required:!0})]}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(d.J,{htmlFor:"optionB",className:"text-sm text-muted-foreground",children:"Option B"}),(0,a.jsx)(r.p,{id:"optionB",value:t.optionB,onChange:N,placeholder:"Second outcome",className:"h-11",required:!0})]})]})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsxs)(d.J,{className:"text-sm font-medium flex items-center gap-2",children:[(0,a.jsx)(p,{className:"w-4 h-4"}),"Category"]}),(0,a.jsxs)(o.l6,{value:t.category,onValueChange:e=>{h(s=>({...s,category:e}))},children:[(0,a.jsx)(o.bq,{className:"h-11",children:(0,a.jsx)(o.yv,{placeholder:"Select a category"})}),(0,a.jsx)(o.gC,{children:["Sports","Politics","Entertainment","Technology","Finance","Weather","Other"].map(e=>(0,a.jsx)(o.eb,{value:e,children:e},e))})]})]}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsxs)(d.J,{htmlFor:"endTime",className:"text-sm font-medium flex items-center gap-2",children:[(0,a.jsx)(g.A,{className:"w-4 h-4"}),"End Time"]}),(0,a.jsx)(r.p,{id:"endTime",type:"datetime-local",value:t.endTime,onChange:N,className:"h-11",required:!0})]})]}),(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)(d.J,{className:"text-sm font-medium flex items-center gap-2",children:[(0,a.jsx)(f.A,{className:"w-4 h-4"}),"Betting Limits (SOL)"]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(d.J,{htmlFor:"minBetAmount",className:"text-sm text-muted-foreground",children:"Minimum Bet Amount"}),(0,a.jsx)(r.p,{id:"minBetAmount",type:"number",step:"0.0001",min:"0",value:t.minBetAmount,onChange:N,placeholder:"0.0001",className:"h-11",required:!0})]}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(d.J,{htmlFor:"maxBetAmount",className:"text-sm text-muted-foreground",children:"Maximum Bet Amount"}),(0,a.jsx)(r.p,{id:"maxBetAmount",type:"number",step:"0.01",min:"0",value:t.maxBetAmount,onChange:N,placeholder:"100",className:"h-11",required:!0})]})]}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:"Set reasonable limits to encourage participation"})]}),(0,a.jsxs)("div",{className:"rounded-lg border border-border bg-muted/50 p-4",children:[(0,a.jsxs)("h3",{className:"font-medium mb-3 flex items-center gap-2",children:[(0,a.jsx)(u.A,{className:"w-4 h-4"}),"Market Preview"]}),(0,a.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,a.jsxs)("div",{className:"flex justify-between",children:[(0,a.jsx)("span",{className:"text-muted-foreground",children:"Description:"}),(0,a.jsx)("span",{className:"font-medium",children:t.description||"Not set"})]}),(0,a.jsxs)("div",{className:"flex justify-between",children:[(0,a.jsx)("span",{className:"text-muted-foreground",children:"Category:"}),(0,a.jsx)("span",{className:"font-medium",children:t.category||"Not selected"})]}),(0,a.jsxs)("div",{className:"flex justify-between",children:[(0,a.jsx)("span",{className:"text-muted-foreground",children:"Options:"}),(0,a.jsxs)("span",{className:"font-medium",children:[t.optionA||"Option A"," vs ",t.optionB||"Option B"]})]}),(0,a.jsxs)("div",{className:"flex justify-between",children:[(0,a.jsx)("span",{className:"text-muted-foreground",children:"Bet Range:"}),(0,a.jsxs)("span",{className:"font-medium",children:[t.minBetAmount," - ",t.maxBetAmount," SOL"]})]})]})]}
1),(0,a.jsx)(l.$,{onClick:b,disabled:e.isPending||!t.description||!t.optionA||!t.optionB||!t.endTime||!t.category,className:"w-full h-12 text-base font-medium",children:e.isPending?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"w-4 h-4 border-2 border-current border-t-transparent rounded-full animate-spin mr-2"}),"Creating Market..."]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(j,{className:"w-4 h-4 mr-2"}),"Create Betting Market"]})})]})]})})})}var b=t(6263),y=t(1392);function w(){var e;let{publicKey:s}=(0,y.v)(),{programId:t,getProgramAccount:l}=(0,n.lQ)();if(!s)return(0,a.jsxs)("div",{className:"min-h-[60vh] flex flex-col justify-center items-center text-center px-4",children:[(0,a.jsx)("h2",{className:"text-2xl font-semibold mb-4",children:"Connect Your Wallet"}),(0,a.jsx)("p",{className:"text-muted-foreground mb-6 max-w-md",children:"To start using the betting platform, connect your Solana wallet."}),(0,a.jsx)(b.U3,{className:"w-full max-w-xs"})]});let i=!!(null==(e=l.data)?void 0:e.value);return(0,a.jsx)("div",{className:"flex justify-center items-center min-h-[60vh] px-4",children:i?(0,a.jsx)(N,{}):(0,a.jsxs)("div",{className:"bg-yellow-50 border border-yellow-200 text-yellow-800 rounded-lg p-6 max-w-lg w-full shadow-sm",children:[(0,a.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Program Not Deployed"}),(0,a.jsx)("p",{className:"text-sm mb-3",children:"The betting program isnât deployed to this cluster. To deploy it, run the following command:"}),(0,a.jsx)("pre",{className:"bg-yellow-100 text-yellow-900 text-xs font-mono p-3 rounded",children:"anchor deploy"})]})})}},6811:(e,s,t)=>{Promise.resolve().then(t.bind(t,4139))},9409:(e,s,t)=>{"use strict";t.d(s,{bq:()=>m,eb:()=>u,gC:()=>x,l6:()=>o,yv:()=>c});var a=t(5155);t(2115);var n=t(3081),l=t(6474),i=t(5196),r=t(7863),d=t(9434);function o(e){let{...s}=e;return(0,a.jsx)(n.bL,{"data-slot":"select",...s})}function c(e){let{...s}=e;return(0,a.jsx)(n.WT,{"data-slot":"select-value",...s})}function m(e){let{className:s,size:t="default",children:i,...r}=e;return(0,a.jsxs)(n.l9,{"data-slot":"select-trigger","data-size":t,className:(0,d.cn)("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",s),...r,children:[i,(0,a.jsx)(n.In,{asChild:!0,children:(0,a.jsx)(l.A,{className:"size-4 opacity-50"})})]})}function x(e){let{className:s,children:t,position:l="popper",...i}=e;return(0,a.jsx)(n.ZL,{children:(0,a.jsxs)(n.UC,{"data-slot":"select-content",className:(0,d.cn)("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md","popper"===l&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",s),position:l,...i,children:[(0,a.jsx)(h,{}),(0,a.jsx)(n.LM,{className:(0,d.cn)("p-1","popper"===l&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),(0,a.jsx)(p,{})]})})}function u(e){let{className:s,children:t,...l}=e;return(0,a.jsxs)(n.q7,{"data-slot":"select-item",className:(0,d.cn)("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",s),...l,children:[(0,a.jsx)("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:(0,a.jsx)(n.VF,{children:(0,a.jsx)(i.A,{className:"size-4"})})}),(0,a.jsx)(n.p4,{children:t})]})}function h(e){let{className:s,...t}=e;return(0,a.jsx)(n.PP,{"data-slot":"select-scroll-up-button",className:(0,d.cn)("flex cursor-default items-center justify-center py-1",s),...t,children:(0,a.jsx)(r.A,{className:"size-4"})})}function p(e){let{className:s,...t}=e;return(0,a.jsx)(n.wn,{"data-slot":"select-scroll-down-button",className:(0,d.cn)("flex cursor-default items-center justify-center py-1",s),...t,children:(0,a.jsx)(l.A,{className:"size-4"})})}}},e=>{var s=s=>e(e.s=s);e.O(0,[252,956,919,33,770,281,354,267,441,684,358],()=>s(6811)),_N_E=e.O()}]);
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.