1import{a3 as g,a2 as h}from"./index-6P0cCGxP.js";const l=[{key:"didnt_mean_to_renew",label:"I didnât mean to renew",next:"renewal"},{key:"too_expensive",label:"Itâs too expensive",next:"offer"},{key:"only_needed_once",label:"I only needed it for one application",next:"offer"},{key:"not_using",label:"Iâm not using it enough",next:"not_using"},{key:"missing_test",label:"The test I need isnât here",next:"missing"},{key:"technical_problem",label:"Something isnât working",next:"tech"},{key:"finished",label:"I got the job, or Iâve finished preparing",next:"finished"},{key:"other",label:"Something else",next:"other"}],N=["saved","cancelled","resumed","support_sent","renewal_kept","refunded"];function _(e,n,t){return{event:"cancel_flow",step:e,reason:n||null,brand:t}}const k=500;function I(e){const n=!!(e&&e.refundOffer&&e.refundOffer.eligible);return l.filter(t=>t.key!=="didnt_mean_to_renew"||n)}function S(e,n){const t=l.find(i=>i.key===e);return t?t.next==="offer"?n&&n.eligible?"offer":"confirm":t.next==="renewal"?n&&n.refundOffer&&n.refundOffer.eligible?"renewal":"confirm":t.next:"confirm"}function D(e){return e==="loss"?{number:1,name:"What youâd lose"}:e==="reason"?{number:2,name:"Your reason"}:{number:3,name:e==="confirm"?"Confirm":"For you"}}function F(e){return e==="month"?"month":"year"}function M(e,n){return`${e}, ${n==="month"?"monthly":"annual"}`}function O(e){const n=c(e);return n?n.toLocaleDateString("en-GB",{day:"numeric",month:"long",year:"numeric",timeZone:"UTC"}):""}function c(e){if(e==null||e==="")return null;if(e instanceof Date)return Number.isNaN(e.getTime())?null:e;if(typeof e=="number"||/^\d+$/.test(String(e))){const t=Number(e),i=new Date(t<1e11?t*1e3:t);return Number.isNaN(i.getTime())?null:i}const n=new Date(e);return Number.isNaN(n.getTime())?null:n}const y=e=>!!e&&e.date!==null&&e.date!==void 0&&(e.score!==null&&e.score!==void 0||!!e.profile);function T(e){const n=(Array.isArray(e)?e:[]).filter(y),t={};n.forEach(r=>{const o=r.format||g(r.slug);!o||r.score===null||r.score===void 0||(t[o]=t[o]||[]).push(r)});let i=null;const s=Object.keys(t).filter(r=>t[r].length>=2).sort((r,o)=>t[o].length-t[r].length)[0];if(s){const r=[...t[s]].sort((m,x)=>u(m.date)-u(x.date)),o=Math.round(r[r.length-1].score-r[0].score);o>0&&(i={points:o,label:b(s)})}const a=new Map;n.forEach(r=>{const o=Number(r.total);r.slug&&Number.isFinite(o)&&o>0&&a.set(r.slug,Math.max(a.get(r.slug)||0,o))});const d=[...a.values()].reduce((r,o)=>r+o,0);return{tests:n.length,scoreChange:i,solutions:d}}function u(e){const n=c(e);return n?n.getTime():0}function b(e){return(h(e)||"").toLowerCase().replace(/\s+reasoning$/,"")}function C(e){return!e||e.tests<2}function E(e){return[e&&e.name,f(e)].filter(Boolean).join(" · ")}function L(e){if(!e)return"";const n=Number(e.questions);return[Number.isFinite(n)&&n>0?`${n} ${n===1?"question":"questions"}`:null,f(e),e.note||null].filter(Boolean).join(" · ")}function f(e){const n=Number(e&&e.minutes);return Number.isFinite(n)&&n>0?`${n} ${n===1?"minute":"minutes"}`:null}function $(e){return!!e&&e.status==="active"&&!e.cancelAtPeriodEnd}function U(){try{if(typeof crypto<"u"&&typeof crypto.randomUUID=="function")return crypto.randomUUID()}catch{}return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const n=Math.random()*16|0;return(e==="x"?n:n&3|8).toString(16)})}export{k as C,N as D,F as a,L as b,E as c,$ as d,T as e,D as f,C as i,O as l,U as n,M as p,I as r,S as s,_ as 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.