1import{k as Y,aI as Z,aJ as ee,i as te,G as oe,x as ne,b as O,m as ae,_ as le}from"./DkmlGzQL.js";import{_ as re}from"./BeSTyRJS.js";import ie from"./BeeoCLlc.js";import se from"./B5W4ohn4.js";import{l as ce,r as h,c as f,t as ue,m as C,s as p,L as b,F as m,I as B,u as I,J as ge,H as M,P as me,i as de,B as he,o as u}from"./CQFj2rK5.js";import"./_DaKjOLS.js";import"./C-PlcRpI.js";import"./BbPoLwmC.js";const pe={class:"banner-inner"},ve={class:"banner-left"},fe={key:0,class:"egg-banner-title title-wrap"},be=["innerHTML"],ye={class:"egg-smash"},xe={key:0,class:"egg-hammer"},we="df_goldweek_26",Ce=ce({__name:"index",props:{eggClosedImg:{},eggOpenImg:{},hammerImg:{},challengeBtnText:{},couponCode:{},discountLabel:{},validMinutes:{},prizeDlgTopImg:{},prizeDlgTitle:{},prizeDlgText:{},prizeDlgCountdownText:{},applyBtnText:{},toUrl:{},promotionId:{},pcBgImage:{},mobileBgImage:{},titleBg:{},titleBgMobile:{},desc:{},timerShow:{type:Boolean},timerShowDays:{},timerBgColor:{},timerBorderColor:{},timerFontColor:{},timerColonColor:{},boxTopImg:{},boxImg:{},couponBg:{},floaterText:{}},setup(t){const r=de("promotionCommonData",null),k=Y().query.endTime||"",i=t,{firstHitAt:F,remainingMs:v,triggerSmash:U,clear:H}=Z({couponCode:i.couponCode,validMinutes:i.validMinutes}),{playSmashAnimation:N}=ee(),y=h(!1),x=h(!1),w=h(!1),d=h(!1),T=h(!1),S=h(!1),n=e=>{var o,a;return e?typeof e=="string"?e:e.url?e.url:((a=(o=e.data)==null?void 0:o.attributes)==null?void 0:a.url)??"":""},$=e=>{var a;if(!e||typeof e=="string")return{width:0,height:0};const o=((a=e.data)==null?void 0:a.attributes)||e;return{width:Math.round(((o==null?void 0:o.width)||0)/2),height:Math.round(((o==null?void 0:o.height)||0)/2)}},E=f(()=>$(i.titleBg)),z=f(()=>$(i.titleBgMobile)),q=f(()=>(O.common().client||"win")==="mac"?62038:62037),A=f(()=>{const e=q.value;if(!e||!i.couponCode)return"";const a=["ext_params_str_param1=dvdfab","ext_params_str_param2=promotion_game",`ext_params_str_param4=${O.common().client||"win"}`,`ext_params_str_param7=${e}`].join("&"),s=(r==null?void 0:r.globalbuyUrlElkStr)||`et_pa=1&_prom_id=${i.promotionId}`;return ae(e,"LFT",`&discount=${we}&coupon=${i.couponCode}&${a}&${s}`,{})}),V=f(()=>n(x.value?i.eggOpenImg:i.eggClosedImg)),j=e=>{S.value=e},G=()=>{try{const e=ne();return(e==null?void 0:e.$trace)??null}catch{return null}},g=e=>{var o,a;try{(a=(o=G())==null?void 0:o.traceCustomEvent)==null||a.call(o,{...e,promotion_id:[i.promotionId]})}catch{}},L=()=>{var e;(e=r==null?void 0:r.updateLotterInfo)==null||e.call(r,{couponCode:i.couponCode})};ue(()=>{F.value!==null&&v.value>0&&(x.value=!0,d.value=!0,L()),g({event:"show",event_category:"banner",ext_params_str_param2:"promotion_game"})});const J=()=>{const e=document.querySelector(".egg-confetti-container");if(!e)return;const o=["#FFD700","#FFA500","#FFB300","#FFCC00","#FFC700","#F4C430","#DAA520","#B8860B","#FFE66D","#FFD580"],a=80;for(let s=0;s<a;s++){const l=document.createElement("div");l.className="egg-confetti",l.style.backgroundColor=o[Math.floor(Math.random()*o.length)];const c=Math.random()*12+8;l.style.width=`${c}px`,l.style.height=`${c}px`,l.style.borderRadius=Math.random()>.5?"50%":"0",l.style.left="50%",l.style.top="50%",l.style.marginLeft=`${-c/2}px`,l.style.marginTop=`${-c/2}px`;const D=Math.PI*2*s/a+(Math.random()-.5)*.3,P=(120+Math.random()*130)*(.7+Math.random()*.6),W=Math.cos(D)*P,X=Math.sin(D)*P+(Math.random()-.5)*60;l.style.setProperty("--tx",`${W}px`),l.style.setProperty("--ty",`${X}px`),e.appendChild(l),setTimeout(()=>l.classList.add("burst"),Math.random()*50)}setTimeout(()=>{e.querySelectorAll(".egg-confetti").forEach(s=>s.remove())},1100)},R=async()=>{if(y.value)return;if(g({event:"click",event_category:"banner",event_label:"play",ext_params_str_param2:"promotion_game"}),F.value!==null&&v.value>0){d.value=!1,w.value=!0,g({event:"show",event_category:"congrat_popup",ext_params_str_param2:"promotion_game"});return}y.value=!0;const e=document.querySelector(".egg-hammer"),o=document.querySelector(".egg-golden");e==null||e.classList.add("smashing"),o==null||o.classList.add("cracking"),await N({onCrackImg:()=>{x.value=!0,J()},onComplete:()=>{e==null||e.classList.remove("smashing"),o==null||o.classList.remove("cracking"),o==null||o.classList.add("opened"),y.value=!1,U(),L(),w.value=!0,he(()=>g({event:"show",event_category:"congrat_popup",ext_params_str_param2:"promotion_game"}))}})},K=()=>{g({event:"click",event_category:"congrat_popup",event_label:"popup_close",ext_params_str_param2:"promotion_game"}),w.value=!1,v.value>0&&(d.value=!0,g({event:"show",event_category:"floater",ext_params_str_param2:"promotion_game_floater"}))},_=e=>{g({event:"buy_now",event_category:e==="popup"?"congrat_popup":"floater",event_value:i.couponCode,ext_params_str_param2:e==="floater"?"promotion_game_floater":"promotion_game"})},Q=()=>{var e;d.value=!1,H(),(e=r==null?void 0:r.updateLotterInfo)==null||e.call(r,{couponCode:""})};return(e,o)=>{const a=te,s=re,l=oe;return u(),C("div",{class:M(["egg-banner promotion-banner-center",{"has-timer":S.value}
1]),style:me({"--egg-banner-pc-bg":n(t.pcBgImage)?`url(${n(t.pcBgImage)})`:"none","--egg-banner-mobile-bg":n(t.mobileBgImage)?`url(${n(t.mobileBgImage)})`:"none"})},[p("div",pe,[p("div",ve,[n(t.titleBg)||n(t.titleBgMobile)?(u(),C("div",fe,[n(t.titleBg)?(u(),B(a,{key:0,class:"egg-title-pc title-img",src:n(t.titleBg),width:E.value.width,height:E.value.height,alt:"promotion title",loading:"eager"},null,8,["src","width","height"])):m("",!0),n(t.titleBgMobile)?(u(),B(a,{key:1,class:"egg-title-mobile title-img",src:n(t.titleBgMobile),width:z.value.width,height:z.value.height,alt:"promotion title",loading:"eager"},null,8,["src","width","height"])):m("",!0)])):m("",!0),t.desc?(u(),C("h1",{key:1,class:"pc-desc",innerHTML:t.desc},null,8,be)):m("",!0),t.timerShow||I(k)?(u(),B(l,{key:2},{default:ge(()=>[b(s,{"timer-bg-color":t.timerBgColor,"timer-border-color":t.timerBorderColor,"timer-font-color":t.timerFontColor,"timer-show-days":t.timerShowDays,"timer-show":t.timerShow,"timer-colon-color":t.timerColonColor,"end-time":I(k),onOnTimeEndStatus:j},null,8,["timer-bg-color","timer-border-color","timer-font-color","timer-show-days","timer-show","timer-colon-color","end-time"])]),_:1})):m("",!0)]),p("div",ye,[p("div",{class:M(["egg-hammer-container",{"is-smashing":y.value}
1]),onMouseenter:o[0]||(o[0]=c=>T.value=!0),onMouseleave:o[1]||(o[1]=c=>T.value=!1),onClick:R},[o[5]||(o[5]=p("div",{class:"egg-confetti-container"},null,-1)),p("div",{class:M(["egg-golden",{opened:x.value}])},[b(a,{src:V.value,alt:"golden egg"},null,8,["src"])],2),n(t.hammerImg)?(u(),C("div",xe,[b(a,{src:n(t.hammerImg),alt:"hammer"},null,8,["src"])])):m("",!0),n(t.boxTopImg)||n(t.boxImg)?(u(),B(a,{key:1,class:"egg-click-tip",src:T.value&&n(t.boxImg)?n(t.boxImg):n(t.boxTopImg)||n(t.boxImg),alt:"click to smash"},null,8,["src"])):m("",!0)],34)])]),b(ie,{show:w.value,"top-img":t.prizeDlgTopImg,"coupon-bg":t.couponBg,title:t.prizeDlgTitle,text:t.prizeDlgText,"discount-label":t.discountLabel,"countdown-text":t.prizeDlgCountdownText,"remaining-ms":I(v),"apply-btn-text":t.applyBtnText,"buy-url":A.value||t.toUrl,onClose:K,onApply:o[2]||(o[2]=c=>_("popup"))},null,8,["show","top-img","coupon-bg","title","text","discount-label","countdown-text","remaining-ms","apply-btn-text","buy-url"]),b(se,{show:d.value,"discount-label":t.discountLabel,"limit-text":t.floaterText||"\u300C\u30AA\u30FC\u30EB\u30A4\u30F3\u30EF\u30F3\u300D\u9650\u5B9A\u5272\u5F15","countdown-text":t.prizeDlgCountdownText,"buy-btn-text":t.applyBtnText,"remaining-ms":I(v),"coupon-bg":t.couponBg,"buy-url":A.value||t.toUrl,onApply:o[3]||(o[3]=c=>_("floater")),onExpire:Q,onClose:o[4]||(o[4]=c=>d.value=!1)},null,8,["show","discount-label","limit-text","countdown-text","buy-btn-text","remaining-ms","coupon-bg","buy-url"])],6)}}}),Ee=le(Ce,[["__scopeId","data-v-3f79f770"]]);export{Ee as default};
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.