1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3454],{3454:(e,t,a)=>{a.r(t),a.d(t,{default:()=>f});var r=a(37876),l=a(27063),s=a(22507),n=a(95498),c=a(89852),i=a.n(c),o=a(88842),d=a.n(o),u=a(33035),x=a(89099),m=a(14232),h=a(29979);let g=[{key:"â â",action:"éæ©"},{key:"Enter",action:"跳转"},{key:"Esc",action:"å
³é"}];function f(e){let{cRef:t}=e,[a,n]=(0,m.useState)([]),[c,o]=(0,m.useState)(!1),[u,f]=(0,m.useState)(0),[v,y]=(0,m.useState)(null),[j,k]=(0,m.useState)(0),[N,w]=(0,m.useState)(0),[C,A]=(0,m.useState)(0),[_,I]=(0,m.useState)(0),[S,E]=(0,m.useState)(!1),[P,D]=(0,m.useState)(!1),F=(0,m.useRef)(null),L=(0,x.useRouter)();(0,h.vC)("ctrl+k",e=>{e.preventDefault(),o(!0)}),(0,h.vC)("down",e=>{P&&(e.preventDefault(),_<a.length-1&&I(_+1))},{enableOnFormTags:!0}),(0,h.vC)("up",e=>{P&&(e.preventDefault(),_>0&&I(_-1))},{enableOnFormTags:!0}),(0,h.vC)("esc",e=>{P&&(e.preventDefault(),o(!1))},{enableOnFormTags:!0}),(0,h.vC)("enter",e=>{P&&a.length>0&&O(T)},{enableOnFormTags:!0});let O=()=>{if(a.length>0){let e=a[_];window.location.href="".concat((0,s.CQ)("SUB_PATH",""),"/").concat(e.slug||e.objectID)}};(0,m.useEffect)(()=>{o(!1)},[L]),(0,m.useEffect)(()=>{c?setTimeout(()=>{var e;null==(e=F.current)||e.focus()},100):(I(0),y(""),n([]),A(0),k(0),w(0),F.current&&(F.current.value=""))},[c]),(0,m.useImperativeHandle)(t,()=>({openSearch:()=>{o(!0)}}));let T=i()((0,s.CQ)("ALGOLIA_APP_ID"),(0,s.CQ)("ALGOLIA_SEARCH_ONLY_APP_KEY")).initIndex((0,s.CQ)("ALGOLIA_INDEX")),R=async(e,t)=>{if(y(e),f(t),n([]),A(0),k(0),w(0),I(0),e&&""!==e){E(!0);try{let{hits:a,nbHits:r,nbPages:s,processingTimeMS:c}=await T.search(e,{page:t,hitsPerPage:10});A(c),k(s),w(r),n(a),E(!1);let i=document.getElementById("search-wrapper").getElementsByClassName("replace");setTimeout(()=>{(0,l.default)({doms:i,search:e,target:{element:"span",className:"font-bold border-b border-dashed"}})},200)}catch(e){console.error("Algolia search error:",e)}}},Q=(0,m.useRef)(d()(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;R(e,t)},1e3)),B=(0,m.useRef)(null),G=()=>{o(!1)};return(0,s.CQ)("ALGOLIA_APP_ID")?(0,r.jsxs)("div",{id:"search-wrapper",className:"".concat(c?"opacity-100":"invisible opacity-0 pointer-events-none"," z-30 fixed h-screen w-screen left-0 top-0 sm:mt-[10vh] flex items-start justify-center mt-0"),children:[(0,r.jsxs)("div",{className:"".concat(c?"opacity-100":"invisible opacity-0 translate-y-10"," max-h-[80vh] flex flex-col justify-between w-full min-h-[10rem] h-full md:h-fit max-w-xl dark:bg-hexo-black-gray dark:border-gray-800 bg-white dark:bg- p-5 rounded-lg z-50 shadow border hover:border-blue-600 duration-300 transition-all "),children:[(0,r.jsxs)("div",{className:"flex justify-between items-center",children:[(0,r.jsx)("div",{className:"text-2xl text-blue-600 dark:text-yellow-600 font-bold",children:"æç´¢"}),(0,r.jsx)("div",{children:(0,r.jsx)("i",{className:"text-gray-600 fa-solid fa-xmark p-1 cursor-pointer hover:text-blue-600",onClick:G})})]}),(0,r.jsx)("input",{type:"text",placeholder:"å¨è¿éè¾å
¥æç´¢å
³é®è¯...",onChange:e=>(e=>{let t=e.target.value;B.current&&clearTimeout(B.current),B.current=setTimeout(()=>{Q.current(t)},800)})(e),onFocus:()=>D(!0),onBlur:()=>D(!1),className:"text-black dark:text-gray-200 bg-gray-50 dark:bg-gray-600 outline-blue-500 w-full px-4 my-2 py-1 mb-4 border rounded-md",ref:F}),(0,r.jsx)("div",{className:"mb-4",children:(0,r.jsx)(p,{})}),0===a.length&&v&&!S&&(0,r.jsx)("div",{children:(0,r.jsxs)("p",{className:" text-slate-600 text-center my-4 text-base",children:[" ","æ æ³æ¾å°ç¸å
³ç»æ",(0,r.jsxs)("span",{className:"font-semibold",children:['"',v,'"']})]})}),(0,r.jsx)("ul",{className:"flex-1 overflow-auto",children:a.map((e,t)=>(0,r.jsx)("li",{onMouseEnter:()=>I(t),onClick:()=>O(t),className:"cursor-pointer replace my-2 p-2 duration-100 \n rounded-lg\n ".concat(_===t?"bg-blue-600 dark:bg-yellow-600":""),children:(0,r.jsx)("a",{className:"".concat(_===t?" text-white":" text-black dark:text-gray-300 "),children:e.title})},e.objectID))}),(0,r.jsx)(b,{totalPage:j,page:u,switchPage:e=>{Q.current(v,e)}}),(0,r.jsxs)("div",{className:"flex items-center justify-between mt-2 sm:text-sm text-xs dar
1k:text-gray-300",children:[0===N&&(0,r.jsx)("div",{className:"flex items-center",children:g.map((e,t)=>(0,r.jsxs)(m.Fragment,{children:[(0,r.jsx)("div",{className:"border-gray-300 dark:text-gray-300 text-gray-600 px-2 rounded border inline-block",children:e.key}),(0,r.jsx)("span",{className:"ml-2 mr-4 text-gray-600 dark:text-gray-300",children:e.action})]},t))}),(0,r.jsx)("div",{children:N>0&&(0,r.jsxs)("p",{children:["å
±æç´¢å° ",N," æ¡ç»æï¼ç¨æ¶ ",C," 毫ç§"]})}),(0,r.jsx)("div",{className:"text-gray-600 dark:text-gray-300 text-right",children:(0,r.jsxs)("span",{children:[(0,r.jsx)("i",{className:"fa-brands fa-algolia"})," Algolia æä¾æç´¢æå¡"]})})]})]}),(0,r.jsx)("div",{onClick:G,className:"z-30 fixed top-0 left-0 w-full h-full flex items-center justify-center glassmorphism"})]}):(0,r.jsx)(r.Fragment,{})}function p(){let{tagOptions:e}=(0,n.PC)(),t=null==e?void 0:e.slice(0,10);return(0,r.jsx)("div",{id:"tags-group",className:"dark:border-gray-700 space-y-2",children:null==t?void 0:t.map((e,t)=>(0,r.jsx)(u.A,{passHref:!0,href:"/tag/".concat(encodeURIComponent(e.name)),className:"cursor-pointer inline-block whitespace-nowrap",children:(0,r.jsxs)("div",{className:"flex items-center text-black dark:text-gray-300 hover:bg-blue-600 dark:hover:bg-yellow-600 hover:scale-110 hover:text-white rounded-lg px-2 py-0.5 duration-150 transition-all",children:[(0,r.jsxs)("div",{className:"text-lg",children:[e.name," "]}),e.count?(0,r.jsx)("sup",{className:"relative ml-1",children:e.count}):(0,r.jsx)(r.Fragment,{})]})},t))})}function b(e){let{totalPage:t,page:a,switchPage:l}=e;return t<=0?(0,r.jsx)(r.Fragment,{}):(0,r.jsx)("div",{className:"flex space-x-1 w-full justify-center py-1",children:Array.from({length:t},(e,t)=>{let s=a===t?"font-bold text-white bg-blue-600 dark:bg-yellow-600 rounded":"hover:text-blue-600 hover:font-bold dark:text-gray-300";return(0,r.jsx)("div",{onClick:()=>l(t),className:"text-center cursor-pointer w-6 h-6 ".concat(s),children:t+1},t)})})}}}]);
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.