import{B as e,lt as t,n as r,t as a}from"./render-cqdoDfd9.js";import"./modulepreload-polyfill-DgzdhEGd.js";import{t as i}from"./Grid-BiwBFfYj.js";import{t as n}from"./Box-pvlRBLzs.js";import{t as o}from"./Typography-8v555lWC.js";import{t as s}from"./Paper-DtiadJnq.js";import{t as l}from"./Alert-BpUkH7Nx.js";import{t as d}from"./WorkspacePremium-BuOxKl4p.js";var m=t(),p=()=>{const{localeMessages:t,name:a,issueDate:l,certificateNumber:p,qrcodeUrl:c,logoUrl:g}=r();return(0,m.jsx)(n,{sx:{p:{xs:1,sm:2,md:4},"@media print":{"@page":{size:"A4 landscape",margin:0},p:0},width:"100%",boxSizing:"border-box",display:"flex",justifyContent:{xs:"flex-start",md:"center"},overflowX:"auto",overflowY:"hidden",WebkitOverflowScrolling:"touch"},children:(0,m.jsx)(s,{elevation:2,sx:t=>({flex:"0 0 auto",padding:"10mm",width:"277mm",height:"190mm",borderRadius:3,position:"relative",backgroundImage:(()=>{const r=e(t.palette.primary.main,.22),a=e(t.palette.secondary.main,.35),i=e(t.palette.secondary.main,.88),n=e(t.palette.primary.main,.88),o=e(t.palette.common.white,.05);return[`linear-gradient(15deg, transparent 0 35%, ${r} 35% 41%, transparent 41% 100%)`,`linear-gradient(-28deg, transparent 0 55%, ${r} 55% 61%, transparent 61% 100%)`,`radial-gradient(circle at 10% 10%, ${a} 0%, transparent 55%)`,`radial-gradient(circle at 90% 90%, ${a} 0%, transparent 55%)`,`repeating-linear-gradient(45deg, ${o} 0 1px, transparent 1px 12px)`,`repeating-linear-gradient(-45deg, ${o} 0 1px, transparent 1px 12px)`,`linear-gradient(135deg, ${i} 0%, ${n} 100%)`].join(", ")})(),backgroundColor:e(t.palette.common.white,.3),backgroundBlendMode:"screen, screen, soft-light, soft-light, overlay, overlay, normal",overflow:"hidden",shadowColor:"rgba(0, 0, 0, 0.5)",pageBreakAfter:"always"}),children:(0,m.jsx)(s,{elevation:0,sx:{padding:"1mm",borderRadius:2,boxSizing:"border-box",width:"100%",height:"100%"},children:(0,m.jsxs)(s,{elevation:0,sx:t=>({width:"100%",height:"100%",display:"flex",borderRadius:2,border:`2px solid ${e(t.palette.secondary.main,.5)}`,position:"relative",backgroundImage:[`repeating-linear-gradient(135deg, ${e(t.palette.secondary.main,.02)} 0 1px, transparent 2px 6px)`].join(", "),backgroundColor:e(t.palette.common.white,.95),boxShadow:`inset 0 0 0 1px ${e(t.palette.common.black,.04)}`,"&::before":{content:'""',position:"absolute",top:16,left:16,right:16,height:6,borderRadius:999,background:`linear-gradient(90deg, ${t.palette.secondary.main} 0%, ${t.palette.primary.main} 100%)`,opacity:.25},flexDirection:"column",alignItems:"center",justifyContent:"center",padding:8,boxSizing:"border-box",color:e(t.palette.common.black,.88),"& .MuiTypography-root":{color:e(t.palette.common.black,.88)}}),children:[(0,m.jsx)(d,{sx:e=>({fontSize:86,color:e.palette.primary.main,mb:2})}),(0,m.jsx)(o,{variant:"h1",gutterBottom:!0,sx:{letterSpacing:"0.04em",textTransform:"uppercase"},children:t.title}),(0,m.jsx)(o,{variant:"h3",align:"center",mt:4,sx:{fontWeight:500,maxWidth:"80%"},dangerouslySetInnerHTML:{__html:t.description.replace(a,"<div style='font-size: 2em; padding: 0.5em; font-weight: 700;'>"+a+"</div>")}}),(0,m.jsxs)(i,{container:!0,spacing:2,sx:{pt:2,mt:4,width:"100%",minHeight:"100px"},alignItems:"flex-end",children:[(0,m.jsx)(i,{item:!0,size:4,sx:{textAlign:"center"},children:(0,m.jsxs)(o,{variant:"body2",children:[g&&(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)("img",{src:g,alt:"Organization Logo",style:{width:80,height:80,objectFit:"contain"}}),(0,m.jsx)("br",{})]}),(0,m.jsx)("b",{children:t.organization_team}),(0,m.jsx)("br",{}),t.issue_date,": ",l]})}),(0,m.jsx)(i,{item:!0,size:4,sx:{textAlign:"center"}}),(0,m.jsx)(i,{item:!0,size:4,sx:{textAlign:"center"},children:(0,m.jsxs)(o,{variant:"body2",children:[(0,m.jsx)("img",{src:c,alt:"QR Code",style:{width:80,height:80}}),(0,m.jsx)("br",{}),t.certificate_number,":",(0,m.jsx)("br",{}),p]})})]})]})})})})};a({children:(0,m.jsx)(()=>{const{errorMessage:e}=r();return(0,m.jsx)(m.Fragment,{children:e?(0,m.jsx)(l,{severity:"error",sx:{maxWidth:800,margin:"20px auto"},children:e}):(0,m.jsx)(p,{})})},{})});