PageSourceSearch

https://klotski.org/_next/static/chunks/app/(web)/%5Blocale%5D/(main)/layout-55b30d7dd317224f.js

js klotski.org collected 2026-10-04 00:15:06 UTC 15,511 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5596],{75615:function(e,t,r){Promise.resolve().then(r.bind(r,91018)),Promise.resolve().then(r.bind(r,66448)),Promise.resolve().then(r.bind(r,40313))},55202:function(e,t,r){"use strict";r.d(t,{al:function(){return n},zX:function(){return l},ck:function(){return a},k1:function(){return s}});let s=["en","zh","it","es","de","pt","ja","ko","pl"],n="en",a="as-needed",l={en:"English",zh:"中文",it:"Italiano",es:"Espa\xf1ol",de:"Deutsch",pt:"Portugu\xeas",ja:"日本語",ko:"한국어",pl:"Polski"}},73634:function(e,t,r){"use strict";r.d(t,{rU:function(){return d},jD:function(){return p},tv:function(){return g}});var s=r(88779),n=r(58496),a=r.t(n,2),l=r(75182),i=a["use".trim()],o=r(91120),c=r(91018),h=r(98396),u=r(83890),x=r(48532),m=r(55202);let{Link:d,redirect:f,usePathname:p,useRouter:g}=function(e){let{Link:t,config:r,getPathname:a,...m}=function(e,t){var r,a,l;let x={...r=t||{},localePrefix:"object"==typeof(l=r.localePrefix)?l:{mode:l||"always"},localeCookie:!!((a=r.localeCookie)??1)&&{name:"NEXT_LOCALE",sameSite:"lax",..."object"==typeof a&&a},localeDetection:r.localeDetection??!0,alternateLinks:r.alternateLinks??!0},m=x.pathnames,d=(0,n.forwardRef)(function({href:t,locale:r,...s},n){let a,l;"object"==typeof t?(a=t.pathname,l=t.params):a=t;let h=(0,o.t3)(t),d=e(),p=(0,o.tI)(d)?i(d):d,g=h?f({locale:r||p,href:null==m?a:{pathname:a,params:l},forcePrefix:null!=r||void 0}):a;return(0,u.jsx)(c.default,{ref:n,href:"object"==typeof t?{...t,pathname:g}:g,locale:r,localeCookie:x.localeCookie,...s})});function f(e){let t;let{forcePrefix:r,href:s,locale:n}=e;return null==m?"object"==typeof s?(t=s.pathname,s.query&&(t+=(0,h.Ci)(s.query))):t=s:t=(0,h.cT)({locale:n,...(0,h.hm)(s),pathnames:x.pathnames}),(0,h.r6)(t,n,x,r)}function p(e){return function(t,...r){return e(f(t),...r)}}return{config:x,Link:d,redirect:p(s.redirect),permanentRedirect:p(s.permanentRedirect),getPathname:f}}(l.bU,e);return{...m,Link:t,usePathname:function(){let e=function(e){let t=(0,s.usePathname)(),r=(0,l.bU)();return(0,n.useMemo)(()=>{if(!t)return t;let s=t,n=(0,o.Af)(r,e.localePrefix);if((0,o.Tp)(n,t))s=(0,o.vz)(t,n);else if("never"!==e.localePrefix.mode&&e.localePrefix.prefixes){let e=(0,o.Sk)(r);(0,o.Tp)(e,t)&&(s=(0,o.vz)(t,e))}return s},[e.localePrefix,r,t])}(r),t=(0,l.bU)();return(0,n.useMemo)(()=>e&&r.pathnames?(0,h.Bv)(t,e,r.pathnames):e,[t,e])},useRouter:function(){let e=(0,s.useRouter)(),t=(0,l.bU)(),i=(0,s.usePathname)();return(0,n.useMemo)(()=>{function s(e){return function(s,n){let{locale:l,...o}=n||{},c=[a({href:s,locale:l||t,forcePrefix:null!=l||void 0})];Object.keys(o).length>0&&c.push(o),(0,x.Z)(r.localeCookie,i,t,l),e(...c)}}return{...e,push:s(e.push),replace:s(e.replace),prefetch:s(e.prefetch)}},[t,i,e])},getPathname:a}}({locales:m.k1,defaultLocale:m.al,localePrefix:m.ck,localeDetection:!1})},40313:function(e,t,r){"use strict";r.d(t,{default:function(){return d}});var s=r(83890),n=r(58496),a=r(75182);function l(e,t){return(...e)=>{try{return t(...e)}catch{throw Error(void 0)}}}let i=l(0,a.T_);l(0,a.Gb);var o=r(73634),c=r(8921),h=r(55202);let u="Klotski",x="https://klotski.org".includes("klotski.org"),m=e=>{let{game:t,onClick:r,locale:n}=e;return(0,s.jsxs)(o.rU,{href:"/game/".concat(t.game_key),locale:n,className:"flex items-center gap-3 p-2 hover:bg-white/10 rounded-lg transition-colors",onClick:r,children:[(0,s.jsx)("img",{src:t.image,alt:t.title,className:"w-12 h-12 object-cover rounded-md"}),(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsx)("h3",{className:"text-white font-medium text-sm truncate",children:t.title}),(0,s.jsx)("p",{className:"text-white/60 text-xs truncate",children:t.category})]})]})};var d=()=>{let e;let t=i("common.navigation"),r=(0,a.bU)(),l=(0,o.jD)(),d=(0,o.tv)(),[f,p]=(0,n.useState)(!1),[g,b]=(0,n.useState)(!1),[w,j]=(0,n.useState)(!1),v=(0,n.useRef)(null),N=(0,n.useRef)(null),k=(0,n.useRef)(null),y=(0,n.useRef)(null),[P,C]=(0,n.useState)(""),[O,E]=(0,n.useState)([]),[U,L]=(0,n.useState)(!1),[S,z]=(0,n.useState)(!1);(0,n.useEffect)(()=>{let e=()=>{p(window.scrollY>0)};return window.addEventListener("scroll",e),()=>{window.removeEventListener("scroll",e)}},[]),(0,n.useEffect)(()=>{let e=e=>{g&&v.current&&!v.current.contains(e.target)&&N.current&&!N.current.contains(e.target)&&b(!1),k.current&&!k.current.contains(e.target)&&z(!1),w&&y.current&&!y.current.contains(e.target)&&j(!1)};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[g,w]);let R=async e=>{if(!e.trim()){E([]),z(!1);return}L(!0);try{let t=new URL("/api/game",window.location.origin);t.searchParams.append("page",1),t.searchParams.append("pageSize",10),t.searchParams.append("search",e);let r=await fetch(t),s=await r.json();E(s.data||[]),z(!0)}catch(e){console.error("Error searching games:",e),E([]),z(!1)}finally{L(!1)}},D=(0,n.useCallback)(function(){for(var t=arguments.length,r=Array(t),s=0;s<t;s++)r[s]=arguments[s];clearTimeout(e),e=setTimeout(()=>R(...r),300)},[]),T=e=>{C(e),D(e)},_=e=>{e.stopPropagation()},A=()=>{z(!1),E([])},G=e=>
1{let t=(e||"").split("/").filter(Boolean);for(;t.length>0&&h.k1.includes(t[0]);)t.shift();return"/".concat(t.join("/")||"")},M=e=>{let t=G(l)||"/";d.push(t,{locale:e}),j(!1),b(!1)};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"h-14 w-full shadow-sm flex items-center z-30 top-0 sticky transition-all duration-300 box-shadow-game-1 ".concat(f?"bg-black/60 backdrop-blur-md":"bg-transparent"),children:[(0,s.jsxs)("div",{className:"flex items-center gap-4 sm:gap-8 px-3 md:px-6",children:[(0,s.jsxs)(o.rU,{href:"/",className:"flex items-center gap-2",children:[(0,s.jsx)("img",{src:"/logo.png",alt:"".concat(u," Logo"),className:"w-8 h-8 object-contain"}),(0,s.jsx)("span",{className:"text-xl sm:text-2xl font-bold text-white",children:u})]}),(0,s.jsxs)("div",{className:"hidden md:flex items-center gap-4",children:[(0,s.jsxs)(o.rU,{href:"/hot-games",className:"flex items-center gap-1 text-white/80 hover:text-white transition",children:[(0,s.jsx)(c.NcA,{className:"text-orange-500"}),(0,s.jsx)("span",{children:t("hotGames")})]}),(0,s.jsxs)(o.rU,{href:"/new-games",className:"flex items-center gap-1 text-white/80 hover:text-white transition",children:[(0,s.jsx)(c.iVx,{className:"text-green-500"}),(0,s.jsx)("span",{children:t("newGames")})]}),(0,s.jsxs)(o.rU,{href:"/all-categories",className:"flex items-center gap-1 text-white/80 hover:text-white transition",children:[(0,s.jsx)(c.uOL,{className:"text-purple-500"}),(0,s.jsx)("span",{children:t("allCategories")})]}),(0,s.jsxs)(o.rU,{href:"/all-games",className:"flex items-center gap-1 text-white/80 hover:text-white transition",children:[(0,s.jsx)(c.MJA,{className:"text-blue-500"}),(0,s.jsx)("span",{children:t("allGames")})]}),(0,s.jsxs)(o.rU,{href:"/blog",className:"flex items-center gap-1 text-white/80 hover:text-white transition",children:[(0,s.jsx)(c.AeW,{className:"text-blue-500"}),(0,s.jsx)("span",{children:t("blog")})]}),x&&(0,s.jsxs)(o.rU,{href:"/klotski-solver",className:"flex items-center gap-1 text-white/80 hover:text-white transition",children:[(0,s.jsx)(c.Kc5,{className:"text-yellow-500"}),(0,s.jsx)("span",{children:t("klotskiSolver")})]})]})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2 ml-auto px-3 md:px-6",children:[(0,s.jsxs)("div",{ref:k,className:"relative w-32 xs:w-40 sm:w-60 md:w-72 lg:w-80",children:[(0,s.jsx)("input",{type:"text",placeholder:t("searchGames"),className:"w-full pl-8 pr-3 py-1.5 text-sm rounded-full bg-white/10 text-white placeholder-white/70 backdrop-blur-lg border border-transparent focus:border-white/30 focus:outline-none transition-all",value:P,onChange:e=>T(e.target.value),onClick:()=>P.trim()&&z(!0)}),(0,s.jsx)("div",{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-white/70 text-xs",children:U?(0,s.jsx)("div",{className:"w-3 h-3 border-2 border-white/20 border-t-white/70 rounded-full animate-spin"}):(0,s.jsx)(c.U41,{})}),S&&O.length>0&&P&&(0,s.jsx)("div",{className:"absolute top-full left-0 right-0 mt-2 bg-black/90 backdrop-blur-xl rounded-xl border border-white/10 shadow-xl max-h-[60vh] overflow-y-auto z-50",onWheel:_,onTouchMove:_,children:(0,s.jsx)("div",{className:"p-2 space-y-1",children:O.map(e=>(0,s.jsx)(m,{game:e,onClick:A,locale:r},e.id))})})]}),(0,s.jsxs)("div",{className:"hidden md:block relative",ref:y,children:[(0,s.jsxs)("button",{onClick:()=>j(!w),className:"flex items-center gap-2 px-3 py-1.5 rounded text-sm transition bg-white/10 hover:bg-white/20 text-white border border-white/20",children:[(0,s.jsx)(c.ssk,{className:"text-sm"}),(0,s.jsx)("span",{children:h.zX[r]||r.toUpperCase()}),(0,s.jsx)(c.RiI,{className:"text-xs transition-transform ".concat(w?"rotate-180":"")})]}),w&&(0,s.jsx)("div",{className:"absolute top-full right-0 mt-2 bg-black/95 backdrop-blur-xl rounded-lg border border-white/20 shadow-xl min-w-[160px] z-50 overflow-hidden",children:(0,s.jsx)("div",{className:"py-1",children:h.k1.map(e=>(0,s.jsx)("button",{onClick:()=>M(e),className:"w-full text-left px-4 py-2 text-sm transition ".concat(r===e?"bg-white/20 text-white":"text-white/70 hover:text-white hover:bg-white/10"),children:h.zX[e]||e.toUpperCase()},e))})})]}),(0,s.jsx)("button",{ref:N,className:"md:hidden flex items-center justify-center w-10 h-10 text-white",onClick:()=>{b(!g)},children:(0,s.jsx)(c.Fm7,{className:"text-lg"})})]})]}),g&&(0,s.jsx)("div",{className:"md:hidden fixed inset-0 bg-black/95 z-40 pt-6 px-6",onClick:()=>b(!1),children:(0,s.jsx)("div",{ref:v,onClick:e=>{e.stopPropagation()}
1,className:"bg-black/90 rounded-2xl p-4 max-w-md ml-0 mr-auto",children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsxs)(o.rU,{href:"/",className:"flex items-center gap-3 text-white/90 hover:text-white transition p-3 mb-2 border-b border-white/10 bg-white/5 rounded-t-xl",onClick:()=>b(!1),children:[(0,s.jsx)(c.xng,{className:"text-white text-xl"}),(0,s.jsx)("span",{className:"text-lg font-medium",children:t("backToHome")})]}),(0,s.jsxs)(o.rU,{href:"/hot-games",className:"flex items-center gap-3 text-white/80 hover:text-white transition p-3 border-b border-white/10",onClick:()=>b(!1),children:[(0,s.jsx)(c.NcA,{className:"text-orange-500 text-xl"}),(0,s.jsx)("span",{className:"text-lg",children:t("hotGames")})]}),(0,s.jsxs)(o.rU,{href:"/new-games",className:"flex items-center gap-3 text-white/80 hover:text-white transition p-3 border-b border-white/10",onClick:()=>b(!1),children:[(0,s.jsx)(c.iVx,{className:"text-green-500 text-xl"}),(0,s.jsx)("span",{className:"text-lg",children:t("newGames")})]}),(0,s.jsxs)(o.rU,{href:"/all-categories",className:"flex items-center gap-3 text-white/80 hover:text-white transition p-3 border-b border-white/10",onClick:()=>b(!1),children:[(0,s.jsx)(c.uOL,{className:"text-purple-500 text-xl"}),(0,s.jsx)("span",{className:"text-lg",children:t("allCategories")})]}),(0,s.jsxs)(o.rU,{href:"/all-games",className:"flex items-center gap-3 text-white/80 hover:text-white transition p-3 border-b border-white/10",onClick:()=>b(!1),children:[(0,s.jsx)(c.MJA,{className:"text-blue-500 text-xl"}),(0,s.jsx)("span",{className:"text-lg",children:t("allGames")})]}),(0,s.jsxs)(o.rU,{href:"/blog",className:"flex items-center gap-3 text-white/80 hover:text-white transition p-3 border-b border-white/10",onClick:()=>b(!1),children:[(0,s.jsx)(c.AeW,{className:"text-blue-500 text-xl"}),(0,s.jsx)("span",{className:"text-lg",children:t("blog")})]}),x&&(0,s.jsxs)(o.rU,{href:"/klotski-solver",className:"flex items-center gap-3 text-white/80 hover:text-white transition p-3 border-b border-white/10",onClick:()=>b(!1),children:[(0,s.jsx)(c.Kc5,{className:"text-yellow-500 text-xl"}),(0,s.jsx)("span",{className:"text-lg",children:t("klotskiSolver")})]}),(0,s.jsxs)("div",{className:"p-3 border-t border-white/10 mt-2",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,s.jsx)(c.ssk,{className:"text-white/70"}),(0,s.jsx)("span",{className:"text-white/70 text-sm",children:"Language"})]}),(0,s.jsx)("select",{value:r,onChange:e=>M(e.target.value),className:"w-full px-3 py-2 rounded text-sm bg-white/10 text-white border border-white/20 focus:outline-none focus:border-white/40 appearance-none cursor-pointer",style:{backgroundImage:"url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23ffffff' d='M6 9L1 4h10z'/%3E%3C/svg%3E\")",backgroundRepeat:"no-repeat",backgroundPosition:"right 0.75rem center",paddingRight:"2.5rem"},children:h.k1.map(e=>(0,s.jsx)("option",{value:e,style:{backgroundColor:"#000",color:"#fff"},children:h.zX[e]||e.toUpperCase()},e))})]})]})})})]})}},66448:function(e,t,r){"use strict";r.d(t,{default:function(){return a}});var s=r(75182),n=r(83890);function a(e){let{locale:t,...r}=e;if(!t)throw Error(void 0);return(0,n.jsx)(s.Pj,{locale:t,...r})}},19897:function(e,t,r){"use strict";r.d(t,{w_:function(){return h}});var s=r(58496),n={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},a=s.createContext&&s.createContext(n),l=["attr","size","title"];function i(){return(i=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];
1for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(e[s]=r[s])}return e}).apply(this,arguments)}function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,s)}return r}function c(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?o(Object(r),!0).forEach(function(t){var s,n;s=t,n=r[t],(s=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var s=r.call(e,t||"default");if("object"!=typeof s)return s;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(s))in e?Object.defineProperty(e,s,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[s]=n}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function h(e){return t=>s.createElement(u,i({attr:c({},e.attr)},t),function e(t){return t&&t.map((t,r)=>s.createElement(t.tag,c({key:r},t.attr),e(t.child)))}(e.child))}function u(e){var t=t=>{var r,{attr:n,size:a,title:o}=e,h=function(e,t){if(null==e)return{};var r,s,n=function(e,t){if(null==e)return{};var r={};for(var s in e)if(Object.prototype.hasOwnProperty.call(e,s)){if(t.indexOf(s)>=0)continue;r[s]=e[s]}return r}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s<a.length;s++)r=a[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}(e,l),u=a||t.size||"1em";return t.className&&(r=t.className),e.className&&(r=(r?r+" ":"")+e.className),s.createElement("svg",i({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},t.attr,n,h,{className:r,style:c(c({color:e.color||t.color},t.style),e.style),height:u,width:u,xmlns:"http://www.w3.org/2000/svg"}),o&&s.createElement("title",null,o),e.children)};return void 0!==a?s.createElement(a.Consumer,null,e=>t(e)):t(n)}}},function(e){e.O(0,[8014,9498,1018,9649,2945,1744],function(){return e(e.s=75615)}),_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.