PageSourceSearch

https://www.landrovercapefear.com/static/assets/libs/hysterics/4.0.0/hysterics.js

js landrovercapefear.com collected 2026-09-28 09:50:35 UTC 14,077 bytes, 2 lines download raw bytes

1!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self).DDC=t.DDC||{},t.DDC.Hysterics={}))}(this,function(t){"use strict";const e="abort",r=t=>{const r=t[e];r&&r.controller&&r.controller.abort()},o=t=>{const r=t[e];return r&&r.controller?r.controller.signal:null},n=t=>(o,n)=>{n[e].controller=new AbortController;const i=(async()=>t(o,n))();return i.cancel=()=>r(n),i};n.contextKey=e;var i=Object.freeze({__proto__:null,abort:r,contextKey:e,getAbortSignal:o,getWrapper:n});const s="no-op",a=t=>(e,r)=>t(e,r);a.contextKey=s;var c=Object.freeze({__proto__:null,contextKey:s,getWrapper:a});const u="contextTerminus",l=t=>(e,r)=>t(e,r);l.contextKey=u;var p=Object.freeze({__proto__:null,contextKey:u,getWrapper:l});const m=(t,e,r)=>{t[e].options={...r,...t[e].options}};let f=window&&window.newrelic;f||(console.warn("Unable to locate the NewRelic browser agent - performance metrics will not be recorded for this application!"),f={noticeError:()=>{},addPageAction:()=>{}});const h=[/Bearer\s+[^\s]+/gi,/token[=:]\s*[^\s&]+/gi,/api[_-]?key[=:]\s*[^\s&]+/gi,/password[=:]\s*[^\s&]+/gi,/secret[=:]\s*[^\s&]+/gi,/client[_-]?secret[=:]\s*[^\s&]+/gi,/Authorization:\s*[^\r\n]+/gi,/eyJ[A-Za-z0-9_-]*\.eyJ[A-Za-z0-9_-]*\.[A-Za-z0-9_-]*/g],y="ETIMEDOUT",d="ECONNRESET",_="ENOTFOUND",w="ECONNREFUSED",g="TimeoutError",T="AbortError",v="FetchError",b=204,x=429,E={retries:1,minTimeout:30},R={timeout:600},O={responseBodyType:"json"},K="newRelic",C={...{},isNoticeable:t=>!0},k=(t,e,r)=>{if(!t[K])return;const{metrics:o}=t[K];if(!o)throw new Error("The New Relic wrapper must be ordered before any wrappers that append metrics!");o[e]=r},N=(t,e)=>(m(e,K,C),async(e,r)=>{const o={};r[K].metrics=o;try{return await t(e,r)}catch(t){throw r[K].options.isNoticeable(t)&&function(){f.noticeError(...arguments)}(t),o.error=!0,t.name&&(o["error.name"]=t.name),t.message&&(o["error.message"]=(t=>{if(!t||"string"!=typeof t)return t;let e=t;return h.forEach(t=>{e=e.replace(t,"[REDACTED]")}),e})(t.message)),t}finally{!function(){f.addPageAction(...arguments)}(r[K].options.prefix||r.name,o)}});N.contextKey=K;var j=Object.freeze({__proto__:null,contextKey:K,getWrapper:N,recordMetric:k});const D="duration",S=t=>async(e,r)=>{const o=Date.now();try{return await t(e,r)}finally{const t=Date.now()-o;r[D].elapsed=t,k(r,`${D}.elapsed`,t)}};S.contextKey=D;var z=Object.freeze({__proto__:null,contextKey:D,getWrapper:S});class A extends Error{constructor(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;super();const{url:o,status:n,statusText:i}=t;this.status=n,this.statusText=i,this.url=o,this.message=`${n} ${i} (${o}) - ${e}`,this.name=`FetchHttpError${n}`,this.upstreamError=r,Error.captureStackTrace?Error.captureStackTrace(this,A):this.stack=new Error(this.message).stack}}const $={...O,validateResponse:async t=>{if(!t.ok){const{headers:e}=t;let r,o;try{const n=e.get("content-type")||"";if("0"===e.get("content-length"))o=t.statusText;else if(n.includes("json")){const e=await t.text();if(e)try{r=JSON.parse(e),o=r.description||r.message||JSON.stringify(r)}catch(t){o=e}else o=t.statusText}else if(n.includes("text/")||n.includes("html")){o=await t.text()||t.statusText}else o=t.statusText}catch(e){o=t.statusText}throw new A(t,o,r)}}},F=t=>!t.status||t.status===x||5===Math.trunc(t.status/100),M="fetch",B=(t,e)=>{if(!fetch)throw new Error("No globally available `fetch` implementation could be found.");return m(e,M,$),async(t,e)=>{const[r]=t,n=o(e),i={...e[M].options,...n&&{signal:n}},{responseBodyType:s}=i,a=["json","text","blob","arrayBuffer","formData"];if(null!=s&&!a.includes(s))throw new TypeError(`Invalid responseBodyType: "${s}". Must be one of: ${a.join(", ")}`);let c;k(e,`${M}.url`,(t=>{if(!t||"string"!=typeof t)return t;try{const e=new URL(t);return e.search="",e.hash="",e.toString()}catch{return t.split("?")[0].split("#")[0]}})(r));try{c=await fetch(r,i)}catch(t){if(t.name===T)return null;throw t}const{status:u}=c;return k(e,`${M}.status`,c.status),u===b?null:(null!==i.validateResponse&&await i.val
1idateResponse(c),null===s?c:c[s]())}};B.contextKey=M;var I=Object.freeze({__proto__:null,contextKey:M,defaultCircuitBreakerErrorFilter:t=>!F(t),defaultIsRetryable:F,getWrapper:B});function P(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var W,U,J,q,H,L,Z,V={};function Y(){return J||(J=1,t=V,e=function(){if(U)return W;function t(t,e){"boolean"==typeof e&&(e={forever:e}),this._originalTimeouts=JSON.parse(JSON.stringify(t)),this._timeouts=t,this._options=e||{},this._maxRetryTime=e&&e.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}return U=1,W=t,t.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)},t.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null},t.prototype.retry=function(t){if(this._timeout&&clearTimeout(this._timeout),!t)return!1;var e=(new Date).getTime();if(t&&e-this._operationStart>=this._maxRetryTime)return this._errors.push(t),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(t);var r=this._timeouts.shift();if(void 0===r){if(!this._cachedTimeouts)return!1;this._errors.splice(0,this._errors.length-1),r=this._cachedTimeouts.slice(-1)}var o=this;return this._timer=setTimeout(function(){o._attempts++,o._operationTimeoutCb&&(o._timeout=setTimeout(function(){o._operationTimeoutCb(o._attempts)},o._operationTimeout),o._options.unref&&o._timeout.unref()),o._fn(o._attempts)},r),this._options.unref&&this._timer.unref(),!0},t.prototype.attempt=function(t,e){this._fn=t,e&&(e.timeout&&(this._operationTimeout=e.timeout),e.cb&&(this._operationTimeoutCb=e.cb));var r=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){r._operationTimeoutCb()},r._operationTimeout)),this._operationStart=(new Date).getTime(),this._fn(this._attempts)},t.prototype.try=function(t){console.log("Using RetryOperation.try() is deprecated"),this.attempt(t)},t.prototype.start=function(t){console.log("Using RetryOperation.start() is deprecated"),this.attempt(t)},t.prototype.start=t.prototype.try,t.prototype.errors=function(){return this._errors},t.prototype.attempts=function(){return this._attempts},t.prototype.mainError=function(){if(0===this._errors.length)return null;for(var t={},e=null,r=0,o=0;o<this._errors.length;o++){var n=this._errors[o],i=n.message,s=(t[i]||0)+1;t[i]=s,s>=r&&(e=n,r=s)}return e},W}(),t.operation=function(r){var o=t.timeouts(r);return new e(o,{forever:r&&(r.forever||r.retries===1/0),unref:r&&r.unref,maxRetryTime:r&&r.maxRetryTime})},t.timeouts=function(t){if(t instanceof Array)return[].concat(t);var e={retries:10,factor:2,minTimeout:1e3,maxTimeout:1/0,randomize:!1};for(var r in t)e[r]=t[r];if(e.minTimeout>e.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var o=[],n=0;n<e.retries;n++)o.push(this.createTimeout(n,e));return t&&t.forever&&!o.length&&o.push(this.createTimeout(n,e)),o.sort(function(t,e){return t-e}),o},t.createTimeout=function(t,e){var r=e.randomize?Math.random()+1:1,o=Math.round(r*Math.max(e.minTimeout,1)*Math.pow(e.factor,t));return o=Math.min(o,e.maxTimeout)},t.wrap=function(e,r,o){if(r instanceof Array&&(o=r,r=null),!o)for(var n in o=[],e)"function"==typeof e[n]&&o.push(n);for(var i=0;i<o.length;i++){var s=o[i],a=e[s];e[s]=function(o){var n=t.operation(r),i=Array.prototype.slice.call(arguments,1),s=i.pop();i.push(function(t){n.retry(t)||(t&&(arguments[0]=n.mainError()),s.apply(this,arguments))}),n.attempt(function(){o.apply(e,i)})}.bind(e,a),e[s].options=r}}),V;var t,e}var G=P(function(){if(Z)return L;Z=1;var t=H?q:(H=1,q=Y());return L=function(e,r){return new Promise(function(o,n){var i,s=r||{};function a(t){n(t||new Error("Aborted"))}function c(t,e){t.bail?a(t):i.retry(t)?s.onRetry&&s.onRetry(t,e):n(i.mainError())}"randomize"in s||(s.randomize=!0),(i=t.operation(s)).attempt(function(t){var r;try{r=e(a,t)}catch(e){return void c(e,t)}Promise.resolve(r).then(o).catch(function(e){c(e,t)})})})}}());const Q="retry",X={...E,isRetryable:t=>{if(!t)return!1;const e=t.name||"",r=t.code||"";if([y,d,_,w].includes(r))return!0;return!![g,T,v].includes(e)||void 0!==t.status&&(t.status===x||5===Math.trunc(t.status/100))}},tt=(t,e)=>(m(e,Q,X),async(e,r)=>{let o=0;try{return await G(async(n,i)=>{o=i;try{return await t(e,r)}catch(t){const{isRetryable:e}=r[Q].options;if(!await e(t))return n(t),null;throw t}},r[Q].options)}finally{r[Q].attempts=o,k(r,`${Q}.attempts`,o)}});tt.contextKey=Q;var et=Object.freeze({__proto__:null,contextKey:Q,getWrapper:tt});const rt="timeout",ot=R;let nt;const it=(t,e)=>(m(e,rt,ot),async(e,r)=>{nt||(nt=await Promise.resolve().then(function(){return wt}));const{timeout:o}=r[rt].options;return nt.default(t(e,r),{milliseconds:o,message:`${r.name} promise timed out after ${o} milliseconds`})});it.contextKey=rt;var st=Object.freeze({__proto__:null,contextKey:rt,getWrapper:it});const at={abort:i,circuitBreaker:c,contextTerminus:p,duration:z,fetch:I,newRelic:j,retry:et,timeout:st},ct=[j,z,c,et,st,i,p],ut=function(){return!(arguments.length>0&&void 0!==arguments[0])||arguments[0]?ct:ct.filter(t=>t!==p)},lt=(t,e,r)=>{const o={...t};return r.forEach(r=>{const{contextKey:n}=r;o[n]={...t[n]||{}},o[n].options={...o[n].options||{},...e[n]||{}}}),o},pt=()=>{const t=new Set,e=function(e,r){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:ut();if(!e||"string"!=typeof e)throw new Error("hysteriCall requires a non-empty string name parameter");(t=>{const e=t.map(t=>t.contextKey),r=t=>e.indexOf(t),o=r("circuitBreaker"),n=r("retry");if(-1!==o&&-1!==n&&o>n)throw new Error("Invalid wrapper order: circuitBreaker must come before retry to properly track failure rates");const i=r("timeout"),s=r("abort");if(-1!==i&&-1!==s&&i>s)throw new Error("Invalid wrapper order: timeout must come before abort so timeouts can trigger abort");const a=r("newRelic");if(-1!==a&&0!==a)throw new Error("Invalid wrapper order: newRelic must be first to accurately measure total execution time");const c=["fetch","contextTerminus"].map(t=>r(t)).filter(t=>-1!==t);if(c.length>0&&Math.max(...c)!==e.length-1)throw new Error("Invalid wrapper order: terminal wrappers (fetch, contextTerminus) must be last in the chain")})(n),t.has(e)?console.warn(`[hysterics] Warning: hysteriCall("${e}", ...) invoked multiple times. This can cause memory leaks and dilute circuit breaker statistics. Consider calling hysteriCall once per service at module scope.`):t.add(e);const i=n.some(t=>"fetch"===t.contextKey||"contextTerminus"===t.contextKey);if(!r&&!i)throw new Error("hysteriCall requires either a function or a terminal wrapper (fetch/contextTerminus) in the wrapper chain.");const s=lt({name:e},o||{},n);let a=r;
1return n.slice().reverse().forEach(t=>{a=t.getWrapper(a,s)}),async function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!Array.isArray(t))throw new Error("Function arguments must be provided as an array");const r=lt(s,e,n);return a(t,r)}};return{hysteriCall:e,hysteriFetch:function(t){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!t||"string"!=typeof t)throw new Error("hysteriFetch requires a non-empty string name parameter");const o={...r,[at.retry.contextKey]:{isRetryable:at.fetch.defaultIsRetryable,...r?r[at.retry.contextKey]:{}},[at.circuitBreaker.contextKey]:{errorFilter:at.fetch.defaultCircuitBreakerErrorFilter,...r?r[at.circuitBreaker.contextKey]:{}}},n=e(t,null,o,[at.newRelic,at.duration,at.circuitBreaker,at.retry,at.timeout,at.abort,at.fetch]);return async function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const o={...r,[at.fetch.contextKey]:{...e||{},...r?r[at.fetch.contextKey]:{}}};return n([t],o)}}}},mt=pt(),{hysteriCall:ft}=mt,{hysteriFetch:ht}=mt;function yt(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var o=r.call(t,e);if("object"!=typeof o)return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}class dt extends Error{constructor(t,e){var r;super(t,e),yt(this,"name","TimeoutError"),null===(r=Error.captureStackTrace)||void 0===r||r.call(Error,this,dt)}}const _t=t=>{var e;return null!==(e=t.reason)&&void 0!==e?e:new DOMException("This operation was aborted.","AbortError")};var wt=Object.freeze({__proto__:null,TimeoutError:dt,default:function(t,e){const{milliseconds:r,fallback:o,message:n,customTimers:i={setTimeout:setTimeout,clearTimeout:clearTimeout},signal:s}=e;let a,c;const u=new Promise((e,u)=>{if("number"!=typeof r||1!==Math.sign(r))throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${r}\``);if(null!=s&&s.aborted)return void u(_t(s));if(s&&(c=()=>{u(_t(s))},s.addEventListener("abort",c,{once:!0})),t.then(e,u),r===Number.POSITIVE_INFINITY)return;const l=new dt;a=i.setTimeout.call(void 0,()=>{if(o)try{e(o())}catch(t){u(t)}else"function"==typeof t.cancel&&t.cancel(),!1===n?e():n instanceof Error?u(n):(l.message=null!=n?n:`Promise timed out after ${r} milliseconds`,u(l))},r)}).finally(()=>{u.clear(),c&&s&&s.removeEventListener("abort",c)});return u.clear=()=>{i.clearTimeout.call(void 0,a),a=void 0},u}});t.createHystericsFactory=pt,t.getDefaultWrappers=ut,t.hysteriCall=ft,t.hysteriFetch=ht,t.wrappers=at});
2//# sourceMappingURL=hysterics.js.map

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.