(window.webpackJsonp=window.webpackJsonp||[]).push([[28],{1476:function(e,t,a){e.exports={booms:"_3HbjT5npwBJcTQ_1kbjrj3"}},1478:function(e,t,a){e.exports={PC_PAGE_MIN:"1024px",PC_PAGE_MAX:"1200px",phone:"screen and (max-width: 500px), screen and (max-height: 500px)",phoneLandscape:"screen and (max-height: 500px) and (orientation: landscape)",phonePortrait:"screen and (max-width: 500px) and (orientation: portrait)",tablet:"screen and (orientation: portrait) and (min-width: 501px) and (max-width: 1024px) and (min-height: 501px) and (max-height: 1366px), screen and (orientation: landscape) and (min-height: 501px) and (max-height: 1024px) and (min-width: 501px) and (max-width: 1366px)",tabletPortrait:"screen and (orientation: portrait) and (min-width: 501px) and (max-width: 1024px) and (min-height: 501px) and (max-height: 1366px)",tabletLandscape:"screen and (orientation: landscape) and (min-height: 501px) and (max-height: 1024px) and (min-width: 501px) and (max-width: 1366px)",actSkin:"_15RF-u0Dg43Vw9KvVzW4rp",bgFilter:"_2vpyCo86Ip95Qody8ySK7k",receiveSkin:"AgV1PDhlpqiblDATIzQUY",loading:"_25dqbQ5y46elB1ivPoDFWt",receivedContent:"_3tsUvqbfqyGOUuVy-kAhZD",text:"_2TiKfR9ywJNRJg_-l1dp8A",header:"_23fe7_Q1elfm3ERExCRHg",backHome:"_3Tgi3wyiyCkLiwDnodUFFI",logo:"DWuWrcYDyucI40DF20QA3",content:"_2HvlFMyldlHTvFqrQECHnS",title:"_29G99g5gqYmj3TuZnFv85U",footer:"_2Wk9OrXN4Bz1gZ_bU47848",secondTitle:"_28r587lPfedY1GseLSpwMz",tips:"_15qU_nUoOhmvXwz3JvuSRC",skinListWrapper:"_1e4lCi5u4e0gleY6iJOZv2",mobileListContainer:"_16gqFKaOefGraBigLDbP8D",stage_box:"_3woi1bOiaUWSN34eSLcEMv",skinList:"_2JQLyYSLyB6l8HaSTOz5H7",skinItem:"_3qyGKyLd8St6N8V_YhbtKT",existed:"_2YCnz_v5woiI0G4uRbPwHl",skinBox:"_9_NACdSnQAp7tVSLgKPYv",selected:"JHBH9iFGS9qqb_jHe0gk5",skinBox_imgBox:"_2nxJuXLN2v_ILKLcfd1u11",receive:"acTI5Ay8SkzsnOUwzQE4t",mouseEvent:"_3wEwoff8fSgIy6LCjGljjo",img:"rmS_J2IgFb3FE2BUlpqe0",stage:"_9WvaAu6focdhK1OheHCkJ",stage_light:"_22F6kIS6m0PieIWtZQHjZB",flower:"_1hZGj4m_26bQk9COrzzHtL",flower_group:"Prx0ABv1czb3r_oZvgffs",flowerRote:"_1TecrQ_ZPdZq3nCgSY0XP6",receivedRotate:"E9QSPkF0yfwnr8cBLkvif",angleList:"_1NW-mS2fsqNNyT-UFxCS9q",angle:"_3xnkcBnzuw0J5srmKg1wNK",animateRoll:"_2o4GdDrI3YeSYyKsLcWL9G",animateScale:"_1gkX4gtdD6ilx_n_fMed2N",flowerScale:"Vwl4ttSkFuqnSw6XKjAuU",ghostBlock:"_21ZxoKBJ8lyWNyvkRQmGMa",mobileToucher:"_1L1S5MkWCUsLls_z4PFNk_"}},1624:function(e,t,a){"use strict";a.r(t);var i=a(1),n=a.n(i),l=a(57),s=a(104),c=a(51),o=a(131),r=a(296),d=a(7);const h={angle:360,spread:360,startVelocity:80,elementCount:101,dragFriction:.17,live:1e4,stagger:0,width:"6px",height:"12px",perspective:"715px",colors:["#a864fd","#29cdff","#78ff44","#ff718d","#fdff6a"],random:Math.random},m=a(1476),g=e=>{const t=()=>({x:document.body.clientWidth>>1,y:document.body.clientHeight>>1}),a=()=>{const e=h.spread,a=h.startVelocity,i=h.random,n=h.angle*(Math.PI/180),l=e*(Math.PI/180);return{x:t().x,y:t().y,z:0,angle2D:-n+(.5*l-i()*l),angle3D:-Math.PI/4+i()*(Math.PI/2),wobble:10*i(),wobbleSpeed:.1+.1*i(),velocity:.5*a+i()*a,tiltAngle:i()*Math.PI,tiltAngleSpeed:.1+.3*i()}},i=e=>{const t=document.querySelector("."+m.booms)||document.body,a=h.dragFriction,i=h.live,n=h.stagger;let l;return new Promise(s=>{const c=o=>{l||(l=o);const r=o-l,d=l===o?0:(o-l)/i;e.slice(0,Math.ceil(r/n)).forEach(e=>{((e,t,a,i)=>{e.physics.x+=Math.cos(e.physics.angle2D)*e.physics.velocity,e.physics.y+=Math.sin(e.physics.angle2D)*e.physics.velocity,e.physics.z+=Math.sin(e.physics.angle3D)*e.physics.velocity,e.physics.wobble+=e.physics.wobbleSpeed,i?e.physics.velocity*=i:e.physics.velocity-=e.physics.velocity*a,e.physics.y+=3,e.physics.tiltAngle+=e.physics.tiltAngleSpeed;const{x:n,y:l,z:s,tiltAngle:c,wobble:o}=e.physics,r=`translate3d(${n+10*Math.cos(o)}px, ${l+10*Math.sin(o)}px, ${s}px) rotate3d(1, 1, 1, ${c}rad)`;e.element.style.visibility="visible",e.element.style.transform=r,e.element.style.opacity=1-t})(e,d,a,null)}),o-l{if(e.element.parentNode===t)return t.removeChild(e.element)}),s(1))};requestAnimationFrame(c)})};return{render:()=>n.a.createElement("svg",{className:m.booms}),play:()=>{const t=(()=>{const t=e.count||100,a=e.colors||h.colors,i=document.querySelector("."+m.booms)||document.body;return Array.from({length:t}).map((e,t)=>{const n=document.createElementNS("http://www.w3.org/2000/svg","rect"),l=a[t%a.length];return n.style.fill=l,n.style.width="16",n.style.height="16",n.style.position="absolute",n.style.willChange="transform, opacity",n.style.visibility="hidden",i.appendChild(n),n})})().map(e=>({element:e,physics:a()}));i(t).catch(e=>null)}}};var p=a(24),u=a(46),y=a(61),v=a(60),w=a(94),f=a(1413),x=(a(1392),a(19)),b=a(62),E=Object.defineProperty,_=Object.defineProperties,N=Object.getOwnPropertyDescriptors,k=Object.getOwnPropertySymbols,S=Object.prototype.hasOwnProperty,C=Object.prototype.propertyIsEnumerable,P=(e,t,a)=>t in e?E(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,L=(e,t)=>{for(var a in t||(t={}))S.call(t,a)&&P(e,a,t[a]);if(k)for(var a of k(t))C.call(t,a)&&P(e,a,t[a]);return e},D=(e,t)=>_(e,N(t)),I=(e,t,a)=>new Promise((i,n)=>{var l=e=>{try{c(a.next(e))}catch(e){n(e)}},s=e=>{try{c(a.throw(e))}catch(e){n(e)}},c=e=>e.done?i(e.value):Promise.resolve(e.value).then(l,s);c((a=a.apply(e,t)).next())});const O=a(1478);const B={showReceive:"点击领取",showGoHome:"返回首页"},T=["showGoHome","showReceive"];t.default=()=>{const e=g({count:100}),t=n.a.useRef(null),a=Object(l.k)(),i=Object(u.b)(y.c),h=Object(u.b)(y.a,()=>[]),m=n.a.useRef(Object(d.g)()),[E,_]=n.a.useState({width:256,height:256}),[N,k]=n.a.useState(window.innerWidth>window.innerHeight?"land":"port"),[S,C]=n.a.useState("loading"),[P,A]=n.a.useState({title:"",secondTitle:"",startDate:"",endDate:"",received:!1,receivedSkin:""}),[H,j]=n.a.useState([]),[R,q]=n.a.useState([]),[z,F]=n.a.useState([]),[G,M]=n.a.useState("normal"),[W,U]=n.a.useState("wait"),[K,Q]=n.a.useState("showReceive"),[$,J]=n.a.useState(-1),[Y,V]=n.a.useState([]);Object(l.l)(()=>{ee()}),n.a.useEffect(()=>{ee()},[]),n.a.useEffect(()=>{Z().catch(e=>console.log("err",e))},[i.isLogin]);const Z=()=>I(void 0,null,(function*(){try{const e=a.get("hash"),t=yield v.a.activity.getUsingGet(e),{skins:i,color:n,topic:l,startTime:s,endTime:c,received:o,eligible:r,receivedSkin:d}=t||{};yield X(i).catch(e=>null),te(i,d),ae(n),A(D(L({},P),{title:l,startDate:s,endDate:c,received:o,receivedSkin:d||""})),ne({startTime:s,endTime:c,received:o,eligible:r}),C("success")}catch(e){C("fail")}})),X=e=>I(void 0,null,(function*(){try{if(!e||!i.isLogin)return;const t=(yield v.a.activity.queryExistedUsingGet(e)).map(e=>e.existed);q(t)}catch(e){console.log("err",e)}})),ee=()=>{window.innerWidth>window.innerHeight?k("land"):k("port")},te=(e,t)=>{const a=e.replace(/\'|\"|\s/g,"").split(",");if((e=>{if(m.current&&"port"===N){const e=document.body.clientWidth>>1,t=e>256?256:e;return void _({width:t,height:t})}const t=document.body.clientWidth-48,a=Math.floor(t/e),i=a>256?256:a;_({width:i,height:i})})(a.length),j(a),t){const e=a.findIndex(e=>e===t);J(null!=e?e:0)}else $<0&&J(0);U("selected")},ae=e=>{const t=e.replace(/\'|\"/g,"").split(";");F(t)},ie=(e,t,a)=>{if(e){const i=e.getBoundingClientRect(),n=(null==t?void 0:t.getBoundingClientRect())||{width:0,height:0,x:0,y:0},l=(null==a?void 0:a.getBoundingClientRect())||{width:0,height:0,x:0,y:0};return{x:i.x-l.x-(n.width>>1)+(i.width>>1),y:i.y-l.y-(n.height>>1)+(i.height>>1)}}return(e=>{if(e){const t=e.getBoundingClientRect();return{x:document.body.clientWidth-(t.width>>1),y:document.body.clientHeight-(t.height>>1)}}return{x:document.body.clientWidth>>1,y:document.body.clientHeight>>1}})(t)},ne=e=>{const t=(new Date).getTime();if(new Date(e.startTime).getTime()>t)M("early");else if(new Date(e.endTime).getTime(){"success"===W&&(e.play(),U("finish"))},se=()=>I(void 0,null,(function*(){if(K)if("showGoHome"!==K)try{U("receiving"),yield I(void 0,null,(function*(){try{const e=a.get("hash"),t=H[$];yield v.a.activity.receivingUsingPost(e,t)}catch(e){throw e}}));const n=(()=>{const e=document.querySelectorAll("."+O.skinBox),a=document.querySelectorAll("."+O.skinItem),i=[];return e.forEach((n,l)=>{l==$?i.push(D(L({},ie(document.body,e[l],a[l])),{scale:1})):i.push(D(L({},ie(t.current,e[l],a[l])),{scale:0}))}),i})();V(n),U("success");(new b.a).track(b.c.RECEIVED_SKIN,{user:i.id,skin:H[$]}),m.current&&"port"===N&&(U("finish"),e.play()),Q("showGoHome")}catch(e){U("fail"),x.a.error("皮肤领取失败喵~,请刷新试试")}else window.location.href="/"})),ce=()=>n.a.createElement("div",{className:O.receivedRotate},n.a.createElement("div",{className:O.animateRoll},n.a.createElement("div",{className:O.animateScale},n.a.createElement("ul",{className:O.angleList},n.a.createElement("li",{className:O.angle},n.a.createElement(c.c,{hash:s.a.skinAngl,width:512,height:512})))))),oe=()=>m.current&&"port"===N?n.a.createElement("div",{className:O.mobileListContainer},"finish"===W?n.a.createElement("article",{className:O.loading,style:{position:"relative",zIndex:1}},n.a.createElement(c.c,{hash:r.a.suite[H[$]],width:256,height:256})):n.a.createElement(f.a,{className:O.skinListWrapper,direction:"horizontal",centeredSlides:!0,slidesPerView:2,onSlideChange:e=>{J(e.activeIndex),U("selected")}},H.map((e,t)=>n.a.createElement(f.b,{key:e},n.a.createElement("div",{className:`\n ${O.skinBox}\n ${$===t?O.selected:""}\n ${"finish"===W?O.receive:""}\n `,style:{width:E.width+"px",height:E.height+"px"}},n.a.createElement("div",{className:O.skinBox_imgBox},n.a.createElement(c.c,{className:O.img,hash:r.a.suite[e],width:256,height:256})))))),"finish"!==W&&n.a.createElement("div",{style:{width:E.width+"px",height:E.height+"px",position:"absolute",transform:"translate3d(-50%, -50%, 0px)",top:"50%",left:"50%"}},n.a.createElement("div",{className:O.stage_box},n.a.createElement("div",{className:O.stage}),n.a.createElement("div",{className:O.stage_light})),n.a.createElement("div",{className:O.existed},R[$]&&"已拥有")),n.a.createElement("div",{className:O.existed,style:{opacity:1}},R[$]&&"已拥有")):n.a.createElement("ul",{className:`${O.skinList} ${O.mouseEvent}`,onTransitionEnd:le},H.map((e,t)=>{var a,i,l,s,o,h;const m=null!=(i=null==(a=Y[t])?void 0:a.x)?i:0,g=null!=(s=null==(l=Y[t])?void 0:l.y)?s:0,p=null!=(h=null==(o=Y[t])?void 0:o.scale)?h:1;return n.a.createElement("li",{className:O.skinItem,key:e},n.a.createElement("div",{className:`\n ${O.skinBox}\n ${$===t?O.selected:""}\n ${"finish"===W?O.receive:""}\n `,onClick:()=>{Object(d.f)()||(J(t),U("selected"))},onTouchEnd:()=>{Object(d.f)()&&(J(t),U("selected"))},style:{width:E.width+"px",height:E.height+"px",transform:`translate3d(${m}px, ${g}px, 0px) scale(${p})`}},n.a.createElement("div",{className:O.skinBox_imgBox},n.a.createElement(c.c,{className:O.img,hash:r.a.suite[e],width:256,height:256})),n.a.createElement("div",{className:O.stage_box},n.a.createElement("div",{className:O.stage}),n.a.createElement("div",{className:O.stage_light})),n.a.createElement("div",{className:O.existed},R[t]&&"已拥有")))})),re=()=>{const e={width:180,height:40};return"success"!==S?null:i.isLogin?"noPermission"===G||"outOfDate"===G||"early"===G?null:n.a.createElement("article",{className:O.footer},n.a.createElement("p",null,"finish"===W&&"恭喜你获得新皮肤,快选一个地图换装吧!"),n.a.createElement("div",{ref:t,style:{visibility:""+(T.some(e=>e===K)?"visible":"hidden")}},n.a.createElement(o.a,D(L({},e),{disabled:"showReceive"===K&&R[$],type:"primary",color:"red-gradient",loading:"receiving"===W,onClick:se}),K?B[K]:""))):n.a.createElement("article",{className:O.footer},n.a.createElement(o.a,D(L({},e),{type:"primary",color:"red-gradient",onClick:h.showLogin}),"点击登录"))};return n.a.createElement("div",{className:O.actSkin,style:{backgroundColor:""+(z[$]||"#6666")}},n.a.createElement("div",{className:O.bgFilter},n.a.createElement("div",{className:O.backHome,onClick:()=>window.location.href="/"},n.a.createElement(p.a,{size:32,icon:"back-home"})),n.a.createElement("div",{className:O.receiveSkin},n.a.createElement("header",{className:O.header},n.a.createElement("div",{className:O.logo,onClick:()=>window.location.href="/"},n.a.createElement(p.a,{style:{cursor:"pointer"},size:120,icon:"logo"})),n.a.createElement("article",{className:O.title},n.a.createElement("h5",null,P.title),i.isLogin&&n.a.createElement("div",{className:O.secondTitle},"noPermission"===G&&"也想拥有新皮肤吗?记得参与下次创作活动哦","outOfDate"===G&&"活动已结束","received"===G&&"你已领取过,快选一个地图换装吧!","early"===G&&"活动还未开始~"))),"loading"===S?n.a.createElement("article",{className:O.loading},n.a.createElement("p",{className:O.text},"正在加载中"),n.a.createElement(w.a,null)):"fail"===S?n.a.createElement("article",{className:O.loading},n.a.createElement("p",{className:O.text},"网络似乎出现了问题喵",n.a.createElement("br",null),"请刷新试试",n.a.createElement("br",null),"有疑问请联系客服喵")):"received"===G?n.a.createElement("article",{className:O.receivedContent,style:{position:"relative",zIndex:1}},n.a.createElement(c.c,{style:{position:"relative",zIndex:1},hash:r.a.suite[P.receivedSkin],width:256,height:256}),ce(),re()):n.a.createElement("article",{className:O.content},oe(),"finish"===W&&ce(),re())),n.a.createElement("div",{className:O.flower},n.a.createElement("div",{className:O.flower_group,style:{transform:"translate3d(0, 0, 0)",top:"-100px",left:"-100px"}},n.a.createElement(c.c,{hash:s.a.flower,width:256,height:256})),n.a.createElement("div",{className:O.flower_group,style:{transform:"translate3d(0, 0, 0)",right:"-30px",bottom:"-120px"}},n.a.createElement(c.c,{hash:s.a.flower,width:256,height:256}))),n.a.createElement("div",{style:{position:"fixed",top:"0",left:"0",width:"100%",height:"100%",pointerEvents:"none"}},e.render()),n.a.createElement("div",{className:O.ghostBlock},n.a.createElement(c.c,{hash:s.a.skinAngl,width:512,height:512}))))}}}]);