PageSourceSearch

https://scavenger.ai/_next/static/chunks/541.c964a0ee88cd4bf0.js

js scavenger.ai collected 2026-10-05 12:37:07 UTC 15,922 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[541],{7774:(e,t,n)=>{function a(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Date.now(),n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:6e4;if(!e)return"stale";let a=Date.parse(e);return Number.isNaN(a)?"stale":a>t||t-a<=n?"live":"stale"}n.d(t,{C7:()=>x,CE:()=>u,HU:()=>_,II:()=>I,K7:()=>C,Om:()=>c,QA:()=>a,QU:()=>z,Rf:()=>B,Sd:()=>M,Ss:()=>k,Tb:()=>F,UK:()=>f,Uj:()=>U,ZV:()=>i,_e:()=>j,a3:()=>N,bp:()=>h,fc:()=>p,fm:()=>O,gW:()=>T,i_:()=>S,iw:()=>g,jT:()=>b,l9:()=>d,nV:()=>v,rq:()=>V,st:()=>A,vD:()=>m,vq:()=>L,wk:()=>o,xP:()=>q,z3:()=>l,zI:()=>s});let r=new Set(["PGRST202","PGRST205","42P01","42883"]);function s(e){if(!e||"object"!=typeof e)return!1;let t=e.code;return"string"==typeof t&&r.has(t)}function l(e){return null==e?"—":e>=1e12?"".concat((e/1e12).toFixed(2)," TB"):e>=1e9?"".concat((e/1e9).toFixed(2)," GB"):e>=1e6?"".concat((e/1e6).toFixed(1)," MB"):e>=1e3?"".concat((e/1e3).toFixed(1)," KB"):"".concat(e," B")}function i(e){return null==e?"—":e.toLocaleString("en-US")}function o(e){return null==e?"—":new Intl.NumberFormat("en-US",{notation:"compact",compactDisplay:"short",maximumFractionDigits:1}).format(e)}function u(e){return null==e?"—":"".concat(e.toFixed(1),"/s")}function d(e){return null==e?"—":"".concat((100*e).toFixed(2),"%")}function c(e){return null==e?"—":e>=1?"100%":"".concat((100*e).toFixed(2),"%")}function f(e){return null==e?"—":"$".concat(e.toFixed(2))}function p(e,t){return e&&"live"===t?e:null}function m(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Date.now(),n={total:0,live:0,stale:0,paused:0,working:0};for(let r of e){n.total+=1;let e=a(r.last_seen_at,t);n[e]+=1,"live"===e&&("paused"===r.state&&(n.paused+=1),"working"===r.state&&(n.working+=1))}return n}function h(e){let t=null,n=-1/0;for(let a of e){let e=a.last_seen_at?Date.parse(a.last_seen_at):NaN;!Number.isNaN(e)&&e>n&&(n=e,t=a)}return t?{host:t.host,loadAvg1m:t.load_avg_1m,freeMemBytes:t.free_mem_bytes,reportedBy:t.worker_id,reportedAt:t.last_seen_at}:null}let g=["stock_check_alerts","scrape_pipeline_alerts","missed_scheduled_scrape_alerts","dual_write_alerts"],_={stock_check_alerts:"Stock check",scrape_pipeline_alerts:"Scrape pipeline",missed_scheduled_scrape_alerts:"Missed schedule",dual_write_alerts:"Dual write"};function w(e){return"string"==typeof e&&e.length>0?e:null}function b(e,t){var n,a,r;let s=w(t.store_id),l=w(t.store_name),i=w(t.scheduled_for),o="missed_scheduled_scrape_alerts"===e?[null!=l?l:s?"store ".concat(s):null,i].filter(Boolean).join(" \xb7 ")||null:s?"store ".concat(s):null;return{source:e,id:String(null!=(n=t.id)?n:""),createdAt:w(t.created_at),type:null!=(a=w(t.alert_type))?a:"missed scheduled scrape",reason:w(t.reason),context:o,emailStatus:w(t.email_status),emailedAt:w(t.emailed_at),emailError:null!=(r=w(t.email_error))?r:w(t.error_message)}}function k(e){return[...e].sort((e,t)=>{let n=e.createdAt?Date.parse(e.createdAt):0;return(t.createdAt?Date.parse(t.createdAt):0)-n})}function N(e,t){if(!e||!t)return null;let n=Date.parse(e),a=Date.parse(t);return Number.isNaN(n)||Number.isNaN(a)||a<n?null:y(Math.floor((a-n)/1e3))}function y(e){if(e<60)return"".concat(e,"s");let t=Math.floor(e/60);return t<60?"".concat(t,"m ").concat(e%60,"s"):"".concat(Math.floor(t/60),"h ").concat(t%60,"m")}function v(e){return null==e||!Number.isFinite(e)||e<0?"—":y(Math.floor(e))}function x(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Date.now();return e?N(e,new Date(t).toISOString()):null}let D=Symbol("not-provisioned");function S(e){return e===D}function T(e){if(s(e))return D;throw e}let j={pause:"Pause",resume:"Resume","stop-graceful":"Stop (graceful)","stop-force":"Force stop"},F={pause:"The worker finishes the store it is on and then claims nothing further. It keeps heartbeating, so it stays visible here.",resume:"The worker starts claiming work again. Any pause sentinel left on disk is cleared.","stop-graceful":"The worker finishes the store it is on and then exits. That can take 20-40 minutes, and the command will sit at “acknowledged” for all of it. systemd restarts the process, but it comes back paused rather than working.","stop-for
1ce":"The store in flight is abandoned immediately and returned to the queue. It consumes one of that store's three attempts, and the attempt is NOT reset — three force stops will dead-letter a store. Pages already scraped are kept."};function M(e){var t,n,a,r;let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Date.now(),l=null!=(a=null==(t=e.acknowledged_by)?void 0:t.length)?a:0,i=null!=(r=null==(n=e.applied_by)?void 0:n.length)?r:0,o=null===e.target_worker_id;if("expired"===e.status)return{status:"expired",label:"Expired — no worker picked it up before it timed out.",isTerminal:!0};if("applied"===e.status)return{status:"applied",label:o?"Applied by all ".concat(i," worker(s) that took it."):"Applied.",isTerminal:!0};if("acknowledged"===e.status){let t="stop-graceful"===e.kind,n=o?" ".concat(i," of ").concat(l," reported back."):"";return{status:"acknowledged",label:t?"Picked up — the worker is finishing its current store first, which can take 20-40 minutes.".concat(n):"Picked up, waiting for the worker to report back.".concat(n),isTerminal:!1}}let u=e.expires_at?Date.parse(e.expires_at):NaN;return!Number.isNaN(u)&&u<=s?{status:"pending",label:"Past its expiry and not picked up — no worker is polling.",isTerminal:!1}:{status:"pending",label:"Waiting for a worker to pick it up.",isTerminal:!1}}function A(e){return"live"===e}let R=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];function C(e){return"string"==typeof e&&/^([01]\d|2[0-3]):[0-5]\d$/.test(e)}function U(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Date,t=Object.fromEntries(new Intl.DateTimeFormat("en-US",{timeZone:"America/New_York",weekday:"short",hour:"2-digit",minute:"2-digit",hour12:!1}).formatToParts(e).map(e=>[e.type,e.value])),n=R.indexOf(String(t.weekday)),a=Number(t.hour)%24,r=Number(t.minute);return n<0||Number.isNaN(a)||Number.isNaN(r)?0:1440*n+60*a+r}function B(e,t,n){if(!C(t)||!Number.isInteger(e)||e<0||e>6)return null;let[a,r]=t.split(":").map(Number);return((1440*e+60*a+r-n)%10080+10080)%10080}let E={imported:"succeeded",completed:"succeeded",failed:"failed",aborted:"failed",running:"in-flight",syncing:"in-flight",pending:"in-flight"};function I(e,t){var n;let a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Date.now();if(!e)return null;let r=null!=(n=E[e])?n:null;if("in-flight"!==r||!t)return r;let s=Date.parse(t);return Number.isNaN(s)?r:a-s>108e5?"stalled":r}function P(e,t){if(0===e.length)return null;if(1===e.length)return e[0];let n=t*(e.length-1),a=Math.floor(n),r=Math.ceil(n);return a===r?e[a]:e[a]+(e[r]-e[a])*(n-a)}function q(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Date.now(),n=new Map,a=new Map;for(let i of e){var r,s,l;if(!i.started_at)continue;let e=new Date(i.started_at);if(Number.isNaN(e.getTime()))continue;let o=e.toISOString().slice(0,10),u=null!=(r=n.get(o))?r:{day:o,runs:0,succeeded:0,failed:0,inFlight:0,stalled:0,products:0,p50Minutes:null,p95Minutes:null,maxMinutes:null};u.runs+=1;let d=I(i.status,i.started_at,t);if("succeeded"===d?u.succeeded+=1:"failed"===d?u.failed+=1:"stalled"===d?u.stalled+=1:"in-flight"===d&&(u.inFlight+=1),u.products+=null!=(s=i.products_found)?s:0,n.set(o,u),"succeeded"===d&&i.completed_at){let t=Date.parse(i.completed_at);if(!Number.isNaN(t)){let n=(t-e.getTime())/6e4;if(n>=0){let e=null!=(l=a.get(o))?l:[];e.push(n),a.set(o,e)}}}}for(let[e,t]of a){let a=n.get(e);a&&(t.sort((e,t)=>e-t),a.p50Minutes=P(t,.5),a.p95Minutes=P(t,.95),a.maxMinutes=t[t.length-1])}return[...n.values()].sort((e,t)=>e.day.localeCompare(t.day))}function O(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Date.now(),n={fresh:0,week:0,fortnight:0,older:0,never:0};for(let a of e){if(!a.last_imported_at){n.never+=1;continue}let e=Date.parse(a.last_imported_at);if(Number.isNaN(e)){n.never+=1;continue}let r=t-e;r<1728e5?n.fresh+=1:r<6048e5?n.week+=1:r<12096e5?n.fortnight+=1:n.older+=1}return[{label:"Under 2 days",stores:n.fresh},{label:"2-7 days",stores:n.week},{label:"7-14 days",stores:n.fortnight},{label:"Over 14 days",stores:n.older},{label:"Never",stores:n.never}]}function L(e){let t=new Map;for(let s of e){var n,a,r;if(!s.created_at)continue;let e=new Date(s.created_at);if(Number.isNaN(e.getTime()))continue;let l=e.toISOString().slice(0,10),i=null!=(n=t.get(l))?n:{day:l,batches:0,completed:0,failed:0,pending:0,itemsWritten:0,pennies:0};i.batches+=1,"completed"===s.status?i.completed+=1:"failed"===s.status?i.failed+=1:i.pending+=1,i.itemsWritten+=null!=(a=s.items_written)?a:0,i.pennies+=null!=(r=s.pennies_found)?r:0,t.set(l,i)}return[...t.values()].sort((e,t)=>
1e.day.localeCompare(t.day))}function z(e){if(!e||"object"!=typeof e)return String(null!=e?e:"unknown error");let t="string"==typeof e.code?e.code:null,n="string"==typeof e.message?e.message:"query failed";return t?"".concat(t,": ").concat(n):n}function Z(e){return"number"==typeof e&&Number.isFinite(e)?e:null}function W(e,t){return null===e||null===t||t<=0?null:e/t}function V(e){var t,n,a;if(!e||"object"!=typeof e||Array.isArray(e))return null;let r=Z(e.eligible_items),s=Z(e.queueable_items),l=Z(e.stores_with_items),o=Z(e.snapshot_age_seconds),u="boolean"==typeof e.snapshot_present?e.snapshot_present:null!==r,d="boolean"==typeof e.snapshot_is_stale?e.snapshot_is_stale:null===o||o>10800,c=u?d?"stale":"fresh":"missing",f=null!=(t=Z(e.window_hours))?t:26,p=w(e.measured_at),m=null!=(n=Z(e.queueable_gap))?n:null!==r&&null!==s?r-s:null,h=Z(e.stores_covered),g=Z(e.stores_covered_24h),_=Z(e.items_written),b=Z(e.batches_total),k=Z(e.runs_started),N=Z(e.runs_failed),y=Z(e.stock_verified_at_24h),x=Z(e.stock_verified_at_48h),D=[];return"missing"===c?D.push("No snapshot row exists, so there is no population to measure against. That is refresh_stock_check_coverage() — the hourly refresher — not the stock checker. The window figures below are still live and still true."):"stale"===c&&D.push("Snapshot is ".concat(v(o)," old and the hourly refresher has stopped landing. Every population figure here is as of ").concat(null!=p?p:"an unknown time",", not now. This says the refresher is behind; it does NOT say coverage fell.")),null!==m&&m>0&&D.push("".concat(i(m)," eligible items are not queueable: enqueue_vps_stock_check_night takes a numeric product id off product_url and silently drops the rows without one, so those items can never be checked. The gap was 0 on 2026-09-09.")),0===b&&D.push("No stock-check batches were created in the last ".concat(f,"h, so nothing was checked in the window. Read the inventory freshness figures below with that in mind: the scrape importer keeps writing stock_verified_at, so they will not fall with the checker.")),null!==N&&N>0&&D.push("".concat(i(N)," of ").concat(i(k)," stock-check runs in the window failed.")),{state:c,windowHours:f,measuredAt:p,snapshotAgeSeconds:o,measureMs:Z(e.measure_ms),eligibleItems:r,queueableItems:s,queueableGap:m,storesWithItems:l,storesCovered:h,storesCovered24h:g,itemsEnqueued:Z(e.items_enqueued),itemsWritten:_,penniesFound:Z(e.pennies_found),runsStarted:k,runsCompleted:Z(e.runs_completed),runsFailed:N,newestRunStartedAt:w(e.newest_run_started_at),pennySkippedRuns:Z(e.penny_skipped_runs),batchesTotal:b,batchesPending:Z(e.batches_pending),batchesClaimed:Z(e.batches_claimed),batchesFailed:Z(e.batches_failed),noBatches:0===b,storeCoverage:W(h,l),storeCoverage24h:W(g,l),itemCoverage:W(_,s),freshness:{within24h:y,within48h:x,missing:Z(e.stock_verified_at_null),rate24h:W(y,r),rate48h:W(x,r),note:null!=(a=w(e.stock_verified_at_note))?a:"products.stock_verified_at has two writers — the stock checker and the scrape importer — so these three keys measure inventory freshness from ANY source, not stock-check coverage. items_written and stores_covered are the stock-check-only signals."},warnings:D}}},13406:(e,t,n)=>{n.d(t,{Xi:()=>u,av:()=>d,j7:()=>o,tU:()=>i});var a=n(95155),r=n(12115),s=n(25667),l=n(64269);let i=s.bL,o=r.forwardRef((e,t)=>{let{className:n,...r}=e;return(0,a.jsx)(s.B8,{ref:t,className:(0,l.cn)("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",n),...r})});o.displayName=s.B8.displayName;let u=r.forwardRef((e,t)=>{let{className:n,...r}=e;return(0,a.jsx)(s.l9,{ref:t,className:(0,l.cn)("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",n),...r})});u.displayName=s.l9.displayName;let d=r.forwardRef((e,t)=>
1{let{className:n,...r}=e;return(0,a.jsx)(s.UC,{ref:t,className:(0,l.cn)("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",n),...r})});d.displayName=s.UC.displayName},29811:(e,t,n)=>{n.d(t,{v:()=>a});let a=new Set(["direct"])},80991:(e,t,n)=>{n.d(t,{k:()=>i});var a=n(95155),r=n(12115),s=n(9484),l=n(64269);let i=r.forwardRef((e,t)=>{let{className:n,value:r,...i}=e;return(0,a.jsx)(s.bL,{ref:t,className:(0,l.cn)("relative h-4 w-full overflow-hidden rounded-full bg-secondary",n),...i,children:(0,a.jsx)(s.C1,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:"translateX(-".concat(100-(r||0),"%)")}})})});i.displayName=s.bL.displayName},98053:(e,t,n)=>{n.d(t,{$v:()=>g,EO:()=>f,Lt:()=>o,Rx:()=>_,Zr:()=>w,ck:()=>m,r7:()=>h,tv:()=>u,wd:()=>p});var a=n(95155),r=n(12115),s=n(35646),l=n(64269),i=n(3998);let o=s.bL,u=s.l9,d=s.ZL,c=r.forwardRef((e,t)=>{let{className:n,...r}=e;return(0,a.jsx)(s.hJ,{className:(0,l.cn)("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",n),...r,ref:t})});c.displayName=s.hJ.displayName;let f=r.forwardRef((e,t)=>{let{className:n,...r}=e;return(0,a.jsxs)(d,{children:[(0,a.jsx)(c,{}),(0,a.jsx)(s.UC,{ref:t,className:(0,l.cn)("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",n),...r})]})});f.displayName=s.UC.displayName;let p=e=>{let{className:t,...n}=e;return(0,a.jsx)("div",{className:(0,l.cn)("flex flex-col space-y-2 text-center sm:text-left",t),...n})};p.displayName="AlertDialogHeader";let m=e=>{let{className:t,...n}=e;return(0,a.jsx)("div",{className:(0,l.cn)("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...n})};m.displayName="AlertDialogFooter";let h=r.forwardRef((e,t)=>{let{className:n,...r}=e;return(0,a.jsx)(s.hE,{ref:t,className:(0,l.cn)("text-lg font-semibold",n),...r})});h.displayName=s.hE.displayName;let g=r.forwardRef((e,t)=>{let{className:n,...r}=e;return(0,a.jsx)(s.VY,{ref:t,className:(0,l.cn)("text-sm text-muted-foreground",n),...r})});g.displayName=s.VY.displayName;let _=r.forwardRef((e,t)=>{let{className:n,...r}=e;return(0,a.jsx)(s.rc,{ref:t,className:(0,l.cn)((0,i.r)(),n),...r})});_.displayName=s.rc.displayName;let w=r.forwardRef((e,t)=>{let{className:n,...r}=e;return(0,a.jsx)(s.ZD,{ref:t,className:(0,l.cn)((0,i.r)({variant:"outline"}),"mt-2 sm:mt-0",n),...r})});w.displayName=s.ZD.displayName}}]);

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.