PageSourceSearch

https://all-restaurant.ru/_next/static/chunks/25112.f12b3d0c1ce48732.js

js all-restaurant.ru collected 2026-10-05 00:26:49 UTC 10,096 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[25112],{8480:(e,t,r)=>{r.d(t,{A:()=>s});let s=(0,r(41285).A)("Link2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]])},17687:(e,t,r)=>{r.d(t,{A:()=>s});let s=(0,r(41285).A)("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},20449:(e,t,r)=>{r.d(t,{A:()=>s});let s=(0,r(41285).A)("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]])},25112:(e,t,r)=>{r.r(t),r.d(t,{default:()=>u});var s=r(95818),l=r(16418),a=r(17687),o=r(40743),n=r(8480),d=r(20449),c=r(41102);async function i(e,t){let r=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),s=await r.json();if(!r.ok)throw Error(s.error||"Y\xeau cầu thất bại");return s}function u(){var e,t,r;let[u,x]=(0,l.useState)("page"),[m,h]=(0,l.useState)("https://example.com"),[p,b]=(0,l.useState)("https://example.com\nhttps://example.com/404"),[f,g]=(0,l.useState)(!0),[y,j]=(0,l.useState)(!1),[v,N]=(0,l.useState)(""),[k,w]=(0,l.useState)(!1),[C,A]=(0,l.useState)(null),S=(0,l.useMemo)(()=>C?f?C.results.filter(e=>!e.ok):C.results:[],[C,f]),L=(0,l.useMemo)(()=>C?C.results.filter(e=>!e.ok).map(e=>{var t;return"".concat(e.url," | ").concat(null!==(t=e.status)&&void 0!==t?t:"ERR").concat(e.error?" | ".concat(e.error):"")}).join("\n"):"",[C]),U=async()=>{if(L)await (async()=>{try{if(navigator.clipboard&&document.hasFocus())await navigator.clipboard.writeText(L);else throw Error("Clipboard requires focused document")}catch(t){let e=document.createElement("textarea");e.value=L,e.setAttribute("readonly",""),e.style.position="fixed",e.style.left="-9999px",e.style.top="0",document.body.appendChild(e),e.focus(),e.select(),document.execCommand("copy"),document.body.removeChild(e)}})(),w(!0),window.setTimeout(()=>w(!1),1800)},q=async()=>{let e=m.trim();if(!e){N("Nhập URL cần qu\xe9t."),A(null);return}j(!0),N(""),A(null);try{let t=await i("/api/tools/seo-fetch",{url:e});if(!t.html)throw Error("Kh\xf4ng lấy được HTML từ trang n\xe0y.");let r=new DOMParser().parseFromString(t.html,"text/html"),s=new Set;r.querySelectorAll("a[href]").forEach(e=>{var r;let l=null===(r=e.getAttribute("href"))||void 0===r?void 0:r.trim();if(!(!l||l.startsWith("#")))try{let e=new URL(l,t.finalUrl);("http:"===e.protocol||"https:"===e.protocol)&&s.add(e.toString())}catch(e){}});let l=Array.from(s);if(0===l.length){A({mode:"page",sourceLabel:t.finalUrl,discoveredCount:0,total:0,broken:0,results:[]});return}let a=await i("/api/tools/check-links",{urls:l});A({mode:"page",sourceLabel:t.finalUrl,discoveredCount:l.length,total:a.total,broken:a.broken,results:a.results})}catch(e){N(e instanceof Error?e.message:"Kh\xf4ng thể qu\xe9t link.")}finally{j(!1)}},E=async()=>{let e=Array.from(new Set(p.split(/\r?\n/).map(e=>e.trim()).filter(Boolean)));if(0===e.length){N("D\xe1n \xedt nhất 1 URL."),A(null);return}j(!0),N(""),A(null);try{let t=await i("/api/tools/check-links",{urls:e});A({mode:"list",sourceLabel:"Danh s\xe1ch d\xe1n v\xe0o",discoveredCount:e.length,total:t.total,broken:t.broken,results:t.results})}catch(e){N(e instanceof Error?e.message:"Kh\xf4ng thể kiểm tra danh s\xe1ch link.")}finally{j(!1)}};return(0,s.jsxs)("div",{className:"grid gap-6 xl:grid-cols-[minmax(0,0.95fr)_minmax(0,1.05fr)]",children:[(0,s.jsxs)("div",{className:"space-y-6",children:[(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex flex-wrap gap-3",children:[(0,s.jsx)("button",{type:"button",onClick:()=>x("page"),className:"rounded-full px-4 py-2 text-sm font-semibold ".concat("page"===u?"bg-primary text-primary-foreground":"bg-accent text-foreground"),children:"Qu\xe9t 1 trang"}),(0,s.jsx)("button",{type:"button",onClick:()=>x("list"),className:"rounded-full px-4 py-2 text-sm font-semibold ".concat("list"===u?"bg-primary text-primary-foreground":"bg-accent text-foreground"),children:"D\xe1n danh s\xe1ch link"})]}),"page"===u?(0,s.jsxs)("div",{className:"mt-5 space-y-4",children:[(0,s.jsxs)("label",{className:"block text-sm font-semibold text-foreground",children:["URL trang",(0,s.jsx)("input",{value:m,onChange:e=>h(e.target.value),placeholder:"https://example.com",className:"mt-2 w-full rounded-2xl border border-border bg-background px-4 py-3 text-sm text-foreground outline-none placeholder:text-muted-foreground"})]}),(0,s.jsxs)("button",{type:"button",onClick:()=>void q(),disabled:y,className:"inline-flex items-center gap-2 rounded-full bg-primary px-4 py-2 text-sm font-semibold text-primary-foreground disabled:opacity-50",children:[y?(0,s.jsx)(a.A,{className:"h-4 w-4 animate-spin"}):(0,s.jsx)(o.A,{className:"h-4 w-4"}),"Qu\xe9t link"]})]}):(0,s.jsxs)("div",{className:"mt-5 space-y-4",children:[(0,s.jsxs)("label",{className:"block text-sm font-semibold text-foreground",children:["Danh s\xe1ch URL",(0,s.jsx)("textarea",{value:p,onChange:e=>b(e.target.value),rows:12,placeholder:"Mỗi d\xf2ng một URL",className:"rounded-lg border border-border bg-background mt-2 w-full px-4 py-3 font-mono text-sm text-foreground outline-none placeholder:text-muted-foreground"})]}),(0,s.jsxs)("button",{type:"button",onClick:()=>void E(),disabled:y,className:"inline-flex items-center gap-2 rounded-full bg-primary px-4 py-2 text-sm font-semibold text-primary-foreground disabled:opacity-50",children:[y?(0,s.jsx)(a.A,{className:"h-4 w-4 animate-spin"}):(0,s.jsx)(n.A,{className:"h-4 w-4"}),"Kiểm tra"]})]}),v?(0,s.jsx)("div",{className:"mt-5 rounded-2xl bg-destructive px-4 py-3 text-sm font-medium text-destructive-foreground",children:v}):null]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[(0,s.jsx)("h2",{className:"text-lg font-bold text-foreground",children:"Bộ lọc"}),(0,s.jsx)("button",{type:"button",onClick:()=>g(e=>!e),className:"rounded-full px-4 py-2 text-sm font-semibold ".concat(f?"bg-destructive text-destructive-foreground":"bg-
1accent text-foreground"),children:f?"Chỉ hiển thị lỗi":"Hiển thị tất cả"})]}),(0,s.jsx)("p",{className:"mt-3 text-sm text-muted-foreground",children:"Bỏ qua mailto, tel, javascript v\xe0 anchor."})]})]}),(0,s.jsxs)("div",{className:"space-y-6",children:[(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"grid gap-3 sm:grid-cols-3",children:[(0,s.jsxs)("div",{className:"rounded-2xl border border-border bg-background p-4",children:[(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:"T\xecm thấy"}),(0,s.jsx)("p",{className:"mt-1 text-2xl font-bold text-foreground",children:null!==(e=null==C?void 0:C.discoveredCount)&&void 0!==e?e:0})]}),(0,s.jsxs)("div",{className:"rounded-2xl border border-border bg-background p-4",children:[(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:"Đ\xe3 kiểm"}),(0,s.jsx)("p",{className:"mt-1 text-2xl font-bold text-foreground",children:null!==(t=null==C?void 0:C.total)&&void 0!==t?t:0})]}),(0,s.jsxs)("div",{className:"rounded-2xl border border-border bg-background p-4",children:[(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:"Link lỗi"}),(0,s.jsx)("p",{className:"mt-1 text-2xl font-bold text-foreground",children:null!==(r=null==C?void 0:C.broken)&&void 0!==r?r:0})]})]}),(0,s.jsxs)("div",{className:"mt-5 flex flex-wrap items-center justify-between gap-3",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-sm font-semibold text-foreground",children:"Kết quả"}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:(null==C?void 0:C.sourceLabel)||"Chưa chạy"})]}),(0,s.jsxs)("button",{type:"button",onClick:()=>void U(),disabled:!L,className:"inline-flex items-center gap-2 rounded-full px-3 py-2 text-xs font-semibold ".concat(k?"bg-success text-success-foreground":"bg-accent text-foreground"," disabled:opacity-50"),children:[k?(0,s.jsx)(d.A,{className:"h-3.5 w-3.5"}):(0,s.jsx)(c.A,{className:"h-3.5 w-3.5"}),k?"Đ\xe3 copy":"Copy link lỗi"]})]})]}),(0,s.jsx)("div",{children:y?(0,s.jsx)("div",{className:"flex min-h-48 items-center justify-center",children:(0,s.jsx)(a.A,{className:"h-8 w-8 animate-spin text-foreground"})}):C?S.length>0?(0,s.jsx)("div",{className:"space-y-3",children:S.map(e=>{let t=null===e.status||e.error?{className:"bg-destructive text-destructive-foreground",label:e.error?"Lỗi: ".concat(e.error):"Lỗi"}:e.status>=200&&e.status<300?{className:"bg-success text-success-foreground",label:String(e.status)}:e.status>=300&&e.status<400?{className:"bg-accent text-foreground",label:String(e.status)}:{className:"bg-destructive text-destructive-foreground",label:String(e.status)};return(0,s.jsx)("div",{className:"rounded-2xl border border-border bg-background p-4",children:(0,s.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsx)("p",{className:"break-all text-sm font-semibold text-foreground",children:e.url}),e.redirected&&e.finalUrl&&e.finalUrl!==e.url?(0,s.jsxs)("p",{className:"mt-2 break-all text-xs text-muted-foreground",children:["→ ",e.finalUrl]}):null]}),(0,s.jsx)("span",{className:"rounded-full px-3 py-1 text-xs font-semibold ".concat(t.className),children:t.label})]})},e.url)})}):(0,s.jsx)("div",{className:"rounded-2xl border border-border bg-background px-4 py-6 text-sm text-muted-foreground",children:f?"Kh\xf4ng c\xf3 link lỗi.":"Kh\xf4ng c\xf3 dữ liệu để hiển thị."}):(0,s.jsx)("div",{className:"rounded-2xl border border-border bg-background px-4 py-6 text-sm text-muted-foreground",children:"Chưa c\xf3 kết quả."})})]})]})}},40743:(e,t,r)=>{r.d(t,{A:()=>s});let s=(0,r(41285).A)("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]])},41102:(e,t,r)=>{r.d(t,{A:()=>s});let s=(0,r(41285).A)("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]])}}]);

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.