PageSourceSearch

https://relief-resq-beta.vercel.app/_next/static/chunks/app/emergencies/page-418d9078052c3945.js

js relief-resq-beta.vercel.app collected 2026-10-03 07:36:31 UTC 10,802 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2304],{56947:(e,s,a)=>{Promise.resolve().then(a.bind(a,34286))},34286:(e,s,a)=>{"use strict";a.d(s,{default:()=>E});var t=a(95155),r=a(12115),l=a(89136),n=a(52604),i=a(87081),c=a(62591),d=a(39124),o=a(25121),m=a(98986),u=a(73312),h=a(51344),x=a(22130),p=a(37528),f=a(33900),j=a(15157),g=a(82651),y=a(86808),v=a(98982),b=a(52316),w=a(99025);let N=e=>{let{article:s,openDialog:a}=e;return(0,t.jsxs)(x.Zp,{className:"flex h-full flex-col justify-between",children:[(0,t.jsx)(x.aR,{children:(0,t.jsx)("div",{className:"flex justify-between",children:(0,t.jsxs)("div",{children:[(0,t.jsx)(x.ZB,{className:"mb-1 text-lg",children:s.title.split(" - ")[0]}),(0,t.jsx)(j.w,{}),(0,t.jsx)(x.BT,{className:"mt-2",children:(0,t.jsxs)("div",{className:"flex justify-between",children:[new Date(s.published).toLocaleDateString(),(0,t.jsx)(o.E,{variant:"high"===s.severity?"destructive":"medium"===s.severity?"secondary":"default",className:"my-auto",children:s.severity.toUpperCase()})]})})]})})}),(0,t.jsxs)(x.Wu,{className:"pb-2",children:[(0,t.jsx)("div",{className:"mb-4",dangerouslySetInnerHTML:{__html:s.description.split(" ")[0]}}),(0,t.jsxs)("div",{className:"mb-2 flex items-center gap-2",children:[(0,t.jsx)(o.E,{variant:"outline",className:"capitalize",children:s.emergencyType}),(0,t.jsxs)("span",{className:"text-sm text-muted-foreground",children:["Source: ",s.source]})]})]}),(0,t.jsx)(x.wL,{className:"border-t pt-4",children:(0,t.jsxs)("div",{className:"flex w-full justify-end gap-3",children:[(0,t.jsx)("a",{href:s.link,target:"_blank",rel:"noopener noreferrer",children:(0,t.jsx)(u.$,{variant:"outline",children:"View Report"})}),(0,t.jsx)(u.$,{variant:"outline",onClick:a,children:(0,t.jsx)(l.A,{})}),(0,t.jsx)("a",{href:"/emergencies/map/".concat(s.title),children:(0,t.jsx)(u.$,{className:"bg-green-600 text-white hover:bg-green-500 dark:bg-green-700",children:(0,t.jsx)(n.A,{})})})]})})]})},E=()=>{let[e,s]=(0,r.useState)([]),[a,l]=(0,r.useState)(!0),[n,o]=(0,r.useState)("all"),[x,E]=(0,r.useState)("all"),[A,C]=(0,r.useState)(""),[S,R]=(0,r.useState)(null),[k,F]=(0,r.useState)(null),[T,_]=(0,r.useState)(!1),[L,H]=(0,r.useState)(""),[P,D]=(0,r.useState)(0),U=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"/emergency-news";try{l(!0);let a=await fetch("".concat("https://disaster-news.vercel.app").concat(e)),t=await a.json();s(t.articles||[]),R(null)}catch(e){R("Failed to fetch emergency news"),s([])}finally{l(!1)}};(0,r.useEffect)(()=>{"all"!==n?U("/emergency-news/by-type/".concat(n)):"all"!==x?U("/emergency-news/by-severity/".concat(x)):A?U("/search/".concat(encodeURIComponent(A))):U()},[n,x,A]),(0,r.useEffect)(()=>{k&&L?D(parseFloat((parseFloat(L)*k).toFixed(2))):D(0)},[L,k]),(0,r.useEffect)(()=>{(async()=>{try{let e=await g.A.get("https://api.coingecko.com/api/v3/simple/price?ids=ethereum&vs_currencies=inr");F(e.data.ethereum.inr)}catch(e){console.error("Error fetching ETH price:",e)}})(),U()},[]);let V=async()=>{let e=new y.k(window.ethereum),s=await e.getSigner(),a="0x36F8A5A4E1fBE6AD9A31D3f6b99Ae7E9ABE507EF";if(!a)throw Error("Contract address is missing in .env");let t=new v.NZ(a,w.HV,s);try{let e=await t.depositFunds({value:(0,b.g5)(L)});await e.wait(),console.log("Deposit successful!")}catch(e){console.error("Error depositing funds:",e)}};return(0,t.jsxs)("div",{className:"mx-auto max-w-7xl px-4 py-8",children:[(0,t.jsxs)("div",{className:"mb-8",children:[(0,t.jsx)("h1",{className:"mb-2 text-3xl font-bold",children:"Emergency Relief Center"}),(0,t.jsx)("p",{className:"text-muted-foreground",children:"Latest updates on emergencies and disasters worldwide"})]}),(0,t.jsxs)("div",{className:"mb-6 flex flex-wrap items-center gap-4",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-4",children:[(0,t.jsx)(i.A,{className:"h-5 w-5"}),(0,t.jsxs)(p.l6,{value:n,onValueChange:e=>{o(e),E("all"),C("")},children:[(0,t.jsx)(p.bq,{className:"w-[180px]",children:(0,t.jsx)(p.yv,{placeholder:"Emergency Type"})}),(0,t.jsxs)(p.gC,{children:[(0,t.jsx)(p.eb,{value:"all",children:"All Types"}),(0,t.jsx)(p.eb,{value:"natural",children:"Natural"}),(0,t.jsx)(p.eb,{value:"medical",children:"Medical"}),(0,t.jsx)(p.eb,{value:"fire",children:"Fire"}),(0,t.jsx)(p.eb,{value:"accident",children:"Accident"}),(0,t.jsx)(p.eb,{value:"other",children:"Other"})]})]}),(0,t.jsxs)(p.l6,{value:x,onValueChange:e=>{E(e),o("all"),C("")},children:[(0,t.jsx)(p.bq,{className:"w-[180px]",children:(0,t.jsx)(p.yv,{placeholder:"Severity"})}),(0,t.jsxs)(p.gC,{children:[(0,t.jsx)(p.eb,{value:"all",children:"All Severities"}),(0,t.jsx)(p.eb,{value:"high",children:"High"}),(0,t.jsx)(p.eb,{value:"medium",children:"Medium"}),(0,t.jsx)(p.eb,{value:"low",children:"Low"})]})]})]}),(0,t.jsxs)("form",{onSubmit:e=>{e.preventDefault(),C(e.target.elements.search.value),o("all"),E("all")},className:"flex gap-2",children:[(0,t.jsx)(f.p,{type:"search",name:"search",placeholder:"Search emergencie
1s...",className:"w-[200px]"}),(0,t.jsx)(u.$,{type:"submit",variant:"secondary",children:(0,t.jsx)(c.A,{className:"h-4 w-4"})})]})]}),a?(0,t.jsx)("div",{className:"flex h-40 items-center justify-center",children:(0,t.jsx)("div",{className:"h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent"})}):(0,t.jsx)("div",{className:"mb-8 grid gap-6 md:grid-cols-2 lg:grid-cols-3",children:e.map((e,s)=>(0,t.jsx)(d.P.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3,delay:.1*s},children:(0,t.jsx)(N,{article:e,openDialog:()=>_(!0)})},s))}),(0,t.jsx)(h.lG,{open:T,onOpenChange:_,children:(0,t.jsxs)(h.Cf,{className:"sm:max-w-[425px]",children:[(0,t.jsxs)(h.c7,{children:[(0,t.jsx)(h.L3,{children:"Pay Now, Help when needed"}),(0,t.jsx)(h.rr,{children:"Set up money in a wallet to pay automatically when an emergency occurs"})]}),(0,t.jsxs)("div",{className:"grid gap-4 py-4",children:[(0,t.jsxs)("div",{className:"flex flex-col space-y-1.5",children:[(0,t.jsx)(m.J,{htmlFor:"amount",children:"Amount (ETH)"}),(0,t.jsx)(f.p,{onChange:e=>H(e.target.value),id:"amount",placeholder:"Amount in ETH"})]}),(0,t.jsxs)("div",{className:"flex flex-col space-y-1.5",children:[(0,t.jsx)(m.J,{htmlFor:"converted",children:"Converted Currency"}),(0,t.jsx)(f.p,{id:"converted",disabled:!0,value:"".concat(P," Rs"),placeholder:"Amount in Rs which is converted"})]})]}),(0,t.jsx)(j.w,{}),(0,t.jsx)(h.Es,{children:(0,t.jsxs)(u.$,{onClick:V,variant:"outline",type:"submit",children:[(0,t.jsx)("img",{src:"https://cdn.simpleicons.org/ethereum/ethereum",height:15,width:15,alt:"Hi"}),"Pay Now with Ethereum"]})})]})})]})}},25121:(e,s,a)=>{"use strict";a.d(s,{E:()=>i});var t=a(95155);a(12115);var r=a(31027),l=a(21567);let n=(0,r.F)("inline-flex items-center rounded-full border px-3 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",success:"border-transparent bg-green-600 text-primary-foreground shadow hover:bg-green-600/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function i(e){let{className:s,variant:a,...r}=e;return(0,t.jsx)("div",{className:(0,l.cn)(n({variant:a}),s),...r})}},37528:(e,s,a)=>{"use strict";a.d(s,{TR:()=>j,bq:()=>h,eb:()=>g,gC:()=>f,l6:()=>o,s3:()=>m,yv:()=>u});var t=a(95155),r=a(12115),l=a(58065),n=a(32645),i=a(52488),c=a(27193),d=a(21567);let o=l.bL,m=l.YJ,u=l.WT,h=r.forwardRef((e,s)=>{let{className:a,children:r,...i}=e;return(0,t.jsxs)(l.l9,{ref:s,className:(0,d.cn)("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm r
1ing-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",a),...i,children:[r,(0,t.jsx)(l.In,{asChild:!0,children:(0,t.jsx)(n.A,{className:"h-4 w-4 opacity-50"})})]})});h.displayName=l.l9.displayName;let x=r.forwardRef((e,s)=>{let{className:a,...r}=e;return(0,t.jsx)(l.PP,{ref:s,className:(0,d.cn)("flex cursor-default items-center justify-center py-1",a),...r,children:(0,t.jsx)(i.A,{className:"h-4 w-4"})})});x.displayName=l.PP.displayName;let p=r.forwardRef((e,s)=>{let{className:a,...r}=e;return(0,t.jsx)(l.wn,{ref:s,className:(0,d.cn)("flex cursor-default items-center justify-center py-1",a),...r,children:(0,t.jsx)(n.A,{className:"h-4 w-4"})})});p.displayName=l.wn.displayName;let f=r.forwardRef((e,s)=>{let{className:a,children:r,position:n="popper",...i}=e;return(0,t.jsx)(l.ZL,{children:(0,t.jsxs)(l.UC,{ref:s,className:(0,d.cn)("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md 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","popper"===n&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",a),position:n,...i,children:[(0,t.jsx)(x,{}),(0,t.jsx)(l.LM,{className:(0,d.cn)("p-1","popper"===n&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:r}),(0,t.jsx)(p,{})]})})});f.displayName=l.UC.displayName;let j=r.forwardRef((e,s)=>{let{className:a,...r}=e;return(0,t.jsx)(l.JU,{ref:s,className:(0,d.cn)("py-1.5 pl-8 pr-2 text-sm font-semibold",a),...r})});j.displayName=l.JU.displayName;let g=r.forwardRef((e,s)=>{let{className:a,children:r,...n}=e;return(0,t.jsxs)(l.q7,{ref:s,className:(0,d.cn)("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",a),...n,children:[(0,t.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,t.jsx)(l.VF,{children:(0,t.jsx)(c.A,{className:"h-4 w-4"})})}),(0,t.jsx)(l.p4,{children:r})]})});g.displayName=l.q7.displayName,r.forwardRef((e,s)=>{let{className:a,...r}=e;return(0,t.jsx)(l.wv,{ref:s,className:(0,d.cn)("-mx-1 my-1 h-px bg-muted",a),...r})}).displayName=l.wv.displayName}},e=>{var s=s=>e(e.s=s);e.O(0,[8249,15,9124,6284,2121,3556,8441,1517,7358],()=>s(56947)),_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.