(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[974],{1469:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{default:function(){return i},getImageProps:function(){return o}});let l=r(8229),s=r(8883),n=r(3063),a=l._(r(1193));function o(e){let{props:t}=(0,s.getImgProps)(e,{defaultLoader:a.default,imgConf:{deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[16,32,48,64,96,128,256,384],path:"/_next/image/",loader:"default",dangerouslyAllowSVG:!1,unoptimized:!0}});for(let[e,r]of Object.entries(t))void 0===r&&delete t[e];return{props:t}}let i=n.Image},2584:(e,t,r)=>{"use strict";r.d(t,{MemeApp:()=>S});var l=r(5155),s=r(2115),n=r(6874),a=r.n(n),o=r(1906),i=r(6104);let c=async e=>{let t=await i.oV;t&&e&&(0,o.$s)(t,"search",{search_term:e})},d=e=>{let{searchQuery:t,onSearchChange:r}=e,[n,a]=(0,s.useState)(t),o=(0,s.useRef)(null);(0,s.useEffect)(()=>{a(t)},[t]),(0,s.useEffect)(()=>()=>{o.current&&clearTimeout(o.current)},[]);let i=e=>{r(e),e&&c(e)};return(0,l.jsx)("div",{className:"w-full",children:(0,l.jsx)("form",{onSubmit:e=>{e.preventDefault(),o.current&&(clearTimeout(o.current),o.current=null),i(n)},className:"relative",children:(0,l.jsxs)("div",{className:"relative",children:[(0,l.jsx)("input",{type:"text",value:n,onChange:e=>{let t=e.target.value;a(t),o.current&&clearTimeout(o.current),o.current=setTimeout(()=>{i(t),o.current=null},1e3)},className:"w-full px-3 py-1.5 pr-16 text-sm border-none rounded-full bg-white text-black shadow-sm focus:outline-none focus:ring-1 focus:ring-blue-200 transition-all duration-200"}),n&&(0,l.jsx)("button",{type:"button",onClick:()=>{a(""),o.current&&(clearTimeout(o.current),o.current=null),r("")},className:"absolute right-10 top-1/2 transform -translate-y-1/2 text-gray-400 hover:text-gray-600 transition-colors duration-200",children:(0,l.jsx)("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})}),(0,l.jsx)("button",{type:"submit",className:"absolute right-1 top-1/2 transform -translate-y-1/2 bg-gradient-to-r from-red-500 to-red-600 text-white rounded-full w-6 h-6 flex items-center justify-center hover:from-red-600 hover:to-red-700 transition-all duration-200 shadow-sm",children:(0,l.jsx)("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",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"})})})]})})})},u=e=>{let{label:t,isSelected:r,onClick:s}=e;return(0,l.jsx)("button",{className:"px-3 py-1 rounded-full text-xs font-medium transition-all duration-200 ".concat(r?"bg-gray-700 text-white shadow-sm border border-gray-700":"bg-white bg-opacity-90 text-gray-700 border border-gray-200 hover:bg-white hover:shadow-sm"),onClick:s,children:t})},h=e=>{let{filters:t,onFiltersChange:r}=e,s=e=>{r({...t,year:e})},n=e=>{r({...t,category:e})},a=e=>{r({...t,source:e})};return(0,l.jsxs)("div",{className:"flex flex-col gap-2 text-xs",children:[(0,l.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[(0,l.jsx)("span",{className:"text-blue-100 font-medium whitespace-nowrap",children:"年代:"}),(0,l.jsx)(u,{label:"全て",isSelected:!t.year||"all"===t.year,onClick:()=>s("all")}),(0,l.jsx)(u,{label:"2026",isSelected:"2026"===t.year,onClick:()=>s("2026")}),(0,l.jsx)(u,{label:"2025",isSelected:"2025"===t.year,onClick:()=>s("2025")}),(0,l.jsx)(u,{label:"2024",isSelected:"2024"===t.year,onClick:()=>s("2024")}),(0,l.jsx)(u,{label:"2023",isSelected:"2023"===t.year,onClick:()=>s("2023")}),(0,l.jsx)(u,{label:"2022",isSelected:"2022"===t.year,onClick:()=>s("2022")}),(0,l.jsx)(u,{label:"2021",isSelected:"2021"===t.year,onClick:()=>s("2021")}),(0,l.jsx)(u,{label:"2020",isSelected:"2020"===t.year,onClick:()=>s("2020")}),(0,l.jsx)(u,{label:"2015~2019",isSelected:"2015-2019"===t.year,onClick:()=>s("2015-2019")}),(0,l.jsx)(u,{label:"2010~2014",isSelected:"2010-2014"===t.year,onClick:()=>s("2010-2014")}),(0,l.jsx)(u,{label:"~2009",isSelected:"unknown"===t.year,onClick:()=>s("unknown")})]}),(0,l.jsxs)("div",{className:"flex flex-col md:flex-row md:items-center gap-2 md:gap-3",children:[(0,l.jsxs)("div",{className:"flex flex-wrap items-center gap-1",children:[(0,l.jsx)("span",{className:"text-blue-100 font-medium whitespace-nowrap",children:"カテゴリ:"}),(0,l.jsx)(u,{label:"全て",isSelected:!t.category||"all"===t.category,onClick:()=>n("all")}),(0,l.jsx)(u,{label:"Twitter",isSelected:"twitter"===t.category,onClick:()=>n("twitter")}),(0,l.jsx)(u,{label:"ネット",isSelected:"net"===t.category,onClick:()=>n("net")}),(0,l.jsx)(u,{label:"アニメ",isSelected:"anime"===t.category,onClick:()=>n("anime")}),(0,l.jsx)(u,{label:"漫画",isSelected:"manga"===t.category,onClick:()=>n("manga")}),(0,l.jsx)(u,{label:"ゲーム",isSelected:"game"===t.category,onClick:()=>n("game")}),(0,l.jsx)(u,{label:"テレビ",isSelected:"tv"===t.category,onClick:()=>n("tv")})]}),(0,l.jsxs)("div",{className:"flex flex-wrap items-center gap-1",children:[(0,l.jsx)("span",{className:"text-blue-100 font-medium whitespace-nowrap",children:"元ネタ:"}),(0,l.jsx)(u,{label:"全て",isSelected:!t.source||"all"===t.source,onClick:()=>a("all")}),(0,l.jsx)(u,{label:"ネット",isSelected:"net"===t.source,onClick:()=>a("net")}),(0,l.jsx)(u,{label:"テレビ",isSelected:"tv"===t.source,onClick:()=>a("tv")}),(0,l.jsx)(u,{label:"本",isSelected:"book"===t.source,onClick:()=>a("book")})]})]})]})},m=e=>{let{filters:t,onFiltersChange:r}=e;return(0,l.jsx)("div",{className:"flex flex-col gap-2",children:(0,l.jsxs)("div",{className:"grid grid-cols-3 gap-2",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("label",{className:"block text-xs text-blue-100 font-medium mb-1",children:"年代"}),(0,l.jsxs)("select",{value:t.year||"all",onChange:e=>(e=>{r({...t,year:"all"===e?"all":e})})(e.target.value),className:"w-full px-2 py-1 text-xs rounded border border-gray-300 bg-white text-gray-700 focus:ring-2 focus:ring-blue-500 focus:border-blue-500",children:[(0,l.jsx)("option",{value:"all",children:"全て"}),(0,l.jsx)("option",{value:"2025",children:"2025"}),(0,l.jsx)("option",{value:"2024",children:"2024"}),(0,l.jsx)("option",{value:"2023",children:"2023"}),(0,l.jsx)("option",{value:"2022",children:"2022"}),(0,l.jsx)("option",{value:"2021",children:"2021"}),(0,l.jsx)("option",{value:"2020",children:"2020"}),(0,l.jsx)("option",{value:"2015-2019",children:"2015~2019"}),(0,l.jsx)("option",{value:"2010-2014",children:"2010~2014"}),(0,l.jsx)("option",{value:"unknown",children:"~2009"})]})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)("label",{className:"block text-xs text-blue-100 font-medium mb-1",children:"カテゴリ"}),(0,l.jsxs)("select",{value:t.category||"all",onChange:e=>(e=>{r({...t,category:"all"===e?"all":e})})(e.target.value),className:"w-full px-2 py-1 text-xs rounded border border-gray-300 bg-white text-gray-700 focus:ring-2 focus:ring-blue-500 focus:border-blue-500",children:[(0,l.jsx)("option",{value:"all",children:"全て"}),(0,l.jsx)("option",{value:"twitter",children:"Twitter"}),(0,l.jsx)("option",{value:"net",children:"ネット"}),(0,l.jsx)("option",{value:"anime",children:"アニメ"}),(0,l.jsx)("option",{value:"manga",children:"漫画"}),(0,l.jsx)("option",{value:"game",children:"ゲーム"}),(0,l.jsx)("option",{value:"tv",children:"テレビ"})]})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)("label",{className:"block text-xs text-blue-100 font-medium mb-1",children:"元ネタ"}),(0,l.jsxs)("select",{value:t.source||"all",onChange:e=>(e=>{r({...t,source:"all"===e?"all":e})})(e.target.value),className:"w-full px-2 py-1 text-xs rounded border border-gray-300 bg-white text-gray-700 focus:ring-2 focus:ring-blue-500 focus:border-blue-500",children:[(0,l.jsx)("option",{value:"all",children:"全て"}),(0,l.jsx)("option",{value:"net",children:"ネット"}),(0,l.jsx)("option",{value:"tv",children:"テレビ"}),(0,l.jsx)("option",{value:"book",children:"本"})]})]})]})})},x=()=>(0,l.jsx)("button",{onClick:()=>{let e="https://twitter.com/intent/tweet?hashtags=".concat(encodeURIComponent("ネットミームの森"),"&url=").concat(encodeURIComponent("https://netmeme.genshun9.com"));window.open(e,"_blank","noopener,noreferrer")},className:"p-2 bg-white rounded-full hover:bg-gray-100 transition-colors duration-200 shadow-md",title:"Xでシェアする",children:(0,l.jsx)("svg",{className:"w-5 h-5 text-black",viewBox:"0 0 24 24",fill:"currentColor",children:(0,l.jsx)("path",{d:"M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"})})}),p=e=>{let{filters:t,onFiltersChange:r,isVisible:s,isMobile:n}=e,o=e=>{r({...t,searchQuery:e})},i=()=>{r({year:"all",category:"all",source:"all",searchQuery:""})};return""!==t.searchQuery||"all"!==t.year||"all"!==t.category||t.source,(0,l.jsx)("header",{className:"\n        ".concat(n?"fixed":"sticky"," top-0 left-0 right-0 z-50\n        bg-blue-600 backdrop-blur-lg border-b border-white border-opacity-20\n        ").concat(n?"transition-transform duration-300 ease-in-out":"","\n        ").concat(n&&s?"translate-y-0":"","\n        ").concat(n&&!s?"-translate-y-full":"","\n      "),children:(0,l.jsxs)("div",{className:"max-w-7xl mx-auto px-4 py-3",children:[(0,l.jsxs)("div",{className:"flex flex-col gap-3 md:hidden",children:[(0,l.jsxs)("div",{className:"flex justify-between items-center",children:[(0,l.jsxs)("div",{className:"flex items-baseline gap-3",children:[(0,l.jsx)(a(),{href:"/",className:"text-lg font-bold text-white",children:"ネットミームの森"}),(0,l.jsx)(a(),{href:"/about",className:"text-xs text-white/80 hover:text-white underline-offset-2 hover:underline whitespace-nowrap",children:"このサイトについて"})]}),(0,l.jsx)(x,{})]}),(0,l.jsx)("div",{children:(0,l.jsx)(d,{searchQuery:t.searchQuery,onSearchChange:o})}),(0,l.jsx)("div",{children:(0,l.jsx)(m,{filters:t,onFiltersChange:r})}),(0,l.jsx)("div",{className:"flex justify-center",children:(0,l.jsxs)("button",{onClick:i,className:"px-4 py-2 bg-gray-600 text-white text-sm rounded-md hover:bg-gray-700 transition-colors duration-200 flex items-center gap-2",children:[(0,l.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),"フィルターをリセット"]})})]}),(0,l.jsxs)("div",{className:"hidden md:flex md:items-start md:justify-between gap-6",children:[(0,l.jsxs)("div",{className:"flex flex-col gap-3 flex-1 max-w-xs",children:[(0,l.jsxs)("div",{className:"flex justify-between items-center",children:[(0,l.jsxs)("div",{className:"flex items-baseline gap-3",children:[(0,l.jsx)(a(),{href:"/",className:"text-xl font-bold text-white",children:"ネットミームの森"}),(0,l.jsx)(a(),{href:"/about",className:"text-xs text-white/80 hover:text-white underline-offset-2 hover:underline whitespace-nowrap",children:"このサイトについて"})]}),(0,l.jsx)(x,{})]}),(0,l.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,l.jsx)("div",{className:"flex-1 min-w-0",children:(0,l.jsx)(d,{searchQuery:t.searchQuery,onSearchChange:o})}),(0,l.jsxs)("button",{onClick:i,className:"px-2 py-1.5 bg-gray-600 text-white text-xs rounded-full hover:bg-gray-700 transition-colors duration-200 flex items-center gap-1 whitespace-nowrap flex-shrink-0",title:"フィルターをリセット",children:[(0,l.jsx)("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),"リセット"]})]})]}),(0,l.jsx)("div",{className:"flex-1",children:(0,l.jsx)(h,{filters:t,onFiltersChange:r})})]})]})})};var g=r(1469),f=r.n(g);let b=e=>{if(e.startsWith("2026_"))return"/images/2026/".concat(e,".jpg");if(e.startsWith("2025_"))return"/images/2025/".concat(e,".jpg");if(e.startsWith("2024_"))return"/images/2024/".concat(e,".jpg");if(e.startsWith("2023_"))return"/images/2023/".concat(e,".jpg");if(e.startsWith("2022_"))return"/images/2022/".concat(e,".jpg");else if(e.startsWith("2021_"))return"/images/2021/".concat(e,".jpg");else if(e.startsWith("2020_"))return"/images/2020/".concat(e,".jpg");else if(e.startsWith("2019_"))return"/images/2019/".concat(e,".jpg");else if(e.startsWith("2018_"))return"/images/2018/".concat(e,".jpg");else if(e.startsWith("2017_"))return"/images/2017/".concat(e,".jpg");else if(e.startsWith("2016_"))return"/images/2016/".concat(e,".jpg");else if(e.startsWith("2015_"))return"/images/2015/".concat(e,".jpg");else if(e.startsWith("2014_"))return"/images/2014/".concat(e,".jpg");else if(e.startsWith("2013_"))return"/images/2013/".concat(e,".jpg");else if(e.startsWith("2012_"))return"/images/2012/".concat(e,".jpg");else if(e.startsWith("2011_"))return"/images/2011/".concat(e,".jpg");else if(e.startsWith("2010_"))return"/images/2010/".concat(e,".jpg");else if(e.startsWith("old_"))return"/images/old/".concat(e,".jpg");else return"/images/old/".concat(e,".jpg")},j=e=>{let{meme:t,onClick:r,priority:s}=e;return(0,l.jsx)("div",{className:"relative rounded-2xl overflow-hidden shadow-lg hover:shadow-xl transition-all duration-300 hover:-translate-y-1 cursor-pointer break-inside-avoid mb-6 group",onClick:()=>{r(t)},children:(0,l.jsxs)("div",{className:"relative bg-gray-100",children:[(0,l.jsx)(f(),{src:b(t.id),alt:[t.title,...t.tags,...t.kw].filter(Boolean).join(" - "),width:400,height:300,className:"w-full h-auto object-cover",priority:s}),(0,l.jsx)("div",{className:"absolute inset-0 bg-gradient-to-t from-black/70 via-transparent to-transparent opacity-0 group-hover:opacity-100 transition-opacity duration-300",children:(0,l.jsxs)("div",{className:"absolute bottom-0 left-0 right-0 p-4 text-white",children:[(0,l.jsx)("h3",{className:"font-semibold text-sm leading-tight mb-2 drop-shadow-lg",children:t.title}),t.tags.length>0&&(0,l.jsxs)("div",{className:"flex flex-wrap gap-1",children:[t.tags.slice(0,3).map((e,t)=>(0,l.jsx)("span",{className:"px-2 py-0.5 bg-white/20 backdrop-blur-sm text-white rounded-md text-xs font-medium border border-white/30",children:e},"".concat(e,"-").concat(t))),t.tags.length>3&&(0,l.jsxs)("span",{className:"px-2 py-0.5 bg-white/20 backdrop-blur-sm text-white rounded-md text-xs font-medium border border-white/30",children:["+",t.tags.length-3]})]})]})})]})})};function v(){return(v=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var l in r)Object.prototype.hasOwnProperty.call(r,l)&&(e[l]=r[l])}return e}).apply(this,arguments)}function w(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);t&&(l=l.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,l)}return r}function y(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?w(Object(r),!0).forEach(function(t){var l,s,n;l=e,s=t,n=r[t],s in l?Object.defineProperty(l,s,{value:n,enumerable:!0,configurable:!0,writable:!0}):l[s]=n}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):w(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}class C extends s.Component{constructor(e){let t;super(e),this.reCalculateColumnCount=this.reCalculateColumnCount.bind(this),this.reCalculateColumnCountDebounce=this.reCalculateColumnCountDebounce.bind(this),t=this.props.breakpointCols&&this.props.breakpointCols.default?this.props.breakpointCols.default:parseInt(this.props.breakpointCols)||2,this.state={columnCount:t}}componentDidMount(){this.reCalculateColumnCount(),window&&window.addEventListener("resize",this.reCalculateColumnCountDebounce)}componentDidUpdate(){this.reCalculateColumnCount()}componentWillUnmount(){window&&window.removeEventListener("resize",this.reCalculateColumnCountDebounce)}reCalculateColumnCountDebounce(){if(!window||!window.requestAnimationFrame)return void this.reCalculateColumnCount();window.cancelAnimationFrame&&window.cancelAnimationFrame(this._lastRecalculateAnimationFrame),this._lastRecalculateAnimationFrame=window.requestAnimationFrame(()=>{this.reCalculateColumnCount()})}reCalculateColumnCount(){let e=window&&window.innerWidth||1/0,t=this.props.breakpointCols;"object"!=typeof t&&(t={default:parseInt(t)||2});let r=1/0,l=t.default||2;for(let s in t){let n=parseInt(s);n>0&&e<=n&&n<r&&(r=n,l=t[s])}l=Math.max(1,parseInt(l)||1),this.state.columnCount!==l&&this.setState({columnCount:l})}itemsInColumns(){let e=this.state.columnCount,t=Array(e),r=s.Children.toArray(this.props.children);for(let l=0;l<r.length;l++){let s=l%e;t[s]||(t[s]=[]),t[s].push(r[l])}return t}renderColumns(){let{column:e,columnAttrs:t={},columnClassName:r}=this.props,l=this.itemsInColumns(),n=`${100/l.length}%`,a=r;a&&"string"!=typeof a&&(this.logDeprecated('The property "columnClassName" requires a string'),void 0===a&&(a="my-masonry-grid_column"));let o=y(y(y({},e),t),{},{style:y(y({},t.style),{},{width:n}),className:a});return l.map((e,t)=>s.createElement("div",v({},o,{key:t}),e))}logDeprecated(e){console.error("[Masonry]",e)}render(){let e=this.props,{children:t,breakpointCols:r,columnClassName:l,columnAttrs:n,column:a,className:o}=e,i=function(e,t){if(null==e)return{};var r,l,s=function(e,t){if(null==e)return{};var r,l,s={},n=Object.keys(e);for(l=0;l<n.length;l++)r=n[l],t.indexOf(r)>=0||(s[r]=e[r]);return s}(e,t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(l=0;l<n.length;l++)r=n[l],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}(e,["children","breakpointCols","columnClassName","columnAttrs","column","className"]),c=o;return"string"!=typeof o&&(this.logDeprecated('The property "className" requires a string'),void 0===o&&(c="my-masonry-grid")),s.createElement("div",v({},i,{className:c}),this.renderColumns())}}C.defaultProps={breakpointCols:void 0,className:void 0,columnClassName:void 0,children:void 0,columnAttrs:void 0,column:void 0};let k=e=>{let{memes:t,onMemeClick:r}=e,s=e=>{r(e)};return(0,l.jsx)("div",{className:"max-w-7xl mx-auto px-5 py-2",children:(0,l.jsx)(C,{breakpointCols:{default:5,1280:4,1024:3,768:2,640:2},className:"flex -ml-6 w-auto",columnClassName:"pl-6 bg-clip-padding",children:t.map((e,t)=>(0,l.jsx)(j,{meme:e,onClick:s,priority:t<6},e.id))})})},N=e=>{let{meme:t,isOpen:r,onClose:n}=e;(0,s.useEffect)(()=>{let e=e=>{"Escape"===e.key&&n()};return r?(document.addEventListener("keydown",e),document.body.style.overflow="hidden"):document.body.style.overflow="unset",()=>{document.removeEventListener("keydown",e),document.body.style.overflow="unset"}},[r,n]);let[o,i]=(0,s.useState)(!1);if(!r||!t)return null;let c=(e=>"/memes/".concat((e=>"unknown"===e?"old":e)(e.year),"/").concat(e.slug,"/"))(t),d=async()=>{let e="https://netmeme.genshun9.com".concat(c);await navigator.clipboard.writeText(e),i(!0),setTimeout(()=>i(!1),2e3)};return(0,l.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-gray-600/70 pt-24 md:pt-0",onClick:e=>{e.target===e.currentTarget&&n()},children:[(0,l.jsx)("button",{onClick:n,className:"absolute top-4 right-4 z-10 w-8 h-8 bg-gray-800 hover:bg-gray-700 text-white rounded-full flex items-center justify-center transition-colors duration-200","aria-label":"閉じる",children:(0,l.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})}),(0,l.jsxs)("div",{className:"flex flex-col items-center gap-4",children:[(0,l.jsx)("div",{className:"relative max-w-[90vw] max-h-[75vh] rounded-lg overflow-hidden shadow-xl",children:(0,l.jsx)(f(),{src:b(t.id),alt:t.title,width:800,height:600,className:"max-w-full max-h-[75vh] object-contain",style:{width:"auto",height:"auto"},priority:!0})}),(0,l.jsxs)("div",{className:"flex gap-3",children:[(0,l.jsxs)(a(),{href:c,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white rounded-full text-sm font-medium transition-colors duration-200 shadow-lg",onClick:e=>e.stopPropagation(),children:[(0,l.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),"詳細を見る"]}),(0,l.jsxs)("button",{onClick:e=>{e.stopPropagation(),d()},className:"flex items-center gap-2 px-4 py-2 bg-green-600 hover:bg-green-700 text-white rounded-full text-sm font-medium transition-colors duration-200 shadow-lg","aria-label":"URLをコピー",children:[(0,l.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:o?(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"}):(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 5H6a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2v-1M8 5a2 2 0 002 2h2a2 2 0 002-2M8 5a2 2 0 012-2h2a2 2 0 012 2m0 0h2a2 2 0 012 2v3m2 4H10m0 0l3-3m-3 3l3 3"})}),o?"コピーしました！":"URLをコピー"]}),(0,l.jsxs)("button",{onClick:e=>{e.stopPropagation(),(()=>{let e="https://netmeme.genshun9.com".concat(c),r="".concat(t.title," - #ネットミームの森"),l="https://twitter.com/intent/tweet?text=".concat(encodeURIComponent(r),"&url=").concat(encodeURIComponent(e));window.open(l,"_blank","noopener,noreferrer")})()},className:"flex items-center gap-2 px-4 py-2 bg-gray-800 hover:bg-gray-900 text-white rounded-full text-sm font-medium transition-colors duration-200 shadow-lg","aria-label":"Xでシェアする",children:[(0,l.jsx)("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"currentColor",children:(0,l.jsx)("path",{d:"M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"})}),"シェア"]})]})]})]})},S=e=>{let{initialMemes:t}=e,[r,n]=(0,s.useState)(t);(0,s.useEffect)(()=>{n((e=>{let t=[...e];for(let e=t.length-1;e>0;e--){let r=Math.floor(Math.random()*(e+1));[t[e],t[r]]=[t[r],t[e]]}return t})(t))},[t]);let[a,o]=(0,s.useState)({year:"all",category:"all",source:"all",searchQuery:""}),[i,c]=(0,s.useState)(30),[d,u]=(0,s.useState)(!1),[h,m]=(0,s.useState)(null),[x,g]=(0,s.useState)(!1),[f,b]=(0,s.useState)(!0),[j,v]=(0,s.useState)(0),[w,y]=(0,s.useState)(null),[C,S]=(0,s.useState)(!1),L=(0,s.useMemo)(()=>r.filter(e=>{let t=((e,t)=>!t||"all"===t||("2015-2019"===t?["2015","2016","2017","2018","2019"].includes(e):"2010-2014"===t?["2010","2011","2012","2013","2014"].includes(e):e===t))(e.year,a.year),r=!a.category||"all"===a.category||e.category===a.category,l=!a.source||"all"===a.source||e.source===a.source,s=""===a.searchQuery||(()=>{let t=a.searchQuery.toLowerCase().trim().split(/\s+/),r=e.kw?e.kw.join(" "):"",l="".concat(e.title," ").concat(e.tags.join(" ")," ").concat(r).toLowerCase();return t.every(e=>l.includes(e))})();return t&&r&&l&&s}),[r,a]),_=(0,s.useMemo)(()=>L.slice(0,i),[L,i]),O=(0,s.useCallback)(()=>{if(d||_.length>=L.length)return;let e=document.documentElement.scrollTop,t=document.documentElement.scrollHeight;e+document.documentElement.clientHeight>=t-1e3&&(u(!0),setTimeout(()=>{c(e=>e+30),u(!1)},500))},[d,_.length,L.length,30]),W=(0,s.useCallback)(()=>{if(!C)return void b(!0);let e=window.scrollY;if(e<=0){b(!0),v(e);return}100>Math.abs(e-j)||(e>j&&e>200?b(!1):e<j&&b(!0),v(e),w&&clearTimeout(w),y(setTimeout(()=>{b(!0)},1e3)))},[j,w,C]);return(0,s.useEffect)(()=>{let e=()=>{O(),W()};return window.addEventListener("scroll",e,{passive:!0}),()=>{window.removeEventListener("scroll",e),w&&clearTimeout(w)}},[O,W,w]),(0,s.useEffect)(()=>{let e=()=>{S(window.innerWidth<768)};return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]),(0,s.useEffect)(()=>{c(30)},[a]),(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(p,{filters:a,onFiltersChange:e=>{o(e),window.scrollTo({top:0,behavior:"smooth"})},isVisible:f,isMobile:C}),(0,l.jsxs)("main",{className:"container mx-auto px-4 py-2 pt-50 md:pt-0",children:[(0,l.jsx)(k,{memes:_,onMemeClick:e=>{m(e),g(!0)}}),d&&(0,l.jsx)("div",{className:"flex justify-center py-8",children:(0,l.jsx)("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-gray-900"})}),!d&&_.length>=L.length&&L.length>30&&(0,l.jsxs)("div",{className:"text-center py-8 text-gray-500",children:["全ての画像を表示しました (",L.length,"件)"]}),0===L.length&&(0,l.jsxs)("div",{className:"text-center py-12",children:[(0,l.jsx)("div",{className:"text-6xl mb-4",children:"\uD83D\uDD0D"}),(0,l.jsx)("p",{className:"text-gray-500",children:"見つかりませんでした。"}),(0,l.jsx)("p",{className:"text-gray-400 text-sm mt-2",children:"検索条件やフィルターを変更してお試しください"})]})]}),(0,l.jsx)(N,{meme:h,isOpen:x,onClose:()=>{g(!1),m(null)}})]})}},5884:(e,t,r)=>{Promise.resolve().then(r.bind(r,2584))},6104:(e,t,r)=>{"use strict";r.d(t,{oV:()=>a});var l=r(3915),s=r(1906);let n=(0,l.Wp)({apiKey:"AIzaSyAdhSnRdLRul_3DLui_DjcOPNBS1-DSs8c",authDomain:"agido-the-ancient-sentinel.firebaseapp.com",projectId:"agido-the-ancient-sentinel",storageBucket:"agido-the-ancient-sentinel.firebasestorage.app",messagingSenderId:"679169694852",appId:"1:679169694852:web:c68c14f025b4613c3976d1",measurementId:"G-S4EX6TRKQE"}),a=(0,s.TT)().then(e=>{if(e)return(0,s.P5)(n)})}},e=>{e.O(0,[874,63,648,441,964,358],()=>e(e.s=5884)),_N_E=e.O()}]);