1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5916],{2960:(e,s,l)=>{"use strict";l.r(s),l.d(s,{__N_SSP:()=>h,default:()=>u});var a=l(37876),n=l(87868),i=l(14232),r=l(19512),t=l(88992),o=l(96415),c=l(91408),d=l(61875),m=l(71134),x=l(11613),h=!0;function u(e){function s(){(0,x.UG)("Failed to validate")}async function l(){if(console.log("Sending message"),confirm("Ok to send"))try{let e=JSON.stringify({options:w});console.log("OPTS",e),await fetch("/api/admin/send_email",{method:"POST",headers:{"Content-Type":"application/json"},body:e}).then(e=>e.json()).then(e=>{console.log(e),e.error?(0,x.UG)(`Failed: ${e.error}`):(0,x.VX)("Sent emails"),_()}).catch(e=>{console.log("FAIL 1"),(0,x.UG)("Failed to send: "+e.message)})}catch(e){console.log("FAIL 2"),(0,x.UG)("Failed to send: "+e.message)}}let h=c.Ik().shape({to:c.Yj(),html:c.Yj(),subject:c.Yj().required("Subject is required")}),u={shouldFocusError:!1,resolver:(0,o.t)(h),defaultValues:(0,i.useMemo)(()=>({to:"",subject:"",html:""}),[])},{register:j,handleSubmit:f,watch:b,reset:_,setValue:g,formState:p,control:N}=(0,t.mN)(u),{errors:v}=p,w=b();return(0,a.jsxs)(n.A,{...e,hideNav:!0,children:[(0,a.jsxs)("section",{className:"mt-8",children:[(0,a.jsx)(r.A,{onClick:function(){g("to",e.sellerEmails?.join(","))},children:"All Sellers"}),(0,a.jsx)(r.A,{onClick:function(){g("to",e.nonSellerEmails?.join(","))},children:"All Non Sellers"}),(0,a.jsx)(r.A,{onClick:function(){g("to",e.allEmails?.join(","))},children:"All Registered Users"})]}),(0,a.jsxs)("div",{className:"mt-4",children:[(0,a.jsx)(d.L0,{field:"to",register:j,className:"w-full",errors:v,label:"To"}),(0,a.jsx)(d.Kw,{field:"to",errors:v})]}),(0,a.jsxs)("div",{className:"mt-4 ",children:[(0,a.jsx)(d.L0,{field:"subject",register:j,className:"w-full",errors:v,label:"Subject"}),(0,a.jsx)(d.Kw,{field:"subject",errors:v})]}),(0,a.jsxs)("div",{className:"mt-4",children:[(0,a.jsx)("textarea",{rows:20,...j("html"),value:w.html,className:`w-full p-2 form-control ${v.html?"is-invalid":""}`,placeholder:"Email html!"}),(0,a.jsx)("div",{className:"bio bg-neutral-900 p-2 ",dangerouslySetInnerHTML:{__html:(0,m.y0)(w.html)}}),(0,a.jsx)(d.Kw,{field:"html",errors:v})]}),(0,a.jsxs)("div",{className:"my-8 flex flex-row gap-4 spacing-4",children:[(0,a.jsx)(r.A,{variant:"contained",component:"label",onClick:()=>f(l,s)(),children:"Send Email"}),(0,a.jsx)(r.A,{onClick:()=>_(),children:"Clear"})]})]})}},33836:(e,s,l)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/_admin/send_email",function(){return l(2960)}])},87868:(e,s,l)=>{"use strict";l.d(s,{A:()=>h});var a=l(37876);l(14232);var n=l(48230),i=l.n(n),r=l(89099),t=l(10553),o=l(4186);let c=[{href:"/_admin/",label:"Admin",icon:(0,a.jsx)(o.g_8,{})},{href:"/_admin/stats",label:"Stats",icon:(0,a.jsx)(o.DX0,{})},{href:"/_admin/orders",label:"Orders",icon:(0,a.jsx)(o.q8i,{})},{href:"/_admin/sales",label:"Sales",icon:(0,a.jsx)(o.imn,{})},{href:"/_admin/carts",label:"Carts",icon:(0,a.jsx)(o.O7Q,{})},{href:"/_admin/payouts",label:"Payouts",icon:(0,a.jsx)(o.DwJ,{})},{href:"/_admin/revenues",label:"Revenues",icon:(0,a.jsx)(o.H4F,{})},{href:"/_admin/vat",label:"VAT",icon:(0,a.jsx)(o.q89,{})},{href:"/_admin/virtual_cash",label:"Virtual Cash",icon:(0,a.jsx)(o.ohY,{})},{href:"/_admin/pricing",label:"Pricing",icon:(0,a.jsx)(o.HdF,{})},{href:"/_admin/sellers",label:"Sellers",icon:(0,a.jsx)(o.nZo,{})},{href:"/_admin/beta_queue",label:"Beta Queue",icon:(0,a.jsx)(o.tX0,{})},{href:"/_admin/music",label:"Music",icon:(0,a.jsx)(o.qzP,{})},{href:"/_admin/tracks",label:"Tracks",icon:(0,a.jsx)(o.vC2,{})},{href:"/_admin/genre_change",label:"Genre Change",icon:(0,a.jsx)(o.M1j,{})},{href:"/_admin/send_email",label:"Send Email",icon:(0,a.jsx)(o.mm2,{})},{href:"/_admin/queues",label:"Queues",icon:(0,a.jsx)(o.fs5,{})},{href:"/_admin/release_jobs",label:"Release Jobs",icon:(0,a.jsx)(o.qzP,{})},{href:"/_admin/waf",label:"WAF",icon:(0,a.jsx)(o.Ueo,{})},{href:"/_admin/system",label:"System",icon:(0,a.jsx)(o.hgV,{})},{href:"/_admin/testing",label:"Testing",icon:(0,a.jsx)(o.mGp,{})}];function d(e){return["inline-flex items-center gap-1.5 rounded-md px-2.5 py-1 text-sm font-medium transition-colors",e?"bg-brand text-white shadow-sm":"bg-neutral-800 text-neutral-200 hover:bg-neutral-600"].join(" ")}function m({href:e,label:s,icon:l}){var n;let t=(n=(0,r.useRouter)().pathname,"/_admin/"===e?"/_admin"===n||"/_admin/"===n:n===e||n.startsWith(`${e}/`));return(0,a.jsx)("li",{children:(0,a.jsxs)(i(),{href:e,className:d(t),children:[(0,a.jsx)("span",{className:"text-base shrink-0 opacity-90",children:l}),s]})})}function x({href:e,label:s,icon:l,onClick:n}){let r=d(!1);return n?(0,a.jsxs)("button",{type:"button",onClick:n,className:r,children:[(0,a.jsx)("span",{className:"text-base shrink-0 opacity-90",children:l}),s]}):(0,a.jsxs)(i(),{href:e,className:r,children:[(0,a.jsx)("span",{className:"text-base shrink-0 opacity-90",children:l}),s]})}function h(e){let s=e.children;return(0,a.jsxs)("div",{className:"min-h-screen bg-neutral-950 text-neutral-100",children:[e.message?(0,a.jsx)("div",{className:"border-b border-orange-400/30 bg-
1orange-300/20 px-4 py-1.5 text-sm text-orange-100",children:e.message}):null,(0,a.jsxs)("header",{className:"border-b border-neutral-800 bg-neutral-900",children:[(0,a.jsxs)("div",{className:"mx-auto flex max-w-7xl flex-wrap items-center justify-between gap-2 px-4 py-2",children:[(0,a.jsxs)("span",{className:"inline-flex items-center gap-2 text-lg font-semibold text-white",children:[(0,a.jsx)(o.g_8,{className:"text-2xl text-brand"}),"Admin"]}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsx)(x,{href:"/",label:"Main Site",icon:(0,a.jsx)(o.Tsc,{})}),(0,a.jsx)(x,{label:"Sign Out",icon:(0,a.jsx)(o.EyH,{}),onClick:()=>(0,t.signOut)()})]})]}),(0,a.jsx)("nav",{className:"mx-auto max-w-7xl border-t border-neutral-800 px-4 py-2",children:(0,a.jsx)("ul",{className:"flex flex-wrap gap-1.5",children:c.map(e=>(0,a.jsx)(m,{...e},e.href))})})]}),(0,a.jsx)("div",{className:"mx-auto max-w-7xl p-4",children:s})]})}}},e=>{e.O(0,[636,6593,8792],()=>e(e.s=33836)),_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.