PageSourceSearch

https://photofinish.live/_next/static/chunks/pages/admin/announcements-a14acea174e383ef.js

js photofinish.live collected 2026-10-01 15:14:05 UTC 58,443 bytes, 13 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2428],{2845:()=>{},24369:(e,t,a)=>{"use strict";a.d(t,{QZ:()=>n,T$:()=>c,pn:()=>i});let l=a(53342),r=["www.youtube.com","player.vimeo.com"],s=["address","article","aside","footer","header","h1","h2","h3","h4","h5","h6","hgroup","main","nav","section","blockquote","dd","div","dl","dt","figcaption","figure","hr","li","main","ol","p","pre","ul","a","abbr","b","bdi","bdo","br","cite","code","data","dfn","em","i","kbd","mark","q","rb","rp","rt","rtc","ruby","s","samp","small","span","strong","sub","sup","time","u","var","wbr","caption","col","colgroup","table","tbody","td","tfoot","th","thead","tr","iframe","img"],n=e=>l(e,{allowedTags:[],allowedAttributes:{}}),i=e=>l(e,{exclusiveFilter:e=>!((e?.tag!=="iframe"||e?.attribs?.src)&&(e?.tag!=="img"||e?.attribs?.src)),allowedTags:s,allowedAttributes:{iframe:["src","allowfullscreen","title","width","height","frameborder","allow"],img:["class","src","srcset","alt","title","width","height","loading"],a:["href","name","target"]},allowedIframeHostnames:r}),c=e=>{if(!e)return"";let t=e.split(/\n\s*\n/).map(e=>{let t=e.trim();if(!t)return"";if(t.split("\n").every(e=>e.trim().startsWith("<li>")))return`<ul>${t}</ul>`;{let e=t.replace(/\n/g,"<br>");return`<p>${e}</p>`}}).filter(e=>e).join("");return(t=t.replace(/<br>\s*<li>/g,"<li>")).replace(/<\/li>\s*<br>/g,"</li>")}},35326:()=>{},35451:(e,t,a)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/announcements",function(){return a(90613)}])},43294:(e,t,a)=>{"use strict";a.d(t,{f:()=>o});var l=a(26514),r=a(72122),s=a(46225),n=a(96456),i=a.n(n);a(75834);let c=[{path:"/admin/announcements",label:"Communications"},{path:"/admin/email-notifications",label:"Email Notifications"},{path:"/admin/kill-switches",label:"Kill Switches"},{path:"/admin/payouts",label:"Payouts"},{path:"/admin/analytics",label:"Analytics"},{path:"/admin/system-health",label:"System Health"}],o=e=>{let t,a,n,o=(0,r.c)(7),{children:d}=e,m=(0,s.useRouter)().pathname;return o[0]!==m?(t=c.map(e=>{let{path:t,label:a}=e;return(0,l.jsx)(i(),{href:t,children:(0,l.jsx)("span",{className:`px-3 py-3 pfmd:px-4 text-sm font-medium border-b-2 transition-colors block min-h-[44px] ${m===t?"border-secondary-400 text-secondary-400 bg-primary-800/50":"border-transparent text-gray-300 hover:text-white hover:bg-primary-800/30"}`,children:a})},t)}),o[0]=m,o[1]=t):t=o[1],o[2]!==t?(a=(0,l.jsx)("div",{className:"flex flex-wrap bg-[#0d343c] border-b border-primary-700 mb-6 rounded-sm",children:t}),o[2]=t,o[3]=a):a=o[3],o[4]!==d||o[5]!==a?(n=(0,l.jsxs)(l.Fragment,{children:[a,d]}),o[4]=d,o[5]=a,o[6]=n):n=o[6],n}},44809:()=>{},70056:()=>{},71837:(e,t,a)=>{"use strict";a.d(t,{A:()=>f});var l=a(26514),r=a(72122),s=a(75834),n=a(92375),i=a(1123),c=a(1455),o=a(46225),d=a(31950),m=a(21958),h=a(96456),u=a.n(h),p=a(69446),g=a(17472),x=a(33321);let b=[{path:"/admin/announcements",label:"Communications",role:p.eq.Agent,isActive:e=>"/admin"===e||"/admin/announcements"===e||"/admin/email-notifications"===e||"/admin/kill-switches"===e||"/admin/payouts"===e||"/admin/analytics"===e||"/admin/system-health"===e||"/admin/blog-editor"===e},{path:"/admin/misc/gameplay",label:"Misc",role:p.eq.Agent,isActive:e=>e.startsWith("/admin/misc")},{path:"/admin/user-management",label:"User Management",role:p.eq.Agent},{path:"/admin/horse-management",label:"Horse Management",role:p.eq.Agent},{path:"/admin/money/miscellaneous",label:"Money",role:p.eq.Agent},{path:"/admin/schedule/editor",label:"Schedule",role:p.eq.LiveOps,isActive:e=>e.startsWith("/admin/schedule")},{path:"/admin/promotions",label:"Promotions",role:p.eq.LiveOps},{path:"/admin/onboarding",label:"Onboarding",role:p.eq.LiveOps},{path:"/admin/cms",label:"CMS",role:p.eq.LiveOps},{path:"/admin/learntoplay",label:"Learn to Play",role:p.eq.LiveOps},{path:"/admin/archived/old-live-ops",label:"Archived",role:p.eq.Agent,isActive:e=>e.startsWith("/admin/archived")}],y=e=>{let t,a,d,m,h,y,f,j,v,N,S,w=(0,r.c)(31),{userRole:_,userName:E,rateLimited:C,children:P}=e,A=(0,o.useRouter)(),{data:k}
1=(0,x.E)(),[T,O]=(0,s.useState)(!1),[Y,$]=(0,s.useState)(!1);w[0]===Symbol.for("react.memo_cache_sentinel")?(t=()=>{let e=()=>{$(window.innerWidth<768)};return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},a=[],w[0]=t,w[1]=a):(t=w[0],a=w[1]),(0,s.useEffect)(t,a),w[2]!==_?(d=e=>_<=e.role,w[2]=_,w[3]=d):d=w[3];let I=b.filter(d);if(w[4]===Symbol.for("react.memo_cache_sentinel")?(m=()=>{O(!1)},w[4]=m):m=w[4],w[5]!==A.pathname?(h=[A.pathname],w[5]=A.pathname,w[6]=h):h=w[6],(0,s.useEffect)(m,h),C){let e,t,a,r;return w[7]===Symbol.for("react.memo_cache_sentinel")?(e=(0,l.jsx)(n.Av,{pageTitle:"Admin Page",className:"mh_admin",children:(0,l.jsx)(i.sT,{description:"Please wait a moment",children:"Admin Console"})}),w[7]=e):e=w[7],w[8]===Symbol.for("react.memo_cache_sentinel")?(t=(0,l.jsx)(c.EY.default,{className:"text-xl font-bold mb-2",children:"Too Many Requests"}),a=(0,l.jsx)(c.EY.default,{className:"text-gray-300 mb-4",children:"The authentication service is temporarily rate limited. Please wait a moment and refresh the page."}),w[8]=t,w[9]=a):(t=w[8],a=w[9]),w[10]!==A?(r=(0,l.jsxs)(n.Ay,{metaPageTitle:"Admin Console",metaPageDescription:"Admin console in Photo Finish™ LIVE",hideMajor:!0,children:[e,(0,l.jsx)(n.Gv,{children:(0,l.jsx)(c.mc,{className:"py-8",children:(0,l.jsxs)("div",{className:"bg-yellow-900/50 border border-yellow-600 rounded-lg p-6 text-center",children:[t,a,(0,l.jsx)("button",{onClick:()=>A.reload(),className:"px-4 py-2 bg-primary-600 hover:bg-primary-500 rounded-md transition-colors",children:"Refresh Page"})]})})})]}),w[10]=A,w[11]=r):r=w[11],r}let F=n.Ay;w[12]!==_?(y=(0,p.pK)(_),w[12]=_,w[13]=y):y=w[13];let D=`User: ${E} | Role: ${y} | Season: ${k?.currentSeason||"..."}`;w[14]!==D?(f=(0,l.jsx)(n.Av,{pageTitle:"Admin Page",className:"mh_admin",children:(0,l.jsx)(i.sT,{description:D,children:"Admin Console"})}),w[14]=D,w[15]=f):f=w[15];let q=n.Gv;w[16]!==Y||w[17]!==T?(j=Y&&(0,l.jsxs)(c.Ye,{className:"justify-between items-center px-4 py-2 bg-[#11444d] border-b border-primary-700",children:[(0,l.jsx)(c.EY.default,{className:"font-bold text-lg",children:"Admin Navigation"}),(0,l.jsx)("button",{onClick:()=>O(!T),className:"p-2 focus:outline-none","aria-label":T?"Close menu":"Open menu",children:T?(0,l.jsx)(g.m6K,{size:24}):(0,l.jsx)(g.vIB,{size:24})})]}),w[16]=Y,w[17]=T,w[18]=j):j=w[18];let M=(!Y||T)&&(0,l.jsx)("div",{className:`
2              bg-[#11444d] border-b border-primary-700
3              ${Y?"absolute z-50 w-full shadow-lg":""}
4              ${Y?"flex flex-col":"flex flex-row flex-wrap justify-start items-center px-2 py-1.5"}
5            `,children:I.map(e=>{let t=e.isActive?e.isActive(A.pathname):A.pathname===e.path;return(0,l.jsx)(u(),{href:e.path,children:(0,l.jsx)("div",{className:`
6                    ${t?"bg-primary-900 text-white border-primary-300":"text-gray-200 hover:bg-primary-700 border-transparent hover:border-primary-400"}
7                    ${Y?"py-3 px-4 w-full border-l-4":"py-1 px-2 mx-0.5 my-0.5 text-xs font-medium whitespace-nowrap border-b-2 rounded-t-sm"}
8                    transition-all duration-150 cursor-pointer
9                  `,children:e.label})},e.path)})}),L=`${Y?"mt-4":"mt-2"}`;return w[19]!==P||w[20]!==L?(v=(0,l.jsx)("div",{className:L,children:P}),w[19]=P,w[20]=L,w[21]=v):v=w[21],w[22]!==q||w[23]!==j||w[24]!==M||w[25]!==v?(N=(0,l.jsxs)(q,{children:[j,M,v]}),w[22]=q,w[23]=j,w[24]=M,w[25]=v,w[26]=N):N=w[26],w[27]!==F||w[28]!==f||w[29]!==N?(S=(0,l.jsxs)(F,{metaPageTitle:"Admin Console",metaPageDescription:"Admin console in Photo Finish™ LIVE",hideMajor:!0,children:[f,N]}),w[27]=F,w[28]=f,w[29]=N,w[30]=S):S=w[30],S},f=e=>{let t,a=(0,r.c)(3),{authUser:s}=(0,d.wV)();if((0,m.gD)(s)){let e;return a[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,l.jsx)(n.Ay,{metaPageTitle:"Admin Console",metaPageDescription:"Admin console in Photo Finish™ LIVE",hideMajor:!0,children:(0,l.jsx)(c.mc,{})}),a[0]=e):e=a[0],e}return a[1]!==e?(t=(0,l.jsx)(y,{...e}),a[1]=e,a[2]=t):t=a[2],t}},75151:(e,t,a)=>{"use strict";a.d(t,{A:()=>d});var l=a(26514),r=a(72122);a(75834);var s=a(17472),n=a(31757),i=a(91504),c=a(74369);function o(e){let t,a,s=(0,r.c)(7),{headlines:n,startIndex:c}=e;if(s[0]!==n||s[1]!==c){let e;s[3]!==c?(e=(e,t)=>(0,l.jsx)("li",{children:(0,l.jsx)("div",{className:"py-3 text-sm font-medium leading-snug text-primary-50 pfmd:text-base",children:(0,l.jsx)(i.V,{text:e.text,category:e.category,entities:e.entities,fallbackLink:e.link})})},`${e.category}-${c+t}`),s[3]=c,s[4]=e):e=s[4],t=n.map(e),s[0]=n,s[1]=c,s[2]=t}else t=s[2];return s[5]!==t?(a=(0,l.jsx)("ul",{className:"divide-y divide-primary-300/15",children:t}),s[5]=t,s[6]=a):a=s[6],a}let d=e=>{let t,a,i,d=(0,r.c)(12),{headlines:m,singleColumn:h}=e,u=void 0!==h&&h;if(!m.length)return null;let p=Math.ceil(m.length/2);d[0]!==m||d[1]!==p?(t=m.slice(0,p),d[0]=m,d[1]=p,d[2]=t):t=d[2];let g=t;d[3]!==m||d[4]!==p?(a=m.slice(p),d[3]=m,d[4]=p,d[5]=a):a=d[5];let x=a;return d[6]!==m||d[7]!==g||d[8]!==p||d[9]!==x||d[10]!==u?(i=(0,l.jsx)(c.Ay,{sectionId:n.Me.TOP_HEADLINES,title:"Top Headlines",icon:s.ith,bodyClassName:"py-0 pfmd:py-0",children:u?(0,l.jsx)("div",{className:"px-4 pfmd:px-5",children:(0,l.jsx)(o,{headlines:m,startIndex:0})}):(0,l.jsxs)("div",{className:"grid grid-cols-1 pfmd:grid-cols-2 pfmd:divide-x pfmd:divide-primary-300/15",children:[(0,l.jsx)("div",{className:"px-4 pfmd:px-5",children:(0,l.jsx)(o,{headlines:g,startIndex:0})}),x.length>0&&(0,l.jsx)("div",{className:"border-t border-primary-300/15 px-4 pfmd:border-t-0 pfmd:px-5",children:(0,l.jsx)(o,{headlines:x,startIndex:p})})]})}
9),d[6]=m,d[7]=g,d[8]=p,d[9]=x,d[10]=u,d[11]=i):i=d[11],i}},77456:(e,t,a)=>{"use strict";a.d(t,{r:()=>i});var l=a(26514),r=a(72122),s=a(75834),n=a(17472);let i=e=>{let t,a,i,o,d,m,h,u,p,g=(0,r.c)(28),{sectionId:x,title:b,description:y,defaultExpanded:f,children:j}=e,v=void 0!==f&&f,N=`admin-section-leave-open-${x}`,S=(0,s.useId)(),[w,_]=(0,s.useState)(!1),[E,C]=(0,s.useState)(v),[P,A]=(0,s.useState)(!1);g[0]!==v||g[1]!==N?(t=()=>{let e="true"===localStorage.getItem(N);_(e),C(e||v),A(!0)},a=[N,v],g[0]=v,g[1]=N,g[2]=t,g[3]=a):(t=g[2],a=g[3]),(0,s.useEffect)(t,a),g[4]===Symbol.for("react.memo_cache_sentinel")?(i=()=>{C(c)},g[4]=i):i=g[4];let k=i;g[5]!==N?(o=e=>{_(e),localStorage.setItem(N,String(e)),e&&C(!0)},g[5]=N,g[6]=o):o=g[6];let T=o;if(!P){let e;return g[7]!==b?(e=(0,l.jsx)("div",{className:"bg-background-900 rounded-lg mb-4 shadow-lg border border-gray-700",children:(0,l.jsx)("div",{className:"px-4 py-3 pfmd:px-6 pfmd:py-4",children:(0,l.jsx)("h2",{className:"text-lg pfmd:text-xl font-bold text-orange-400",children:b})})}),g[7]=b,g[8]=e):e=g[8],e}let O=w||E;return g[9]!==b?(d=(0,l.jsx)("h2",{className:"text-lg pfmd:text-xl font-bold text-orange-400",children:b}),g[9]=b,g[10]=d):d=g[10],g[11]!==O?(m=O?(0,l.jsx)(n.Xbk,{className:"shrink-0 text-gray-300",size:24,"aria-hidden":!0}):(0,l.jsx)(n.j1Q,{className:"shrink-0 text-gray-300",size:24,"aria-hidden":!0}),g[11]=O,g[12]=m):m=g[12],g[13]!==S||g[14]!==O||g[15]!==d||g[16]!==m?(h=(0,l.jsxs)("button",{type:"button",onClick:k,"aria-expanded":O,"aria-controls":S,className:"w-full flex items-center justify-between gap-3 px-4 py-3 pfmd:px-6 pfmd:py-4 min-h-[44px] text-left hover:bg-primary-900/30 transition-colors rounded-t-lg",children:[d,m]}),g[13]=S,g[14]=O,g[15]=d,g[16]=m,g[17]=h):h=g[17],g[18]!==j||g[19]!==S||g[20]!==y||g[21]!==T||g[22]!==O||g[23]!==w?(u=O&&(0,l.jsxs)("div",{id:S,className:"px-4 pb-4 pfmd:px-6 pfmd:pb-6 border-t border-gray-700",children:[(0,l.jsxs)("label",{className:"flex items-center gap-2 py-3 text-sm text-gray-300 cursor-pointer select-none",children:[(0,l.jsx)("input",{type:"checkbox",checked:w,onChange:e=>T(e.target.checked),className:"h-4 w-4 rounded border-gray-500"}),"Leave open"]}),y&&(0,l.jsx)("p",{className:"text-gray-300 mb-4 text-sm",children:y}),(0,l.jsx)("div",{className:"mt-2",children:j})]}),g[18]=j,g[19]=S,g[20]=y,g[21]=T,g[22]=O,g[23]=w,g[24]=u):u=g[24],g[25]!==h||g[26]!==u?(p=(0,l.jsxs)("div",{className:"bg-background-900 rounded-lg mb-4 shadow-lg border border-gray-700",children:[h,u]}),g[25]=h,g[26]=u,g[27]=p):p=g[27],p};function c(e){return!e}},77982:()=>{},80230:(e,t,a)=>{"use strict";a.d(t,{I:()=>n});var l=a(72122),r=a(31412),s=a(14063);let n=e=>{let t,a=(0,l.c)(2);return a[0]!==e?(t={mutationFn:i,...e},a[0]=e,a[1]=t):t=a[1],(0,s.n)(t)};async function i(e){return(0,r.P)("https://api.photofinish.live/users/admin/cdn-image-upload",{method:"PUT",body:JSON.stringify(e)})}},90613:(e,t,a)=>{"use strict";a.r(t),a.d(t,{__N_SSP:()=>eS,default:()=>ew});var l=a(26514),r=a(72122),s=a(46225),n=a(1455),i=a(71837),c=a(43294),o=a(77456),d=a(75834),m=a(12024),h=a(48257),u=a(31412),p=a(14063);function g(e){return(0,u.P)("https://api.photofinish.live/users/admin/announcement/update",{method:"POST",body:JSON.stringify(e)})}let x=[{key:"announcement",label:"Announcement",theme:"default",color:"gray"},{key:"reminder",label:"Reminder",theme:"success",color:"green"},{key:"deadline",label:"Deadline",theme:"warning",color:"orange"},{key:"alert",label:"Alert",theme:"danger",color:"red"}],b=()=>{let e,t,a,s,i,c,o,d,u,b,f,j,v,N,S=(0,r.c)(15),{mutate:w}=((N=(0,r.c)(1))[0]===Symbol.for("react.memo_cache_sentinel")?(v={mutationFn:g},N[0]=v):v=N[0],(0,p.n)(v));return S[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,l.jsx)("div",{children:(0,l.jsx)("h1",{children:"\uD83D\uDCE2 Add Announcements "})}),t=(0,l.jsx)("br",{}),S[0]=e,S[1]=t):(e=S[0],t=S[1]),S[2]===Symbol.for("react.memo_cache_sentinel")?(a={message:"",showTime:"",messageType:0,announcementUrl:"",hideTime:""},S[2]=a):a=S[2],S[3]!==w?(s=e=>{let t=x[e.messageType];w({message:e.message,announcementUrl:e.announcementUrl,showTime:new Date(`${e.showTime}:00`).toISOString(),hideTime:new Date(`${e.hideTime}:00`).toISOString(),color:t.color,theme:t.theme})},S[3]=w,S[4]=s):s=S[4],S[5]===Symbol.for("react.memo_cache_sentinel")?(i=(0,l.jsx)(n.bn,{span:12,children:(0,l.jsx)(m.D0,{name:"message",placeholder:"Message",type:"text"})}),S[5]=i):i=S[5],S[6]===Symbol.for("react.memo_cache_sentinel")?(c=(0,l.jsx)(n.bn,{span:12,children:(0,l.jsx)(m.D0,{name:"announcementUrl",placeholder:"Link (Optional)",type:"text"})}),S[6]=c):c=S[6],S[7]===Symbol.for("react.memo_cache_sentinel")?(o=(0,l.jsxs)(n.bn,{span:12,className:"flex w-full space-x-2",children:[(0,l.jsx)(m.D0,{name:"showTime",type:"datetime-local",placeholder:"Show",groupClassName:"w-full"}),(0,l.jsx)(m.D0,{name:"hideTime",type:"datetime-local",placeholder:"hide",groupClassName:"w-full"})]}),S[7]=o):o=S[7],S[8]===Symbol.for("react.memo_cache_sentinel")?(d=(0,l.jsx)(n.bn,{span:12,children:(0,l.jsx)(m.JC,{label:"Message Type",name:"messageType",options:x.map(y)})}),S[8]=d):d=S[8],S[9]===Symbol.for("react.memo_cache_sentinel")?(u=(0,l.jsx)(h.lV,{children:(0,l.jsxs)(n.xA,{cols:12,className:"gap-3 max-w-[600px] mb-3",children:[i,c,o,d,(0,l.jsx)(n.bn,{span:12,children:(0,l.jsx)(n.jn,{type:"submit",className:"w-full",children:"Create"})})]})}),S[9]=u):u=S[9],S[10]!==s?(b=(0,l.jsx)(h.l1,{initialValues:a,onSubmit:s,children:u}),S[10]=s,S[11]=b):b=S[11],S[12]===Symbol.for("react.memo_cache_sentinel")?(f=(0,l.jsx)("hr",{}),S[12]=f):f=S[12],S[13]!==b?(j=(0,l.jsxs)(l.Fragment,{children:[e,t,b,f]}),S[13]=b,S[14]=j):j=S[14],j};function y(e){return e.label}var f=a(2483),j=a(23469),v=a.n(j),N=a(85398);function S(e){return(0,u.P)("https://api.photofinish.live/users/admin/changelog-update",{method:"POST",body:JSON.stringify({id:e.id,description:e.description})})}a(70056);let w=v()(()=>Promise.all([a.e(9882),a.e(1664),a.e(5412)]).then(a.bind(a,15412)),{loadableGenerated:{webpack:()=>[15412]},ssr:!1,loading:()=>(0,l.jsx)("p",{children:"Loading editor..."})}),_=()=>{var e;let t,a,s,n,i,c,o,d,m,u,g=(0,r.c)(7);g[0]===Symbol.for("react.memo_cache_sentinel")?(t={onSuccess:E,onError:C},g[0]=t):t=g[0];let{mutate:x}=(e=t,m=(0,r.c)(6),u=(0,N.jE)(),m[0]!==e||m[1]!==u?(o=(...t)=>{if(u.invalidateQueries({queryKey:["change-log"]}),e?.onSuccess)return e?.onSuccess(...t)},m[0]=e,m[1]=u,m[2]=o):o=m[2],m[3]!==e||m[4]!==o?(d={mutationFn:S,...e,onSuccess:o},m[3]=e,m[4]=o,m[5]=d):d=m[5],(0,p.n)(d));return g[1]===Symbol.for("react.memo_cache_sentinel")?(a=(0,l.jsx)("hr",{}),s=(0,l.jsx)("div",{children:(0,l.jsx)("h1",{children:"Update Changelog"})}),n=(0,l.jsx)("br",{}),g[1]=a,g[2]=s,g[3]=n):(a=g[1],s=g[2],n=g[3]),g[4]===Symbol.for("react.memo_cache_sentinel")?(i={id:"",description:""},g[4]=i):i=g[4],g[5]!==x?(c=(0,l.jsxs)(l.Fragment,{children:[a,s,n,(0,l.jsx)(h.l1,{initialValues:i,onSubmit:e=>{x({id:e.id,description:e.description})},children:P})]}),g[5]=x,g[6]=c):c=g[6],c};function E(){f.Ay.success("Update successful ",{duration:5e3})}function C(e){f.Ay.error(e.message)}function P(e){return(0,l.jsx)(h.lV,{className:"justify-start",children:(0,l.jsxs)(n.wt,{className:"gap-3 mb-3",children:[(0,l.jsx)("label",{children:"Date field: FOLLOW FORMAT OF 2024-04-01 1:45 PM ET"}),(0,l.jsx)(n.Ye,{className:"w-full gap-3",children:(0,l.jsx)(h.D0,{name:"id",placeholder:"2024-04-01 1:45 PM ET",type:"text",className:"w-[700px] bg-transparent"})}),(0,l.jsx)("label",{children:"Changelog Description"}),(0,l.jsx)(w,{value:e?.values?.description,onChange:t=>e.setFieldValue("description",t),className:"h-[300px]"}),(0,l.jsx)(n.jn,{type:"submit",className:"w-[200px] mt-10",children:"Update Changelog"})]})})}function A(e){return(0,u.P)("https://api.photofinish.live/season/admin/headlines/preview",{method:"POST",body:JSON.stringify({rules:e.rules,pageContexts:e.pageContexts})})}function k(){f.Ay.success("Headline preview refreshed")}function T(e){f.Ay.error(e.message||"Failed to refresh headline preview")}var O=a(33989),Y=a(31950),$=a(21958);let I=["admin.headline-trigger-config"],F="https://api.photofinish.live/season/admin/headlines/config";function D(){return(0,u.P)(F,{method:"GET"})}function q(e){return(0,u.P)(F,{method:"POST",body:JSON.stringify({rules:e.rules,pageContexts:e.pageContexts})})}function M(e){f.Ay.error(e.message||"Failed to save headline configuration")}let L=[{id:"mainPage",label:"Main Page"},{id:"breedingPage",label:"Breeding Page"},{id:"marketplacePage",label:"Marketplace"},{id:"claimingPage",label:"Claiming Page"},{id:"myStablePage",label:"My Stable"}],U={minDerby:"Minimum DERBY price or purse",minWins:"Minimum wins",minEarnings:"Minimum earnings DERBY",minParentEarnings:"Each parent minimum earnings",minParentPrestige:"Each parent minimum G1 wins",minG1Wins:"Minimum G1 wins",displayDays:"Display for N days (news default 7, speed record default 3)"};function R(e,t){let a="sale"===t?"marketplaceSale":"win"===t?"longshotWin":"stableMilestone"===t?"stableWinMilestone":t;return e?.find(e=>e.type===a)}let K=e=>{let t,a,s,i,c,o,d,m,h,u,p=(0,r.c)(30),{activeContext:g,contextConfig:x,rules:b,onSelectContext:y,onChangeContext:f}=e;p[0]!==x||p[1]!==f?(t=(e,t)=>
9{let a=t?[...x.ruleIds,e]:x.ruleIds.filter(t=>t!==e);f({...x,ruleIds:a})},p[0]=x,p[1]=f,p[2]=t):t=p[2];let j=t;if(p[3]!==g||p[4]!==y?(a=L.map(e=>(0,l.jsx)("button",{type:"button",onClick:()=>y(e.id),className:`min-h-[44px] shrink-0 rounded px-4 py-2 text-sm font-semibold transition ${g===e.id?"bg-secondary-500 text-primary-950":"bg-primary-800 text-primary-100 hover:bg-primary-700"}`,children:e.label},e.id)),p[3]=g,p[4]=y,p[5]=a):a=p[5],p[6]!==a?(s=(0,l.jsx)("div",{className:"flex gap-2 overflow-x-auto pb-1 pfmd:flex-wrap",children:a}),p[6]=a,p[7]=s):s=p[7],p[8]!==x||p[9]!==f?(i=e=>f({...x,enabled:e.target.checked}),p[8]=x,p[9]=f,p[10]=i):i=p[10],p[11]!==x.enabled||p[12]!==i?(c=(0,l.jsx)("input",{type:"checkbox",checked:x.enabled,onChange:i}),p[11]=x.enabled,p[12]=i,p[13]=c):c=p[13],p[14]===Symbol.for("react.memo_cache_sentinel")?(o=(0,l.jsx)(n.EY.white,{children:"Enable this future headline surface"}),p[14]=o):o=p[14],p[15]!==c?(d=(0,l.jsxs)("label",{className:"flex min-h-[44px] items-center gap-2",children:[c,o]}),p[15]=c,p[16]=d):d=p[16],p[17]!==x.ruleIds||p[18]!==b||p[19]!==j){let e;p[21]!==x.ruleIds||p[22]!==j?(e=e=>(0,l.jsxs)("label",{className:"flex min-h-[44px] items-center gap-3 rounded border border-primary-700 bg-primary-900/30 px-3 py-2",children:[(0,l.jsx)("input",{type:"checkbox",checked:x.ruleIds.includes(e.id),onChange:t=>j(e.id,t.target.checked)}),(0,l.jsxs)("span",{children:[(0,l.jsx)(n.EY.white,{className:"text-sm font-semibold",children:e.displayName}),(0,l.jsx)(n.EY.default,{className:"text-xs text-gray-400",children:e.headlineType})]})]},e.id),p[21]=x.ruleIds,p[22]=j,p[23]=e):e=p[23],m=b.map(e),p[17]=x.ruleIds,p[18]=b,p[19]=j,p[20]=m}else m=p[20];return p[24]!==m?(h=(0,l.jsx)("div",{className:"grid grid-cols-1 gap-2 pfmd:grid-cols-2",children:m}),p[24]=m,p[25]=h):h=p[25],p[26]!==s||p[27]!==d||p[28]!==h?(u=(0,l.jsxs)("div",{className:"space-y-4",children:[s,d,h]}),p[26]=s,p[27]=d,p[28]=h,p[29]=u):u=p[29],u};var Q=a(75151);let W=e=>{let t,a=(0,r.c)(5),{headlines:s,isPending:i}=e;if(i){let e;return a[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,l.jsx)(n.EY.default,{children:"Loading recent headline candidates..."}),a[0]=e):e=a[0],e}if(!s){let e;return a[1]===Symbol.for("react.memo_cache_sentinel")?(e=(0,l.jsx)(n.EY.default,{className:"text-gray-400",children:"Refresh the preview to evaluate the current draft against recent game data."}),a[1]=e):e=a[1],e}if(0===s.length){let e;return a[2]===Symbol.for("react.memo_cache_sentinel")?(e=(0,l.jsx)(n.EY.default,{className:"text-gray-400",children:"No recent candidates match this page's assigned rules."}),a[2]=e):e=a[2],e}return a[3]!==s?(t=(0,l.jsx)(Q.A,{headlines:s}),a[3]=s,a[4]=t):t=a[4],t},H=["minDerby","minWins","minEarnings","minParentEarnings","minParentPrestige","minG1Wins","displayDays"],z=e=>{let t,a,s,i,c,o,d,m,h,u,p=(0,r.c)(74),{rule:g,typeCatalog:x,onChange:b,onDelete:y}=e;p[0]!==x?(t=x.reduce((e,t)=>{let a=e[t.category]??[];return a.push(t),e[t.category]=a,e},{}),p[0]=x,p[1]=t):t=p[1];let f=t;p[2]!==g.headlineType||p[3]!==x?(a=R(x,g.headlineType),p[2]=g.headlineType,p[3]=x,p[4]=a):a=p[4];let j=a;if(p[5]!==g.headlineType||p[6]!==x){let e;p[8]!==g.headlineType?(e=e=>e.type===g.headlineType,p[8]=g.headlineType,p[9]=e):e=p[9],s=x.some(e),p[5]=g.headlineType,p[6]=x,p[7]=s}else s=p[7];let v=s;if(p[10]!==f||p[11]!==v||p[12]!==b||p[13]!==g||p[14]!==x||p[15]!==j){let e,t,a,r,s,h,u,y,N,S,w,_,E,C,P;p[21]!==g||p[22]!==j?.supportedThresholds?(e=e=>j?.supportedThresholds.includes(e)||null!=g[e],p[21]=g,p[22]=j?.supportedThresholds,p[23]=e):e=p[23];let A=H.filter(e);p[24]!==b||p[25]!==x?(t=e=>{let t=R(x,e);b({...H.reduce((e,a)=>(t?.supportedThresholds.includes(a)||(e[a]=null),e),{}),headlineType:e})},p[24]=b,p[25]=x,p[26]=t):t=p[26];let k=t;p[27]!==b?(a=(e,t)=>{b({[e]:""===t?null:Number(t)})},p[27]=b,p[28]=a):a=p[28];let T=a;i="space-y-4 rounded-lg border border-primary-700 bg-primary-900/30 p-4",p[29]===Symbol.for("react.memo_cache_sentinel")?(r=(0,l.jsx)(n.EY.white,{className:"text-sm font-semibold",children:"Rule name"}),p[29]=r):r=p[29],p[30]!==b?(s=e=>b({displayName:e.target.value}),p[30]=b,p[31]=s):s=p[31],p[32]!==g.displayName||p[33]!==s?(h=(0,l.jsxs)("label",{className:"flex-1 space-y-1",children:[r,(0,l.jsx)("input",{value:g.displayName,onChange:s,className:"w-full rounded border border-primary-700 bg-primary-950 px-3 py-2 text-white"})]}),p[32]=g.displayName,p[33]=s,p[34]=h):h=p[34],p[35]===Symbol.for("react.memo_cache_sentinel")?(u=(0,l.jsx)(n.EY.white,{className:"text-sm font-semibold",children:"Headline type"}),p[35]=u):u=p[35];let O=g.headlineType;p[36]!==k?(y=e=>k(e.target.value),p[36]=k,p[37]=y):y=p[37],p[38]!==v||p[39]!==g.headlineType||p[40]!==j?.label?(N=!v&&(0,l.jsxs)("option",{value:g.headlineType,children:[j?.label??g.headlineType," (legacy)"]}),p[38]=v,p[39]=g.headlineType,p[40]=j?.label,p[41]=N):N=p[41],p[42]!==f?(S=Object.entries(f).map(G),p[42]=f,p[43]=S):S=p[43],p[44]!==g.headlineType||p[45]!==y||p[46]!==N||p[47]!==S?(w=(0,l.jsxs)("label",{className:"flex-1 space-y-1",children:[u,(0,l.jsxs)("select",{value:O,onChange:y,className:"w-full rounded border border-primary-700 bg-primary-950 px-3 py-2 text-white",children:[N,S]})]}),p[44]=g.headlineType,p[45]=y,p[46]=N,p[47]=S,p[48]=w):w=p[48],p[49]!==b?(_=e=>b({enabled:e.target.checked}),p[49]=b,p[50]=_):_=p[50],p[51]!==g.enabled||p[52]!==_?(E=(0,l.jsx)("input",{type:"checkbox",checked:g.enabled,onChange:_}),p[51]=g.enabled,p[52]=_,p[53]=E):E=p[53],p[54]===Symbol.for("react.memo_cache_sentinel")?(C=(0,l.jsx)(n.EY.default,{children:"Enabled"}),p[54]=C):C=p[54],p[55]!==E?(P=(0,l.jsxs)("label",{className:"flex min-h-[44px] items-center gap-2",children:[E,C]}),p[55]=E,p[56]=P):P=p[56],p[57]!==h||p[58]!==w||p[59]!==P?(c=(0,l.jsxs)("div",{className:"flex flex-col gap-3 pfmd:flex-row pfmd:items-end",children:[h,w,P]}),p[57]=h,p[58]=w,p[59]=P,p[60]=c):c=p[60],p[61]!==j?(o=j?.description&&(0,l.jsx)(n.EY.default,{className:"text-xs text-gray-300",children:j.description}),p[61]=j,p[62]=o):o=p[62],p[63]!==j?(d=j&&!j.previewSupported&&(0,l.jsx)(n.EY.warning,{className:"text-xs",children:"Real-data preview is not available for this type yet. The rule can still be configured and saved."}),p[63]=j,p[64]=d):d=p[64],m=A.length>0&&(0,l.jsx)("div",{className:"grid grid-cols-1 gap-3 pfmd:grid-cols-2 pflg:grid-cols-3",children:A.map(e=>(0,l.jsxs)("label",{className:"space-y-1",children:[(0,l.jsx)(n.EY.default,{className:"text-xs text-gray-300",children:U[e]}),(0,l.jsx)("input",{type:"number",min:"0",step:"1",value:g[e]??"",onChange:t=>T(e,t.target.value),className:"w-full rounded border border-primary-700 bg-primary-950 px-3 py-2 text-white"})]},e))}),p[10]=f,p[11]=v,p[12]=b,p[13]=g,p[14]=x,p[15]=j,p[16]=i,p[17]=c,p[18]=o,p[19]=d,p[20]=m}
9else i=p[16],c=p[17],o=p[18],d=p[19],m=p[20];return p[65]!==y?(h=(0,l.jsx)("div",{className:"flex justify-end",children:(0,l.jsx)(n.Qi,{type:"button",onClick:y,children:"Delete rule"})}),p[65]=y,p[66]=h):h=p[66],p[67]!==i||p[68]!==c||p[69]!==o||p[70]!==d||p[71]!==m||p[72]!==h?(u=(0,l.jsxs)("div",{className:i,children:[c,o,d,m,h]}),p[67]=i,p[68]=c,p[69]=o,p[70]=d,p[71]=m,p[72]=h,p[73]=u):u=p[73],u};function V(e){return(0,l.jsx)("option",{value:e.type,children:e.label},e.type)}function G(e){let[t,a]=e;return(0,l.jsx)("optgroup",{label:t,children:a.map(V)},t)}let J=()=>{let e,t,a,s,i,c,o,m,h,u,g,x,b,y,j,v,S,w,_,E,C,P,F,U,R,Q,H,V=(0,r.c)(59),{data:G,isLoading:J,isError:X,error:Z}=(()=>{let e,t,a=(0,r.c)(4),{authUser:l}=(0,Y.wV)();return a[0]!==l?(e=(0,$.n9)(l),a[0]=l,a[1]=e):e=a[1],a[2]!==e?(t={queryKey:I,queryFn:D,enabled:e},a[2]=e,a[3]=t):t=a[3],(0,O.I)(t)})(),[ee,et]=(0,d.useState)(),[ea,el]=(0,d.useState)("mainPage"),er=(U=(0,r.c)(2),R=(0,N.jE)(),U[0]!==R?(F={mutationFn:q,onSuccess:e=>{R.setQueryData(I,e),f.Ay.success("Headline configuration saved")},onError:M},U[0]=R,U[1]=F):F=U[1],(0,p.n)(F)),es=((H=(0,r.c)(1))[0]===Symbol.for("react.memo_cache_sentinel")?(Q={mutationFn:A,onSuccess:k,onError:T},H[0]=Q):Q=H[0],(0,p.n)(Q));V[0]!==G?(e=()=>{G&&et({...G,typeCatalog:G.typeCatalog?.map(e=>({...e})),rules:G.rules.map(e=>({...e})),pageContexts:Object.fromEntries(L.map(({id:e})=>[e,{...G.pageContexts[e],ruleIds:[...G.pageContexts[e].ruleIds]}]))})},t=[G],V[0]=G,V[1]=e,V[2]=t):(e=V[1],t=V[2]),(0,d.useEffect)(e,t),V[3]===Symbol.for("react.memo_cache_sentinel")?(a=(e,t)=>{et(a=>a?{...a,rules:a.rules.map(a=>a.id===e?{...a,...t}:a)}:a)},V[3]=a):a=V[3];let en=a;V[4]===Symbol.for("react.memo_cache_sentinel")?(s=()=>{et(B)},V[4]=s):s=V[4];let ei=s;V[5]===Symbol.for("react.memo_cache_sentinel")?(i=e=>{et(t=>t?{...t,rules:t.rules.filter(t=>t.id!==e),pageContexts:Object.fromEntries(L.map(a=>{let{id:l}=a;return[l,{...t.pageContexts[l],ruleIds:t.pageContexts[l].ruleIds.filter(t=>t!==e)}]}))}:t)},V[5]=i):i=V[5];let ec=i;if(X){let e,t=Z?.message;return V[6]!==t?(e=(0,l.jsxs)(n.EY.danger,{children:["Failed to load headline configuration: ",t]}),V[6]=t,V[7]=e):e=V[7],e}if(J||!ee){let e;return V[8]===Symbol.for("react.memo_cache_sentinel")?(e=(0,l.jsx)(n.EY.default,{children:"Loading headline configuration..."}),V[8]=e):e=V[8],e}let eo=ee.pageContexts[ea],ed=es.data?.previews[ea];V[9]!==ee.typeCatalog?(c=ee.typeCatalog??[],V[9]=ee.typeCatalog,V[10]=c):c=V[10];let em=c;if(V[11]===Symbol.for("react.memo_cache_sentinel")?(o=(0,l.jsxs)("div",{className:"flex flex-col gap-3 pfmd:flex-row pfmd:items-center pfmd:justify-between",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)(n.EY.primary,{className:"text-xl font-bold",children:"Headline rules"}),(0,l.jsx)(n.EY.default,{className:"text-sm text-gray-400",children:"Thresholds are optional. Parent prestige is evaluated as G1 wins for each parent."})]}),(0,l.jsx)(n.tA,{type:"button",onClick:ei,children:"Add rule"})]}),V[11]=o):o=V[11],V[12]!==ee.rules||V[13]!==em){let e;V[15]!==em?(e=e=>(0,l.jsx)(z,{rule:e,typeCatalog:em,onChange:t=>en(e.id,t),onDelete:()=>ec(e.id)},e.id),V[15]=em,V[16]=e):e=V[16],m=ee.rules.map(e),V[12]=ee.rules,V[13]=em,V[14]=m}else m=V[14];V[17]!==ee.rules.length?(h=0===ee.rules.length&&(0,l.jsx)(n.EY.default,{className:"text-gray-400",children:"No rules configured. Add a rule to populate a future headline surface."}),V[17]=ee.rules.length,V[18]=h):h=V[18],V[19]!==m||V[20]!==h?(u=(0,l.jsxs)("div",{className:"space-y-4",children:[m,h]}),V[19]=m,V[20]=h,V[21]=u):u=V[21],V[22]===Symbol.for("react.memo_cache_sentinel")?(g=(0,l.jsx)(n.EY.primary,{className:"text-lg font-bold",children:"Page assignments"}),V[22]=g):g=V[22],V[23]!==ea||V[24]!==ee?(x=e=>et({...ee,pageContexts:{...ee.pageContexts,[ea]:e}}),V[23]=ea,V[24]=ee,V[25]=x):x=V[25],V[26]!==ea||V[27]!==eo||V[28]!==ee.rules||V[29]!==x?(b=(0,l.jsxs)("div",{className:"space-y-3 rounded-lg border border-primary-700 bg-primary-900/20 p-4",children:[g,(0,l.jsx)(K,{activeContext:ea,contextConfig:eo,rules:ee.rules,onSelectContext:el,onChangeContext:x})]}),V[26]=ea,V[27]=eo,V[28]=ee.rules,V[29]=x,V[30]=b):b=V[30],V[31]===Symbol.for("react.memo_cache_sentinel")?(y=(0,l.jsx)(n.EY.primary,{className:"text-lg font-bold",children:"Preview"}),V[31]=y):y=V[31],V[32]!==ed||V[33]!==es.isPending?(j=(0,l.jsxs)("div",{className:"space-y-3 rounded-lg border border-primary-700 bg-primary-900/20 p-4",children:[y,(0,l.jsx)(W,{headlines:ed,isPending:es.isPending})]}),V[32]=ed,V[33]=es.isPending,V[34]=j):j=V[34],V[35]!==b||V[36]!==j?(v=(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-6 pfmd:grid-cols-2",children:[b,j]}),V[35]=b,V[36]=j,V[37]=v):v=V[37];let eh=es.isPending||er.isPending;V[38]!==ee||V[39]!==es?(S=()=>es.mutate(ee),V[38]=ee,V[39]=es,V[40]=S):S=V[40];let eu=es.isPending?"Refreshing...":"Refresh preview";V[41]!==eh||V[42]!==S||V[43]!==eu?(w=(0,l.jsx)(n.tA,{type:"button",disabled:eh,onClick:S,children:eu}),V[41]=eh,V[42]=S,V[43]=eu,V[44]=w):w=V[44];let ep=er.isPending||es.isPending;V[45]!==ee||V[46]!==er?(_=()=>er.mutate(ee),V[45]=ee,V[46]=er,V[47]=_):_=V[47];let eg=er.isPending?"Saving...":"Save configuration";return V[48]!==ep||V[49]!==_||V[50]!==eg?(E=(0,l.jsx)(n.jn,{type:"button",disabled:ep,onClick:_,children:eg}),V[48]=ep,V[49]=_,V[50]=eg,V[51]=E):E=V[51],V[52]!==w||V[53]!==E?(C=(0,l.jsxs)("div",{className:"flex flex-col gap-3 pfmd:flex-row pfmd:justify-end",children:[w,E]}
9),V[52]=w,V[53]=E,V[54]=C):C=V[54],V[55]!==v||V[56]!==C||V[57]!==u?(P=(0,l.jsxs)("div",{className:"space-y-6",children:[o,u,v,C]}),V[55]=v,V[56]=C,V[57]=u,V[58]=P):P=V[58],P};function B(e){var t,a;if(!e)return e;let l=(t=e.rules.length,a=e.typeCatalog,{id:`headline-rule-${Date.now().toString(36)}-${t}`,displayName:`New headline rule ${t+1}`,headlineType:a?.[0]?.type??"marketplaceSale",enabled:!0});return{...e,rules:[...e.rules,l]}}var X=a(89788);async function Z(e){return(await (0,u.P)("https://api.photofinish.live/users/admin/blog/articles",{method:"POST",body:JSON.stringify(e)})).article}async function ee(e){return(await (0,u.P)("https://api.photofinish.live/users/admin/blog/articles",{method:"PUT",body:JSON.stringify(e)})).article}async function et(e){return await (0,u.P)(`https://api.photofinish.live/users/admin/blog/articles/${e}`,{method:"DELETE"})}async function ea(e){return await (0,u.P)("https://api.photofinish.live/users/admin/blog/articles/order",{method:"PUT",body:JSON.stringify(e)})}var el=a(90617);let er=e=>{var t,a,s;let i,c,o,m,h,g,x,b,y,j,v,S,w,_,E,C,P,A,k,T,Y,$,I,F,D,q,M,L,U,R,K,Q,W,H,z,V,G,J,B,X,Z,ee,er,ed,em,eh,eu,ep,eg,ex,eb=(0,r.c)(79),{onEditArticle:ey,onCreateNew:ef}=e,[ej,ev]=(0,d.useState)(!0),[eN,eS]=(0,d.useState)(!1);eb[0]===Symbol.for("react.memo_cache_sentinel")?(i=[],eb[0]=i):i=eb[0];let[ew,e_]=(0,d.useState)(i),[eE,eC]=(0,d.useState)(!1);eb[1]!==ej?(c={includeUnpublished:ej},eb[1]=ej,eb[2]=c):c=eb[2];let{data:eP,isLoading:eA,error:ek}=(t=c,G=(0,r.c)(8),J=t?.includeUnpublished,G[0]!==J?(H=["admin-blog-articles",J],G[0]=J,G[1]=H):H=G[1],G[2]!==t?(z=async()=>{let e=new URLSearchParams;t?.includeUnpublished!==void 0&&e.append("includeUnpublished",t.includeUnpublished.toString());let a=e.toString(),l=`https://api.photofinish.live/users/admin/blog/articles${a?`?${a}`:""}`;return(await (0,u.P)(l,{method:"GET"})).articles},G[2]=t,G[3]=z):z=G[3],void 0!==G[4]||G[5]!==H||G[6]!==z?(V={queryKey:H,queryFn:z,...void 0},G[4]=void 0,G[5]=H,G[6]=z,G[7]=V):V=G[7],(0,O.I)(V));eb[3]===Symbol.for("react.memo_cache_sentinel")?(o={onSuccess:()=>{f.Ay.success("Article order updated successfully!",{duration:5e3}),eS(!1),eC(!1)},onError:es},eb[3]=o):o=eb[3];let eT=(a=o,Z=(0,r.c)(7),ee=(0,N.jE)(),Z[0]!==a||Z[1]!==ee?(B=(e,t,l)=>{ee.invalidateQueries({queryKey:["blog-articles"]}),ee.invalidateQueries({queryKey:["blog-article"]}),ee.invalidateQueries({queryKey:["admin-blog-articles"]}),a?.onSuccess?.(e,t,l,void 0)},Z[0]=a,Z[1]=ee,Z[2]=B):B=Z[2],er=a?.onError,ed=a?.onSettled,Z[3]!==B||Z[4]!==er||Z[5]!==ed?(X={mutationFn:ea,onSuccess:B,onError:er,onSettled:ed},Z[3]=B,Z[4]=er,Z[5]=ed,Z[6]=X):X=Z[6],(0,p.n)(X));e:{let e;if(!eP){let e;eb[4]===Symbol.for("react.memo_cache_sentinel")?(e=[],eb[4]=e):e=eb[4],m=e;break e}eb[5]!==eP?(e=[...eP].sort(en),eb[5]=eP,eb[6]=e):e=eb[6],m=e}let eO=m;eb[7]!==eO?(h=()=>{e_([...eO]),eS(!0),eC(!1)},eb[7]=eO,eb[8]=h):h=eb[8];let eY=h;eb[9]===Symbol.for("react.memo_cache_sentinel")?(g=()=>{eS(!1),e_([]),eC(!1)},eb[9]=g):g=eb[9];let e$=g;eb[10]===Symbol.for("react.memo_cache_sentinel")?(x=e=>{0!==e&&(e_(t=>{let a=[...t],[l,r]=[a[e],a[e-1]];return a[e-1]=l,a[e]=r,a}),eC(!0))},eb[10]=x):x=eb[10];let eI=x;eb[11]===Symbol.for("react.memo_cache_sentinel")?(b=e=>{e_(t=>{if(e===t.length-1)return t;let a=[...t],[l,r]=[a[e+1],a[e]];return a[e]=l,a[e+1]=r,a}),eC(!0)},eb[11]=b):b=eb[11];let eF=b;eb[12]===Symbol.for("react.memo_cache_sentinel")?(y=e=>{0!==e&&(e_(t=>{let a=[...t],[l]=a.splice(e,1);return a.unshift(l),a}),eC(!0))},eb[12]=y):y=eb[12];let eD=y;eb[13]!==ew||eb[14]!==eT?(j=()=>{let e=ew.map(ei);eT.mutate({articleOrders:e})},eb[13]=ew,eb[14]=eT,eb[15]=j):j=eb[15];let eq=j,eM=eN?ew:eO;eb[16]===Symbol.for("react.memo_cache_sentinel")?(v={onSuccess:ec,onError:eo},eb[16]=v):v=eb[16];let eL=(s=v,eu=(0,r.c)(7),ep=(0,N.jE)(),eu[0]!==s||eu[1]!==ep?(em=(e,t,a)=>{ep.invalidateQueries({queryKey:["blog-articles"]}),ep.invalidateQueries({queryKey:["blog-article"]}),ep.invalidateQueries({queryKey:["admin-blog-articles"]}),s?.onSuccess?.(e,t,a,void 0)},eu[0]=s,eu[1]=ep,eu[2]=em):em=eu[2],eg=s?.onError,ex=s?.onSettled,eu[3]!==em||eu[4]!==eg||eu[5]!==ex?(eh={mutationFn:et,onSuccess:em,onError:eg,onSettled:ex},eu[3]=em,eu[4]=eg,eu[5]=ex,eu[6]=eh):eh=eu[6],(0,p.n)(eh));eb[17]!==eL?(S=e=>{confirm(`Are you sure you want to delete "${e.title}"?`)&&eL.mutate(e.id)},eb[17]=eL,eb[18]=S):S=eb[18];let eU=S;if(eA){let e;return eb[19]===Symbol.for("react.memo_cache_sentinel")?(e=(0,l.jsx)(n.wt,{className:"p-4",children:(0,l.jsx)(n.EY.default,{children:"Loading articles..."})}),eb[19]=e):e=eb[19],e}if(ek){let e;return eb[20]!==ek.message?(e=(0,l.jsx)(n.wt,{className:"p-4",children:(0,l.jsxs)(n.EY.default,{className:"text-red-500",children:["Error loading articles: ",ek.message]})}),eb[20]=ek.message,eb[21]=e):e=eb[21],e}if(eb[22]===Symbol.for("react.memo_cache_sentinel")?(w=(0,l.jsx)(n.EY.primary,{className:"text-xl font-bold",children:"Blog Articles"}),eb[22]=w):w=eb[22],eb[23]===Symbol.for("react.memo_cache_sentinel")?(_=e=>ev(e.target.checked),eb[23]=_):_=eb[23],eb[24]!==ej||eb[25]!==eN?(E=(0,l.jsx)("input",{type:"checkbox",checked:ej,onChange:_,className:"rounded",disabled:eN}),eb[24]=ej,eb[25]=eN,eb[26]=E):E=eb[26],eb[27]===Symbol.for("react.memo_cache_sentinel")?(C=(0,l.jsx)(n.EY.default,{children:"Include unpublished"}),eb[27]=C):C=eb[27],eb[28]!==E?(P=(0,l.jsxs)(n.Ye,{className:"gap-4 items-center",children:[w,(0,l.jsxs)("label",{className:"flex items-center gap-2",children:[E,C]})]}),eb[28]=E,eb[29]=P):P=eb[29],eb[30]!==eq||eb[31]!==eY||eb[32]!==eE||eb[33]!==eN||eb[34]!==ef||eb[35]!==eT.isPending?(A=(0,l.jsx)(n.Ye,{className:"gap-2",children:eN?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(n.tA,{onClick:e$,disabled:eT.isPending,children:"Cancel"}),(0,l.jsx)(n.jn,{onClick:eq,disabled:!eE||eT.isPending,children:eT.isPending?"Saving...":"Save Order"})]}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(n.tA,{onClick:eY,children:"Manage Order"}
9),(0,l.jsx)(n.jn,{onClick:ef,children:"Create New Article"})]})}),eb[30]=eq,eb[31]=eY,eb[32]=eE,eb[33]=eN,eb[34]=ef,eb[35]=eT.isPending,eb[36]=A):A=eb[36],eb[37]!==P||eb[38]!==A?(k=(0,l.jsxs)(n.Ye,{className:"justify-between items-center flex-wrap gap-4",children:[P,A]}),eb[37]=P,eb[38]=A,eb[39]=k):k=eb[39],eb[40]!==eN?(T=eN&&(0,l.jsx)("div",{className:"bg-blue-900/50 border border-blue-500 rounded-lg p-4",children:(0,l.jsxs)(n.EY.default,{className:"text-blue-200",children:[(0,l.jsx)("strong",{children:"Managing Article Order:"}),' Use the arrow buttons to reorder articles. Articles with lower positions appear first on the site. Click "Save Order" when done.']})}),eb[40]=eN,eb[41]=T):T=eb[41],eb[42]!==eN?(Y=eN&&(0,l.jsx)("th",{className:"px-4 py-3 text-left text-white w-24",children:"Order"}),eb[42]=eN,eb[43]=Y):Y=eb[43],eb[44]===Symbol.for("react.memo_cache_sentinel")?($=(0,l.jsx)("th",{className:"px-4 py-3 text-left text-white",children:"Title"}),I=(0,l.jsx)("th",{className:"px-4 py-3 text-left text-white",children:"Status"}),F=(0,l.jsx)("th",{className:"px-4 py-3 text-left text-white",children:"Category"}),D=(0,l.jsx)("th",{className:"px-4 py-3 text-left text-white",children:"Created"}),eb[44]=$,eb[45]=I,eb[46]=F,eb[47]=D):($=eb[44],I=eb[45],F=eb[46],D=eb[47]),eb[48]!==eN?(q=!eN&&(0,l.jsx)("th",{className:"px-4 py-3 text-left text-white",children:"Actions"}),eb[48]=eN,eb[49]=q):q=eb[49],eb[50]!==Y||eb[51]!==q?(M=(0,l.jsx)("thead",{className:"bg-gray-700",children:(0,l.jsxs)("tr",{children:[Y,$,I,F,D,q]})}),eb[50]=Y,eb[51]=q,eb[52]=M):M=eb[52],eb[53]!==eL||eb[54]!==eM||eb[55]!==eU||eb[56]!==eN||eb[57]!==ey){let e;eb[59]!==eL||eb[60]!==eM.length||eb[61]!==eU||eb[62]!==eN||eb[63]!==ey?(e=(e,t)=>(0,l.jsxs)("tr",{className:"border-b border-gray-700 hover:bg-gray-750",children:[eN&&(0,l.jsx)("td",{className:"px-4 py-3",children:(0,l.jsxs)(n.Ye,{className:"gap-1 items-center",children:[(0,l.jsx)("span",{className:"text-gray-400 text-sm w-6 text-center",children:t+1}),(0,l.jsxs)(n.wt,{className:"gap-1",children:[(0,l.jsx)("button",{onClick:()=>eD(t),disabled:0===t,className:`px-2 py-0.5 rounded text-xs ${0===t?"bg-gray-600 text-gray-400 cursor-not-allowed":"bg-orange-600 hover:bg-orange-500 text-white"}`,title:"Move to top",children:"⬆⬆"}),(0,l.jsxs)(n.Ye,{className:"gap-1",children:[(0,l.jsx)("button",{onClick:()=>eI(t),disabled:0===t,className:`px-2 py-0.5 rounded text-xs ${0===t?"bg-gray-600 text-gray-400 cursor-not-allowed":"bg-blue-600 hover:bg-blue-500 text-white"}`,title:"Move up",children:"▲"}),(0,l.jsx)("button",{onClick:()=>eF(t),disabled:t===eM.length-1,className:`px-2 py-0.5 rounded text-xs ${t===eM.length-1?"bg-gray-600 text-gray-400 cursor-not-allowed":"bg-blue-600 hover:bg-blue-500 text-white"}`,title:"Move down",children:"▼"})]})]})]})}),(0,l.jsx)("td",{className:"px-4 py-3",children:(0,l.jsxs)("div",{children:[(0,l.jsx)(n.EY.default,{className:"font-medium",children:e.title}),(0,l.jsx)(n.EY.default,{className:"text-sm text-gray-400",children:e.slug})]})}),(0,l.jsx)("td",{className:"px-4 py-3",children:(0,l.jsx)("span",{className:`px-2 py-1 rounded text-xs ${e.isPublished?"bg-green-600 text-white":"bg-yellow-600 text-white"}`,children:e.isPublished?"Published":"Draft"})}),(0,l.jsx)("td",{className:"px-4 py-3",children:(0,l.jsx)(n.EY.default,{children:e.category||"-"})}),(0,l.jsx)("td",{className:"px-4 py-3",children:(0,l.jsx)(n.EY.default,{className:"text-sm",children:function(e){try{return el.c9.fromISO(e).toFormat("MMM d, yyyy h:mm a")}catch{return""}}(e.createdTime)})}),!eN&&(0,l.jsx)("td",{className:"px-4 py-3",children:(0,l.jsxs)(n.Ye,{className:"gap-2",children:[(0,l.jsx)("button",{onClick:()=>ey(e),className:"text-blue-400 hover:text-blue-300 text-sm",children:"Edit"}),(0,l.jsx)("button",{onClick:()=>eU(e),className:"text-red-400 hover:text-red-300 text-sm",disabled:eL.isPending,children:eL.isPending?"Deleting...":"Delete"})]})})]},e.id),eb[59]=eL,eb[60]=eM.length,eb[61]=eU,eb[62]=eN,eb[63]=ey,eb[64]=e):e=eb[64],L=eM.map(e),eb[53]=eL,eb[54]=eM,eb[55]=eU,eb[56]=eN,eb[57]=ey,eb[58]=L}else L=eb[58];return eb[65]!==L?(U=(0,l.jsx)("tbody",{children:L}),eb[65]=L,eb[66]=U):U=eb[66],eb[67]!==M||eb[68]!==U?(R=(0,l.jsxs)("table",{className:"w-full",children:[M,U]}),eb[67]=M,eb[68]=U,eb[69]=R):R=eb[69],eb[70]!==eM.length?(K=0===eM.length&&(0,l.jsx)("div",{className:"p-8 text-center",children:(0,l.jsx)(n.EY.default,{className:"text-gray-400",children:"No articles found. Create your first article to get started."})}),eb[70]=eM.length,eb[71]=K):K=eb[71],eb[72]!==R||eb[73]!==K?(Q=(0,l.jsxs)("div",{className:"bg-background-900 rounded-lg overflow-hidden",children:[R,K]}),eb[72]=R,eb[73]=K,eb[74]=Q):Q=eb[74],eb[75]!==k||eb[76]!==T||eb[77]!==Q?(W=(0,l.jsxs)(n.wt,{className:"gap-4",children:[k,T,Q]}),eb[75]=k,eb[76]=T,eb[77]=Q,eb[78]=W):W=eb[78],W};function es(e){alert(`Failed to update order: ${e.message}`)}function en(e,t){return e.sortOrder!==t.sortOrder?e.sortOrder-t.sortOrder:new Date(t.createdTime).getTime()-new Date(e.createdTime).getTime()}function ei(e,t){return{id:e.id,sortOrder:t+1}}function ec(){alert("Article deleted successfully")}function eo(e){alert(`Failed to delete article: ${e.message}`)}var ed=a(80230),em=a(24369);let eh=e=>{let t,a,s,n=(0,r.c)(8),{value:i,onChange:c,style:o}=e;return n[0]!==c?(t=e=>c(e.target.value),n[0]=c,n[1]=t):t=n[1],n[2]!==o?(a={width:"100%",height:"400px",padding:"12px",border:"1px solid #ccc",borderRadius:"4px",fontFamily:"monospace",fontSize:"14px",...o},n[2]=o,n[3]=a):a=n[3],n[4]!==t||n[5]!==a||n[6]!==i?(s=(0,l.jsx)("textarea",{value:i,onChange:t,style:a,placeholder:"Write your blog post content here..."}),n[4]=t,n[5]=a,n[6]=i,n[7]=s):s=n[7],s},eu=e=>{var t,a;let s,i,c,o,m,h,u,g,x,b,y,j,v,S,w,_,E,C,P,A,k,T,O,Y,$,I,F,D,q,M,L,U,R,K,Q,W,H,z,V,G,J,B,X,et,ea,el,er,es,en,ei,ec,eo,eu,ev,eN,eS,ew,e_,eE,eC,eP,eA,ek,eT,eO,eY,e$,eI,eF=(0,r.c)(146),{article:eD,onSave:eq,onCancel:eM}=e,[eL,eU]=(0,d.useState)(""),[eR,eK]=(0,d.useState)(""),[eQ,eW]=(0,d.useState)(""),[eH,ez]=(0,d.useState)(""),[eV,eG]=(0,d.useState)(""),[eJ,eB]=(0,d.useState)(""),[eX,eZ]=(0,d.useState)(""),[e0,e1]=(0,d.useState)(""),[e2,e4]=(0,d.useState)(!1),[e3,e5]=(0,d.useState)(0),[e6,e7]=(0,d.useState)(null),[e9,e8]=(0,d.useState)(!1);eF[0]!==eD?(s=()=>{eD?(eU(eD.title),eK(eD.slug),eW(eD.content),ez(eD.excerpt),eG(eD.featuredImageUrl),eB(eD.category),eZ(eD.tags.join(", ")),e1(eD.metaDescription),e4(eD.isPublished),e5(eD.sortOrder??0)):(eU(""),eK(""),eW(""),ez(""),eG(""),eB(""),eZ(""),e1(""),e4(!1),e5(0))},i=[eD],eF[0]=eD,eF[1]=s,eF[2]=i):(s=eF[1],i=eF[2]),(0,d.useEffect)(s,i),eF[3]!==eD||eF[4]!==eL?(c=()=>{eD||eK(eL.toLowerCase().replace(/[^a-zA-Z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").trim())},o=[eL,eD],eF[3]=eD,eF[4]=eL,eF[5]=c,eF[6]=o):(c=eF[5],o=eF[6]),(0,d.useEffect)(c,o),eF[7]!==eQ||eF[8]!==eH?(m=()=>{if(!eH&&eQ){let e=eQ.replace(/<[^>]+>/g," ").replace(/\s+/g," ").trim();ez(e.length>200?e.substring(0,200)+"...":e)}},h=[eQ,eH],eF[7]=eQ,eF[8]=eH,eF[9]=m,eF[10]=h):(m=eF[9],h=eF[10]),(0,d.useEffect)(m,h),eF[11]!==eq?(u={onSuccess:()=>{f.Ay.success("Article created successfully!",{duration:5e3}),eq()},onError:ep},eF[11]=eq,eF[12]=u):u=eF[12];let te=(t=u,eE=(0,r.c)(7),eC=(0,N.jE)(),eE[0]!==t||eE[1]!==eC?(ew=(e,a,l)=>{eC.invalidateQueries({queryKey:["blog-articles"]}),eC.invalidateQueries({queryKey:["blog-article"]}),eC.invalidateQueries({queryKey:["admin-blog-articles"]}),t?.onSuccess?.(e,a,l,void 0)},eE[0]=t,eE[1]=eC,eE[2]=ew):ew=eE[2],eP=t?.onError,eA=t?.onSettled,eE[3]!==ew||eE[4]!==eP||eE[5]!==eA?(e_={mutationFn:Z,onSuccess:ew,onError:eP,onSettled:eA},eE[3]=ew,eE[4]=eP,eE[5]=eA,eE[6]=e_):e_=eE[6],(0,p.n)(e_));eF[13]!==eq?(g={onSuccess:()=>{f.Ay.success("Article updated successfully!",{duration:5e3}),eq()},onError:eg},eF[13]=eq,eF[14]=g):g=eF[14];let tt=(a=g,eO=(0,r.c)(7),eY=(0,N.jE)(),eO[0]!==a||eO[1]!==eY?(ek=(e,t,l)=>
9{eY.invalidateQueries({queryKey:["blog-articles"]}),eY.invalidateQueries({queryKey:["blog-article"]}),eY.invalidateQueries({queryKey:["admin-blog-articles"]}),eY.setQueryData(["blog-article",e.slug],e),a?.onSuccess?.(e,t,l,void 0)},eO[0]=a,eO[1]=eY,eO[2]=ek):ek=eO[2],e$=a?.onError,eI=a?.onSettled,eO[3]!==ek||eO[4]!==e$||eO[5]!==eI?(eT={mutationFn:ee,onSuccess:ek,onError:e$,onSettled:eI},eO[3]=ek,eO[4]=e$,eO[5]=eI,eO[6]=eT):eT=eO[6],(0,p.n)(eT));eF[15]===Symbol.for("react.memo_cache_sentinel")?(x={onSuccess:e=>{eG(e.url),e7(null)},onError:ex},eF[15]=x):x=eF[15];let ta=(0,ed.I)(x),tl=eb;eF[16]===Symbol.for("react.memo_cache_sentinel")?(b={onSuccess:e=>{console.log("Image upload successful:",e.url);let t=`
10
11![Uploaded image](${e.url})
12
13`;eW(e=>e+t),console.log("Image added to content successfully")},onError:ey},eF[16]=b):b=eF[16];let tr=(0,ed.I)(b);eF[17]!==tr?(y=()=>{console.log("Image upload button clicked");let e=document.createElement("input");e.setAttribute("type","file"),e.setAttribute("accept","image/*"),e.click(),e.onchange=async()=>{let t=e.files?.[0];if(console.log("File selected:",t?.name,t?.type,t?.size),t)try{console.log("Processing image file...");let e=await tl(t);console.log("Image processed, starting upload:",e),tr.mutate(e)}catch(e){console.error("Error processing image:",e),alert("Failed to process image file")}}},eF[17]=tr,eF[18]=y):y=eF[18];let ts=y;eF[19]===Symbol.for("react.memo_cache_sentinel")?(j=e=>{e.target.files&&e.target.files[0]&&e7(e.target.files[0])},eF[19]=j):j=eF[19];let tn=j;eF[20]!==e6||eF[21]!==ta?(v=async()=>{if(e6)try{let e=await tl(e6);ta.mutate(e)}catch(e){console.error("Error processing featured image:",e),alert("Failed to process featured image file")}},eF[20]=e6,eF[21]=ta,eF[22]=v):v=eF[22];let ti=v;eF[23]!==eD||eF[24]!==eJ||eF[25]!==eQ||eF[26]!==te||eF[27]!==eH||eF[28]!==eV||eF[29]!==e2||eF[30]!==e0||eF[31]!==eR||eF[32]!==e3||eF[33]!==eX||eF[34]!==eL||eF[35]!==tt?(S=()=>{if(!eL.trim())return void alert("Title is required");if(!eR.trim())return void alert("Slug is required");if(!eQ.trim())return void alert("Content is required");let e=eX.split(",").map(ef).filter(ej),t={title:eL.trim(),slug:eR.trim(),content:eQ.trim(),excerpt:eH.trim(),featuredImageUrl:eV.trim(),category:eJ.trim(),tags:e,metaDescription:e0.trim(),isPublished:e2,isDraft:!e2,sortOrder:e3};eD?tt.mutate({id:eD.id,...t}):te.mutate(t)},eF[23]=eD,eF[24]=eJ,eF[25]=eQ,eF[26]=te,eF[27]=eH,eF[28]=eV,eF[29]=e2,eF[30]=e0,eF[31]=eR,eF[32]=e3,eF[33]=eX,eF[34]=eL,eF[35]=tt,eF[36]=S):S=eF[36];let tc=S,to=te.isPending||tt.isPending||ta.isPending||tr.isPending,td=eD?"Edit Article":"Create New Article";eF[37]!==td?(w=(0,l.jsx)(n.EY.primary,{className:"text-xl font-bold",children:td}),eF[37]=td,eF[38]=w):w=eF[38],eF[39]!==to||eF[40]!==eM?(_=(0,l.jsx)(n.tA,{onClick:eM,disabled:to,children:"Cancel"}),eF[39]=to,eF[40]=eM,eF[41]=_):_=eF[41],eF[42]!==e9?(E=()=>e8(!e9),eF[42]=e9,eF[43]=E):E=eF[43];let tm=e9?"Edit":"Preview";eF[44]!==to||eF[45]!==E||eF[46]!==tm?(C=(0,l.jsx)(n.tA,{onClick:E,disabled:to,children:tm}),eF[44]=to,eF[45]=E,eF[46]=tm,eF[47]=C):C=eF[47];let th=to?"Saving...":"Save";eF[48]!==tc||eF[49]!==to||eF[50]!==th?(P=(0,l.jsx)(n.jn,{onClick:tc,disabled:to,children:th}),eF[48]=tc,eF[49]=to,eF[50]=th,eF[51]=P):P=eF[51],eF[52]!==_||eF[53]!==C||eF[54]!==P?(A=(0,l.jsxs)(n.Ye,{className:"gap-2",children:[_,C,P]}),eF[52]=_,eF[53]=C,eF[54]=P,eF[55]=A):A=eF[55],eF[56]!==w||eF[57]!==A?(k=(0,l.jsxs)(n.Ye,{className:"justify-between items-center",children:[w,A]}),eF[56]=w,eF[57]=A,eF[58]=k):k=eF[58],eF[59]===Symbol.for("react.memo_cache_sentinel")?(T=e=>eU(e.target.value),eF[59]=T):T=eF[59],eF[60]!==to||eF[61]!==eL?(O=(0,l.jsx)(n.pd,{name:"title",label:"Title",value:eL,onChange:T,placeholder:"Enter article title",disabled:to}),eF[60]=to,eF[61]=eL,eF[62]=O):O=eF[62],eF[63]===Symbol.for("react.memo_cache_sentinel")?(Y=e=>eK(e.target.value),eF[63]=Y):Y=eF[63],eF[64]!==to||eF[65]!==eR?($=(0,l.jsx)(n.pd,{name:"slug",label:"Slug",value:eR,onChange:Y,placeholder:"article-slug",disabled:to}),eF[64]=to,eF[65]=eR,eF[66]=$):$=eF[66],eF[67]===Symbol.for("react.memo_cache_sentinel")?(I=e=>eB(e.target.value),eF[67]=I):I=eF[67],eF[68]!==eJ||eF[69]!==to?(F=(0,l.jsx)(n.pd,{name:"category",label:"Category",value:eJ,onChange:I,placeholder:"Article category",disabled:to}),eF[68]=eJ,eF[69]=to,eF[70]=F):F=eF[70],eF[71]===Symbol.for("react.memo_cache_sentinel")?(D=e=>eZ(e.target.value),eF[71]=D):D=eF[71],eF[72]!==to||eF[73]!==eX?(q=(0,l.jsx)(n.pd,{name:"tags",label:"Tags (comma-separated)",value:eX,onChange:D,placeholder:"tag1, tag2, tag3",disabled:to}),eF[72]=to,eF[73]=eX,eF[74]=q):q=eF[74],eF[75]===Symbol.for("react.memo_cache_sentinel")?(M=e=>ez(e.target.value),eF[75]=M):M=eF[75],eF[76]!==eH||eF[77]!==to?(L=(0,l.jsx)(n.pd,{name:"excerpt",label:"Excerpt",value:eH,onChange:M,placeholder:"Brief description of the article",disabled:to}),eF[76]=eH,eF[77]=to,eF[78]=L):L=eF[78],eF[79]===Symbol.for("react.memo_cache_sentinel")?(U=e=>e1(e.target.value),eF[79]=U):U=eF[79],eF[80]!==to||eF[81]!==e0?(R=(0,l.jsx)(n.pd,{name:"metaDescription",label:"Meta Description",value:e0,onChange:U,placeholder:"SEO meta description",disabled:to}),eF[80]=to,eF[81]=e0,eF[82]=R):R=eF[82],eF[83]===Symbol.for("react.memo_cache_sentinel")?(K=(0,l.jsx)(n.EY.default,{className:"mb-2",children:"Featured Image"}),eF[83]=K):K=eF[83],eF[84]!==to?(Q=(0,l.jsx)("input",{type:"file",accept:"image/*",onChange:tn,disabled:to,className:"text-white"}),eF[84]=to,eF[85]=Q):Q=eF[85];let tu=!e6||to;eF[86]!==ti||eF[87]!==tu?(W=(0,l.jsx)(n.jn,{onClick:ti,disabled:tu,children:"Upload"}),eF[86]=ti,eF[87]=tu,eF[88]=W):W=eF[88],eF[89]!==Q||eF[90]!==W?(H=(0,l.jsxs)(n.Ye,{className:"gap-2 items-center",children:[Q,W]}),eF[89]=Q,eF[90]=W,eF[91]=H):H=eF[91],eF[92]!==eV?(z=eV&&(0,l.jsx)("div",{className:"mt-2",children:(0,l.jsx)("img",{src:eV,alt:"Featured",className:"max-w-xs h-auto rounded"})}),eF[92]=eV,eF[93]=z):z=eF[93],eF[94]!==H||eF[95]!==z?(V=(0,l.jsxs)("div",{children:[K,H,z]}),eF[94]=H,eF[95]=z,eF[96]=V):V=eF[96],eF[97]===Symbol.for("react.memo_cache_sentinel")?(G=e=>e4(e.target.checked),eF[97]=G):G=eF[97],eF[98]!==to||eF[99]!==e2?(J=(0,l.jsx)("input",{type:"checkbox",checked:e2,onChange:G,disabled:to,className:"rounded"}),eF[98]=to,eF[99]=e2,eF[100]=J):J=eF[100],eF[101]===Symbol.for("react.memo_cache_sentinel")?(B=(0,l.jsx)(n.EY.default,{children:"Publish article"}),eF[101]=B):B=eF[101],eF[102]!==J?(X=(0,l.jsxs)("label",{className:"flex items-center gap-2",children:[J,B]}),eF[102]=J,eF[103]=X):X=eF[103],eF[104]!==e3?(et=e3.toString(),eF[104]=e3,eF[105]=et):et=eF[105],eF[106]===Symbol.for("react.memo_cache_sentinel")?(ea=e=>
13e5(parseInt(e.target.value)||0),eF[106]=ea):ea=eF[106],eF[107]!==to||eF[108]!==et?(el=(0,l.jsx)(n.pd,{name:"sortOrder",label:"Sort Order",type:"number",value:et,onChange:ea,placeholder:"0",disabled:to}),eF[107]=to,eF[108]=et,eF[109]=el):el=eF[109],eF[110]===Symbol.for("react.memo_cache_sentinel")?(er=(0,l.jsx)(n.EY.default,{className:"text-xs text-gray-400 mt-1",children:'Lower values appear first. Use 0 for default (date-based) ordering, or use "Manage Order" in the list view.'}),eF[110]=er):er=eF[110],eF[111]!==el?(es=(0,l.jsxs)("div",{children:[el,er]}),eF[111]=el,eF[112]=es):es=eF[112],eF[113]!==O||eF[114]!==$||eF[115]!==F||eF[116]!==q||eF[117]!==L||eF[118]!==R||eF[119]!==V||eF[120]!==X||eF[121]!==es?(en=(0,l.jsxs)(n.wt,{className:"gap-4",children:[O,$,F,q,L,R,V,X,es]}),eF[113]=O,eF[114]=$,eF[115]=F,eF[116]=q,eF[117]=L,eF[118]=R,eF[119]=V,eF[120]=X,eF[121]=es,eF[122]=en):en=eF[122];let tp=e9?"(Preview)":"(Markdown)";if(eF[123]!==tp?(ei=(0,l.jsxs)(n.EY.default,{children:["Content ",tp]}),eF[123]=tp,eF[124]=ei):ei=eF[124],eF[125]!==ts||eF[126]!==to||eF[127]!==e9?(ec=!e9&&(0,l.jsx)(n.jn,{onClick:ts,disabled:to,children:"Add Image"}),eF[125]=ts,eF[126]=to,eF[127]=e9,eF[128]=ec):ec=eF[128],eF[129]!==ei||eF[130]!==ec?(eo=(0,l.jsxs)(n.Ye,{className:"justify-between items-center",children:[ei,ec]}),eF[129]=ei,eF[130]=ec,eF[131]=eo):eo=eF[131],eF[132]!==eQ||eF[133]!==eV||eF[134]!==e9||eF[135]!==eL){let e;eu=(0,l.jsx)("div",{className:"bg-white text-black rounded min-h-[860px]",children:e9?(0,l.jsx)("div",{className:"p-6 w-4/5 mx-auto",children:(0,l.jsxs)("div",{className:"cms-rendered-html",children:[eL&&(0,l.jsx)("h1",{className:"mb-6 text-3xl font-bold",dangerouslySetInnerHTML:{__html:(0,em.pn)(eL)}}),eV&&(0,l.jsx)("div",{className:"mb-6",children:(0,l.jsx)("img",{src:eV,alt:"Featured",className:"w-full max-w-2xl mx-auto h-auto rounded"})}),(0,l.jsx)("div",{dangerouslySetInnerHTML:{__html:(0,em.pn)((!(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=eQ).replace(/!\[([^\]]*)\]\(([^)]+)\)/g,'<img src="$2" alt="$1" style="max-width: 100%; height: auto; display: block; margin: 1rem 0;" />')).replace(/^### (.*$)/gm,"<h3>$1</h3>")).replace(/^## (.*$)/gm,"<h2>$1</h2>")).replace(/^# (.*$)/gm,"<h1>$1</h1>")).replace(/\*\*(.*?)\*\*/g,"<strong>$1</strong>")).replace(/\*(.*?)\*/g,"<em>$1</em>")).replace(/\[([^\]]+)\]\(([^)]+)\)/g,'<a href="$2" target="_blank" rel="noopener noreferrer">$1</a>')).replace(/\n\n+/g,"</p><p>")).replace(/\n/g,"<br>")).startsWith("<")&&e.trim()&&(e="<p>"+e+"</p>"),e))}})]})}):(0,l.jsx)(eh,{value:eQ,onChange:eW,style:{height:"800px",padding:"20px"}})}),eF[132]=eQ,eF[133]=eV,eF[134]=e9,eF[135]=eL,eF[136]=eu}else eu=eF[136];return eF[137]!==eo||eF[138]!==eu?(ev=(0,l.jsxs)(n.wt,{className:"gap-4",children:[eo,eu]}),eF[137]=eo,eF[138]=eu,eF[139]=ev):ev=eF[139],eF[140]!==en||eF[141]!==ev?(eN=(0,l.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[en,ev]}),eF[140]=en,eF[141]=ev,eF[142]=eN):eN=eF[142],eF[143]!==k||eF[144]!==eN?(eS=(0,l.jsxs)(n.wt,{className:"gap-6",children:[k,eN]}),eF[143]=k,eF[144]=eN,eF[145]=eS):eS=eF[145],eS};function ep(e){alert(`Failed to create article: ${e.message}`)}function eg(e){alert(`Failed to update article: ${e.message}`)}function ex(e){alert(`Failed to upload image: ${e.message}`)}function eb(e){return new Promise((t,a)=>{let l=new FileReader;l.onload=()=>{let a=l.result,r=e.type.split("/")[1]||"png",s=Math.floor(Date.now()/1e3),n=(e.name.replace(/\.[^/.]+$/,"")||"image").replace(/[^a-zA-Z0-9-_]/g,"-").toLowerCase();t({imageData:a,imageFormat:r,imageName:`blog-${n}-${s}`})},l.onerror=a,l.readAsDataURL(e)})}function ey(e){console.error("Image upload failed:",e),alert(`Failed to upload inline image: ${e.message}`)}function ef(e){return e.trim()}function ej(e){return e}let ev=()=>{let e,t,a,s,i,c,o,m,h,u,p,g,x,b=(0,r.c)(25),[y,f]=(0,d.useState)("list"),[j,v]=(0,d.useState)();b[0]===Symbol.for("react.memo_cache_sentinel")?(e=e=>{v(e),f("editor")},b[0]=e):e=b[0];let N=e;b[1]===Symbol.for("react.memo_cache_sentinel")?(t=()=>{v(void 0),f("editor")},b[1]=t):t=b[1];let S=t;b[2]===Symbol.for("react.memo_cache_sentinel")?(a=()=>{v(void 0),f("list")},b[2]=a):a=b[2];let w=a;b[3]===Symbol.for("react.memo_cache_sentinel")?(s=()=>{v(void 0),f("list")},b[3]=s):s=b[3];let _=s,E="list"===y;b[4]===Symbol.for("react.memo_cache_sentinel")?(i=()=>{f("list"),v(void 0)},b[4]=i):i=b[4],b[5]!==E?(c=(0,l.jsx)(X.O,{isActive:E,onClick:i,children:"Article List"}),b[5]=E,b[6]=c):c=b[6];let C="editor"===y;b[7]===Symbol.for("react.memo_cache_sentinel")?(o=()=>f("editor"),b[7]=o):o=b[7];let P=j?"Edit Article":"Create Article";return b[8]!==C||b[9]!==P?(m=(0,l.jsx)(X.O,{isActive:C,onClick:o,children:P}),b[8]=C,b[9]=P,b[10]=m):m=b[10],b[11]!==m||b[12]!==c?(h=(0,l.jsxs)(X.L,{children:[c,m]}),b[11]=m,b[12]=c,b[13]=h):h=b[13],b[14]!==y?(u="list"===y&&(0,l.jsx)(er,{onEditArticle:N,onCreateNew:S}),b[14]=y,b[15]=u):u=b[15],b[16]!==y||b[17]!==j?(p="editor"===y&&(0,l.jsx)(eu,{article:j,onSave:w,onCancel:_}),b[16]=y,b[17]=j,b[18]=p):p=b[18],b[19]!==u||b[20]!==p?(g=(0,l.jsxs)("div",{className:"mt-4",children:[u,p]}),b[19]=u,b[20]=p,b[21]=g):g=b[21],b[22]!==h||b[23]!==g?(x=(0,l.jsxs)(n.wt,{className:"gap-4",children:[h,g]}),b[22]=h,b[23]=g,b[24]=x):x=b[24],x};var eN=a(69446),eS=!0;let ew=e=>{let t,a,d,m,h,u,p,g=(0,r.c)(19),{userRole:x,userName:y}=e,f=(0,s.useRouter)(),j="string"==typeof f.query.section?f.query.section:void 0;return g[0]===Symbol.for("react.memo_cache_sentinel")?(t=(0,l.jsx)(c.f,{}),g[0]=t):t=g[0],g[1]!==x?(a=x<=eN.eq.LiveOps&&(0,l.jsx)(o.r,{sectionId:"main-headlines",title:"Headlines",description:"Configure headline triggers and preview four future page surfaces",children:(0,l.jsx)(J,{})}),g[1]=x,g[2]=a):a=g[2],g[3]!==x?(d=x<=eN.eq.LiveOps&&(0,l.jsx)(o.r,{sectionId:"main-announcements",title:"Announcements",description:"Update announcements",children:(0,l.jsx)(b,{})}),g[3]=x,g[4]=d):d=g[4],g[5]!==x?(m=x<=eN.eq.LiveOps&&(0,l.jsx)(o.r,{sectionId:"main-changelog",title:"Changelog Management",description:"Update application changelog entries",children:(0,l.jsx)(_,{})}),g[5]=x,g[6]=m):m=g[6],g[7]!==j||g[8]!==x?(h=x<=eN.eq.LiveOps&&(0,l.jsx)(o.r,{sectionId:"main-blog-editor",title:"Blog Editor",description:"Create, edit, and manage blog articles",defaultExpanded:"main-blog-editor"===j,children:(0,l.jsx)(ev,{})}),g[7]=j,g[8]=x,g[9]=h):h=g[9],g[10]!==a||g[11]!==d||g[12]!==m||g[13]!==h?(u=(0,l.jsxs)(n.wt,{className:"gap-4 max-w-6xl mx-auto mt-4 pfmd:mt-8 px-3 pfmd:px-0",children:[a,d,m,h]}),g[10]=a,g[11]=d,g[12]=m,g[13]=h,g[14]=u):u=g[14],g[15]!==u||g[16]!==y||g[17]!==x?(p=(0,l.jsxs)(i.A,{userRole:x,userName:y,children:[t,u]}),g[15]=u,g[16]=y,g[17]=x,g[18]=p):p=g[18],p}}},e=>{e.O(0,[3342,2172,1168,6593,636,8792],()=>e(e.s=35451)),_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.