forked from sent/waves
1 line
12 KiB
JavaScript
1 line
12 KiB
JavaScript
"use strict";(self.webpackChunkcrazygames_gameframe=self.webpackChunkcrazygames_gameframe||[]).push([[7318],{32992:(e,t,r)=>{r.d(t,{S:()=>O,Z:()=>V});var n=r(82937),i=r(47313),s=r(52797),o=r(46604),a=r(77626),l=r(42669),c=r(46745),d=r(57484),h=r(93825),u=r(90831);const x=()=>{const{category:e,altGame:t,gameStatus:r}=(0,u.NI)();return"unavailable"===r?null===t||void 0===t?void 0:t.category:e};var m=r(19314),p=r(46417);class g extends i.Component{constructor(e){super(e),this.videoRef=void 0,this.onMouseEnter=()=>{const e=this.videoRef.current;e&&e.play(),this.setState({isHovered:!0})},this.onMouseLeave=()=>{const e=this.videoRef.current;e&&e.pause(),this.setState({isHovered:!1})},this.state={isHovered:!1},this.videoRef=i.createRef()}render(){const{gameName:e,rating:t,gameLink:r,tracker:i,video:s,thumbnail:o,autoplayVideo:u,target:g,gameThumbContainerCustomStyle:v}=this.props,j=(0,m.U)();return(0,p.jsx)(d.vN,{className:"gameThumbContainer",style:v,onMouseEnter:u?void 0:this.onMouseEnter,onMouseLeave:u?void 0:this.onMouseLeave,children:(0,p.jsx)("a",{href:r,onClick:i||void 0,target:g||"_blank",children:(0,p.jsxs)(n.ZP,{container:!0,direction:"column",children:[(0,p.jsx)(d.wT,{item:!0,children:(0,p.jsx)(c.Z,{ref:this.videoRef,video:s,thumbnail:o,autoplay:u})}),t&&(0,p.jsx)(d.sF,{item:!0,className:"rating",children:t}),(0,p.jsxs)(n.ZP,{item:!0,className:"gameTitleContainer",sx:{mt:"20px",p:"10px"},children:[(0,p.jsx)(d.Aw,{className:"gameTitle",children:e}),(0,p.jsx)(l.Z,{variant:"caption",className:"gameCategory",style:{color:"white",opacity:j?1:.5,textTransform:"uppercase",letterSpacing:8},children:x()})]}),(0,p.jsx)(n.ZP,{item:!0,container:!0,className:"buttonContainer",sx:{margin:"15px 0"},justifyContent:"center",children:(0,p.jsx)(h.Z,{children:(0,p.jsx)(a.Z,{id:"buttons.playNow"})})})]})})})}}const v=g;var j=r(8226),Z=r(91423);const b=()=>{},f=e=>{let{tracker:t,closer:r,children:i,leaveUrl:s,showCloseText:o}=e;const c=r||b;return(0,p.jsxs)(n.ZP,{container:!0,direction:"column",alignItems:"center",children:[(0,p.jsx)(n.ZP,{item:!0,children:(0,p.jsx)("a",{href:s,target:"_blank",style:{textDecoration:"none"},rel:"noopener noreferrer",children:(0,p.jsx)(Z.Z,{onClick:e=>{t(e),c()},children:i})})}),o&&(0,p.jsx)(n.ZP,{item:!0,children:(0,p.jsx)(l.Z,{sx:{color:"primary.contrastText"},variant:"subtitle1",children:(0,p.jsxs)(n.ZP,{container:!0,direction:"row",alignItems:"center",onClick:c,style:{cursor:"pointer"},children:[(0,p.jsx)(n.ZP,{item:!0,children:(0,p.jsx)(j.Z,{})}),(0,p.jsxs)(n.ZP,{item:!0,children:["\xa0",(0,p.jsx)(a.Z,{id:"error.generic.orCloseAndBack"})]})]})})})]})};var y=r(42379);const C=(0,y.ZP)("button")((()=>({background:"linear-gradient(to bottom, #0086cb 0%, #0282c5 100%)",fallbacks:{background:"#3498db"},cursor:"pointer","-webkit-border-radius":15,"-moz-border-radius":15,borderRadius:15,textShadow:"1px 1px 3px #666666",color:"#ffffff",fontSize:20,fontWeight:"bold",textDecoration:"none",border:"solid #1f628d 3px",textTransform:"uppercase",display:"block",margin:"0 auto",marginLeft:"auto",marginRight:"auto",padding:"30px 15px","&:hover":{background:"#00a6e7",backgroundImage:"linear-gradient(to bottom, #00a6e7, #1a91cf)",textDecoration:"none"}}))),w=(0,y.ZP)("div")((e=>{let{theme:{palette:t}}=e;return{color:t.primary.contrastText,textAlign:"center",fontSize:20}})),k=(0,y.ZP)(n.ZP,{shouldForwardProp:e=>"compactTitle"!==e})((e=>{let{theme:{breakpoints:t,spacing:r},compactTitle:n}=e;return{height:"100%",flexDirection:"column",[t.up("sm")]:{flexDirection:"row"},...n&&{"& .labelTextContainerWithAlt":{[t.up("sm")]:{width:"40%"}},"& .errorTitle":{marginBottom:r()},"& .errorSubheading":{fontSize:"3vw",[t.up("sm")]:{fontSize:"2vw"},lineHeight:1.5,marginBottom:r()}}}})),P=(0,y.ZP)(n.ZP)((e=>{let{theme:{breakpoints:t}}=e;return{color:"white",width:"55%",[t.up("sm")]:{width:"35%"}}})),T=(0,y.ZP)(n.ZP)((e=>{let{theme:{breakpoints:t}}=e;return{maxWidth:"78%",[t.up("sm")]:{maxWidth:"40%"}}})),S=e=>({color:"white",opacity:.8,marginTop:10,fontSize:"0.8em",textAlign:"center","& a":{color:e.palette.secondary.main,"&:hover":{cursor:"pointer",color:e.palette.secondary.dark}}}),B=(0,y.ZP)(n.ZP)((e=>{let{theme:t}=e;return{...S(t)}})),L=(0,y.ZP)("div")((e=>{let{theme:t}=e;return{...S(t)}})),M=(0,y.ZP)(l.Z)((e=>{let{theme:{breakpoints:t}}=e;return{fontSize:"9vw",[t.up("sm")]:{fontSize:"7vw"},fontWeight:900,textAlign:"center",lineHeight:1,color:"white",transform:"rotate(-3deg)"}})),A=(0,y.ZP)(l.Z)((e=>{let{theme:{breakpoints:t}}=e;return{fontSize:"3.5vw",[t.up("sm")]:{fontSize:"2.5vw"},textAlign:"center",color:"white",width:"100%"}})),R=(0,y.ZP)("div")((e=>{let{theme:{breakpoints:t}}=e;return{width:"100%",height:"20%",position:"relative",display:"none",[t.up("sm")]:{display:"flex",justifyContent:"flex-end"},"& svg":{width:"50% !important",float:"right"}}})),N=()=>{};class I extends i.Component{constructor(e){super(e),this.inputRef=void 0,this.copyToClipboard=e=>{const t=this.inputRef.current;if(t){t.select();const e=document.execCommand("Copy");this.setState({copied:e})}},this.state={copied:!1},this.inputRef=i.createRef()}render(){const{closer:e,children:t,leaveUrl:r,showCloseText:i}=this.props,s=e||N;return(0,p.jsxs)(n.ZP,{container:!0,direction:"column",alignItems:"center",children:[(0,p.jsx)(n.ZP,{item:!0,children:(0,p.jsx)(l.Z,{variant:"h5",sx:{color:"primary.contrastText"},children:t})}),(0,p.jsx)(n.ZP,{item:!0,children:(0,p.jsxs)(C,{onClick:this.copyToClipboard,children:[(0,p.jsx)("div",{children:(0,p.jsx)("input",{ref:this.inputRef,type:"url",value:r,style:{width:500,background:"transparent",color:"white",border:"none"}})}),this.renderCopiedText()]})}),i&&(0,p.jsx)(n.ZP,{item:!0,children:(0,p.jsx)(l.Z,{sx:{color:"primary.contrastText"},variant:"body2",children:(0,p.jsxs)(n.ZP,{container:!0,direction:"row",alignItems:"center",onClick:s,style:{cursor:"pointer"},children:[(0,p.jsx)(n.ZP,{item:!0,children:(0,p.jsx)(j.Z,{})}),(0,p.jsxs)(n.ZP,{item:!0,children:["\xa0",(0,p.jsx)(a.Z,{id:"error.generic.orCloseAndBack"})]})]})})})]})}renderCopiedText(){return this.state.copied?(0,p.jsx)(l.Z,{variant:"subtitle1",style:{float:"right"},children:(0,p.jsx)(a.Z,{id:"error.generic.linkCopied"})}):null}}const W=I;var z=r(85541);const U=i.memo((e=>(0,p.jsx)(z.Z,{...e,width:"24",height:"24",viewBox:"0 0 24 24",children:(0,p.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.40033 4.44945C10.5543 2.43547 13.4458 2.43547 14.5998 4.44945L21.528 16.5411C22.6732 18.5398 21.2493 21.0611 18.9282 21.0611H5.07184C2.75081 21.0611 1.32687 18.5398 2.47213 16.5411L9.40033 4.44945ZM12.8644 5.44375C12.4788 4.7707 11.5213 4.7707 11.1357 5.44375L4.20745 17.5354C3.81311 18.2236 4.31367 19.0611 5.07184 19.0611H18.9282C19.6864 19.0611 20.187 18.2236 19.7926 17.5354L12.8644 5.44375ZM12 8.98477C12.5523 8.98477 13 9.43248 13 9.98477V12C13 12.5523 12.5523 13 12 13C11.4478 13 11 12.5523 11 12V9.98477C11 9.43248 11.4478 8.98477 12 8.98477ZM11 16.0306C11 15.4783 11.4478 15.0306 12 15.0306H12.01C12.5623 15.0306 13.01 15.4783 13.01 16.0306C13.01 16.5829 12.5623 17.0306 12.01 17.0306H12C11.4478 17.0306 11 16.5829 11 16.0306Z"})}))),E=e=>{let{children:t}=e;return(0,p.jsxs)(n.ZP,{container:!0,children:[(0,p.jsx)(n.ZP,{item:!0,xs:1}),(0,p.jsx)(n.ZP,{item:!0,xs:1,children:(0,p.jsx)(l.Z,{sx:{color:"text.secondary"},children:(0,p.jsx)(U,{style:{color:"white",fontSize:"5em",opacity:.7}})})}),(0,p.jsx)(n.ZP,{item:!0,container:!0,xs:8,alignItems:"center",style:{marginLeft:16},children:(0,p.jsx)(w,{children:t})}),(0,p.jsx)(n.ZP,{item:!0,xs:2})]})};var G=r(69121);const H=i.memo((e=>(0,p.jsx)(z.Z,{...e,width:"199",height:"101",viewBox:"0 0 199 101",children:(0,p.jsx)("path",{fillRule:"evenodd",d:"M116.645 24.904l9.612 13.836 40.964 6.253C122.062 72.937 84.826 81.06 56.561 68.802 19.148 52.575 19.234.484 19.148 0L0 5.7c.389 2.18 10.031 53.623 52.727 71.983\n 9.747 4.19 20.346 6.283 31.774 6.283 23.324 0 50.098-8.749 80.05-26.122l-17.696 36.238 5.493 6.918 46.348-66.786-82.051-9.31z"})})));var D=r(86857);const F=s.GA.Instance;function O(e,t){return function(r){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;return F.trackButtonClick(n,t.gameSlug)}}class _ extends i.Component{constructor(e){super(e),this.sandboxed=void 0,this.sandboxed=o.Z.isSandboxed()}render(){return this.props.showAlternativeGame?this.renderLayoutWithAlternative():this.renderLayoutWithoutAlternatives()}renderLayoutWithAlternative(){const{alternativeAction:e,altGame:t,title:r,message:n,compactTitle:l,shouldShowGDPRNotice:c}=this.props,{countryCode:d}=(0,G.bG)(),h=t?()=>F.trackButtonClick(s.J.AlternativeGame,t.gameSlug):void 0,u=void 0!==c?c:(0,G.Ax)(d)&&o.Z.isEmbeddedExternally();return(0,p.jsxs)(k,{compactTitle:!!l,container:!0,justifyContent:"space-around",alignItems:"center",children:[(0,p.jsxs)(P,{item:!0,className:"labelTextContainerWithAlt",container:!0,direction:"column",justifyContent:"center",alignItems:"center",children:[(0,p.jsx)(M,{variant:"h6",children:r||(0,p.jsx)(a.Z,{id:"error.generic.mainTitle"})}),(0,p.jsx)(A,{variant:"subtitle1",className:"errorSubheading",children:n}),(0,p.jsx)(R,{children:(0,p.jsx)(H,{style:{fill:"#58538a",width:"100%",height:"100%",verticalAlign:"middle"}})})]}),!!t&&(0,p.jsxs)(T,{item:!0,children:[(0,p.jsx)(v,{...t,tracker:h,gameThumbContainerCustomStyle:{maxWidth:"42vh",margin:"auto"}}),e&&(0,p.jsx)(L,{children:e})]}),u&&(0,p.jsx)(i.Suspense,{fallback:null,children:(0,p.jsx)(D.Z,{})})]})}renderLayoutWithoutAlternatives(){const{alternativeAction:e}=this.props;return(0,p.jsxs)(n.ZP,{container:!0,direction:"column",spacing:8,alignItems:"center",children:[(0,p.jsx)(n.ZP,{item:!0,style:{width:"100%"},children:this.renderErrorMessage()}),(0,p.jsx)(n.ZP,{item:!0,children:this.renderExitButton()}),e&&(0,p.jsx)(B,{item:!0,children:e})]})}renderErrorMessage(){return(0,p.jsx)(E,{children:this.props.message})}renderExitButton(){return this.sandboxed?this.renderSandbox():this.renderButton()}renderSandbox(){const{leaveButtonUrl:e,close:t,showCloseText:r}=this.props;return e?(0,p.jsx)(W,{closer:t,showCloseText:r,leaveUrl:e,children:this.sandboxMessage()}):null}renderButton(){const{leaveButtonUrl:e,tracker:t,close:r,showCloseText:n,leaveButtonMessage:i,customButton:s}=this.props;return s?(0,p.jsx)(s,{}):e?(0,p.jsx)(f,{tracker:t,closer:r,showCloseText:n,leaveUrl:e,children:i}):null}sandboxMessage(){return this.props.sandboxMessage?this.props.sandboxMessage:(0,p.jsx)(a.Z,{id:"error.sandbox.copyAndPasteLink"})}}const V=_},47318:(e,t,r)=>{r.r(t),r.d(t,{default:()=>j});var n=r(47313),i=r(8242),s=r(87308),o=r(90831),a=r(50009),l=r(52797),c=r(46604),d=r(77626),h=r(32992),u=r(69121),x=r(46417);const m={textDecoration:"underline",fontWeight:"bolder",color:"#FFF"};class p extends n.Component{constructor(e){super(e),this.config=void 0,this.config=(0,o.NI)()}render(){return this.isRecentBrowser()?(0,x.jsx)(h.Z,{tracker:()=>Promise.resolve(),showCloseText:!1,message:this.createOverlayMessageForRecentBrowser()}):(0,x.jsx)(h.Z,{showCloseText:!1,message:this.createOverlayMessage(),leaveButtonMessage:this.createLeaveButtonMessage(),leaveButtonUrl:this.createLeaveButtonUrl(),tracker:(0,h.S)(l.J.SimilarGames,this.config)})}isRecentBrowser(){var e,t;const r=(0,u.Tb)();return!!((0,s.vU)()&&parseInt((null===(e=r.rawBrowser)||void 0===e?void 0:e.version)||"0")>90)||!!((0,s.i7)()&&parseInt((null===(t=r.rawBrowser)||void 0===t?void 0:t.version)||"0")>90)}createOverlayMessage(){return(0,x.jsx)("div",{style:{textAlign:"center"},children:(0,x.jsx)(d.Z,{id:"error.unity.browserNotSupported",values:{gameName:this.config.gameName}})})}createOverlayMessageForRecentBrowser(){return(0,x.jsx)("div",{style:{textAlign:"center"},children:(0,x.jsx)(d.Z,{id:"error.unity.browserWithoutWebGL",values:{link:(0,x.jsx)("a",{href:"https://get.webgl.org/webgl2/enable.html",target:"_blank",rel:"noopener noreferrer",style:m,children:(0,x.jsx)(d.Z,{id:"error.unity.browserWithoutWebGLLinkLabel"})})}})})}createLeaveButtonMessage(){return(0,x.jsx)("div",{children:(0,x.jsx)(d.Z,{id:"error.generic.playOurOtherCatGames",values:{category:this.config.category}})})}createLeaveButtonUrl(){const e=this.config,t=(0,a.Z)(),r=l.O.UnityUnavailableRedirect;return c.Z.utmUrl(e.categoryLink,t,r)}}const g=(0,i.Z)(p);class v extends n.Component{render(){const{device:e,...t}=this.props;return this.isIE()?null:(0,x.jsx)(g,{...t})}isIE(){const{device:e}=this.props;return e.isIE}}const j=(0,i.Z)(v)},91423:(e,t,r)=>{r.d(t,{Z:()=>s});r(47313);var n=r(31080),i=r(46417);const s=e=>{let{onClick:t,className:r,responsive:s,customStyle:o,children:a,variant:l="contained"}=e;return(0,i.jsx)(n.v,{responsive:!!s,variant:l,className:r,onClick:t,style:o,children:a})}}}]); |