1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8488],{59380:function(e,t,s){Promise.resolve().then(s.bind(s,42659))},79205:function(e,t,s){"use strict";s.d(t,{Z:function(){return n}});var a=s(2265);let r=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),l=function(){for(var e=arguments.length,t=Array(e),s=0;s<e;s++)t[s]=arguments[s];return t.filter((e,t,s)=>!!e&&""!==e.trim()&&s.indexOf(e)===t).join(" ").trim()};var c={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let o=(0,a.forwardRef)((e,t)=>{let{color:s="currentColor",size:r=24,strokeWidth:o=2,absoluteStrokeWidth:n,className:d="",children:i,iconNode:x,...u}=e;return(0,a.createElement)("svg",{ref:t,...c,width:r,height:r,stroke:s,strokeWidth:n?24*Number(o)/Number(r):o,className:l("lucide",d),...u},[...x.map(e=>{let[t,s]=e;return(0,a.createElement)(t,s)}),...Array.isArray(i)?i:[i]])}),n=(e,t)=>{let s=(0,a.forwardRef)((s,c)=>{let{className:n,...d}=s;return(0,a.createElement)(o,{ref:c,iconNode:t,className:l("lucide-".concat(r(e)),n),...d})});return s.displayName="".concat(e),s}},96362:function(e,t,s){"use strict";s.d(t,{Z:function(){return a}});let a=(0,s(79205).Z)("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]])},29090:function(e,t,s){"use strict";s.d(t,{Z:function(){return a}});let a=(0,s(79205).Z)("LogIn",[["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}],["polyline",{points:"10 17 15 12 10 7",key:"1ail0h"}],["line",{x1:"15",x2:"3",y1:"12",y2:"12",key:"v6grx8"}]])},84286:function(e,t,s){"use strict";s.d(t,{Z:function(){return a}});let a=(0,s(79205).Z)("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},32489:function(e,t,s){"use strict";s.d(t,{Z:function(){return a}});let a=(0,s(79205).Z)("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]])},42659:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return f}});var a=s(57437),r=s(29),l=s.n(r),c=s(2265),o=s(49924),n=s(18030),d=s(99376),i=s(27648),x=s(68497),u=s(96778);function m(){let e=(0,o.b)(),{t}=(0,n.$)(e),s=(0,d.useSearchParams)();(0,d.useRouter)();let{auth_status:r,user:m}=(0,u.P)(),f="authenticated"===r,[h,g]=(0,c.useState)(""),[j,b]=(0,c.useState)(""),[w,y]=(0,c.useState)([]),[k,v]=(0,c.useState)(!1),[N,D]=(0,c.useState)(!1),[P,H]=(0,c.useState)(!1),[C,M]=(0,c.useState)([]),[S,E]=(0,c.useState)(!1),[L,A]=(0,c.useState)(""),[T,z]=(0,c.useState)(!1),[I,B]=(0,c.useState)([]),[U,_]=(0,c.useState)(""),[W,R]=(0,c.useState)("#0D5EA6"),[O,F]=(0,c.useState)(""),[J,V]=(0,c.useState)(""),[Z,q]=(0,c.useState)(!1),[$,Y]=(0,c.useState)(!1),[K,X]=(0,c.useState)(""),[G,Q]=(0,c.useState)(!1),[ee,et]=(0,c.useState)(!1),[es,ea]=(0,c.useState)(null),[er,el]=(0,c.useState)(null),[ec,eo]=(0,c.useState)("1month"),[en,ed]=(0,c.useState)(""),[ei,ex]=(0,c.useState)(""),[eu,em]=(0,c.useState)(!1),[ep,ef]=(0,c.useState)(!1),[eh,eg]=(0,c.useState)(!1),[ej,eb]=(0,c.useState)(!1),[ew,ey]=(0,c.useState)({isPro:!1,expiresAt:null,payments:[]}),ek=(0,c.useRef)(null),ev=(0,c.useRef)(null),eN=(e,t)=>{ea({type:e,message:t})},eD=e=>{el(e)},eP=()=>{el(null)},eH=()=>{ef(!1),ex(""),H(!0)};(0,c.useEffect)(()=>{if(!es)return;let e=window.setTimeout(()=>ea(null),3e3);return()=>window.clearTimeout(e)},[es]),(0,c.useEffect)(()=>{let e=localStorage.getItem("lucky_draw_history");e&&B(JSON.parse(e));let t=localStorage.getItem("lucky_draw_sound");null===t?(localStorage.setItem("lucky_draw_sound","false"),z(!1)):z("true"===t),"success"===s.get("payment")&&eb(!0);let a=async()=>{let e=localStorage.getItem("token");if(e)try{let t=await fetch("/api/lucky-draw/history",{headers:{Authorization:"Bearer ".concat(e)}}),s=await t.json();if(s.success&&s.data){let e=s.data.map(e=>({id:e.id,title:e.title,timestamp:e.timestamp,resultsCount:e.resultsCount,data:""}));B(e)}}catch(e){console.error("Failed to fetch history",e)}},r=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;try{let t=localStorage.getItem("token"),a=localStorage.getItem("lucky_draw_pro_email"),l=s.get("key"),c=new URLSearchParams;l?(c.set("drawEditKey",l),c.set("accessKey",l)):a&&c.set("guestEmail",a);let o=await fetch("/api/lucky-draw/pro/status?".concat(c.toString()),{headers:t?{Authorization:"Bearer ".concat(t)}:{}}),n=await o.json();n.success&&n.data&&(ey(n.data),"success"===s.get("payment")&&!n.data.isPro&&e<3&&setTimeout(()=>r(e+1),1500))}catch(e){console.error("Failed to fetch PRO status",e)}};r(),f&&a()},[s,f]),(0,c.useEffect)(()=>{let e=window.location.hash.replace("#s=","")||s.get("s");if(e){let t=function(e){if(!e)return null;let t=e.replace(/ /g,"+");try{let e=atob(t),s=Uint8Array.from(e,e=>e.codePointAt(0)),a=new TextDecoder().decode(s);return JSON.parse(a)}catch(e){try{return JSON.parse(decodeURIComponent(escape(atob(t))))}catch(e){return null}}}(e);if(t){t.title&&g(t.title),t.candidates&&b(t.candidates),t.prizes&&y(t.prizes),void 0!==t.allowDuplicateWins&&v(t.allowDuplicateWins),t.logoUrl&&_(t.logoUrl),t.themeColor&&R(t.themeColor),t.ctaText&&F(t.ctaText),t.ctaUrl&&V(t.ctaUrl),void 0!==t.hideBranding&&q(t.hideBranding),void 0!==t.animationEnabled&&Y(t.animationEnabled);return}}try{let e=localStorage.getItem("lucky_draw_draft");if(e){let t=JSON.parse(e);t.title&&g(t.title),void 0!==t.candidates&&b(t.candidates),t.prizes&&y(t.prizes),void 0!==t.allowDuplicateWins&&v(t.allowDuplicateWins),t.logoUrl&&_(t.logoUrl),t.themeColor&&R(t.themeColor),void 0!==t.ctaText&&F(t.ctaText),void 0!==t.ctaUrl&&V(t.ctaUrl),void 0!==t.hideBranding&&q(t.hideBranding),void 0!==t.animationEnabled&&Y(t.animationEnabled);return}}catch(e){console.warn("Could not parse draft:",e)}let a=t("luckyDrawHelperPage.defaultTitle");a&&"luckyDrawHelperPage.defaultTitle"!==a&&g(a);let r=t("luckyDrawHelperPage.defaultNames");r&&"luckyDrawHelperPage.defaultNames"!==r&&b(r);let l=t("luckyDrawHelperPage.defaultPrizeName");l&&"luckyDrawHelperPage.defaultPrizeName"!==l&&y([{id:"1",name:l,count:1}])},[t,s]),(0,c.useEffect)(()=>{(h||j.trim().length>0||w.length>0)&&localStorage.setItem("lucky_draw_draft",JSON.stringify({title:h,candidates:j,prizes:w,allowDuplicateWins:k,logoUrl:U,themeColor:W,ctaText:O,ctaUrl:J,hideBranding:Z,animationEnabled:$}))},[h,j,w,k,U,W,O,J,Z,$]);let eC=j.split("\n").filter(e=>e.trim().length>0),eM=w.reduce((e,t)=>
1e+t.count,0),eS=eC.length>0?eM/eC.length*100:0,eE=eC.length>100&&!ew.isPro,eL=e=>{w.length>1&&y(w.filter(t=>t.id!==e))},eA=(e,t,s)=>{y(w.map(a=>a.id===e?{...a,[t]:s}:a))},eT=async e=>{var t,s;let a=null===(t=e.target.files)||void 0===t?void 0:t[0];if(!a)return;let r=localStorage.getItem("token");if(r){let e=new FormData;e.append("file",a);try{let t=await fetch("/api/upload/image",{method:"POST",headers:{Authorization:"Bearer ".concat(r)},body:e}),a=await t.json();if(a.success&&(null===(s=a.data)||void 0===s?void 0:s.url)){_(a.data.url);return}}catch(e){console.error("Upload failed",e)}}if(a.size>8e4){eN("error",eG.logoTooLarge);return}let l=new FileReader;l.onload=e=>{var t;_(null===(t=e.target)||void 0===t?void 0:t.result)},l.readAsDataURL(a)},ez=async t=>{if(0===eC.length||0===eM)return;if(eC.length>100&&!ew.isPro){H(!0);return}if(!k&&eM>eC.length){eN("error",eG.prizeCountExceeds);return}if(O.trim().length>0&&0===p(J).trim().length){eN("error",eG.ctaUrlRequired);return}let s=[];if(k)w.forEach(e=>{for(let t=0;t<e.count;t++){let t=Math.floor(Math.random()*eC.length);s.push({prizeName:e.name||"...",winner:eC[t]})}});else{let e=[...eC].sort(()=>Math.random()-.5),t=0;w.forEach(a=>{for(let r=0;r<a.count;r++)t<e.length&&(s.push({prizeName:a.name||"...",winner:e[t]}),t++)})}if(t){E(!0);let t=setInterval(()=>{let e=Math.floor(Math.random()*eC.length);A(eC[e])},100);setTimeout(async()=>{clearInterval(t);let a={title:h,candidates:j,prizes:w,logoUrl:U,themeColor:W,ctaText:O,ctaUrl:p(J),hideBranding:Z,animationEnabled:$,allowDuplicateWins:k,drawPassword:K},r=localStorage.getItem("token"),l=localStorage.getItem("lucky_draw_pro_email");try{let t=await fetch("/api/lucky-draw/save",{method:"POST",headers:{"Content-Type":"application/json",...r?{Authorization:"Bearer ".concat(r)}:{}},body:JSON.stringify({...a,results:s,guestEmail:l})}),c=await t.json();if(c.success){window.location.href="/".concat(e,"/lucky-draw-helper/result?id=").concat(c.drawId);return}}catch(e){console.error("Server save failed",e),eN("error",eG.systemError)}},2500)}else M(s),D(!0)},eI=async(e,s)=>{e.preventDefault(),e.stopPropagation(),eD({title:eG.deleteHistoryTitle,message:eG.deleteHistoryMessage,confirmLabel:eG.deleteHistoryConfirm,cancelLabel:t("common.cancel"),onConfirm:async()=>{eP();let e=localStorage.getItem("token"),t=I.find(e=>e.id===s);if(t&&t.id&&e)try{let s=await fetch("/api/lucky-draw/".concat(t.id),{method:"DELETE",headers:{Authorization:"Bearer ".concat(e)}}),a=await s.json();if(!a.success){eN("error",a.message||eG.deleteHistoryFailed);return}}catch(e){console.error("Delete failed",e),eN("error",eG.deleteHistoryFailed);return}let a=I.filter(e=>e.id!==s);B(a),e||localStorage.setItem("lucky_draw_history",JSON.stringify(a)),eN("success",eG.deleteHistorySuccess)}})},eB=async()=>{0!==I.length&&eD({title:eG.clearHistoryTitle,message:eG.clearHistoryMessage,confirmLabel:eG.clearHistoryConfirm,cancelLabel:t("common.cancel"),onConfirm:async()=>{eP();let e=localStorage.getItem("token");if(e)try{let t=await fetch("/api/lucky-draw/history",{method:"DELETE",headers:{Authorization:"Bearer ".concat(e)}}),s=await t.json();if(!t.ok||!(null==s?void 0:s.success)){eN("error",eG.clearHistoryFailed);return}}catch(e){console.error("Failed to clear history",e),eN("error",eG.clearHistoryFailed);return}B([]),localStorage.removeItem("lucky_draw_history"),eN("success",eG.clearHistorySuccess)}})},eU=()=>{b(""),ek.current&&(ek.current.value="");try{localStorage.setItem("lucky_draw_draft",JSON.stringify({title:h,candidates:"",prizes:w,allowDuplicateWins:k,logoUrl:U,themeColor:W,ctaText:O,ctaUrl:J,hideBranding:Z,animationEnabled:$}))}catch(e){console.warn("Could not update draft:",e)}{let e=new URL(window.location.href);e.searchParams.delete("s"),e.hash="";let t="".concat(e.pathname).concat(e.search).concat(e.hash);window.history.replaceState({},"",t)}eN("success",eG.clearCandidatesSuccess)},e_=e=>{switch(e){case"7days":return t("luckyDrawHelperPage.proModal.priceTrialLabel");case"1month":return t("luckyDrawHelperPage.proModal.priceMonthlyLabel");case"1year":return t("luckyDrawHelperPage.proModal.priceYearlyLabel");default:return e}},eW=e=>{switch(e){case"7days":return 7;case"1month":return 30;case"1year":return 365;default:return 0}},eR=e=>{switch(e){case"paid":return t("luckyDrawHelperPage.paymentStatus.paid");
1case"pending":return t("luckyDrawHelperPage.paymentStatus.pending");default:return e}},eO=(ew.payments||[]).filter(e=>"paid"===e.status),eF=(ew.payments||[]).filter(e=>"pending"===e.status),eJ=eO.slice().sort((e,t)=>new Date(t.createdAt).getTime()-new Date(e.createdAt).getTime())[0],eV={noPlan:t("luckyDrawHelperPage.planInfo.noPlan"),currentPlan:t("luckyDrawHelperPage.planInfo.currentPlan"),remainingDays:t("luckyDrawHelperPage.planInfo.remainingDays"),expired:t("luckyDrawHelperPage.planInfo.expired"),dayUnit:t("luckyDrawHelperPage.planInfo.dayUnit"),currentExpiry:t("luckyDrawHelperPage.planInfo.currentExpiry"),selectedPlan:t("luckyDrawHelperPage.planInfo.selectedPlan"),projectedExpiryActive:t("luckyDrawHelperPage.planInfo.projectedExpiryActive"),projectedExpiryInactive:t("luckyDrawHelperPage.planInfo.projectedExpiryInactive"),addedValue:t("luckyDrawHelperPage.planInfo.addedValue")},eZ=eJ?e_(eJ.planType):eV.noPlan,eq=ew.expiresAt?new Date(ew.expiresAt):null,e$=new Date,eY=eq?Math.max(0,Math.ceil((eq.getTime()-e$.getTime())/864e5)):0,eK=new Date((eq&&eq>e$?eq:e$).getTime()+864e5*eW(ec)),eX=t("luckyDrawHelperPage.pendingOrdersMessage",{count:String(eF.length)});t("luckyDrawHelperPage.pendingOrdersTitle");let eG={logoTooLarge:t("luckyDrawHelperPage.messages.logoTooLarge"),prizeCountExceeds:t("luckyDrawHelperPage.messages.prizeCountExceeds"),ctaUrlRequired:t("luckyDrawHelperPage.messages.ctaUrlRequired"),shareCopied:t("luckyDrawHelperPage.messages.shareCopied"),systemError:t("luckyDrawHelperPage.messages.systemError"),deleteHistoryTitle:t("luckyDrawHelperPage.messages.deleteHistoryTitle"),deleteHistoryMessage:t("luckyDrawHelperPage.messages.deleteHistoryMessage"),deleteHistoryConfirm:t("luckyDrawHelperPage.messages.deleteHistoryConfirm"),deleteHistoryFailed:t("luckyDrawHelperPage.messages.deleteHistoryFailed"),deleteHistorySuccess:t("luckyDrawHelperPage.messages.deleteHistorySuccess"),clearHistoryTitle:t("luckyDrawHelperPage.messages.clearHistoryTitle"),clearHistoryMessage:t("luckyDrawHelperPage.messages.clearHistoryMessage"),clearHistoryConfirm:t("luckyDrawHelperPage.messages.clearHistoryConfirm"),clearHistoryFailed:t("luckyDrawHelperPage.messages.clearHistoryFailed"),clearHistorySuccess:t("luckyDrawHelperPage.messages.clearHistorySuccess"),clearCandidatesTitle:t("luckyDrawHelperPage.messages.clearCandidatesTitle"),clearCandidatesConfirm:t("luckyDrawHelperPage.messages.clearCandidatesConfirm"),clearCandidatesSuccess:t("luckyDrawHelperPage.messages.clearCandidatesSuccess"),paymentFailed:t("luckyDrawHelperPage.messages.paymentFailed")};return(0,a.jsxs)("div",{className:"jsx-e21718e3f33edc48 min-h-screen bg-slate-50 p-4 md:p-8",children:[es&&(0,a.jsx)("div",{className:"jsx-e21718e3f33edc48 fixed top-4 left-1/2 z-[120] w-[min(92vw,32rem)] -translate-x-1/2",children:(0,a.jsxs)("div",{className:"jsx-e21718e3f33edc48 "+"flex items-start gap-3 rounded-2xl border px-4 py-3 shadow-xl backdrop-blur ".concat("success"===es.type?"border-emerald-200 bg-emerald-50/95 text-emerald-800":"border-red-200 bg-red-50/95 text-red-800"),children:[(0,a.jsx)("div",{className:"jsx-e21718e3f33edc48 "+"mt-0.5 flex h-6 w-6 items-center justify-center rounded-full text-sm font-black ".concat("success"===es.type?"bg-emerald-100 text-emerald-700":"bg-red-100 text-red-700"),children:"success"===es.type?"â":"!"}),(0,a.jsx)("div",{className:"jsx-e21718e3f33edc48 min-w-0 flex-1",children:(0,a.jsx)("p",{className:"jsx-e21718e3f33edc48 text-sm font-bold",children:es.message})}),(0,a.jsx)("button",{type:"button",onClick:()=>ea(null),className:"jsx-e21718e3f33edc48 text-current/50 transition-colors hover:text-current cursor-pointer",children:(0,a.jsx)("svg",{fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",className:"jsx-e21718e3f33edc48 h-5 w-5",children:(0,a.jsx)("path",{d:"M6 18L18 6M6 6l12 12",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"jsx-e21718e3f33edc48"})})})]})}),(0,a.jsxs)("div",{className:"jsx-e21718e3f33edc48 max-w-4xl mx-auto space-y-8 pb-12",children:[ej&&(0,a.jsxs)("div",{className:"jsx-e21718e3f33edc48 bg-emerald-50 border-2 border-emerald-200 rounded-2xl p-5 flex items-center justify-between shadow-sm animate-in fade-in",children:[(0,a.jsxs)("div",{className:"jsx-e21718e3f33edc48 flex items-center gap-3",children:[(0,a.jsx)("span",{className:"jsx-e21718e3f33edc48 text-3xl",children:"??"}),(0,a.jsxs)("div",{className:"jsx-e21718e3f33edc48",children:[(0,a.jsx)("p",{className:"jsx-e21718e3f33edc48 font-black text-emerald-800",children:t("luckyDrawHelperPage.proModal.paymentSuccessTitle")}),(0,a.jsx)("p",{className:"jsx-e21718e3f33edc48 text-sm text-emerald-600",children:t("luckyDrawHelperPage.proModal.paymentSuccessDesc")})]})]}),(0,a.jsx)("button",{onClick:()=>eb(!1),className:"jsx-e21718e3f33edc48 text-emerald-400 hover:text-emerald-600 transition-colors cursor-pointer",children:(0,a.jsx)("svg",{fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",className:"jsx-e21718e3f33edc48 w-5 h-5",children:(0,a.jsx)("path",{d:"M6 18L18 6M6 6l12 12",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"jsx-e21718e3f33edc48"})})})]}),(0,a.jsxs)("section",{className:"jsx-e21718e3f33edc48 bg-white border border-slate-200 shadow-sm rounded-3xl p-6 md:p-8 flex flex-col md:flex-row md:items-center justify-between gap-4",children:[(0,a.jsxs)("div",{className:"jsx-e21718e3f33edc48",children:[(0,a.jsx)("h1",{className:"jsx-e21718e3f33edc48 text-3xl font-black text-[#0D5EA6] mb-2",children:t("luckyDrawHelperPage.title")}),(0,a.jsx)("p",{className:"jsx-e21718e3f33edc48 text-slate-500 font-medium tracking-tight",children:t("luckyDrawHelperPage.subtitle")})]}),(0,a.jsx)("div",{className:"jsx-e21718e3f33edc48 flex gap-2",children:(0,a.jsxs)("button",{onClick:()=>
1{if(O.trim().length>0&&0===p(J).trim().length){eN("error",eG.ctaUrlRequired);return}let t=function(e){try{let t=JSON.stringify(e),s=new TextEncoder().encode(t),a=Array.from(s,e=>String.fromCodePoint(e)).join("");return btoa(a)}catch(e){return console.error("Encoding failed",e),""}}({title:h,candidates:j,prizes:w,allowDuplicateWins:k,logoUrl:U,themeColor:W,ctaText:O,ctaUrl:p(J),hideBranding:Z,animationEnabled:$}),s="".concat(window.location.origin,"/").concat(e,"/lucky-draw-helper#s=").concat(encodeURIComponent(t));navigator.clipboard.writeText(s),eN("success",eG.shareCopied)},className:"jsx-e21718e3f33edc48 flex items-center gap-2 px-6 py-3 bg-white border-2 border-slate-100 rounded-2xl text-[#0D5EA6] font-bold hover:bg-slate-50 transition-all text-sm cursor-pointer shadow-sm",children:[(0,a.jsx)("svg",{fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",className:"jsx-e21718e3f33edc48 w-4 h-4",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2.5,d:"M8.684 13.342C8.886 12.938 9 12.482 9 12c0-.482-.114-.938-.316-1.342m0 2.684a3 3 0 110-2.684m0 2.684l6.632 3.316m-6.632-6l6.632-3.316m0 0a3 3 0 105.367-2.684 3 3 0 00-5.367 2.684zm0 9.316a3 3 0 105.368 2.684 3 3 0 00-5.368-2.684z",className:"jsx-e21718e3f33edc48"})}),t("luckyDrawHelperPage.shareConfig")]})})]}),(0,a.jsxs)("div",{className:"jsx-e21718e3f33edc48 grid grid-cols-1 lg:grid-cols-12 gap-8",children:[(0,a.jsxs)("div",{className:"jsx-e21718e3f33edc48 lg:col-span-8 space-y-8",children:[(0,a.jsxs)("div",{className:"jsx-e21718e3f33edc48 bg-white border border-slate-200 rounded-2xl p-6 shadow-sm",children:[(0,a.jsx)("h2",{className:"jsx-e21718e3f33edc48 text-lg font-bold text-slate-800 mb-4",children:t("luckyDrawHelperPage.activityTheme")}),(0,a.jsx)("input",{type:"text",value:h,onChange:e=>g(e.target.value),placeholder:t("luckyDrawHelperPage.defaultTitle"),className:"jsx-e21718e3f33edc48 w-full px-4 py-3 bg-slate-50 border border-slate-200 rounded-xl focus:ring-2 focus:ring-[#0D5EA6] outline-none"})]}),(0,a.jsxs)("div",{className:"jsx-e21718e3f33edc48 bg-white border border-slate-200 rounded-2xl p-6 shadow-sm",children:[(0,a.jsxs)("div",{className:"jsx-e21718e3f33edc48 mb-4 space-y-3",children:[(0,a.jsxs)("div",{className:"jsx-e21718e3f33edc48 flex items-start justify-between gap-3",children:[(0,a.jsxs)("div",{className:"jsx-e21718e3f33edc48 min-w-0",children:[(0,a.jsx)("h2",{className:"jsx-e21718e3f33edc48 text-base font-black leading-tight text-slate-800 sm:text-lg",children:t("luckyDrawHelperPage.candidateList")}),eE&&(0,a.jsx)("button",{type:"button",onClick:eH,className:"jsx-e21718e3f33edc48 mt-1 text-[10px] font-black uppercase tracking-tight text-amber-500 hover:underline cursor-pointer",children:t("luckyDrawHelperPage.proLimit")})]}),(0,a.jsx)("span",{className:"jsx-e21718e3f33edc48 "+"shrink-0 rounded-full px-3 py-1.5 text-xs font-bold leading-tight ".concat(eE?"bg-amber-100 text-amber-600":"bg-[#0D5EA6]/10 text-[#0D5EA6]"),children:t("luckyDrawHelperPage.candidateCount",{count:String(eC.length)})})]}),(0,a.jsxs)("div",{className:"jsx-e21718e3f33edc48 grid grid-cols-2 gap-2 sm:flex sm:flex-wrap sm:items-center sm:gap-3",children:[(0,a.jsx)("button",{onClick:()=>{let e=new Blob([t("luckyDrawHelperPage.defaultNames")],{type:"text/plain;charset=utf-8"}),s=URL.createObjectURL(e),a=document.createElement("a");a.href=s,a.download="lucky_draw_example.txt",document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL(s)},className:"jsx-e21718e3f33edc48 rounded-xl bg-slate-50 px-3 py-2 text-center text-[11px] font-bold leading-tight text-slate-500 transition-colors hover:bg-slate-100 hover:text-slate-700 cursor-pointer sm:bg-transparent sm:px-0 sm:py-0",children:t("luckyDrawHelperPage.downloadExample")}),(0,a.jsx)("button",{onClick:()=>{eD({title:eG.clearCandidatesTitle,message:t("luckyDrawHelperPage.clearCandidatesConfirm"),confirmLabel:eG.clearCandidatesConfirm,cancelLabel:t("common.cancel"),onConfirm:()=>{eP(),eU()}})},className:"jsx-e21718e3f33edc48 rounded-xl bg-red-50 px-3 py-2 text-center text-[11px] font-bold leading-tight text-red-500 transition-colors hover:bg-red-100 hover:text-red-600 cursor-pointer sm:bg-transparent sm:px-0 sm:py-0",children:t("luckyDrawHelperPage.clearCandidates")}),(0,a.jsx)("button",{onClick:()=>{var e;return null===(e=ek.current)||void 0===e?void 0:e.click()},className:"jsx-e21718e3f33edc48 col-span-2 rounded-xl bg-[#0D5EA6]/8 px-3 py-2 text-center text-xs font-bold leading-tight text-[#0D5EA6] transition-colors hover:bg-[#0D5EA6]/12 cursor-pointer sm:col-span-1 sm:bg-transparent sm:px-0 sm:py-0 sm:hover:underline",children:t("luckyDrawHelperPage.importCandidates")}),(0,a.jsx)("input",{type:"file",ref:ek,accept:".txt,.csv",onChange:e=>{var t;let s=null===(t=e.target.files)||void 0===t?void 0:t[0];if(!s)return;let a=new FileReader;a.onload=e=>{var t;return b(null===(t=e.target)||void 0===t?void 0:t.result)},a.readAsText(s)},className:"jsx-e21718e3f33edc48 hidden"})]})]}),(0,a.jsx)("textarea",{value:j,onChange:e=>b(e.target.value),placeholder:t("luckyDrawHelperPage.candidatePlaceholder"),className:"jsx-e21718e3f33edc48 w-full h-48 px-4 py-3 bg-slate-50 border border-slate-200 rounded-xl focus:ring-2 focus:ring-[#0D5EA6] outline-none resize-none"})]}),(0,a.jsxs)("div",{className:"jsx-e21718e3f33edc48 bg-white border border-slate-200 rounded-2xl p-6 shadow-sm",children:[(0,a.jsxs)("div",{className:"jsx-e21718e3f33edc48 flex justify-between mb-4",children:[(0,a.jsx)("h2",{className:"jsx-e21718e3f33edc48 text-lg font-bold text-slate-800",children:t("luckyDrawHelperPage.prizeSettings")}),(0,a.jsx)("button",{onClick:()=>{let e=t("luckyDrawHelperPage.defaultPrizeName");y([...w,{id:Math.random().toString(36).substr(2,9),name:e,count:1}])},className:"jsx-e21718e3f33edc48 text-sm font-bold text-[#0D5EA6] curs
1or-pointer",children:t("luckyDrawHelperPage.addPrize")})]}),(0,a.jsx)("div",{className:"jsx-e21718e3f33edc48 space-y-4",children:w.map((e,s)=>(0,a.jsxs)("div",{className:"jsx-e21718e3f33edc48 flex items-center gap-4 bg-slate-50 p-4 rounded-xl border border-slate-100",children:[(0,a.jsxs)("span",{className:"jsx-e21718e3f33edc48 w-8 h-8 rounded-lg bg-slate-200 flex items-center justify-center text-xs font-bold text-slate-500",children:["#",s+1]}),(0,a.jsx)("input",{type:"text",value:e.name,onChange:t=>eA(e.id,"name",t.target.value),placeholder:t("luckyDrawHelperPage.prizePlaceholder"),className:"jsx-e21718e3f33edc48 flex-1 bg-transparent border-none focus:ring-0 font-bold text-slate-800 outline-none"}),(0,a.jsx)("div",{className:"jsx-e21718e3f33edc48 flex items-center gap-2 w-20",children:(0,a.jsx)("input",{type:"number",min:"1",value:e.count,onChange:t=>eA(e.id,"count",parseInt(t.target.value)||0),className:"jsx-e21718e3f33edc48 w-full bg-white border border-slate-200 rounded-lg px-2 py-1 text-center font-bold text-slate-800"})}),w.length>1&&(0,a.jsx)("button",{onClick:()=>eL(e.id),className:"jsx-e21718e3f33edc48 text-red-400 hover:text-red-500 cursor-pointer",children:(0,a.jsx)("svg",{fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",className:"jsx-e21718e3f33edc48 w-5 h-5",children:(0,a.jsx)("path",{d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"jsx-e21718e3f33edc48"})})})]},e.id))}),(0,a.jsx)("div",{className:"jsx-e21718e3f33edc48 mt-6 pt-6 border-t border-slate-100",children:(0,a.jsxs)("label",{className:"jsx-e21718e3f33edc48 flex items-center gap-3 cursor-pointer group",children:[(0,a.jsxs)("div",{className:"jsx-e21718e3f33edc48 relative",children:[(0,a.jsx)("input",{type:"checkbox",checked:k,onChange:e=>v(e.target.checked),className:"jsx-e21718e3f33edc48 sr-only"}),(0,a.jsx)("div",{className:"jsx-e21718e3f33edc48 "+"w-12 h-6 rounded-full transition-colors ".concat(k?"bg-[#0D5EA6]":"bg-slate-200")}),(0,a.jsx)("div",{className:"jsx-e21718e3f33edc48 "+"absolute top-1 left-1 w-4 h-4 bg-white rounded-full transition-transform ".concat(k?"translate-x-6":"")})]}),(0,a.jsx)("span",{className:"jsx-e21718e3f33edc48 text-sm font-bold text-slate-600 group-hover:text-slate-800 transition-colors",children:t("luckyDrawHelperPage.allowDuplicateWins")})]})})]}),(0,a.jsxs)("div",{className:"jsx-e21718e3f33edc48 bg-gradient-to-br from-[#0D5EA6]/5 to-slate-50 border-2 border-dashed border-[#0D5EA6]/20 rounded-2xl p-6 shadow-sm",children:[(0,a.jsxs)("div",{className:"jsx-e21718e3f33edc48 mb-6 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsxs)("div",{className:"jsx-e21718e3f33edc48 flex items-center gap-2",children:[(0,a.jsx)("span",{className:"jsx-e21718e3f33edc48 p-1 px-2 bg-[#0D5EA6] text-white text-[10px] font-black rounded uppercase",children:"PRO"}),(0,a.jsx)("h2",{className:"jsx-e21718e3f33edc48 text-lg font-bold text-slate-800",children:t("luckyDrawHelperPage.proSettings")})]}),!ew.isPro&&(0,a.jsx)("button",{type:"button",onClick:eH,className:"jsx-e21718e3f33edc48 inline-flex items-center justify-center rounded-xl bg-amber-500 px-4 py-2 text-sm font-black text-white shadow-lg shadow-amber-500/20 transition-all hover:bg-amber-600 cursor-pointer",children:t("luckyDrawHelperPage.proModal.buyDirectlyButton")})]}),(0,a.jsxs)("div",{className:"jsx-e21718e3f33edc48 grid grid-cols-1 md:grid-cols-2 gap-6",children:[(0,a.jsxs)("div",{className:"jsx-e21718e3f33edc48 space-y-4",children:[(0,a.jsxs)("div",{className:"jsx-e21718e3f33edc48 flex justify-between items-center",children:[(0,a.jsx)("label",{className:"jsx-e21718e3f33edc48 text-xs font-bold text-slate-500 uppercase tracking-wider",children:t("luckyDrawHelperPage.customLogoUrl")}),(0,a.jsx)("button",{onClick:()=>{var e;return null===(e=ev.current)||void 0===e?void 0:e.click()},className:"jsx-e21718e3f33edc48 text-[10px] bg-slate-800 text-white px-2 py-1 rounded font-bold hover:bg-black transition-colors cursor-pointer",children:t("luckyDrawHelperPage.uploadLogo")}),(0,a.jsx)("input",{type:"file",ref:ev,accept:"image/png,image/jpeg,image/svg+xml",onChange:eT,className:"jsx-e21718e3f33edc48 hidden"})]}),(0,a.jsxs)("div",{className:"jsx-e21718e3f33edc48 relative",children:[(0,a.jsx)("input",{type:"text",readOnly:U.startsWith("data:"),value:U&&(U.startsWith("data:")||U.startsWith("/uploads/"))?t("luckyDrawHelperPage.uploadedImage"):U,onChange:e=>_(e.target.value),onClick:()=>
1{if(U.startsWith("data:")){var e;null===(e=ev.current)||void 0===e||e.click()}},placeholder:"https://...",className:"jsx-e21718e3f33edc48 "+"w-full px-4 py-3 bg-white border border-slate-200 rounded-xl outline-none text-sm text-slate-600 overflow-hidden ".concat(U&&(U.startsWith("data:")||U.startsWith("/uploads/"))?"cursor-pointer hover:border-[#0D5EA6]":"")}),U&&(0,a.jsxs)("div",{className:"jsx-e21718e3f33edc48 mt-4 flex items-end gap-3",children:[(0,a.jsx)("div",{className:"jsx-e21718e3f33edc48 w-24 h-24 bg-white border border-slate-200 rounded-2xl p-2 flex items-center justify-center overflow-hidden shadow-sm",children:(0,a.jsx)("img",{src:U,alt:"Preview",className:"jsx-e21718e3f33edc48 max-w-full max-h-full object-contain"})}),(0,a.jsx)("button",{onClick:()=>_(""),className:"jsx-e21718e3f33edc48 text-xs font-bold text-red-500 hover:text-red-600 mb-2 px-3 py-1.5 bg-red-50 rounded-lg transition-colors cursor-pointer",children:t("luckyDrawHelperPage.removeLogo")})]})]})]}),(0,a.jsxs)("div",{className:"jsx-e21718e3f33edc48 space-y-2",children:[(0,a.jsx)("label",{className:"jsx-e21718e3f33edc48 text-xs font-bold text-slate-500 uppercase tracking-wider",children:t("luckyDrawHelperPage.customThemeColor")}),(0,a.jsxs)("div",{className:"jsx-e21718e3f33edc48 flex gap-3",children:[(0,a.jsx)("input",{type:"color",value:W,onChange:e=>R(e.target.value),className:"jsx-e21718e3f33edc48 w-12 h-12 bg-white border border-slate-200 rounded-lg cursor-pointer p-1"}),(0,a.jsx)("div",{className:"jsx-e21718e3f33edc48 flex-1 px-4 py-3 bg-white border border-slate-200 rounded-xl font-mono text-sm flex items-center uppercase text-slate-600",children:W})]})]}),(0,a.jsxs)("div",{className:"jsx-e21718e3f33edc48 space-y-2",children:[(0,a.jsx)("label",{className:"jsx-e21718e3f33edc48 text-xs font-bold text-slate-500 uppercase tracking-wider",children:t("luckyDrawHelperPage.customCtaText")}),(0,a.jsx)("input",{type:"text",value:O,onChange:e=>F(e.target.value),placeholder:t("luckyDrawHelperPage.customCtaPlaceholder"),className:"jsx-e21718e3f33edc48 w-full px-4 py-3 bg-white border border-slate-200 rounded-xl outline-none"})]}),(0,a.jsxs)("div",{className:"jsx-e21718e3f33edc48 space-y-2",children:[(0,a.jsx)("label",{className:"jsx-e21718e3f33edc48 text-xs font-bold text-slate-500 uppercase tracking-wider",children:t("luckyDrawHelperPage.customCtaUrl")}),(0,a.jsx)("input",{type:"text",value:J,onChange:e=>V(e.target.value),placeholder:t("luckyDrawHelperPage.customCtaUrlPlaceholder"),className:"jsx-e21718e3f33edc48 w-full px-4 py-3 bg-white border border-slate-200 rounded-xl outline-none"})]}),(0,a.jsxs)("div",{className:"jsx-e21718e3f33edc48 space-y-2 md:col-span-2",children:[(0,a.jsx)("label",{className:"jsx-e21718e3f33edc48 text-xs font-bold text-slate-500 uppercase tracking-wider",children:t("luckyDrawHelperPage.drawPassword")}),(0,a.jsxs)("div",{className:"jsx-e21718e3f33edc48 relative",children:[(0,a.jsx)("input",{type:G?"text":"password",value:K,onChange:e=>X(e.target.value),placeholder:t("luckyDrawHelperPage.drawPasswordPlaceholder"),className:"jsx-e21718e3f33edc48 w-full px-4 py-3 bg-white border border-slate-200 rounded-xl outline-none pr-14"}),(0,a.jsx)("button",{type:"button",onClick:()=>Q(!G),className:"jsx-e21718e3f33edc48 absolute right-2 top-1/2 -translate-y-1/2 flex h-8 w-8 items-center justify-center text-slate-400 hover:text-[#0D5EA6] transition-colors cursor-pointer",children:G?(0,a.jsxs)("svg",{fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",className:"jsx-e21718e3f33edc48 w-4 h-4",children:[(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z",className:"jsx-e21718e3f33edc48"}),(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z",className:"jsx-e21718e3f33edc48"})]}):(0,a.jsx)("svg",{fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",className:"jsx-e21718e3f33edc48 w-4 h-4",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13.875 18.825A10.05 10.05 0 0112 19c-4.478 0-8.268-2.943-9.542-7a9.97 9.97 0 011.563-3.029m5.858.908a3 3 0 114.243 4.243M9.878 9.878l4.242 4.242M9.88 9.88l-3.29-3.29m7.532 7.532l3.29 3.29M3 3l18 18",className:"jsx-e21718e3f33edc48"})})})]})]})]}),(0,a.jsx)("div",{className:"jsx-e21718e3f33edc48 mt-6 pt-6 border-t border-[#0D5EA6]/10",children:(0,a.jsxs)("label",{className:"jsx-e21718e3f33edc48 flex items-center gap-3 cursor-pointer group",children:[(0,a.jsxs)("div",{className:"jsx-e21718e3f33edc48 relative",children:[(0,a.jsx)("input",{type:"checkbox",checked:$,onChange:e=>Y(e.target.checked),className:"jsx-e21718e3f33edc48 sr-only"}),(0,a.jsx)("div",{className:"jsx-e21718e3f33edc48 "+"w-12 h-6 rounded-full transition-colors ".concat($?"bg-[#0D5EA6]":"bg-slate-200")}),(0,a.jsx)("div",{className:"jsx-e21718e3f33edc48 "+"absolute top-1 left-1 w-4 h-4 bg-white rounded-full transition-transform ".concat($?"translate-x-6":"")}
1)]}),(0,a.jsx)("span",{className:"jsx-e21718e3f33edc48 text-sm font-bold text-slate-600",children:t("luckyDrawHelperPage.animationEffect")})]})}),(0,a.jsx)("div",{className:"jsx-e21718e3f33edc48 mt-6 pt-6 border-t border-[#0D5EA6]/10",children:(0,a.jsxs)("label",{className:"jsx-e21718e3f33edc48 flex items-center gap-3 cursor-pointer group",children:[(0,a.jsxs)("div",{className:"jsx-e21718e3f33edc48 relative",children:[(0,a.jsx)("input",{type:"checkbox",checked:Z,onChange:e=>q(e.target.checked),className:"jsx-e21718e3f33edc48 sr-only"}),(0,a.jsx)("div",{className:"jsx-e21718e3f33edc48 "+"w-12 h-6 rounded-full transition-colors ".concat(Z?"bg-[#0D5EA6]":"bg-slate-200")}),(0,a.jsx)("div",{className:"jsx-e21718e3f33edc48 "+"absolute top-1 left-1 w-4 h-4 bg-white rounded-full transition-transform ".concat(Z?"translate-x-6":"")})]}),(0,a.jsx)("span",{className:"jsx-e21718e3f33edc48 text-sm font-bold text-slate-600",children:t("luckyDrawHelperPage.hideBranding")})]})}),!ew.isPro&&(0,a.jsxs)("div",{className:"jsx-e21718e3f33edc48 mt-6 rounded-2xl border border-amber-200 bg-amber-50/80 p-4",children:[(0,a.jsx)("div",{className:"jsx-e21718e3f33edc48 text-sm font-black text-amber-900",children:t("luckyDrawHelperPage.proModal.instantUpgradeTitle")}),(0,a.jsx)("p",{className:"jsx-e21718e3f33edc48 mt-1 text-xs font-medium leading-5 text-amber-800",children:t("luckyDrawHelperPage.proModal.instantUpgradeDesc")}),(0,a.jsx)("button",{type:"button",onClick:eH,className:"jsx-e21718e3f33edc48 mt-3 inline-flex items-center justify-center rounded-xl bg-slate-900 px-4 py-2.5 text-sm font-black text-white transition-colors hover:bg-black cursor-pointer",children:t("luckyDrawHelperPage.proModal.buyDirectlyButton")})]})]})]}),(0,a.jsxs)("div",{className:"jsx-e21718e3f33edc48 lg:col-span-4 space-y-6",children:[(0,a.jsxs)("div",{style:{backgroundColor:W},className:"jsx-e21718e3f33edc48 bg-[#0D5EA6] rounded-3xl p-6 text-white shadow-xl shadow-[#0D5EA6]/20 text-center",children:[(0,a.jsx)("h3",{className:"jsx-e21718e3f33edc48 text-[10px] font-bold opacity-70 uppercase tracking-widest mb-1",children:t("luckyDrawHelperPage.winRate")}),(0,a.jsxs)("div",{className:"jsx-e21718e3f33edc48 text-3xl font-black mb-4",children:[k?"100":eS>100?100:eS.toFixed(1),"%"]}),(0,a.jsx)("div",{className:"jsx-e21718e3f33edc48 h-1.5 bg-white/20 rounded-full overflow-hidden",children:(0,a.jsx)("div",{style:{width:"".concat(k?100:Math.min(100,eS),"%")},className:"jsx-e21718e3f33edc48 h-full bg-white transition-all duration-500"})})]}),(0,a.jsxs)("div",{className:"jsx-e21718e3f33edc48 bg-white border border-slate-200 rounded-2xl p-6 shadow-sm space-y-4",children:[(0,a.jsxs)("div",{className:"jsx-e21718e3f33edc48 flex items-center justify-between px-2",children:[(0,a.jsx)("span",{className:"jsx-e21718e3f33edc48 text-xs font-bold text-slate-400 uppercase tracking-wider",children:t("luckyDrawHelperPage.soundEffect")}),(0,a.jsx)("button",{onClick:()=>{z(!T),localStorage.setItem("lucky_draw_sound",String(!T))},className:"jsx-e21718e3f33edc48 "+"w-10 h-10 flex items-center justify-center rounded-xl transition-colors cursor-pointer ".concat(T?"bg-amber-100 text-amber-600":"bg-slate-100 text-slate-400"),children:T?(0,a.jsx)("svg",{fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",className:"jsx-e21718e3f33edc48 w-5 h-5",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15.536 8.464a5 5 0 010 7.072m2.828-9.9a9 9 0 010 12.728M5.586 15H4a1 1 0 01-1-1v-4a1 1 0 011-1h1.586l4.707-4.707C10.923 3.663 12 4.109 12 5v14c0 .891-1.077 1.337-1.707.707L5.586 15z",className:"jsx-e21718e3f33edc48"})}):(0,a.jsxs)("svg",{fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",className:"jsx-e21718e3f33edc48 w-5 h-5",children:[(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5.586 15H4a1 1 0 01-1-1v-4a1 1 0 011-1h1.586l4.707-4.707C10.923 3.663 12 4.109 12 5v14c0 .891-1.077 1.337-1.707.707L5.586 15z",className:"jsx-e21718e3f33edc48"}),(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M17 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2",className:"jsx-e21718e3f33edc48"})]})})]}),(0,a.jsx)("button",{onClick:()=>ez(!1),className:"jsx-e21718e3f33edc48 w-full py-4 rounded-xl border-2 border-slate-100 text-slate-600 font-bold hover:bg-slate-50 cursor-pointer shadow-sm transition-all",children:t("luckyDrawHelperPage.trialButton")}),(0,a.jsx)("button",{onClick:()=>ez(!0),style:{backgroundColor:W},className:"jsx-e21718e3f33edc48 w-full py-4 rounded-xl bg-[#0D5EA6] text-white font-black hover:opacity-90 shadow-lg transition-all cursor-pointer",children:t("luckyDrawHelperPage.officialButton")}),(ew.isPro||ew.payments&&ew.payments.length>0)&&(0,a.jsxs)("div",{className:"jsx-e21718e3f33edc48 mt-4 p-4 rounded-xl border border-amber-200 bg-gradient-to-r from-amber-50 to-amber-100/50 flex flex-col items-center justify-center text-center shadow-sm",children:[(0,a.jsxs)("div",{className:"jsx-e21718e3f33edc48 flex items-center gap-2 mb-1",children:[(0,a.jsx)("svg",{fill:"currentColor",viewBox:"0 0 20 20",className:"jsx-e21718e3f33edc48 w-4 h-4 text-amber-500",children:(0,a.jsx)("path",{d:"M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z",className:"jsx-e21718e3f33edc48"})}),(0,a.jsx)("span",{className:"jsx-e21718e3f33edc48 text-xs font-black text-amber-700 tracking-wider",children:ew.isPro?t("luckyDrawHelperPage.proStatusActive"):t("luckyDrawHelperPage.proStatusExpired")})]}),ew.expiresAt&&(0,a.jsxs)("span",{className:"jsx-e21718e3f33edc48 text-[10px] text-amber-600/80 font-medium",children:[t("luckyDrawHelperPage.proExpiresAt"),new Date(ew.expiresAt).toLocaleDateString()]}),(0,a.jsxs)("div",{className:"jsx-e21718e3f33edc48 mt-4 grid w-full grid-cols-2 gap-2 text-left",children:[(0,a.jsxs)("div",{className:"jsx-e21718e3f33edc48 rounded-xl border border-amber-200/70 bg-white/70 px-3 py-2",children:[(0,a.jsx)("div",{className:"jsx-e21718e3f33edc48 text-[10px] font-black uppercase tracking-wider text-amber-700/70",children:eV.currentPlan}),(0,a.jsx)("div",{className:"jsx-e21718e3f33edc48 mt-1 text-sm font-black text-amber-900",children:eZ})]}),(0,a.jsxs)("div",{className:"jsx-e21718e3f33edc48 rounded-xl border border-amber-200/70 bg-white/70 px-3 py-2",children:[(0,a.jsx)("div",{className:"jsx-e21718e3f33edc48 text-[10px] font-black uppercase tracking-wider text-amber-700/70",children:eV.remainingDays}),(0,a.jsx)("div",{className:"jsx-e21718e3f33edc48 mt-1 text-sm font-black text-amber-900",children:ew.isPro?"".concat(eY," ").concat(eV.dayUnit):eV.expired})]})]}),(0,a.jsx)("button",{type:"button",onClick:eH,className:"jsx-e21718e3f33edc48 mt-4 w-full rounded-xl bg-amber-500 px-4 py-3 text-sm font-black text-white shadow-lg shadow-amber-500/20 transition-all hover:bg-amber-600 cursor-pointer",children:t("luckyDrawHelperPage.proModal.managePlanButton")}),ew.payments&&ew.payments.length>0&&(0,a.jsxs)("div",{className:"jsx-e21718e3f33edc48 mt-4 pt-4 border-t border-amber-200/50 w-full",children:[(0,a.jsxs)("h4",{className:"jsx-e21718e3f33edc48 text-[10px] font-black text-amber-800/40 uppercase tracking-widest mb-2 flex items-center justify-center gap-1.5",children:[(0,a.jsx)("svg",{fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",className:"jsx-e21718e3f33edc48 w-3 h-3",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2.5,d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2",className:"jsx-e21718e3f33edc48"})}),t("luckyDrawHelperPage.paymentHistoryTitle")]}),(0,a.jsx)("div",{className:"jsx-e21718e3f33edc48 space-y-1.5",children:ew.payments.slice(0,3).map((e,t)=>(0,a.jsxs)("div",{className:"jsx-e21718e3f33edc48 flex justify-between items-center px-1",children:[(0,a.jsxs)("div",{className:"jsx-e21718e3f33edc48 flex flex-col items-start",children:[(0,a.jsx)("span",{className:"jsx-e21718e3f33edc48 text-[10px] font-bold text-amber-900",children:e_(e.planType)}),(0,a.jsx)("span",{className:"jsx-e21718e3f33edc48 text-[8px] text-amber-700/60 font-medium",children:new Date(e.createdAt).toLocaleDateString()})]}),(0,a.jsxs)("div",{className:"jsx-e21718e3f33edc48 flex flex-col items-end",children:[(0,a.jsxs)("span",{className:"jsx-e21718e3f33edc48 text-[10px] font-black text-amber-900",children:["$",e.amount]}),(0,a.jsx)("span",{className:"jsx-e21718e3f33edc48 "+"text-[8px] font-bold px-1 rounded ".concat("paid"===e.status?"text-green-600 bg-green-50":"text-slate-400 bg-slate-50"),children:eR(e.status)})]})]},t))})]})]})]}),I.length>0&&(0,a.jsxs)("div",{className:"jsx-e21718e3f33edc48 bg-white border border-slate-200 rounded-2xl shadow-sm overflow-hidden",children:[(0,a.jsxs)("div",{className:"jsx-e21718e3f33edc48 p-6 flex justify-between items-center bg-slate-50/50 border-b border-slate-100",children:[(0,a.jsxs)("div",{onClick:()=>et(!ee),className:"jsx-e21718e3f33edc48 flex items-center gap-2 cursor-pointer select-none",children:[(0,a.jsx)("h3",{className:"jsx-e21718e3f33edc48 text-xs font-black text-slate-400 uppercase tracking-widest",children:t("luckyDrawHelperPage.recentHistory")}),(0,a.jsx)("svg",{fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",className:"jsx-e21718e3f33edc48 "+"w-3 h-3 text-slate-400 transition-transform ".concat(ee?"-rotate-90":""),children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:3,d:"M19 9l-7 7-7-7",className:"jsx-e21718e3f33edc48"})})]}),!ee&&(0,a.jsx)("button",{onClick:eB,className:"jsx-e21718e3f33edc48 text-[10px] font-bold text-red-400 hover:underline cursor-pointer",children:t("luckyDrawHelperPage.clearHistory")})]}),!ee&&(0,a.jsx)("div",{className:"jsx-e21718e3f33edc48 p-6 space-y-3",children:I.map(s=>{let r=s.id?"/".concat(e,"/lucky-draw-helper/result?id=").concat(s.id):"/".concat(e,"/lucky-draw-helper/result#d=").concat(s.data);return(0,a.jsxs)("div",{className:"jsx-e21718e3f33edc48 relative group/item",children:[(0,a.jsxs)(i.default,{href:r,className:"block p-3 bg-slate-50 rounded-xl border border-slate-100 hover:bg-blue-50 hover:border-blue-100 transition-all group cursor-pointer pr-10",children:[(0,a.jsx)("div",{className:"jsx-e21718e3f33edc48 text-sm font-bold text-slate-700 group-hover:text-[#0D5EA6] truncate",children:s.title}),(0,a.jsxs)("div",{className:"jsx-e21718e3f33edc48 text-[10px] text-slate-400 mt-1 font-medium",children:[new Date(s.timestamp).toLocaleDateString()," \xb7 ",s.resultsCount," ",t("luckyDrawHelperPage.winnersCountSuffix")]})]}),(0,a.jsx)("button",{onClick:e=>eI(e,s.id),className:"jsx-e21718e3f33edc48 absolute right-3 top-1/2 -translate-y-1/2 p-2 text-slate-300 hover:text-red-500 hover:bg-red-50 rounded-lg transition-all opacity-0 group-hover/item:opacity-100 cursor-pointer",children:(0,a.jsx)("svg",{fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",className:"jsx-e21718e3f33edc48 w-4 h-4",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16",className:"jsx-e21718e3f33edc48"})})})]},s.id)})})]})]})]})]}),P&&(0,a.jsxs)("div",{className:"jsx-e21718e3f33edc48 fixed inset-0 z-[140] bg-slate-900/80 backdrop-blur-md",children:[(0,a.jsx)("div",{onClick:()=>H(!1),className:"jsx-e21718e3f33edc48 absolute inset-0 hidden sm:block"}),(0,a.jsx)("div",{className:"jsx-e21718e3f33edc48 relative flex min-h-full items-stretch justify-center sm:p-4 md:items-center",children:(0,a.jsxs)("div",{className:"jsx-e21718e3f33edc48 relative flex h-[100dvh] w-full max-w-xl flex-col overflow-hidden bg-white shadow-2xl sm:h-auto sm:max-h-[calc(100dvh-2rem)] sm:rou
1nded-[40px] sm:border sm:border-white/20",children:[(0,a.jsxs)("div",{className:"jsx-e21718e3f33edc48 flex items-center justify-between bg-slate-900 px-4 py-3 text-white sm:hidden",children:[(0,a.jsxs)("div",{className:"jsx-e21718e3f33edc48",children:[(0,a.jsx)("div",{className:"jsx-e21718e3f33edc48 text-[10px] font-black uppercase tracking-[0.24em] text-white/60",children:"PRO"}),(0,a.jsx)("div",{className:"jsx-e21718e3f33edc48 text-sm font-black",children:t("luckyDrawHelperPage.proModal.sheetTitle")})]}),(0,a.jsx)("button",{type:"button",onClick:()=>{H(!1),ef(!1)},className:"jsx-e21718e3f33edc48 flex h-10 w-10 items-center justify-center rounded-full bg-white/10 text-white transition-colors hover:bg-white/20 cursor-pointer",children:(0,a.jsx)("svg",{fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",className:"jsx-e21718e3f33edc48 h-5 w-5",children:(0,a.jsx)("path",{d:"M6 18L18 6M6 6l12 12",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",className:"jsx-e21718e3f33edc48"})})})]}),(0,a.jsx)("button",{type:"button",onClick:()=>{H(!1),ef(!1)},className:"jsx-e21718e3f33edc48 absolute right-3 top-3 z-10 hidden h-10 w-10 items-center justify-center rounded-full bg-white/20 text-white backdrop-blur-md transition-colors hover:bg-white/30 curs
1or-pointer sm:flex",children:(0,a.jsx)("svg",{fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",className:"jsx-e21718e3f33edc48 h-5 w-5",children:(0,a.jsx)("path",{d:"M6 18L18 6M6 6l12 12",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",className:"jsx-e21718e3f33edc48"})})}),(0,a.jsxs)("div",{className:"jsx-e21718e3f33edc48 flex-1 overflow-y-auto overscroll-contain",children:[(0,a.jsxs)("div",{className:"jsx-e21718e3f33edc48 relative overflow-hidden bg-gradient-to-r from-amber-400 via-orange-500 to-rose-500 p-5 pb-9 text-center sm:p-8 sm:pb-12",children:[(0,a.jsx)("div",{className:"jsx-e21718e3f33edc48 absolute top-0 right-0 w-32 h-32 bg-white/10 rounded-full -mr-16 -mt-16 blur-2xl"}),(0,a.jsxs)("div",{className:"jsx-e21718e3f33edc48 relative",children:[(0,a.jsx)("div",{className:"jsx-e21718e3f33edc48 mb-3 inline-block rounded-full bg-white/20 p-1 px-3 text-[10px] font-black uppercase tracking-widest text-white shadow-sm backdrop-blur-md sm:mb-4",children:"Unlock Pro"}),(0,a.jsx)("h2",{className:"jsx-e21718e3f33edc48 mb-2 text-2xl font-black leading-tight tracking-tighter text-white sm:text-3xl",children:t("luckyDrawHelperPage.proModal.title")}),(0,a.jsx)("p",{className:"jsx-e21718e3f33edc48 mx-auto max-w-md text-sm font-medium text-white/85 sm:text-base",children:t("luckyDrawHelperPage.proModal.subtitle")})]})]}),(0,a.jsx)("div",{className:"jsx-e21718e3f33edc48 relative mx-1 -mt-5 flex-1 overflow-y-auto rounded-t-[24px] bg-white px-4 pb-[max(1rem,env(safe-area-inset-bottom))] pt-5 sm:-mt-8 sm:rounded-t-[32px] sm:px-8 sm:pb-6 sm:pt-8",children:(0,a.jsxs)("div",{className:"jsx-e21718e3f33edc48 space-y-5 sm:space-y-6",children:[(0,a.jsxs)("div",{className:"jsx-e21718e3f33edc48 "+"flex items-start gap-4 roun
1ded-2xl border p-4 ".concat(eE?"border-amber-100 bg-amber-50":"border-slate-200 bg-slate-50"),children:[(0,a.jsx)("div",{className:"jsx-e21718e3f33edc48 p-2 bg-amber-100 rounded-lg",children:(0,a.jsx)("svg",{fill:"currentColor",viewBox:"0 0 20 20",className:"jsx-e21718e3f33edc48 w-5 h-5 text-amber-600",children:(0,a.jsx)("path",{fillRule:"evenodd",d:"M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z",clipRule:"evenodd",className:"jsx-e21718e3f33edc48"})})}),(0,a.jsx)("p",{className:"jsx-e21718e3f33edc48 "+"text-sm font-bold leading-relaxed ".concat(eE?"text-amber-900":"text-slate-700"),children:eE?t("luckyDrawHelperPage.proModal.limitExceeded",{count:String(eC.length)}):t("luckyDrawHelperPage.proModal.directUnlockIntro")})]}),(0,a.jsx)("div",{className:"jsx-e21718e3f33edc48 grid grid-cols-1 md:grid-cols-2 gap-x-8 gap-y-6",children:[{title:t("luckyDrawHelperPage.proModal.feature1Title"),desc:t("luckyDrawHelperPage.proModal.feature1Desc"),icon:"M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z"},{title:t("luckyDrawHelperPage.proModal.feature2Title"),desc:t("luckyDrawHelperPage.proModal.feature2Desc"),icon:"M3 15a4 4 0 004 4h9a5 5 0 10-.1-9.999 5.002 5.002 0 10-9.78 2.096A4.001 4.001 0 003 15z"},{title:t("luckyDrawHelperPage.proModal.feature3Title"),desc:t("luckyDrawHelperPage.proModal.feature3Desc"),icon:"M7 21a4 4 0 01-4-4V5a2 2 0 012-2h4a2 2 0 012 2v12a4 4 0 01-4 4zm0 0h12a2 2 0 002-2v-4a2 2 0 00-2-2h-2.343M11 7.343l1.657-1.657a2 2 0 012.828 0l2.829 2.829a2 2 0 010 2.828l-8.486 8.485M7 17h.01"},{title:t("luckyDrawHelperPage.proModal.feature4Title"),desc:t("luckyDrawHelperPage.proModal.feature4Desc"),icon:"M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"}].map((e,t)=>(0,a.jsxs)("div",{className:"jsx-e21718e3f33edc48 group flex gap-3 sm:gap-4",children:[(0,a.jsx)("div",{className:"jsx-e21718e3f33edc48 flex h-10 w-10 flex-shrink-0 items-center justify-center rounded-2xl border border-slate-100 bg-slate-50 text-[#0D5EA6] shadow-sm transition-all group-hover:bg-[#0D5EA6] group-hover:text-white",children:(0,a.jsx)("svg",{fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",className:"jsx-e21718e3f33edc48 w-5 h-5",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:e.icon,className:"jsx-e21718e3f33edc48"})})}),(0,a.jsxs)("div",{className:"jsx-e21718e3f33edc48",children:[(0,a.jsx)("h4",{className:"jsx-e21718e3f33edc48 text-sm font-black text-slate-800 mb-1",children:e.title}),(0,a.jsx)("p",{className:"jsx-e21718e3f33edc48 text-[11px] text-slate-500 font-medium leading-relaxed",children:e.desc})]})]},t))}),(0,a.jsxs)("div",{className:"jsx-e21718e3f33edc48 pt-2 flex flex-col gap-4 sm:pt-4",children:[(0,a.jsx)("div",{className:"jsx-e21718e3f33edc48 grid grid-cols-1 gap-2 sm:grid-cols-3",children:["7days","1month","1year"].map(e=>{let s=ec===e,r={"7days":{label:t("luckyDrawHelperPage.proModal.priceTrialLabel"),fee:t("luckyDrawHelperPage.proModal.priceTrialFee"),color:"text-amber-600",bg:"bg-amber-50",border:"border-amber-100"},"1month":{label:t("luckyDrawHelperPage.proModal.priceMonthlyLabel"),fee:t("luckyDrawHelperPage.proModal.priceMonthlyFee"),color:"text-[#0D5EA6]",bg:"bg-[#0D5EA6]/5",border:"border-[#0D5EA6]/10"},"1year":{label:t("luckyDrawHelperPage.proModal.priceYearlyLabel"),fee:t("luckyDrawHelperPage.proModal.priceYearlyFee"),color:"text-slate-400",bg:"bg-slate-50",border:"border-slate-100"}}[e];return(0,a.jsxs)("button",{type:"button",onClick:()=>eo(e),className:"jsx-e21718e3f33edc48 "+"relative overflow-hidden rounded-2xl border-2 p-3 text-center transition-all cursor-pointer ".concat(r.bg," ").concat(s?"border-slate-900 ring-2 ring-slate-900/10 scale-[1.02]":r.border),children:["1month"===e&&(0,a.jsx)("div",{className:"jsx-e21718e3f33edc48 absolute top-0 right-0 bg-[#0D5EA6] text-white text-[8px] px-1.5 py-0.5 rounded-bl-lg font-black",children:t("luckyDrawHelperPage.proModal.priceBestTag")}),(0,a.jsx)("div",{className:"jsx-e21718e3f33edc48 "+"text-[10px] font-bold uppercase tracking-tighter ".concat(r.color),children:r.label}),(0,a.jsx)("div",{className:"jsx-e21718e3f33edc48 text-sm font-black text-slate-800",children:r.fee})]},e)})}),(0,a.jsxs)("div",{className:"jsx-e21718e3f33edc48 space-y-3 rounded-2xl border border-slate-200 bg-slate-50/80 p-4",children:[(0,a.jsxs)("div",{className:"jsx-e21718e3f33edc48 grid grid-cols-1 gap-3 sm:grid-cols-2",children:[(0,a.jsxs)("div",{className:"jsx-e21718e3f33edc48",children:[(0,a.jsx)("div",{className:"jsx-e21718e3f33edc48 text-[10px] font-black uppercase tracking-wider text-slate-400",children:eV.currentPlan}),(0,a.jsx)("div",{className:"jsx-e21718e3f33edc48 mt-1 text-sm font-black text-slate-800",children:eZ})]}),(0,a.jsxs)("div",{className:"jsx-e21718e3f33edc48",children:[(0,a.jsx)("div",{className:"jsx-e21718e3f33edc48 text-[10px] font-black uppercase tracking-wider text-slate-400",children:ew.isPro?eV.currentExpiry:eV.selectedPlan}
1),(0,a.jsx)("div",{className:"jsx-e21718e3f33edc48 mt-1 text-sm font-black text-slate-800",children:ew.isPro&&eq?eq.toLocaleDateString(e):e_(ec)})]})]}),(0,a.jsx)("div",{className:"jsx-e21718e3f33edc48 h-px bg-slate-200"}),(0,a.jsxs)("div",{className:"jsx-e21718e3f33edc48 grid grid-cols-1 gap-3 sm:grid-cols-2",children:[(0,a.jsxs)("div",{className:"jsx-e21718e3f33edc48",children:[(0,a.jsx)("div",{className:"jsx-e21718e3f33edc48 text-[10px] font-black uppercase tracking-wider text-slate-400",children:ew.isPro?eV.projectedExpiryActive:eV.projectedExpiryInactive}),(0,a.jsx)("div",{className:"jsx-e21718e3f33edc48 mt-1 text-base font-black text-[#0D5EA6]",children:eK.toLocaleDateString(e)})]}),(0,a.jsxs)("div",{className:"jsx-e21718e3f33edc48",children:[(0,a.jsx)("div",{className:"jsx-e21718e3f33edc48 text-[10px] font-black uppercase tracking-wider text-slate-400",children:eV.addedValue}),(0,a.jsxs)("div",{className:"jsx-e21718e3f33edc48 mt-1 text-sm font-black text-slate-800",children:[e_(ec)," / ",eW(ec)," ",eV.dayUnit]})]})]}),eF.length>0&&(0,a.jsx)("div",{className:"jsx-e21718e3f33edc48 rounded-xl border border-amber-200 bg-amber-50 px-3 py-2 text-xs font-bold leading-5 text-amber-800",children:eX})]}),f?(0,a.jsx)("button",{disabled:eu,onClick:async()=>{ex(""),em(!0);try{let t="zh-TW"===e?"ecpay":"paypal",s=await fetch("/api/lucky-draw/payment/create-order",{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(localStorage.getItem("token")||"")},body:JSON.stringify({planType:ec,email:(null==m?void 0:m.account_email)||"",gateway:t,locale:e})}),a=await s.json();if(!a.success)throw Error("Order creation failed");if("ecpay"===t&&a.formHtml){let e=document.createElement("div");e.innerHTML=a.formHtml,document.body.appendChild(e);let t=e.querySelector("form");t&&t.submit()}else"paypal"===t&&a.approvalUrl&&(window.location.href=a.approvalUrl)}catch(e){console.error("Payment error:",e),ex(eG.paymentFailed)}finally{em(!1)}},className:"jsx-e21718e3f33edc48 w-full rounded-2xl bg-slate-900 py-4 text-white font-black shadow-xl shadow-slate-900/20 transition-all hover:bg-black active:scale-[0.98] cursor-pointer disabled:opacity-50",children:eu?"...":t("luckyDrawHelperPage.proModal.buyDirectlyButton")}):ep?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"jsx-e21718e3f33edc48 p-4 bg-red-50 rounded-2xl border border-red-100 space-y-2",children:[(0,a.jsx)("p",{className:"jsx-e21718e3f33edc48 text-sm font-black text-red-800",children:t("luckyDrawHelperPage.proModal.anonymousWarningTitle")}),(0,a.jsx)("ul",{className:"jsx-e21718e3f33edc48 space-y-1.5",children:["anonymousWarning1","anonymousWarning2","anonymousWarning3","anonymousWarning4"].map(e=>(0,a.jsxs)("li",{className:"jsx-e21718e3f33edc48 text-xs text-red-700 leading-relaxed flex items-start gap-2",children:[(0,a.jsx)("span",{className:"jsx-e21718e3f33edc48 mt-0.5 flex-shrink-0 w-1.5 h-1.5 rounded-full bg-red-400"}),t("luckyDrawHelperPage.proModal.".concat(e))]},e))})]}),(0,a.jsxs)("div",{className:"jsx-e21718e3f33edc48 space-y-2",children:[(0,a.jsx)("input",{type:"email",value:en,onChange:e=>ed(e.target.value),placeholder:t("luckyDrawHelperPage.proModal.emailPlaceholder"),className:"jsx-e21718e3f33edc48 w-full px-4 py-3 rounded-2xl border-2 border-slate-200 focus:border-slate-900 focus:outline-none text-sm font-medium transition-colors"}),ei&&(0,a.jsx)("p",{className:"jsx-e21718e3f33edc48 text-xs text-red-500 font-bold px-2",children:ei})]}),(0,a.jsx)("button",{disabled:eu,onClick:async()=>{if(!en||!en.includes("@")){ex(t("luckyDrawHelperPage.proModal.emailRequired"));return}ex(""),em(!0),localStorage.setItem("lucky_draw_pro_email",en);try{let t="zh-TW"===e?"ecpay":"paypal",s=await fetch("/api/lucky-draw/payment/create-order",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({planType:ec,email:en,gateway:t,locale:e})}),a=await s.json();if(!a.success)throw Error("Order creation failed");if("ecpay"===t&&a.formHtml){let e=document.createElement("div");e.innerHTML=a.formHtml,document.body.appendChild(e);let t=e.querySelector("form");t&&t.submit()}else"paypal"===t&&a.approvalUrl&&(window.location.href=a.approvalUrl)}catch(e){console.error("Payment error:",e),ex(eG.paymentFailed)}finally{em(!1)}},className:"jsx-e21718e3f33edc48 w-full rounded-2xl bg-red-600 py-4 text-white font-black shadow-xl shadow-red-600/20 transition-all hover:bg-red-700 active:scale-[0.98] cursor-pointer disabled:opacity-50",children:eu?"...":t("luckyDrawHelperPage.proModal.anonymousBuyButton")}),(0,a.jsx)("button",{onClick:()=>ef(!1),className:"jsx-e21718e3f33edc48 w-full py-1 text-[#0D5EA6] font-bold hover:text-[#0A4A85] transition-colors cursor-pointer text-xs",children:t("luckyDrawHelperPage.proModal.anonymousBackToReg
1ister")})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("p",{className:"jsx-e21718e3f33edc48 text-xs text-slate-500 text-center leading-relaxed px-2",children:t("luckyDrawHelperPage.proModal.registerDesc")}),(0,a.jsx)("button",{onClick:()=>eg(!0),className:"jsx-e21718e3f33edc48 w-full rounded-2xl bg-slate-900 py-4 text-white font-black shadow-xl shadow-slate-900/20 transition-all hover:bg-black active:scale-[0.98] cursor-pointer",children:t("luckyDrawHelperPage.proModal.upgradeButton")}),(0,a.jsx)("button",{onClick:()=>ef(!0),className:"jsx-e21718e3f33edc48 w-full py-1 text-slate-400 font-medium hover:text-slate-600 transition-colors cursor-pointer text-xs underline underline-offset-2 decoration-dashed",children:t("luckyDrawHelperPage.proModal.anonymousToggle")})]}),(0,a.jsx)("button",{onClick:()=>{H(!1),ef(!1)},className:"jsx-e21718e3f33edc48 w-full py-2 text-slate-400 font-bold hover:text-slate-600 transition-colors cursor-pointer text-sm",children:t("luckyDrawHelperPage.proModal.maybeLater")})]})]})})]})]})})]}),N&&(0,a.jsxs)("div",{className:"jsx-e21718e3f33edc48 fixed inset-0 z-50 flex items-center justify-center p-4",children:[(0,a.jsx)("div",{onClick:()=>D(!1),className:"jsx-e21718e3f33edc48 absolute inset-0 bg-slate-900/60 backdrop-blur-sm"}),(0,a.jsxs)("div",{className:"jsx-e21718e3f33edc48 relative w-full max-w-lg bg-white rounded-3xl shadow-2xl overflow-hidden",children:[(0,a.jsx)("div",{className:"jsx-e21718e3f33edc48 bg-amber-500 p-6 text-white text-center font-bold text-xl",children:t("luckyDrawHelperPage.trialResultTitle")}),(0,a.jsx)("div",{className:"jsx-e21718e3f33edc48 p-8 max-h-[60vh] overflow-y-auto space-y-4",children:C.map((e,t)=>(0,a.jsxs)("div",{className:"jsx-e21718e3f33edc48 flex justify-between p-4 bg-slate-50 rounded-xl border border-slate-100 font-bold",children:[(0,a.jsx)("span",{className:"jsx-e21718e3f33edc48 text-[#0D5EA6]",children:e.prizeName}),(0,a.jsx)("span",{className:"jsx-e21718e3f33edc48 text-slate-800",children:e.winner})]},t))}),(0,a.jsxs)("div",{className:"jsx-e21718e3f33edc48 p-6 bg-slate-50 border-t border-slate-100 flex gap-4",children:[(0,a.jsx)("button",{onClick:()=>D(!1),className:"jsx-e21718e3f33edc48 flex-1 py-3 font-bold text-slate-400 cursor-pointer",children:t("luckyDrawHelperPage.closeButton")}),(0,a.jsx)("button",{onClick:()=>{D(!1),ez(!0)},className:"jsx-e21718e3f33edc48 flex-1 py-3 bg-amber-500 text-white font-black rounded-xl cursor-pointer",children:t("luckyDrawHelperPage.officialButton")})]})]})]}),er&&(0,a.jsxs)("div",{className:"jsx-e21718e3f33edc48 fixed inset-0 z-[110] flex items-center justify-center p-4",children:[(0,a.jsx)("div",{onClick:eP,className:"jsx-e21718e3f33edc48 absolute inset-0 bg-slate-900/60 backdrop-blur-sm"}),(0,a.jsxs)("div",{className:"jsx-e21718e3f33edc48 relative w-full max-w-md rounded-3xl border border-slate-200 bg-white p-6 shadow-2xl",children:[(0,a.jsxs)("div",{className:"jsx-e21718e3f33edc48 mb-5 flex items-start gap-3",children:[(0,a.jsx)("div",{className:"jsx-e21718e3f33edc48 flex h-11 w-11 items-center justify-center rounded-2xl bg-red-50 text-red-500",children:(0,a.jsx)("svg",{fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",className:"jsx-e21718e3f33edc48 h-6 w-6",children:(0,a.jsx)("path",{d:"M12 9v4m0 4h.01M5.07 19h13.86c1.54 0 2.5-1.67 1.73-3L13.73 4c-.77-1.33-2.69-1.33-3.46 0L3.34 16c-.77 1.33.19 3 1.73 3z",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"jsx-e21718e3f33edc48"})})}),(0,a.jsxs)("div",{className:"jsx-e21718e3f33edc48 min-w-0 flex-1",children:[(0,a.jsx)("h3",{className:"jsx-e21718e3f33edc48 text-lg font-black text-slate-900",children:er.title}),(0,a.jsx)("p",{className:"jsx-e21718e3f33edc48 mt-1 text-sm leading-6 text-slate-500",children:er.message})]})]}),(0,a.jsxs)("div",{className:"jsx-e21718e3f33edc48 flex gap-3",children:[(0,a.jsx)("button",{type:"button",onClick:eP,className:"jsx-e21718e3f33edc48 flex-1 rounded-2xl border border-slate-200 bg-white px-4 py-3 text-sm font-bold text-slate-500 transition-colors hover:bg-slate-50 cursor-pointer",children:er.cancelLabel||t("common.cancel")}),(0,a.jsx)("button",{type:"button",onClick:()=>{er.onConfirm()},className:"jsx-e21718e3f33edc48 flex-1 rounded-2xl bg-red-500 px-4 py-3 text-sm font-black text-white shadow-lg shadow-red-500/20 transition-colors hover:bg-red-600 cursor-pointer",children:er.confirmLabel||t("common.confirm")})]})]})]}),S&&(0,a.jsx)("div",{style:{backgroundColor:"".concat(W,"F2")},className:"jsx-e21718e3f33edc48 fixed inset-0 z-[100] flex flex-col items-center justify-center bg-[#0D5EA6]/95 backdrop-blur-md p-6",children:(0,a.jsxs)("div",{className:"jsx-e21718e3f33edc48 text-center space-y-12 max-w-lg w-full",children:[(0,a.jsxs)("div",{className:"jsx-e21718e3f33edc48 space-y-4",children:[(0,a.jsx)("h2",{className:"jsx-e21718e3f33edc48 text-blue-100/60 font-black uppercase tracking-[0.3em] text-sm animate-pulse",children:t("luckyDrawHelperPage.drawingStatus")}),(0,a.jsx)("div",{className:"jsx-e21718e3f33edc48 relative h-24 flex items-center justify-center overflow-hidden",children:(0,a.jsx)("div",{className:"jsx-e21718e3f33edc48 text-white text-5xl md:text-7xl font-black tracking-tighter animate-bounce px-4",children:L})})]}),(0,a.jsx)("div",{className:"jsx-e21718e3f33edc48 relative w-full h-1 bg-white/10 rounded-full overflow-hidden",children:(0,a.jsx)("div",{className:"jsx-e21718e3f33edc48 absolute top-0 left-0 h-full bg-white animate-progress-glow"})}),T&&(0,a.jsx)("audio",{autoPlay:!0,loop:!0,src:"https://assets.mixkit.co/active_storage/sfx/2568/2568-preview.mp3",className:"jsx-e21718e3f33edc48"})]})}),(0,a.jsx)(x.Z,{open:eh,onClose:()=>eg(!1),initialMode:"register"}),(0,a.jsx)(l(),{id:"e21718e3f33edc48",children:"@-webkit-keyframes progress-glow{0%{width:0%;left:0}50%{width:40%;left:30%}100%{width:0%;left:100%}}@-moz-keyframes progress-glow{0%{width:0%;left:0}50%{width:40%;left:30%}100%{width:0%;left:100%}}@-o-keyframes progress-glow{0%{width:0%;left:0}50%{width:40%;left:30%}100%{width:0%;left:100%}}@keyframes progress-glow{0%{width:0%;left:0}50%{width:40%;left:30%}100%{width:0%;left:100%}}.animate-progress-glow{-webkit-animation:progress-glow 1.5s infinite ease-in-out;-moz-animation:progress-glow 1.5s infinite ease-in-out;-o-animation:progress-glow 1.5s infinite ease-in-out;animation:progress-glow 1.5s infinite ease-in-out}"})]})}function p(e){if(!e||""===e.trim()||"#"===e)return"";let t=e.trim();return/^https?:\/\//i.test(t)?t:"https://".concat(t)}function f(){return(0,a.jsx)(c.Suspense,{fallback:(0,a.jsx)("div",{className:"min-h-screen bg-slate-50"}),children:(0,a.jsx)(m,{})})}},96778:function(e,t,s){"use strict";s.d(t,{P:function(){return c}});
1var a=s(2265),r=s(49924),l=s(71837);function c(){let[e,t]=(0,a.useState)("loading"),[s,c]=(0,a.useState)(null),o=(0,r.b)(),n=e=>new Promise(t=>setTimeout(t,e)),d=(0,a.useCallback)(async()=>{let e=localStorage.getItem("token");if(!e){console.log("[useAuthCheck] No token in localStorage"),c(null),t("unauthenticated");return}console.log("[useAuthCheck] Token found, calling /auth/me...");try{let s=null;for(let e of[0,180,450,900]){if(e>0&&await n(e),!localStorage.getItem("token"))break;let t=await (0,l.SC)(l.Pn.AUTH.ME,void 0,o),a=await t.json();if(console.log("[useAuthCheck] /auth/me response:",{status:t.status,success:null==a?void 0:a.success,hasUser:!!(null==a?void 0:a.user),delay:e}),(null==a?void 0:a.success)&&a.user){s=a.user;break}}s?(c(s),t("authenticated")):(localStorage.getItem("token")===e?(console.log("[useAuthCheck] Token invalid after retries, clearing same token"),localStorage.removeItem("token"),localStorage.removeItem("user"),window.dispatchEvent(new Event("user-logged-out"))):console.log("[useAuthCheck] Token changed by another tab, skip clearing"),c(null),t("unauthenticated"))}catch(e){console.log("[useAuthCheck] Network error, keeping token optimistically:",e),t("authenticated")}},[o]);return(0,a.useEffect)(()=>{function e(e){"token"===e.key&&d()}function t(){d()}function s(e){e.data&&("oauth_result"===e.data.type||"email_verified"===e.data.type)&&e.data.token&&d()}return d(),window.addEventListener("storage",e),window.addEventListener("user-logged-in",t),window.addEventListener("message",s),()=>{window.removeEventListener("storage",e),window.removeEventListener("user-logged-in",t),window.removeEventListener("message",s)}},[d]),{auth_status:e,user:s}}}},function(e){e.O(0,[3448,29,2442,1837,8497,2971,2117,1744],function(){return e(e.s=59380)}),_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.