1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9227],{23865:e=>{e.exports={unread:"NotificationList_unread__OxKBI"}},60439:(e,s,t)=>{"use strict";t.d(s,{A:()=>u});var l=t(46045),r=t(16690),o=t(37876),n=t(15039),a=t.n(n),i=t(14232),c=t(84206),d=t(24809),h=t(88839),x=t(64058);function u(e){let{className:s,controlStyles:t,defaultValue:n,onSelect:u,placeholder:m}=e,[p,g]=(0,i.useState)([]),[f,v]=(0,i.useState)(n),[j,w]=(0,i.useState)(!1);(0,i.useEffect)(()=>{w(!0)},[]);let b=async(e,s)=>{let t=encodeURI(e)||"",l=await fetch("/api/user/search?search="+t,{method:"GET",headers:{"Content-Type":"application/json"}}),r=await l.json();g(r),s(r)},y=(0,d.s)(500,b);return j?(0,o.jsx)(c.A,{backspaceRemovesValue:!0,className:a()("text-left text-base",s),components:{DropdownIndicator:null,IndicatorSeparator:null},formatOptionLabel:(e,s)=>{let{context:t}=s;return(0,o.jsx)("div",{style:{animation:"menu"===t?"fadeIn 0.1s ease-out":"none",animationDelay:"menu"===t?"".concat(.02*p.findIndex(s=>s._id===e._id),"s"):"0s",animationFillMode:"both"},children:(0,o.jsx)(x.A,{id:"select",noLinks:!0,noTooltip:!0,size:h.A.AvatarSizeSmall,user:e})})},getOptionLabel:e=>e.name,getOptionValue:e=>e._id.toString(),inputId:"search-author-input-async-select-input",instanceId:"search-author-input-async-select",isClearable:!0,loadOptions:y,noOptionsMessage:()=>"No users found",onChange:(e,s)=>{v(e),s&&u&&("clear"===s.action?u("",s):u(e,s))},options:p,placeholder:m||"Search users...",styles:{control:(e,s)=>(0,l._)((0,r._)((0,l._)({},e),{backgroundColor:"rgba(255, 255, 255, 0.1)",backdropFilter:"blur(10px)",borderColor:s.isFocused?"rgba(139, 92, 246, 0.5)":"rgba(255, 255, 255, 0.2)",borderRadius:"0.75rem",borderWidth:"1px",boxShadow:s.isFocused?"0 0 0 2px rgba(139, 92, 246, 0.2)":"none",cursor:"text",height:44,maxWidth:"100%",minWidth:"100%",transition:"all 0.2s ease","&:hover":{borderColor:"rgba(255, 255, 255, 0.3)",backgroundColor:"rgba(255, 255, 255, 0.15)"}}),t),container:e=>(0,r._)((0,l._)({},e),{maxWidth:"100%"}),dropdownIndicator:e=>(0,r._)((0,l._)({},e),{color:"rgba(255, 255, 255, 0.7)","&:hover":{color:"rgba(255, 255, 255, 0.9)"}}),input:e=>(0,r._)((0,l._)({},e),{color:"white"}),menu:e=>(0,r._)((0,l._)({}
1,e),{backgroundColor:"rgba(30, 41, 59, 0.95)",backdropFilter:"blur(20px)",borderColor:"rgba(255, 255, 255, 0.2)",borderRadius:"0.75rem",borderWidth:"1px",marginTop:"4px",boxShadow:"0 10px 32px rgba(0, 0, 0, 0.3)",zIndex:9999,animation:"fadeInDown 0.2s ease-out"}),option:(e,s)=>(0,r._)((0,l._)({},e),{backgroundColor:s.isSelected?"rgba(139, 92, 246, 0.3)":s.isFocused?"rgba(255, 255, 255, 0.1)":"transparent",color:"white","&:hover":{backgroundColor:"rgba(255, 255, 255, 0.15)"},overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:"12px 16px",transition:"all 0.2s ease",animation:"fadeInUp 0.15s ease-out",animationDelay:"".concat(.03*(e.index||0),"s"),animationFillMode:"both"}),placeholder:e=>(0,r._)((0,l._)({},e),{color:"rgba(255, 255, 255, 0.6)"}),singleValue:e=>(0,r._)((0,l._)({},e),{color:"white"})},value:f}):(0,o.jsx)("div",{className:a()("text-left text-base",s),style:{height:44}})}},69227:(e,s,t)=>{"use strict";t.d(s,{A:()=>ec});var l=t(37876),r=t(65458),o=t(64632),n=t(73943),a=t(56756),i=t(58241),c=t(17749),d=t(15039),h=t.n(d),x=t(54587),u=t.n(x),m=t(48230),p=t.n(m),g=t(89099),f=t(14232),v=t(97685),j=t(77001);function w(e){let{children:s,href:t}=e;return(0,l.jsx)("a",{className:"hover:underline w-fit",href:t,rel:"noreferrer",style:{color:"var(--color-gray)"},target:"_blank",children:s})}function b(){let e=(0,l.jsx)("a",{className:"w-fit m-2",href:"https://discord.gg/j6RxRdqq4A",rel:"noreferrer",target:"_blank",children:(0,l.jsx)(u(),{alt:"discord",src:"/discord.svg?v=1",width:"120",height:"40"})}),s=(0,l.jsx)("a",{className:"w-fit m-2",href:"https://apps.apple.com/app/pathology-block-pushing-game/id1668925562",rel:"noreferrer",target:"_blank",children:(0,l.jsx)(u(),{alt:"app-store",src:"/app-store.svg",width:"120",height:"40"})}),t=(0,l.jsx)("a",{className:"w-fit m-2",href:"https://play.google.com/store/apps/details?id=com.pathology.gg",rel:"noreferrer",target:"_blank",children:(0,l.jsx)(u(),{alt:"play-store",src:"/play-store.svg",width:"120",height:"35"})});return(0,l.jsxs)("footer",{className:"footer flex flex-col items-center gap-4 p-4 w-full bg-1 text-sm",children:[(0,l.jsxs)("div",{className:"flex flex-wrap gap-x-4 gap-y-2 items-center justify-center",children:[e,s,t]}),(0,l.jsxs)("div",{className:"flex flex-wrap gap-4 justify-center",children:[(0,l.jsx)(w,{href:"mailto:[email protected]",children:"Contact"}),(0,l.jsx)(w,{href:"https://github.com/sspenst/thinky.gg",children:"GitHub"}),(0,l.jsx)(w,{href:"https://github.com/sspenst/thinky.gg/wiki",children:"Wiki"}),(0,l.jsx)(w,{href:"https://docs.google.com/document/d/e/2PACX-1vSNgV3NVKlsgSOEsnUltswQgE8atWe1WCLUY5fQUVjEdu_JZcVlRkZcpbTOewwe3oBNa4l7IJlOnUIB/pub",children:"Privacy Policy"}),(0,l.jsx)(w,{href:"https://docs.google.com/document/d/e/2PACX-1vR4E-RcuIpXSrRtR3T3y9begevVF_yq7idcWWx1A-I9w_VRcHhPTkW1A7DeUx2pGOcyuKifEad3Qokn/pub",children:"Terms of Service"})]}),(0,l.jsxs)("div",{className:"text-center text-xs",style:{color:"var(--color-gray)"},children:["\xa9 2026 ",(0,l.jsx)(w,{href:"https://thinky.gg",children:"Thinky.gg"})]})]})}function y(){return(0,l.jsx)("div",{className:"h-px px-2 my-1 bg-3 w-full",style:{minHeight:1}})}function N(e){let{game:s,onGameChange:t}=e,{game:o}=(0,f.useContext)(n.B),a=(0,c.A)(),i=s.id===o.id;return(0,l.jsx)("a",{href:a(s.id,i?"/":void 0),suppressHydrationWarning:!0,onClick:t,children:(0,l.jsxs)("div",{className:h()("flex w-full items-center rounded-md cursor-pointer px-3 py-2 gap-5",i?"bg-2 hover-bg-4":"bg-1 hover-bg-3"),children:[(0,l.jsx)(r.A,{gameId:s.id,id:s.id+"menu_item",size:20}),(0,l.jsx)("span",{children:s.displayName})]})})}function C(e){let{onGameChange:s}=e,{game:t}=(0,f.useContext)(n.B),[r,a]=(0,f.useState)(!1);return(0,l.jsxs)("div",{className:"relative",children:[(0,l.jsxs)("button",{className:"focus:outline-hidden flex w-full items-center rounded-md px-3 py-2 justify-between hover-bg-3",onClick:e=>{e.stopPropagation(),e.preventDefault(),a(!r)},children:[(0,l.jsx)("div",{className:"flex items-center gap-5",children:(0,l.jsx)(j.A,{gameId:t.id,id:t.id,size:20})}),(0,l.jsx)("svg",{className:h()("h-5 w-5 transition-transform",r&&"rotate-180"),xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:(0,l.jsx)("path",{fillRule:"evenodd",d:"M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z",clipRule:"evenodd"})})]}),r&&(0,l.jsx)("div",{className:"flex flex-col gap-1 mt-1",children:Object.values(o.kx).filter(e=>e.id!==t.id).map(e=>(0,l.jsx)(N,{game:e,onGameChange:()=>{a(!1),null==s||s()}},e.id))})]})}function k(e){let{hidden:s,href:t,icon:r,label:o,onClick:n,special:a}=e,[i,c]=(0,f.useState)(!1),d=(0,g.useRouter)();return((0,f.useEffect)(()=>{c(d.asPath.split("?")[0]===t)},[t,d.asPath]),s)?null:(0,l.jsxs)(p(),{className:h()("flex w-full items-center rounded-md cursor-pointer px-3 py-2 gap-5",i?"bg-2 hover-bg-4":"".concat(a?"bg-purple-50 dark:bg-purple-700":"bg-1 hover-bg-3")),href:t,onClick:n,passHref:!0,children:[r,(0,l.jsx)("span",{children:o})]})}function L(e){let{isDropdown:s,onGameChange:t}=e,{game:r,playLater:o,user:c}=(0,f.useContext)(n.B),{connectedPlayersCount:d,matches:x,socket:m}=(0,f.useContext)(n.F),p=(0,l.jsx)(k,{href:"/pro",icon:(0,l.jsx)(u(),{alt:"pro",src:"/pro.svg",width:"20",height:"20"}),label:"Pro"}),g=(0,l.jsx)(k,{hidden:r.disableMultiplayer,href:"/multiplayer",icon:(0,l.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"w-5 h-5",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 19.128a9.38 9.38 0 002.625.372 9.337 9.337 0 004.121-.952 4.125 4.125 0 00-7.533-2.493M15 19.128v-.003c0-1.113-.285-2.16-.786-3.07M15 19.128v.106A12.318 12.318 0 018.624 21c-2.331 0-4.512-.645-6.374-1.766l-.001-.109a6.375 6.375 0 0111.964-3.07M12 6.375a3.375 3.375 0 11-6.75 0 3.375 3.375 0 016.75 0zm8.25 2.25a2.625 2.625 0 11-5.25 0 2.625 2.625 0 015.25 0z"})}),label:(0,l.jsxs)("div",{className:"flex flex-col",children:[(0,l.jsx)("span",{children:"Multiplayer"}),(null==m?void 0:m.connected)?(0,l.jsxs)("div",{className:"flex flex-col",children:[(0,l.jsx)("span",{className:"text-xs text-green-500",children:"".concat(d," player").concat(1!==d?"s":""," online")}),x.length>0&&(0,l.jsx)("span",{className:"text-xs text-green-300",children:"".concat(x.length," current match").concat(1===x.length?"":"es")})]}):(0,l.jsx)("span",{className:"text-xs text-yellow-500",children:"Connecting..."})]})}),j=(0,l.jsx)(k,{href:"/create",icon:(0,l.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"2 2 20 20",strokeWidth:1.5,stroke:"currentColor",className:"w-5 h-5",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4.5v15m7.5-7.5h-15"})}),label:"Create Level"}),w=(0,l.jsx)(k,{href:"/drafts",icon:(0,l.jsxs)("svg",{className:"w-5 h-5",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,l.jsx)("path",{d:"M20 11V10C20 6.22876 20 4.34315 18.7595 3.17157C17.519 2 15.5225 2 11.5294 2L10.4706 2C6.47752 2 4.48098 2 3.24049 3.17157C2 4.34315 2 6.22876 2 10L2 14C2 17.7712 2 19.6569 3.24049 20.8284C4.48098 22 6.47751 22 10.4706 22H11",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),(0,l.jsx)("path",{d:"M7 7H15",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),(0,l.jsx)("path",{d:"M7 12H15",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),(0,l.jsx)("path",{d:"M15.3477 21.8557L15.1909 21.1223L15.3477 21.8557ZM14.1443 20.6523L14.8777 20.8091L14.1443 20.6523ZM15.0207 18.1117L14.4903 17.5814L15.0207 18.1117ZM17.8883 20.9793L17.358 20.449L17.8883 20.9793ZM21.7963 15.4773L22.4458 15.1023V15.1023L21.7963 15.4773ZM21.1961 17.6715L21.7265 18.2018L21.1961 17.6715ZM21.7963 16.9981L22.4458 17.3731L21.7963 16.9981ZM20.5227 14.2037L20.8977 13.5542V13.5542L20.5227 14.2037ZM18.3285 14.8039L18.8588 15.3342L18.3285 14.8039ZM19.0019 14.2037L18.6269 13.5542V13.5542L19.0019 14.2037ZM20.6658 17.1412L17.358 20.449L18.4186 21.5097L21.7265 18.2018L20.6658 17.1412ZM15.551 18.642L18.8588 15.3342L17.7982 14.2735L14.4903 17.5814L15.551 18.642ZM15.1909 21.1223C15.0155 21.1598 14.8753 21.1897 14.7548 21.2121C14.6333 21.2347 14.5536 21.2454 14.4996 21.2488C14.4441 21.2524 14.4479 21.2458 14.4825 21.2547C14.5296 21.2669 14.5936 21.2972 14.6482 21.3518L13.5876 22.4124C13.9113 22.7362 14.3158 22.7636 14.5948 22.7458C14.8603 22.7289 15.1839 22.6577 15.5045 22.5891L15.1909 21.1223ZM13.4109 20.4955C13.3423 20.8161 13.2711 21.1397 13.2542 21.4052C13.2364 21.6842 13.2638 22.0887 13.5876 22.4124L14.6482 21.3518C14.7028 21.4064 14.7331 21.4704 14.7453 21.5175C14.7542 21.5521 14.7476 21.5559 14.7512 21.5004C14.7546 21.4464 14.7653 21.3667 14.7879 21.2452C14.8103 21.1247 14.8402 20.9845 14.8777 20.8091L13.4109 20.4955ZM20.6658 15.3342C21.0333 15.7017 21.1084 15.786 21.1467 15.8523L22.4458 15.1023C22.2839 14.8218 22.0257 14.5728 21.7265 14.2735L20.6658 15.3342ZM21.7265 18.2018C22.0257 17.9026 22.2839 17.6535 22.4458 17.3731L21.1467 16.6231C21.1084 16.6894 21.0333 16.7737 20.6658 17.1412L21.7265 18.2018ZM21.1467 15.8523C21.2844 16.
10908 21.2844 16.3846 21.1467 16.6231L22.4458 17.3731C22.8514 16.6705 22.8514 15.8049 22.4458 15.1023L21.1467 15.8523ZM21.7265 14.2735C21.4272 13.9743 21.1782 13.7161 20.8977 13.5542L20.1477 14.8533C20.214 14.8916 20.2983 14.9667 20.6658 15.3342L21.7265 14.2735ZM18.8588 15.3342C19.2263 14.9667 19.3106 14.8916 19.3769 14.8533L18.6269 13.5542C18.3465 13.7161 18.0974 13.9743 17.7982 14.2735L18.8588 15.3342ZM20.8977 13.5542C20.1951 13.1486 19.3295 13.1486 18.6269 13.5542L19.3769 14.8533C19.6154 14.7156 19.9092 14.7156 20.1477 14.8533L20.8977 13.5542ZM17.358 20.449C17.1624 20.6445 16.8952 20.771 16.5155 20.8679C16.3253 20.9165 16.1224 20.954 15.8963 20.9931C15.679 21.0306 15.4303 21.0711 15.1909 21.1223L15.5045 22.5891C15.7063 22.546 15.9131 22.5124 16.1517 22.4712C16.3814 22.4315 16.6346 22.3856 16.8866 22.3213C17.3914 22.1924 17.9533 21.975 18.4186 21.5097L17.358 20.449ZM14.8777 20.8091C14.9289 20.5697 14.9694 20.321 15.0069 20.1037C15.046 19.8776 15.0835 19.6747 15.1321 19.4845C15.229 19.1048 15.3555 18.8376 15.551 18.642L14.4903 17.5814C14.025 18.0467 13.8076 18.6086 13.6787 19.1134C13.6144 19.3654 13.5685 19.6186 13.5288 19.8483C13.4876 20.0869 13.454 20.2937 13.4109 20.4955L14.8777 20.8091Z",fill:"currentColor"})]}),label:"Draft Levels"}),N=(0,l.jsx)(k,{hidden:r.disableRanked,href:"/ranked",icon:(0,l.jsx)("span",{className:"w-5 h-5 flex justify-center items-center text-xl",children:"\uD83C\uDFC5"}),label:"Ranked"}),L=c&&(0,l.jsx)(k,{href:"/collection/".concat(c.name,"/play-later"),icon:(0,l.jsx)("svg",{className:"w-5 h-5",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,l.jsx)("path",{d:"M4 17.9808V9.70753C4 6.07416 4 4.25748 5.17157 3.12874C6.34315 2 8.22876 2 12 2C15.7712 2 17.6569 2 18.8284 3.12874C20 4.25748 20 6.07416 20 9.70753V17.9808C20 20.2867 20 21.4396 19.2272 21.8523C17.7305 22.6514 14.9232 19.9852 13.59 19.1824C12.8168 18.7168 12.4302 18.484 12 18.484C11.5698 18.484 11.1832 18.7168 10.41 19.1824C9.0768 19.9852 6.26947 22.6514 4.77285 21.8523C4 21.4396 4 20.2867 4 17.9808Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),label:"Play Later",onClick:e=>{o&&0!==Object.keys(o).length||(v.Ay.success("Add a level to your Play Later collection first!",{icon:"â",duration:3e3}),e.preventDefault())}}),M=(0,l.jsx)(k,{hidden:r.disableTutorial,href:"/tutorial",icon:(0,l.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",fill:"none",viewBox:"2 2 20 20",stroke:"currentColor",strokeWidth:1,children:[(0,l.jsx)("path",{d:"M12 14l9-5-9-5-9 5 9 5z"}),(0,l.jsx)("path",{d:"M12 14l6.16-3.422a12.083 12.083 0 01.665 6.479A11.952 11.952 0 0012 20.055a11.952 11.952 0 00-6.824-2.998 12.078 12.078 0 01.665-6.479L12 14z"}),(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 14l9-5-9-5-9 5 9 5zm0 0l6.16-3.422a12.083 12.083 0 01.665 6.479A11.952 11.952 0 0012 20.055a11.952 11.952 0 00-6.824-2.998 12.078 12.078 0 01.665-6.479L12 14zm-4 6v-7.5l4-2.222"})]}),label:"Tutorial"}),A=(0,l.jsx)(k,{hidden:r.disableCampaign,href:"/campaigns",icon:(0,l.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",className:"w-5 h-5",viewBox:"0 0 16 16",children:(0,l.jsx)("path",{d:"M1 2.828c.885-.37 2.154-.769 3.388-.893 1.33-.134 2.458.063 3.112.752v9.746c-.935-.53-2.12-.603-3.213-.493-1.18.12-2.37.461-3.287.811V2.828zm7.5-.141c.654-.689 1.782-.886 3.112-.752 1.234.124 2.503.523 3.388.893v9.923c-.918-.35-2.107-.692-3.287-.81-1.094-.111-2.278-.039-3.213.492V2.687zM8 1.783C7.015.936 5.587.81 4.287.94c-1.514.153-3.042.672-3.994 1.105A.5.5 0 0 0 0 2.5v11a.5.5 0 0 0 .707.455c.882-.4 2.303-.881 3.68-1.02 1.409-.142 2.59.087 3.223.877a.5.5 0 0 0 .78 0c.633-.79 1.814-1.019 3.222-.877 1.378.139 2.8.62 3.681 1.02A.5.5 0 0 0 16 13.5v-11a.5.5 0 0 0-.293-.455c-.952-.433-2.48-.952-3.994-1.105C10.413.809 8.985.936 8 1.783z"})}),label:"Campaigns"}),z=(0,l.jsx)(k,{href:"/leaderboards",icon:(0,l.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",className:"w-5 h-5",viewBox:"0 0 16 16",children:(0,l.jsx)("path",{d:"M2.5.5A.5.5 0 0 1 3 0h10a.5.5 0 0 1 .5.5c0 .538-.012 1.05-.034 1.536a3 3 0 1 1-1.133 5.89c-.79 1.865-1.878 2.777-2.833 3.011v2.173l1.425.356c.194.048.377.135.537.255L13.3 15.1a.5.5 0 0 1-.3.9H3a.5.5 0 0 1-.3-.9l1.838-1.379c.16-.
112.343-.207.537-.255L6.5 13.11v-2.173c-.955-.234-2.043-1.146-2.833-3.012a3 3 0 1 1-1.132-5.89A33.076 33.076 0 0 1 2.5.5zm.099 2.54a2 2 0 0 0 .72 3.935c-.333-1.05-.588-2.346-.72-3.935zm10.083 3.935a2 2 0 0 0 .72-3.935c-.133 1.59-.388 2.885-.72 3.935zM3.504 1c.007.517.026 1.006.056 1.469.13 2.028.457 3.546.87 4.667C5.294 9.48 6.484 10 7 10a.5.5 0 0 1 .5.5v2.61a1 1 0 0 1-.757.97l-1.426.356a.5.5 0 0 0-.179.085L4.5 15h7l-.638-.479a.501.501 0 0 0-.18-.085l-1.425-.356a1 1 0 0 1-.757-.97V10.5A.5.5 0 0 1 9 10c.516 0 1.706-.52 2.57-2.864.413-1.12.74-2.64.87-4.667.03-.463.049-.952.056-1.469H3.504z"})}),label:"Leaderboards"}),S=(0,l.jsx)(k,{href:"/reviews",icon:(0,l.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"w-5 h-5",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7.5 8.25h9m-9 3H12m-9.75 1.51c0 1.6 1.123 2.994 2.707 3.227 1.129.166 2.27.293 3.423.379.35.026.67.21.865.501L12 21l2.755-4.133a1.14 1.14 0 01.865-.501 48.172 48.172 0 003.423-.379c1.584-.233 2.707-1.626 2.707-3.228V6.741c0-1.602-1.
1123-2.995-2.707-3.228A48.394 48.394 0 0012 3c-2.392 0-4.744.175-7.043.513C3.373 3.746 2.25 5.14 2.25 6.741v6.018z"})}),label:"Reviews"}),B=(0,l.jsx)(k,{href:"/users",icon:(0,l.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",className:"w-5 h-5",viewBox:"0 0 16 16",children:[(0,l.jsx)("path",{fillRule:"evenodd",d:"M5 11.5a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5zm0-4a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5zm0-4a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5z"}),(0,l.jsx)("path",{d:"M1.713 11.865v-.474H2c.217 0 .363-.137.363-.317 0-.185-.158-.31-.361-.31-.223 0-.367.152-.373.31h-.59c.016-.467.373-.787.986-.787.588-.002.954.291.957.703a.595.595 0 0 1-.492.594v.033a.615.615 0 0 1 .569.631c.003.533-.502.8-1.051.8-.656 0-1-.37-1.008-.794h.582c.008.178.186.306.422.309.254 0 .424-.145.422-.35-.002-.195-.155-.348-.414-.348h-.3zm-.004-4.699h-.604v-.035c0-.408.295-.844.958-.844.583 0 .96.326.96.756 0 .389-.257.617-.476.848l-.537.572v.03h1.054V9H1.143v-.395l.957-.99c.138-.142.293-.304.293-.508 0-.18-.147-.32-.342-.32a.33.33 0 0 0-.342.338v.041zM2.564 5h-.635V2.924h-.031l-.598.42v-.567l.629-.443h.635V5z"})]}),label:"Users"}),W=(0,l.jsx)(k,{href:"/search",icon:(0,l.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),label:"Find Levels"}),H=c&&(0,l.jsx)(k,{href:(0,a.A)(c),icon:(0,l.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"w-5 h-5",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 6a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0zM4.501 20.118a7.5 7.5 0 0114.998 0A17.933 17.933 0 0112 21.75c-2.676 0-5.216-.584-7.499-1.632z"})}),label:"Your Profile"}),_=(0,l.jsx)(k,{href:"/",icon:(0,l.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"w-5 h-5",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 12l8.954-8.955c.44-.439 1.152-.439 1.591 0L21.75 12M4.5 9.75v10.125c0 .621.504 1.125 1.125 1.125H9.75v-4.875c0-.621.504-1.125 1.125-1.125h2.25c.621 0 1.125.504 1.125 1.125V21h4.125c.621 0 1.125-.504 1.125-1.125V9.75M8.25 21h8.25"})}),label:"Home"}),I=(0,l.jsx)(k,{hidden:r.disableCampaign,href:"/play",icon:(0,l.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"1 1 22 22",strokeWidth:1.5,stroke:"currentColor",className:"w-5 h-5",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5.25 5.653c0-.856.917-1.398 1.667-.986l11.54 6.348a1.125 1.125 0 010 1.971l-11.54 6.347a1.125 1.125 0 01-1.667-.985V5.653z"})}),label:"Play"}),O=(0,l.jsx)(k,{href:"/play-history",icon:(0,l.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"currentColor",className:"w-5 h-5",viewBox:"0 0 16 16",children:[(0,l.jsx)("path",{d:"M8 3.5a.5.5 0 0 0-1 0V9a.5.5 0 0 0 .252.434l3.5 2a.5.5 0 0 0 .496-.868L8 8.71V3.5z"}),(0,l.jsx)("path",{d:"M8 16A8 8 0 1 0 8 0a8 8 0 0 0 0 16zm7-8A7 7 0 1 1 1 8a7 7 0 0 1 14 0z"})]}),label:"Play History"});return(0,l.jsxs)("nav",{className:h()("w-60 bg-1 flex flex-col items-center gap-1 overflow-y-auto",s?"p-1":"fixed p-2"),style:{height:"calc(100% - 48px)"},children:[(0,l.jsxs)("div",{className:"flex flex-col gap-1 xl:hidden w-full",children:[(0,l.jsx)(C,{onGameChange:t}),(0,l.jsx)(y,{})]}),_,c&&(0,l.jsxs)(l.Fragment,{children:[I,N,g]}),W,(0,l.jsx)(y,{}),!r.isNotAGame&&(0,l.jsxs)(l.Fragment,{children:[B,S,A,z,M,(0,l.jsx)(y,{})]}),c&&(0,l.jsxs)(l.Fragment,{children:[H,!r.isNotAGame&&(0,l.jsxs)(l.Fragment,{children:[j,w,!(0,i.A)(c)&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(y,{}),p]}),L,O]}),(0,l.jsx)(y,{})]}),(0,l.jsx)(b,{})]})}var M=t(90086),A=t(88839),z=t(62261),S=t(70642),B=t(21288),W=t(28418),H=t(29391),_=t(4176),I=t(60439),O=t(23410),R=t(97622),E=t(15094),P=t(37851),T=t(8983);function F(e){var s;let{closeModal:t,isOpen:r}=e,{isDynamic:o,setIsDynamic:a,isDynamicSupported:i,isHot:c,isPlaying:d,setIsPlaying:
1x,isSeeking:u,isToggling:m,seek:p,seekByIndex:g,songMetadata:v,toggleVersion:j,volume:w,setVolume:b}=(0,f.useContext)(P.$O),{deviceInfo:y}=(0,f.useContext)(n.B),N=y.isIOS;return(0,l.jsx)(T.A,{closeModal:t,isOpen:r,title:"Music",children:(0,l.jsxs)("div",{className:"flex flex-col gap-4 items-center",children:[v&&(0,l.jsx)("a",{className:"hover:underline italic w-fit",href:v.artistHref,rel:"noreferrer",target:"_blank",children:v.artist}),(0,l.jsxs)(B.W1,{as:"div",className:"relative inline-block text-left z-30",children:[(0,l.jsx)(B.IU,{id:"dropdownMenuBtn","aria-label":"dropdown menu",children:(0,l.jsxs)("div",{className:"flex items-center gap-2 hover-bg-3 px-3 py-1 rounded-md",children:[(0,l.jsx)("div",{className:h()("font-bold",{"animate-pulse":d},d&&(c?"text-orange-400":"text-blue-400")),children:null!=(s=null==v?void 0:v.title)?s:"Audio not found"}),(0,l.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"w-3 h-3",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 8.25l-7.5 7.5-7.5-7.5"})})]})}),(0,l.jsx)(E.e,{as:f.Fragment,enter:"transition ease-out duration-100",enterFrom:"transform opacity-0 scale-95",enterTo:"transform opacity-100 scale-100",leave:"transition ease-in duration-75",leaveFrom:"transform opacity-100 scale-100",leaveTo:"transform opacity-0 scale-95",children:(0,l.jsx)(B.c,{className:"absolute m-1 origin-top-right rounded-[10px] shadow-lg border overflow-y-auto overflow-x-hidden bg-1 border-color-3",children:(0,l.jsx)("div",{className:"px-1 py-1",children:P.dY.map((e,s)=>{let t=e.title===(null==v?void 0:v.title)&&d;return(0,l.jsx)(B.Dr,{children:()=>(0,l.jsx)("button",{className:h()("hover-bg-3 px-3 py-1 rounded-md w-44",{"animate-pulse":t},t&&(c?"text-orange-400":"text-blue-400")),onClick:()=>g(s),children:e.title},"song-select-".concat(e.title))},"song-select-menu-".concat(e.title))})})})})]}),(0,l.jsxs)("div",{className:"p-1 rounded-lg flex justify-between items-center w-fit",style:{backgroundColor:"var(--bg-color-3)"},children:[(0,l.jsx)("button",{className:"px-3 py-1 rounded-l audio-bar-button disabled:opacity-50",disabled:u,onClick:()=>p(-1),children:"â®"}),(0,l.jsx)("button",{className:"px-3 py-1 audio-bar-button",id:"btn-audio-player-play",onClick:()=>{x(e=>!e)},children:d?"ââ":"â¶"}),(0,l.jsx)("button",{className:h()("px-3 py-1 audio-bar-button disabled:opacity-50",{"rounded-r":!i}),disabled:u,onClick:()=>p(1),children:"â"}),i&&(0,l.jsx)("button",{className:"px-3 py-1 rounded-r audio-bar-button",disabled:m,id:"btn-audio-player-version",onClick:()=>j(),children:m?"â³":c?"\uD83D\uDD25":"âï¸"})]}),!N&&(0,l.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,l.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"w-6 h-6",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.114 5.636a9 9 0 010 12.728M16.463 8.288a5.25 5.25 0 010 7.424M6.75 8.25l4.72-4.72a.75.75 0 011.28.53v15.88a.75.75 0 01-1.28.53l-4.72-4.72H4.51c-.88 0-1.704-.507-1.938-1.354A9.01 9.01 0 012.25 12c0-.83.112-1.633.322-2.396C2.806 8.756 3.63 8.25 4.51 8.25H6.75z"})}),(0,l.jsx)("input",{max:"1",min:"0",onChange:e=>{b(parseFloat(e.target.value))},step:"0.01",type:"range",value:w})]}),i&&(0,l.jsxs)("div",{className:"flex flex-col gap-2 items-center",children:[(0,l.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,l.jsx)("label",{className:"font-medium",htmlFor:"dynamic-music",children:"Dynamic Music"}),(0,l.jsx)("input",{id:"dynamic-music",type:"checkbox",checked:o,onChange:()=>a(e=>!e)})]}),(0,l.jsxs)("div",{className:"flex flex-col word-wrap gap-2 text-sm",children:[(0,l.jsx)("span",{children:"Changes the music depending on what is happening in the game."}),(0,l.jsxs)("span",{className:"text-xs",children:["For example, if you are in a puzzle, the music will be more ambient âï¸.",(0,l.jsx)("br",{}),"After solving, the music will transition to a more energetic \uD83D\uDD25 version."]})]})]})]})})}var V=t(46045),D=t(23550),Z=t(21379),U=t(98826);function G(e){let{closeModal:s,isOpen:t,onSubmit:r}=e,[o,n]=(0,f.useState)("");return(0,l.jsx)(T.A,{closeModal:s,isOpen:t,onSubmit:()=>{r(o),s()},title:"Import Theme",children:(0,l.jsx)("div",{className:"flex flex-col gap-2 w-112 max-w-full",children:(0,l.jsx)("textarea",{className:"p-1 rounded-md border text-xs font-mono",name:"data",onChange:function(e){n(e.currentTarget.value)},placeholder:"Paste exported theme here",required:!0,rows:6,value:o})})})}
1let J={"--bg-color":"Background","--bg-color-2":"Background 2","--bg-color-3":"Background 3","--bg-color-4":"Background 4","--color":"Text","--color-complete":"Complete","--color-error":"Error","--color-gray":"Gray","--color-incomplete":"Incomplete","--level-block":"Level Block","--level-block-border":"Level Block Border","--level-end":"Level End","--level-grid":"Level Grid","--level-grid-text":"Level Grid Text","--level-grid-used":"Level Grid Used","--level-hole":"Level Hole","--level-hole-border":"Level Hole Border","--level-player":"Level Player","--level-player-extra":"Level Player Extra","--level-player-text":"Level Player Text","--level-wall":"Level Wall"};function K(e){let s=document.createElement("div");s.style.color=getComputedStyle(document.documentElement).getPropertyValue(e).trim(),document.body.appendChild(s);let t=getComputedStyle(s).color;document.body.removeChild(s);let l=t.match(/\d+/g);if(!l||l.length<3)return"#000000";let[r,o,n]=l.map(e=>{let s=Number(e).toString(16);return 1===s.length&&(s="0"+s),s});return"#".concat(r).concat(o).concat(n)}function X(e){let{closeModal:s,isOpen:t}=e,[r,o]=(0,f.useState)({}),{game:a,mutateUser:c,user:d,userConfig:h}=(0,f.useContext)(n.B),[x,m]=(0,f.useState)(!1),{setTheme:g,theme:j}=(0,Z.D)(),[w,b]=(0,f.useState)(j===U.Ay.Custom?"Custom":"Presets"),y=(0,i.A)(d);function N(e){if(e===U.Ay.Custom)for(let e of Object.keys(J))document.documentElement.style.setProperty(e,r[e]);else for(let e of Object.keys(J))document.documentElement.style.removeProperty(e);g(e)}(0,f.useEffect)(()=>{if(!(null==h?void 0:h.theme))return;let e=(null==h?void 0:h.customTheme)?JSON.parse(h.customTheme):{},s={};for(let t of Object.keys(J)){let l=K(t);e[t]&&(l=e[t]),h.theme===U.Ay.Custom&&document.documentElement.style.setProperty(t,l),s[t]=l}o(s),Object.values(U.Ay).includes(h.theme)&&j!==h.theme&&g(h.theme)},[null==h?void 0:h.customTheme,null==h?void 0:h.theme]),(0,f.useEffect)(()=>{document.documentElement.setAttribute("data-theme-dark",j===U.Ay.Light?"false":"true")},[j]);let C=(e,s)=>{o(t=>{let l=(0,V._)({},t);return l[e]=s,document.documentElement.style.setProperty(e,s),l})};return(0,l.jsx)(T.A,{closeModal:()=>{s(),fetch("/api/user-config",{method:"PUT",body:JSON.stringify({customTheme:y?JSON.stringify(r):void 0,theme:j}),credentials:"include",headers:{"Content-Type":"application/json"}}).then(()=>{c()}).catch(e=>{console.error(e)})},isOpen:t,title:"Theme",children:(0,l.jsxs)("div",{className:"flex flex-col gap-4",children:[y&&(0,l.jsxs)("div",{className:"flex justify-center gap-2",children:[(0,l.jsx)("button",{className:"px-3 py-1.5 rounded-md tab ".concat("Presets"===w?"bg-2":"bg-1"," focus:outline-hidden"),onClick:()=>b("Presets"),children:"Presets"}),(0,l.jsx)("button",{className:"px-3 py-1.5 rounded-md tab ".concat("Custom"===w?"bg-2":"bg-1"," focus:outline-hidden"),onClick:()=>{N(U.Ay.Custom),b("Custom")},children:(0,l.jsx)("div",{className:"flex gap-2",children:"Custom"})})]}),"Presets"===w&&(0,l.jsx)("div",{className:"flex flex-col gap-1",children:Object.keys(U.Ay).map(e=>{let s=(0,U.DI)(a,U.Ay[e],D.A.Player),t="theme-".concat(U.Ay[e]),r=U.Ay[e]===U.Ay.Custom;return(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("input",{checked:j===U.Ay[e],disabled:r&&!y,id:t,onChange:e=>N(e.currentTarget.value),type:"radio",value:U.Ay[e]}),(0,l.jsx)("label",{htmlFor:t,children:e}),s&&(0,l.jsx)("span",{children:s({size:24})}),r&&!y&&(0,l.jsx)(p(),{href:"/pro",children:(0,l.jsx)(u(),{alt:"pro",src:"/pro.svg",width:16,height:16,style:{minWidth:16,minHeight:16}})})]},"".concat(U.Ay[e],"-parent-div"))})}),"Custom"===w&&(0,l.jsx)("div",{className:"max-h-[350px] overflow-y-auto px-3 flex flex-col gap-2",children:Object.keys(r).map(e=>(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsx)("label",{className:"mr-2",children:J[e]}),(0,l.jsx)("input",{className:"border-0 p-0",onChange:s=>C(e,s.target.value),type:"color",value:r[e]})]},e))}),y&&(0,l.jsxs)("div",{className:"flex justify-center text-sm gap-3",children:[(0,l.jsx)("button",{className:"bg-blue-500 hover:bg-blue-700 text-white rounded-md px-3 py-2 w-fit",onClick:()=>{let e={};for(let s of Object.keys(J))e[s]=K(s);navigator.clipboard.writeText(JSON.stringify(e)),v.Ay.dismiss(),v.Ay.success("Copied theme to clipboard!")},children:"Export"}),(0,l.jsx)("button",{className:"bg-blue-500 hover:bg-blue-700 text-white rounded-md px-3 py-2 w-fit",onClick:()=>m(!0),children:"Import"}),(0,l.jsx)(G,{closeModal:()=>m(!1),isOpen:x,onSubmit:e=>{try{let s=JSON.parse(e);for(let e in s)if(J[e]){if(!s[e].match(/^#[0-9A-Fa-f]{6}$/i))throw Error("Invalid color");C(e,s[e])}g(U.Ay.Custom),b("Custom"),v.Ay.success("Imported theme successfully")}catch(e){v.Ay.error("Invalid theme")}}})]})]})})}var q=t(63029),Q=t(28665);function Y(){let{isHot:e,isPlaying:s}=(0,f.useContext)(P.$O);return(0,l.jsx)("div",{className:h()({"animate-pulse":s},s&&(e?"text-orange-400":"text-blue-400")),children:(0,l.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"w-5 h-5",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 9l10.5-3m0 6.553v3.75a2.25 2.25 0 01-1.632 2.163l-1.32.377a1.803 1.803 0 11-.99-3.467l2.31-.66a2.25 2.25 0 001.632-2.163zm0 0V2.25L9 5.25v10.303m0 0v3.75a2.25 2.25 0 01-1.632 2.163l-1.32.377a1.803 1.803 0 01-.99-3.467l2.31-.66A2.25 2.25 0 009 15.553z"})})})}function $(){let{game:e,mutateUser:s,setShouldAttemptAuth:t,user:r}=(0,f.useContext)(n.B),[o,i]=(0,f.useState)(!1),[c,d]=(0,f.useState)(!1),x=(0,g.useRouter)(),{setPreventKe
1yDownEvent:m}=(0,f.useContext)(z.N);function j(){v.oR.dismiss(),v.oR.loading("Logging out...",{duration:1e3}),fetch("/api/logout",{method:"POST"}).then(()=>{localStorage.clear(),sessionStorage.clear(),s(void 0),t(!1),x.push("/"),x.reload()})}function w(){return(0,l.jsx)("div",{className:"opacity-30 m-1 h-px bg-4"})}return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(B.W1,{children:[(0,l.jsx)(B.IU,{className:"focus:outline-hidden",id:"dropdownMenuBtn","aria-label":"dropdown menu",children:r?(0,l.jsx)(q.A,{user:r}):(0,l.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5 hover:opacity-70",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 6h16M4 12h16M4 18h16"})})}),(0,l.jsxs)(B.c,{anchor:{to:"bottom start",gap:"9px",padding:"4px"},className:h()("p-1 w-fit origin-top-right rounded-[10px] shadow-lg border overflow-y-auto bg-1 border-color-3 transition duration-100 ease-out focus:outline-hidden data-closed:scale-95 data-closed:opacity-0 z-20",(0,H.Ay)(e.id)),modal:!1,transition:!0,children:[r&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(B.Dr,{children:(0,l.jsx)(p(),{href:(0,a.A)(r),passHref:!0,children:(0,l.jsxs)("div",{className:"flex w-full items-center rounded-md cursor-pointer px-3 py-2 gap-3 hover-bg-3",children:[(0,l.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"w-5 h-5",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 6a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0zM4.501 20.118a7.5 7.5 0 0114.998 0A17.933 17.933 0 0112 21.75c-2.676 0-5.216-.584-7.499-1.632z"})}),"Profile"]})})}),(0,l.jsx)(w,{})]}),(0,l.jsx)(B.Dr,{children:(0,l.jsxs)("div",{className:"flex w-full items-center rounded-md cursor-pointer px-3 py-2 gap-3 hover-bg-3",onClick:()=>{d(!0),m(!0)},children:[(0,l.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",className:"w-5 h-5",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.098 19.902a3.75 3.75 0 005.304 0l6.401-6.402M6.75 21A3.75 3.75 0 013 17.25V4.125C3 3.504 3.504 3 4.125 3h5.25c.621 0 1.125.504 1.125 1.125v4.072M6.75 21a3.75 3.75 0 003.75-3.75V8.197M6.75 21h13.125c.621 0 1.125-.504 1.125-1.125v-5.25c0-.621-.504-1.125-1.125-1.125h-4.072M10.5 8.197l2.88-2.88c.438-.439 1.15-.439 1.59 0l3.712 3.713c.44.44.44 1.152 0 1.59l-2.879 2.88M6.75 17.25h.008v.008H6.75v-.008z"})}),"Theme"]})}),(0,l.jsx)(B.Dr,{children:(0,l.jsxs)("div",{className:"flex w-full items-center rounded-md cursor-pointer px-3 py-2 gap-3 hover-bg-3",onClick:()=>{i(!0),m(!0)},children:[(0,l.jsx)(Y,{}),"Music"]})}),r?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(B.Dr,{children:(0,l.jsx)(p(),{href:"/settings",passHref:!0,children:(0,l.jsxs)("div",{className:"flex w-full items-center rounded-md cursor-pointer px-3 py-2 gap-3 hover-bg-3",children:[(0,l.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 16 16",children:[(0,l.jsx)("path",{d:"M8 4.754a3.246 3.246 0 1 0 0 6.492 3.246 3.246 0 0 0 0-6.492zM5.754 8a2.246 2.246 0 1 1 4.492 0 2.246 2.246 0 0 1-4.492 0z"}),(0,l.jsx)("path",{d:"M9.796 1.343c-.527-1.79-3.065-1.79-3.592 0l-.094.319a.873.873 0 0 1-1.255.52l-.292-.16c-1.64-.892-3.433.902-2.54 2.541l.159.292a.873.873 0 0 1-.52 1.255l-.319.094c-1.79.527-1.79 3.065 0 3.592l.319.094a.873.873 0 0 1 .52 1.255l-.16.292c-.892 1.64.901 3.434 2.541 2.54l.292-.159a.873.873 0 0 1 1.255.52l.094.319c.527 1.79 3.065 1.79 3.592 0l.094-.319a.873.873 0 0 1 1.255-.52l.292.16c1.64.893 3.434-.902 2.54-2.541l-.159-.292a.873.873 0 0 1 .52-1.255l.319-.094c1.79-.527 1.79-3.065 0-3.592l-.319-.094a.873.873 0 0 1-.52-1.255l.16-.292c.893-1.64-.902-3.433-2.541-2.54l-.292.159a.873.873 0 0 1-1.255-.52l-.094-.319zm-2.633.283c.246-.835 1.428-.835 1.674 0l.094.319a1.873 1.873 0 0 0 2.693 1.115l.291-.16c.764-.415 1.6.42 1.184 1.185l-.159.292a1.873 1.873 0 0 0 1.116 2.692l.318.094c.835.246.835 1.428 0 1.674l-.319.094a1.873 1.873 0 0 0-1.115 2.693l.16.291c.415.764-.42 1.6-1.185 1.184l-.291-.159a1.873 1.873 0 0 0-2.693 1.116l-.094.318c-.246.835-1.428.835-1.674 0l-.094-.319a1.873 1.873 0 0 0-2.692-1.115l-.292.16c-.764.415-1.6-.42-1.184-1.185l.159-.291A1.873 1.873 0 0 0 1.945 8.93l-.319-.094c-.835-.246-.835-1.428 0-1.674l.319-.094A1.873 1.873 0 0 0 3.06 4.377l-.16-.292c-.415-.764.42-1.6 1.185-1.184l.292.159a1.873 1.873 0 0 0 2.692-1.115l.094-.319z"})]}),"Settings"]})})}),e.hasPro&&(0,l.jsx)(B.Dr,{children:(0,l.jsx)(p(),{href:"/pro",passHref:!0,children:(0,l.jsxs)("div",{className:"flex w-full items-center rounded-md cursor-pointer px-3 py-2 gap-3 hover-bg-3",children:[(0,l.jsx)(u(),{alt:"pro",src:"/pro.svg",width:"20",height:"20"}),"Pro"]})})}),(0,l.jsx)(w,{}),(0,l.jsx)(B.Dr,{children:(0,l.jsxs)("div",{className:"flex w-full items-center rounded-md cursor-pointer px-3 py-2 gap-3 hover-bg-3",onClick:()=>{(0,R.A)(r)?(v.oR.dismiss(),v.oR.error((0,l.jsxs)("div",{className:"flex",children:[(0,l.jsxs)("div",{className:"flex flex-col gap-3 justify-center items-center",children:[(0,l.jsx)("span",{className:"text-lg font-bold text-center",children:"Are you sure you want to log out?"}),(0,l.jsxs)("span",{className:"text-sm text-center",children:["Unless you saved the generated password for your Guest account, ",(0,l.jsx)("span",{className:"font-bold",children:"you will lose your progress!"})]}),(0,l.jsx)(p(),{className:"text-white font-medium rounded-lg text-sm py-2.5 px-3.5 text-center transition bg-green-600 hover:bg-green-700",href:"/settings",onClick:()=>v.oR.dismiss(),children:"Convert to a (free) regular account"}),(0,l.jsx)("button",{className:"text-white font-medium rounded-lg text-sm py-2.5 px-3.5 text-center transition bg-red-600 hover:bg-red-700",onClick:j,children:"Proceed with logging out"})]}),(0,l.jsx)(Q.A,{})]}),{duration:3e4,icon:"â ï¸"})):j()},children:[(0,l.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 16 16",children:[(0,l.jsx)("path",{fillRule:"evenodd",d:"M6 12.5a.5.5 0 0 0 .5.5h8a.5.5 0 0 0 .5-.5v-9a.5.5 0 0 0-.5-.5h-8a.5.5 0 0 0-.5.5v2a.5.5 0 0 1-1 0v-2A1.5 1.5 0 0 1 6.5 2h8A1.5 1.5 0 0 1 16 3.5v9a1.5 1.5 0 0 1-1.5 1.5h-8A
11.5 1.5 0 0 1 5 12.5v-2a.5.5 0 0 1 1 0v2z"}),(0,l.jsx)("path",{fillRule:"evenodd",d:"M.146 8.354a.5.5 0 0 1 0-.708l3-3a.5.5 0 1 1 .708.708L1.707 7.5H10.5a.5.5 0 0 1 0 1H1.707l2.147 2.146a.5.5 0 0 1-.708.708l-3-3z"})]}),"Log Out"]})})]}):(0,l.jsxs)("div",{className:"block sm:hidden",children:[(0,l.jsx)(w,{}),(0,l.jsx)(B.Dr,{children:(0,l.jsx)(p(),{href:"/login",onClick:()=>{sessionStorage.clear()},children:(0,l.jsxs)("div",{className:"flex w-full items-center rounded-md cursor-pointer px-3 py-2 gap-3 hover-bg-3",children:[(0,l.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 16 16",children:[(0,l.jsx)("path",{fillRule:"evenodd",d:"M6 3.5a.5.5 0 0 1 .5-.5h8a.5.5 0 0 1 .5.5v9a.5.5 0 0 1-.5.5h-8a.5.5 0 0 1-.5-.5v-2a.5.5 0 0 0-1 0v2A1.5 1.5 0 0 0 6.5 14h8a1.5 1.5 0 0 0 1.5-1.5v-9A1.5 1.5 0 0 0 14.5 2h-8A1.5 1.5 0 0 0 5 3.5v2a.5.5 0 0 0 1 0z"}),(0,l.jsx)("path",{fillRule:"evenodd",d:"M11.854 8.354a.5.5 0 0 0 0-.708l-3-3a.5.5 0 1 0-.708.708L10.293 7.5H1.5a.5.5 0 0 0 0 1h8.793l-2.147 2.146a.5.5 0 0 0 .708.708l3-3z"})]}),"Log In"]})})}),(0,l.jsx)(B.Dr,{children:(0,l.jsx)(p(),{href:"/signup",children:(0,l.jsxs)("div",{className:"flex w-full items-center rounded-md cursor-pointer px-3 py-2 gap-3 hover-bg-3",children:[(0,l.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"w-5 h-5",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 6a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0zM4.501 20.118a7.5 7.5 0 0114.998 0A17.933 17.933 0 0112 21.75c-2.676 0-5.216-.584-7.499-1.632z"})}),"Sign Up"]})})})]})]})]}),(0,l.jsx)(X,{closeModal:()=>{d(!1),m(!1)},isOpen:c}),(0,l.jsx)(F,{closeModal:()=>{i(!1),m(!1)},isOpen:o})]})}var ee=t(7871),es=t(5164);function et(){let{game:e}=(0,f.useContext)(n.B),s=(0,c.A)();return(0,l.jsxs)(B.W1,{children:[(0,l.jsxs)(B.IU,{className:"focus:outline-hidden hover-bg-2 text-sm items-center gap-1 rounded-md pl-1.5 pr-1 py-0.5 hidden xl:flex","aria-label":"game menu",children:[(0,ee.eU)(e.id).displayName,(0,l.jsx)(es.A,{className:"w-4 h-4"})]}),(0,l.jsx)(B.c,{anchor:{to:"bottom start",gap:"9px",padding:"4px"},className:h()("p-1 w-fit origin-top-left rounded-[10px] shadow-lg border overflow-y-auto bg-1 border-color-3 transition duration-100 ease-out focus:outline-hidden data-closed:scale-95 data-closed:opacity-0 z-20",(0,H.Ay)(e.id)),modal:!1,transition:!0,children:Object.values(o.kx).map(t=>{let o=t.id===e.id;return(0,l.jsx)(B.Dr,{children:(0,l.jsx)("a",{href:s(t.id,o?"/":void 0),suppressHydrationWarning:!0,children:(0,l.jsxs)("div",{className:h()("flex w-full items-center rounded-md cursor-pointer px-3 py-2 gap-3",o?"bg-2 hover-bg-4":"hover-bg-3"),children:[(0,l.jsx)(r.A,{gameId:t.id,id:t.id+"_header_menu",size:20}),(0,l.jsx)("span",{children:t.displayName})]})})},t.id)})})]})}var el=t(32616);function er(){let{user:e}=(0,f.useContext)(n.B),{connectedPlayersCount:s,matches:t,socket:r}=(0,f.useContext)(n.F);if(!e)return null;let o=!!(null==r?void 0:r.connected);return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(p(),{className:"hover:opacity-70",id:"multiplayerBtn","aria-label":"multiplayer - ".concat(s," online"),href:"/multiplayer",passHref:!0,children:(0,l.jsxs)("div",{className:"flex items-start -mr-1","data-tooltip-id":"connected-players-count","data-tooltip-content":o?"".concat(s," player").concat(1!==s?"s":""," online").concat(t.length>0?", ".concat(t.length," current multiplayer match").concat(1===t.length?"":"es"):""):"Connecting...",children:[(0,l.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"w-5 h-6",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 19.128a9.38 9.38 0 002.625.372 9.337 9.337 0 004.121-.952 4.125 4.125 0 00-7.533-2.493M15 19.128v-.003c0-1.113-.285-2.16-.786-3.07M15 19.128v.106A12.318 12.318 0 018.624 21c-2.331 0-4.512-.645-6.374-1.766l-.001-.109a6.375 6.375 0 0111.964-3.07M12 6.375a3.375 3.375 0 11-6.75 0 3.375 3.375 0 016.75 0zm8.25 2.25a2.625 2.625 0 11-5.25 0 2.625 2.625 0 015.25 0z"})}),(0,l.jsx)("div",{className:"flex flex-col -ml-1 px-0.5 text-xs rounded-full bg-1",style:{fontSize:"0.75rem",lineHeight:"0.75rem"},children:o?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("div",{className:"text-green-500",children:s}),t.length>0&&(0,l.jsx)("div",{className:"text-green-300",children:t.length})]}):(0,l.jsxs)("div",{className:"h-3 w-2 pt-0.5",children:[(0,l.jsx)("span",{className:"animate-ping absolute inline-flex rounded-full bg-yellow-500 opacity-75 h-2 w-2"}),(0,l.jsx)("span",{className:"bg-yellow-500 absolute h-2 w-2 rounded-full"})]})})]})}),(0,l.jsx)(el.A,{id:"connected-players-count"})]})}var eo=t(51),en=t(74590);function ea(){let{game:e,notifications:s,setNotifications:t,user:r}=(0,f.useContext)(n.B);return((0,f.useEffect)(()=>{r&&t(r.notifications)},[t,r]),r)?(0,l.jsxs)(B.W1,{children:[(0,l.jsxs)(B.IU,{"aria-label":"notifications",className:"flex items-start hover:opacity-70 focus:outline-hidden",id:"notificationsBtn",children:[(0,l.jsx)(eo.A,{className:"h-6 w-5"}),s.some(e=>!e.read)&&(0,l.jsx)("div",{id:"smallindicator",className:"absolute ml-3 h-2 w-2 bg-red-500 rounded-full border",style:{borderColor:"var(--bg-color-2)",borderRadius:5,height:10,width:10}})]}
1),(0,l.jsx)(B.c,{anchor:{to:"bottom start",gap:"15px",padding:"4px"},className:h()("p-1 w-96 origin-top-right rounded-[10px] shadow-lg border overflow-y-auto bg-1 border-color-3 transition duration-100 ease-out focus:outline-hidden data-closed:scale-95 data-closed:opacity-0 z-20",(0,H.Ay)(e.id)),modal:!1,transition:!0,children:(0,l.jsx)(B.Dr,{children:(0,l.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,l.jsx)(en.A,{notifications:s,setNotifications:t}),(0,l.jsx)("div",{className:"text-center pb-2 text-sm",children:(0,l.jsx)(p(),{href:"/notifications",passHref:!0,className:"underline",children:"See all"})})]})})})]}):null}function ei(e){var s;let{folders:t,isFullScreen:r,subtitle:o,title:a}=e,[i,c]=(0,f.useState)(),{deviceInfo:d,game:x,setShowNav:m,user:g,mutateUser:j}=(0,f.useContext)(n.B),[w,b]=(0,f.useState)(null),[y,N]=(0,f.useState)(!1),C=d.screenSize<M.G.XL||r;return(0,f.useEffect)(()=>{window.location.hostname.includes("thinky.gg")||c("linear-gradient(45deg, darkred 20%, var(--bg-color-2) 20%, var(--bg-color-2) 40%, var(--bg-color) 40%, var(--bg-color) 60%, var(--bg-color-2) 60%, var(--bg-color-2) 80%, var(--bg-color) 80%, var(--bg-color) 100%")},[]),(0,f.useEffect)(()=>{(async()=>{if(g){var e;if(g.impersonatingAdminId){N(!0),b(g);return}let s=null==(e=/token=([^;]+)/.exec(document.cookie))?void 0:e[1];if(s)try{let e=s.split(".");if(3===e.length){let s=JSON.parse(atob(e[1]));s.isImpersonating&&s.adminId&&(N(!0),b(g))}}catch(e){}}})()},[g]),(0,l.jsxs)("header",{className:"select-none shadow-md w-full fixed top-0 z-20 flex justify-between px-4 gap-4 border-color-2 border-b bg-1",style:{background:i,height:A.A.MenuHeight,minHeight:A.A.MenuHeight},children:[(0,l.jsxs)("div",{className:"flex items-center truncate z-20 gap-4",children:[x.isNotAGame?null:C?(0,l.jsxs)(B.W1,{children:[(0,l.jsx)(B.IU,{className:"w-full focus:outline-hidden",children:(0,l.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5 hover:opacity-70",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 6h16M4 12h16M4 18h16"})})}),(0,l.jsx)(B.c,{anchor:{to:"bottom end",gap:"17px",padding:"4px"},className:h()("p-1 w-fit origin-top-left rounded-[10px] shadow-lg border overflow-y-auto bg-1 border-color-3 transition duration-100 ease-out focus:outline-hidden data-closed:scale-95 data-closed:opacity-0 z-40",(0,H.Ay)(x.id)),modal:!1,transition:!0,children:(0,l.jsx)(L,{isDropdown:!0})})]}):(0,l.jsx)("button",{onClick:()=>m(e=>!e),children:(0,l.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5 hover:opacity-70",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 6h16M4 12h16M4 18h16"})})}),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("div",{children:(0,l.jsx)(p(),{className:"font-bold text-3xl",href:"/",children:(0,l.jsx)(u(),{alt:"logo",src:x.logo,width:"24",height:"24",className:"h-6 w-6",style:{minWidth:24,minHeight:24}})})}),(0,l.jsx)(et,{}),(0,l.jsx)("div",{className:"-ml-2",children:(0,l.jsx)(O.A,{folders:t,subtitle:o,title:a})})]})]}),void 0===g?(0,l.jsx)("div",{className:"flex items-center",children:(0,l.jsx)(_.A,{})}):(0,l.jsxs)("div",{className:"flex gap-4 items-center z-20",children:[(y||g&&(null==(s=g.roles)?void 0:s.includes(W.A.ADMIN)))&&(0,l.jsxs)("div",{className:"hidden sm:flex items-center gap-2",children:[y&&(0,l.jsx)("div",{className:"bg-red-600 text-white px-2 py-1 rounded-sm text-sm font-medium",children:"Impersonating"}),y?(0,l.jsxs)("div",{className:"flex items-center gap-2 bg-red-100 dark:bg-red-900 px-3 py-1 rounded-md",children:[(0,l.jsx)("span",{className:"text-sm font-medium",children:null==w?void 0:w.name}),(0,l.jsx)("button",{onClick:async()=>{(await fetch("/api/admin/impersonate",{method:"DELETE"})).ok?(v.oR.success("Stopped impersonating"),b(null),N(!1),j(),window.location.reload()):v.oR.error("Failed to stop impersonating")},className:"text-red-600 hover:text-red-800 dark:text-red-400 dark:hover:text-red-300",title:"Stop impersonating",children:(0,l.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:(0,l.jsx)("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",clipRule:"evenodd"})})})]}):(0,l.jsx)(I.A,{className:"w-48",controlStyles:{minHeight:"36px",height:"36px"},placeholder:"Impersonate user...",onSelect:async e=>{if(e){let s=await fetch("/api/admin/impersonate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userId:e._id})});if(s.ok){let t=await s.json();v.oR.success("Now impersonating ".concat(t.targetUser.name)),b(e),N(!0),j(),window.location.reload()}else{let e=await s.json();v.oR.error(e.error||"Failed to impersonate user")}}else(await fetch("/api/admin/impersonate",{method:"DELETE"})).ok?(v.oR.success("Stopped impersonating"),b(null),N(!1),j(),window.location.reload()):v.oR.error("Failed to stop impersonating")}})]}),(0,l.jsx)(p(),{id:"searchBtn","aria-label":"search",className:"hover:opacity-70",href:"/search",passHref:!0,prefetch:!1,children:(0,l.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})})}),(0,l.jsx)(er,{}),g&&(0,l.jsx)(ea,{}),(0,l.jsxs)("div",{className:"flex gap-3 items-center",children:[null===g&&(0,l.jsxs)("div",{className:"hidden sm:flex gap-3",children:[(0,l.jsx)(p(),{className:"hover:underline",href:"/login",onClick:()=>{sessionStorage.clear()},children:"Log In"}),(0,l.jsx)(p(),{href:"/signup",className:"hover:underline",children:"Sign Up"})]}),(0,l.jsx)($,{})]})]})]})}function ec(e){let{children:s,folders:t,isFullScreen:r,style:o,subtitle:a,subtitleHref:i,title:c,titleHref:d}=e,{deviceInfo:x,game:u,showNav:m}=(0,f.useContext)(n.B),[p,v]=(0,f.useState)(!1),j=(0,g.useRouter)(),[w,y]=(0,f.useState)(!0),[N,C]=(0,f.useState)(null),k=!(x.screenSize<M.G.XL||r)&&m&&(!u.isNotAGame||"/"!==j.pathname);return(0,f.useEffect)(()=>(r?document.body.classList.add("touch-pinch-zoom"):document.body.classList.remove("touch-pinch-zoom"),()=>{document.body.classList.remove("touch-pinch-zoom")}),[r]),(0,l.jsx)(z.N.Provider,{value:{preventKeyDownEvent:p,setPreventKe
1yDownEvent:v,setShowHeader:y,showHeader:w,setModal:C,modal:N},children:(0,l.jsxs)("div",{className:h()("flex flex-col",{"fixed inset-0 overflow-hidden":r}),style:o,children:[null!==N&&N,w&&(0,l.jsx)(ei,{folders:t,isFullScreen:r,subtitle:a?new S.A(a,i):void 0,title:c?new S.A(c,d):void 0}),(0,l.jsxs)("div",{className:"grow flex",style:{height:w?"calc(100% - ".concat(A.A.MenuHeight,"px)"):"100%",marginTop:w?A.A.MenuHeight:0},children:[k&&(0,l.jsx)(L,{}),(0,l.jsxs)("div",{className:h()("flex flex-col gap-4",{"ml-60":k}),style:{maxWidth:k?"calc(100% - 240px)":"100%",width:k?"calc(100% - 240px)":"100%"},children:[(0,l.jsx)("main",{className:"grow h-full",children:s}),!r&&!k&&(0,l.jsx)(b,{})]})]})]})})}},70642:(e,s,t)=>{"use strict";t.d(s,{A:()=>n});var l=t(37876),r=t(48230),o=t.n(r);class n{toElement(){return this.href?(0,l.jsx)(o(),{className:"underline",href:this.href,children:this.text}):this.text}constructor(e,s){this.text=e,this.href=s}}},74590:(e,s,t)=>{"use strict";t.d(s,{A:()=>h});var l=t(37876),r=t(15039),o=t.n(r),n=t(14232),a=t(99074),i=t(8705),c=t(23865),d=t.n(c);function h(e){let{close:s,notifications:t,setNotifications:r}=e,c=(0,a.E)({notifications:t,setNotifications:r}),h=(0,n.useCallback)(()=>t.map(e=>(0,l.jsx)(i.A,{close:s,notification:e,notificationActions:c},"notification-"+e._id)),[s,t,c]),x=t.some(e=>!e.read);return(0,l.jsxs)("div",{className:"px-3 py-2 flex flex-col gap-2",children:[(0,l.jsxs)("div",{className:"flex flex-cols-2 justify-between gap-2",children:[(0,l.jsx)("h2",{className:"focus:outline-hidden text-xl font-semibold",children:"Notifications"}),(0,l.jsx)("button",{disabled:!x,className:o()("focus:outline-hidden text-sm",x?d().unread:void 0),onClick:()=>{if(x){let e=t.filter(e=>!e.read).map(e=>e._id.toString());c.markMultipleAsRead(e,!0)}s&&s()},style:{color:x?void 0:"var(--bg-color-4)"},children:"Mark all read"})]}),h().length>0?h():(0,l.jsx)("p",{className:"text-sm pt-2 justify-center flex",children:"No notifications!"})]})}}}]);
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.