1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[74],{11930:(e,s,a)=>{"use strict";a.r(s),a.d(s,{NotFound:()=>h,__N_SSG:()=>g,default:()=>p});var l=a(37876),t=a(63366),n=a(77328),r=a.n(n),i=a(2650),o=a(30463),d=a(60409),c=a(33657),m=a(5419),u=a(63341),x=a(69452),g=!0;let h=({locale:e})=>{let s=(0,i.s9)()?.table(e);return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(r(),{children:(0,l.jsx)("title",{children:s["page-not-found"]})}),(0,l.jsxs)("div",{className:"mx-auto mt-20 max-w-max rounded-2xl border border-accent-old-lace bg-white p-12 text-center shadow-lg",children:[(0,l.jsx)(t.In,{name:"logo",alt:"Brunel Logo",className:"mb-8 w-30"}),(0,l.jsx)("h1",{className:"mb-4 text-d-h2 tracking-wide text-brunel-dark-grey md:text-d-h2",children:s["page-not-found"]}),(0,l.jsx)("p",{className:"mb-7 text-brunel-dark-grey",children:s["page-not-found-message"]}),(0,l.jsx)("a",{href:`/${o.A?.defaultLanguage||d.Xn}`,className:"inline-block rounded-lg bg-brunel-yellow px-8 py-3 font-bold text-brunel-dark-grey shadow",children:s["go-to-home"]})]})]})},p=e=>e?.page?(0,l.jsx)(u.A,{componentProps:e.componentProps,page:e.page,children:(0,l.jsx)(c.q,{id:m.G.Default,page:e.page})}):(0,l.jsx)(i.CY,{lngDict:x.S[e.locale],locale:e.locale,children:(0,l.jsx)(h,{locale:e.locale??d.Xn})})},95020:(e,s,a)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/google-indexing",function(){return a(95104)}])},95104:(e,s,a)=>{"use strict";a.r(s),a.d(s,{__N_SSP:()=>g,default:()=>h});var l=a(37876),t=a(12130),n=a(14232);let r={loading:!1,error:null,urls:[],nestedSitemaps:[]},i={running:!1,error:null,logs:[],processed:0,okCount:0,failCount:0};var o=a(92678),d=a(63366),c=a(60409),m=a(11930),u=a(63341);let x={locale:"en",mode:{name:t.IY.Normal,designLibrary:{isVariantGeneration:!1},isNormal:!0,isDesignLibrary:!1,isPreview:!1,isEditing:!1},layout:{sitecore:{context:{itemPath:"",originalItemPath:"",pageCanonicalUrl:"",pageHrefLangUrl:[],pageLanguages:[],googleSiteVerification:"",facebookSiteVerification:"",pageDateModified:"",pageDatePublished:""},route:null},dictionary:{},session:null}};var g=!0;let h=({allowed:e})=>{let{sitemapUrl:s,setSitemapUrl:a,notificationType:t,setNotificationType:g,batchSize:h,setBatchSize:p,skipCount:b,setSkipCount:j,clampedBatchSize:f,clampedSkipCount:N,urlsToSubmit:y,parseState:w,submitState:v,parseSitemap:S,submitUrls:L,maxBatchSize:_}=(()=>
1{let[e,s]=(0,n.useState)(""),[a,l]=(0,n.useState)("URL_UPDATED"),[t,o]=(0,n.useState)(50),[d,c]=(0,n.useState)(0),[m,u]=(0,n.useState)(r),[x,g]=(0,n.useState)(i),h=(0,n.useMemo)(()=>Math.min(100,Math.max(1,t||1)),[t]),p=(0,n.useMemo)(()=>Math.max(0,Math.min(m.urls.length,Math.floor(d)||0)),[m.urls.length,d]),b=(0,n.useMemo)(()=>m.urls.slice(p),[m.urls,p]),j=(0,n.useCallback)(async()=>{u({...r,loading:!0}),g(i);try{let s=await fetch("/api/google-indexing/parse",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sitemapUrl:e.trim()})}),a=await s.json();if(!s.ok)throw Error(a.error||`Parse failed (${s.status})`);u({loading:!1,error:null,urls:a.urls??[],nestedSitemaps:a.nestedSitemaps??[]})}catch(e){u({...r,error:e instanceof Error?e.message:"Failed to parse sitemap"})}},[e]),f=(0,n.useCallback)(async()=>{if(0===b.length||x.running)return;g({...i,running:!0});let e=0,s=0,l=0,t=[];try{for(let n=0;n<b.length;n+=h){let r=Math.floor(n/h)+1,i=b.slice(n,n+h),o=await fetch("/api/google-indexing/submit",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({urls:i,type:a})}),d=await o.json();if(!o.ok)throw Error(d.error||`Submit failed (${o.status})`);let c=new Date().toISOString();for(let a of d.results??[]){let n={...a,batchIndex:r,at:c};t.push(n),e+=1,a.success?s+=1:l+=1}g({running:!0,error:null,logs:[...t],processed:e,okCount:s,failCount:l})}g({running:!1,error:null,logs:[...t],processed:e,okCount:s,failCount:l})}catch(a){g({running:!1,error:a instanceof Error?a.message:"Submit failed",logs:[...t],processed:e,okCount:s,failCount:l})}},[h,a,x.running,b]);return{sitemapUrl:e,setSitemapUrl:s,notificationType:a,setNotificationType:l,batchSize:t,setBatchSize:o,skipCount:d,setSkipCount:c,clampedBatchSize:h,clampedSkipCount:p,urlsToSubmit:b,parseState:m,submitState:x,parseSitemap:j,submitUrls:f,maxBatchSize:100}})();if(!e)return(0,l.jsx)(m.NotFound,{locale:c.Xn});let k=0===y.length?0:Math.round(v.processed/y.length*100);return(0,l.jsx)(u.A,{page:x,children:(0,l.jsxs)("div",{className:"min-h-svh bg-white p-4 text-black md:p-8",children:[(0,l.jsx)(d.o5,{type:"h1",className:"mb-2",plainText:"Google Indexing (develop only)"}),(0,l.jsx)(d.o5,{type:"medium",className:"mb-6 max-w-3xl",plainText:"Parse a sitemap and manually notify Google Indexing API (URL_UPDATED / URL_DELETED). Batches up to 100 URLs. Each URL counts against quota."}),(0,l.jsxs)("div",{className:"mb-4 flex max-w-3xl flex-col gap-3",children:[(0,l.jsxs)("label",{className:"flex flex-col gap-1",children:[(0,l.jsx)("span",{className:"text-sm font-medium",children:"Sitemap URL"}),(0,l.jsx)("input",{className:"border border-gray-300 px-3 py-2",value:s,onChange:e=>a(e.target.value),placeholder:"https://develop.cloudsites.brunel.net/sitemap.xml"})]}),(0,l.jsxs)("div",{className:"flex flex-wrap gap-4",children:[(0,l.jsxs)("label",{className:"flex flex-col gap-1",children:[(0,l.jsx)("span",{className:"text-sm font-medium",children:"Notification type"}),(0,l.jsxs)("select",{className:"border border-gray-300 px-3 py-2",value:t,onChange:e=>g(e.target.value),children:[(0,l.jsx)("option",{value:"URL_UPDATED",children:"URL_UPDATED"}),(0,l.jsx)("option",{value:"URL_DELETED",children:"URL_DELETED"})]})]}),(0,l.jsxs)("label",{className:"flex flex-col gap-1",children:[(0,l.jsxs)("span",{className:"text-sm font-medium",children:["Batch size (1â",_,")"]}),(0,l.jsx)("input",{type:"number",min:1,max:_,className:"w-28 border border-gray-300 px-3 py-2",value:h,onChange:e=>p(Number(e.target.value))})]}),(0,l.jsxs)("label",{className:"flex flex-col gap-1",children:[(0,l.jsx)("span",{className:"text-sm font-medium",children:"Skip first N URLs"}),(0,l.jsx)("input",{type:"number",min:0,max:w.urls.length||void 0,className:"w-28 border border-gray-300 px-3 py-2",value:b,onChange:e=>j(Number(e.target.value))})]})]}),(0,l.jsxs)("div",{className:"flex flex-wrap gap-3",children:[(0,l.jsx)(o.Button,{plainText:w.loading?"Parsingâ¦":"Parse sitemap",className:"h-12 min-w-40",disabled:w.loading||v.running||!s.trim(),onClick:()=>{S()}}),(0,l.jsx)(o.Button,{plainText:v.running?`Submitting⦠(${v.processed}/${y.length})`:`Submit to Google (${y.length} URLs, ${f}/batch)`,className:"h-12 min-w-40",disabled:v.running||w.loading||0===y.length,onClick:()=>{L()}})]})]}),w.error?(0,l.jsx)(d.o5,{type:"medium",className:"mb-3 text-red-700",plainText:w.error}):null,v.error?(0,l.jsx)(d.o5,{type:"medium",className:"mb-3 text-red-700",plainText:v.error}):null,w.urls.length>0?(0,l.jsxs)("div",{className:"mb-4 max-w-3xl",children:[(0,l.jsx)(d.o5,{type:"h3",className:"mb-2",plainText:`Parsed ${w.urls.length} URLs${w.nestedSitemaps.length?` from ${w.nestedSitemaps.length} nested sitemaps`:""}${N>0?` \xb7 skipping first ${N} \xb7 will submit ${y.length}`:""}`}),(0,l.jsx)("div",{className:"mb-2 h-2 w-full overflow-hidden bg-gray-200",children:(0,l.jsx)("div",{className:"h-full bg-green-600 transition-all",style:{width:`${k}%`}})}),(0,l.jsx)(d.o5,{type:"small",plainText:`Progress: ${v.processed}/${y.length} \xb7 OK: ${v.okCount} \xb7 Failed: ${v.failCount}`}),(0,l.jsxs)("details",{className:"mt-3",children:[(0,l.jsxs)("summary",{className:"cursor-pointer text-sm font-medium",children:["Preview URLs to submit",N>0?" (after skip)":""]}),(0,l.jsxs)("ul",{className:"mt-2 max-h-48 overflow-auto border border-gray-200 p-2 text-xs",children:[y.slice(0,200).map(e=>(0,l.jsx)("li",{className:"truncate",children:e},e)),y.length>200?(0,l.jsxs)("li",{children:["â¦and ",y.length-200," more"]}):null]})]})]}):null,v.logs.length>0?(0,l.jsxs)("div",{className:"max-w-5xl",children:[(0,l.jsx)(d.o5,{type:"h3",className:"mb-2",plainText:"Submission log"}),(0,l.jsx)("div",{className:"max-h-120 overflow-auto border border-gray-300",children:(0,l.jsxs)("table",{className:"w-full text-left text-xs",children:[(0,l.jsx)("thead",{className:"sticky top-0 bg-gray-100",children:(0,l.jsxs)("tr",{children:[(0,l.jsx)("th",{className:"p-2",children:"Batch"}),(0,l.jsx)("th",{className:"p-2",children:"Status"}),(0,l.jsx)("th",{className:"p-2",children:"HTTP"}),(0,l.jsx)("th",{className:"p-2",children:"URL"}),(0,l.jsx)("th",{className:"p-2",children:"Message"})]})}),(0,l.jsx)("tbody",{children:v.logs.map(e=>(0,l.jsxs)("tr",{className:e.success?"bg-green-50":"bg-red-50",children:[(0,l.jsx)("td",{className:"p-2 align-top",children:e.batchIndex}),(0,l.jsx)("td",{className:"p-2 align-top",children:e.success?"OK":"FAIL"}),(0,l.jsx)("td",{className:"p-2 align-top",children:e.statusCode??"â"}
1),(0,l.jsx)("td",{className:"max-w-md truncate p-2 align-top",title:e.url,children:e.url}),(0,l.jsx)("td",{className:"p-2 align-top wrap-break-word",children:e.message})]},`${e.batchIndex}-${e.url}-${e.at}`))})]})})]}):null]})})}}},e=>{e.O(0,[636,593,792],()=>e(e.s=95020)),_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.