PageSourceSearch

https://co.vet/assets/partnerSort-CZ2AR7OZ.js

js co.vet collected 2026-10-01 14:01:51 UTC 2,485 bytes, 1 lines download raw bytes

1import{r as u}from"./react-vendor-BR-w6wQm.js";import{y as S,l as p}from"./index-BV4kwaqQ.js";import{P as I,e as T,K as R,C as O}from"./partnerDirectory-Cl0bKNHX.js";function D(){const[o,e]=u.useState(I);return u.useEffect(()=>{let t=!1;return S().then(r=>{!t&&r&&r.length>0&&e(r.map(T))}),()=>{t=!0}},[]),o}const m="covet-geo-country";function K(){const[o,e]=u.useState(()=>{const t=p.get(m);return t?t.toUpperCase():null});return u.useEffect(()=>{if(p.get(m))return;let t=!1;async function r(){try{const n=new AbortController,s=setTimeout(()=>n.abort(),3e3),c=await fetch("https://ipapi.co/country_code/",{signal:n.signal});if(clearTimeout(s),!c.ok)return;const i=(await c.text()).trim().toUpperCase();!t&&i&&(p.set(m,i,{expires:30}),e(i))}catch{}}return r(),()=>{t=!0}},[]),o}const P=new Set(["AT","BE","BG","HR","CY","CZ","DE","DK","EE","ES","FI","FR","GR","HU","IE","IT","LT","LU","LV","MT","NL","PL","PT","RO","SE","SI","SK","NO","IS","LI","CH"]),g={US:"US",CA:"CA",GB:"UK",AU:"AU",NZ:"NZ",DK:"DK",FR:"FR",DE:"DE",ES:"ES",IT:"IT",NL:"NL",PL:"PL",SE:"SE",NO:"NO",FI:"FI"};function U(o){if(!o)return[];const e=[];return g[o]&&e.push(g[o]),P.has(o)&&e.push("EU"),e}function d(o,e){const t=o.locales||[];return t.includes("Global")||e.length&&t.some(r=>e.includes(r))?0:1}function L(o,e=3){const t=[...o];for(const[r,n]of R){const s=t.findIndex(f=>f.name===r),c=t.findIndex(f=>f.name===n);if(s===-1||c===-1)continue;const i=t.length;if(i<=e+1)continue;const E=Math.abs(s-c);if(Math.min(E,i-E)>e)continue;const h=Math.min(s,c),[C]=t.splice(Math.max(s,c),1);let l=h+e+1;l>t.length&&(l=Math.max(0,h-(e+1))),t.splice(l,0,C)}return t}function a(o,e){const t=U(e),r=o.map((n,s)=>({p:n,i:s})).sort((n,s)=>{const c=(n.p.importance==="top"?0:1)-(s.p.importance==="top"?0:1);if(c!==0)return c;const i=d(n.p,t)-d(s.p,t);return i!==0?i:n.i-s.i}).map(({p:n})=>n);return L(r)}function N(o,e,t){const r=o.findIndex(c=>c.name===e);if(r===-1)return o;const n=[...o],[s]=n.splice(r,1);return n.splice(Math.min(t,n.length),0,s),n}function x(o){let e=o;for(const[t,r]of Object.entries(O))e=N(e,t,r);return e}function M(o,e){const t=o.filter(n=>n.category==="enterprise"),r=o.filter(n=>n.category!=="enterprise");if(t.length===0&&r.length>1){const n=a(r,e),s=Math.ceil(n.length/2);return[n.slice(0,s),n.slice(s)]}return[x(a(t,e)),a(r,e)]}function F(o,e){const t=o.filter(n=>n.category==="pms"),r=o.filter(n=>n.category==="content");return[...a(t,e),...a(r,e)]}export{D as a,M as c,F as i,a as s,K as u};

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.