PageSourceSearch

https://app.clariumhealth.com/assets/amplifyUrl-DhBXUoj8.js

js clariumhealth.com collected 2026-09-25 15:14:53 UTC 11,740 bytes, 239 lines download raw bytes

1import { x as AmplifyErrorCode } from "./Amplify-ydFdTLPK.js";
2import { n as _objectSpread2, r as init_objectSpread2 } from "./objectWithoutProperties-Cgp7QKOy.js";
3var byteToHex = [];
4for (let i = 0; i < 256; ++i) byteToHex.push((i + 256).toString(16).slice(1));
5function unsafeStringify(arr, offset = 0) {
6	return (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase();
7}
8var getRandomValues;
9var rnds8 = new Uint8Array(16);
10function rng() {
11	if (!getRandomValues) {
12		if (typeof crypto === "undefined" || !crypto.getRandomValues) throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
13		getRandomValues = crypto.getRandomValues.bind(crypto);
14	}
15	return getRandomValues(rnds8);
16}
17var native_default = { randomUUID: typeof crypto !== "undefined" && crypto.randomUUID && crypto.randomUUID.bind(crypto) };
18function v4(options, buf, offset) {
19	var _ref, _options$random, _options$rng;
20	if (native_default.randomUUID && !buf && !options) return native_default.randomUUID();
21	options = options || {};
22	const rnds = (_ref = (_options$random = options.random) !== null && _options$random !== void 0 ? _options$random : (_options$rng = options.rng) === null || _options$rng === void 0 ? void 0 : _options$rng.call(options)) !== null && _ref !== void 0 ? _ref : rng();
23	if (rnds.length < 16) throw new Error("Random bytes length must be >= 16");
24	rnds[6] = rnds[6] & 15 | 64;
25	rnds[8] = rnds[8] & 63 | 128;
26	if (buf) {
27		offset = offset || 0;
28		if (offset < 0 || offset + 16 > buf.length) throw new RangeError(`UUID byte range ${offset}:${offset + 15} is out of buffer bounds`);
29		for (let i = 0; i < 16; ++i) buf[offset + i] = rnds[i];
30		return buf;
31	}
32	return unsafeStringify(rnds);
33}
34var v4_default = v4;
35init_objectSpread2();
36var parseMetadata = (response) => {
37	var _ref, _headers$xAmznReque;
38	const { headers, statusCode } = response;
39	return _objectSpread2(_objectSpread2({}, isMetadataBearer(response) ? response.$metadata : {}), {}, {
40		httpStatusCode: statusCode,
41		requestId: (_ref = (_headers$xAmznReque = headers["x-amzn-requestid"]) !== null && _headers$xAmznReque !== void 0 ? _headers$xAmznReque : headers["x-amzn-request-id"]) !== null && _ref !== void 0 ? _ref : headers["x-amz-request-id"],
42		extendedRequestId: headers["x-amz-id-2"],
43		cfId: headers["x-amz-cf-id"]
44	});
45};
46var isMetadataBearer = (response) => typeof (response === null || response === void 0 ? void 0 : response.$metadata) === "object";
47init_objectSpread2();
48var composeServiceApi = (transferHandler, serializer, deserializer, defaultConfig) => {
49	return async (config, input) => {
50		const resolvedConfig = _objectSpread2(_objectSpread2({}, defaultConfig), config);
51		return deserializer(await transferHandler(await serializer(input, await resolvedConfig.endpointResolver(resolvedConfig, input)), _objectSpread2({}, resolvedConfig)));
52	};
53};
54var MAX_DELAY_MS = 300 * 1e3;
55function jitteredBackoff(maxDelayMs = MAX_DELAY_MS) {
56	const BASE_TIME_MS = 100;
57	const JITTER_FACTOR = 100;
58	return (attempt) => {
59		const delay = 2 ** attempt * BASE_TIME_MS + JITTER_FACTOR * Math.random();
60		return delay > maxDelayMs ? false : delay;
61	};
62}
63var AMZ_SDK_INVOCATION_ID_HEADER = "amz-sdk-invocation-id";
64var AMZ_SDK_REQUEST_HEADER = "amz-sdk-request";
65var DEFAULT_MAX_DELAY_MS = 300 * 1e3;
66var jitteredBackoff$1 = (attempt) => {
67	const delay = jitteredBackoff(DEFAULT_MAX_DELAY_MS)(attempt);
68	return delay === false ? DEFAULT_MAX_DELAY_MS : delay;
69};
70var CLOCK_SKEW_ERROR_CODES = [
71	"AuthFailure",
72	"InvalidSignatureException",
73	"RequestExpired",
74	"RequestInTheFuture",
75	"RequestTimeTooSkewed",
76	"SignatureDoesNotMatch",
77	"BadRequestException"
78];
79var isClockSkewError = (errorCode) => !!errorCode && CLOCK_SKEW_ERROR_CODES.includes(errorCode);
80var getRetryDecider = (errorParser) => async (response, error) => {
81	var _ref;
82	const parsedError = (_ref = error !== null && error !== void 0 ? error : await errorParser(response)) !== null && _ref !== void 0 ? _ref : void 0;
83	const errorCode = (parsedError === null || parsedError === void 0 ? void 0 : parsedError.code) || (parsedError === null || parsedError === void 0 ? void 0 : parsedError.name);
84	const statusCode = response === null || response === void 0 ? void 0 : response.statusCode;
85	return { retryable: isConnectionError(error) || isThrottlingError(statusCode, errorCode) || isClockSkewError(errorCode) || isServerSideError(statusCode, errorCode) };
86};
87var THROTTLING_ERROR_CODES = [
88	"BandwidthLimitExceeded",
89	"EC2ThrottledException",
90	"LimitExceededException",
91	"PriorRequestNotComplete",
92	"ProvisionedThroughputExceededException",
93	"RequestLimitExceeded",
94	"RequestThrottled",
95	"RequestThrottledException",
96	"SlowDown",
97	"ThrottledException",
98	"Throttling",
99	"ThrottlingException",
100	"TooManyRequestsException"
101];
102var TIMEOUT_ERROR_CODES = [
103	"TimeoutError",
104	"RequestTimeout",
105	"RequestTimeoutException"
106];
107var isThrottlingError = (statusCode, errorCode) => statusCode === 429 || !!errorCode && THROTTLING_ERROR_CODES.includes(errorCode);
108var isConnectionError = (error) => [AmplifyErrorCode.NetworkError, "ERR_NETWORK"].includes(error === null || error === void 0 ? void 0 : error.name);
109var isServerSideError = (statusCode, errorCode) => !!statusCode && [
110	500,
111	502,
112	503,
113	504
114].includes(statusCode) || !!errorCode && TIMEOUT_ERROR_CODES.includes(errorCode);
115init_objectSpread2();
116var retryMiddlewareFactory = ({ maxAttempts = 3, retryDecider, computeDelay, abortSignal }) => {
117	if (maxAttempts < 1) throw new Error("maxAttempts must be greater than 0");
118	return (next, context) => async function retryMiddleware(request) {
119		var _context$attemptsCoun;
120		let error;
121		let attemptsCount = (_context$attemptsCoun = context.attemptsCount) !== null && _context$attemptsCoun !== void 0 ? _context$attemptsCoun : 0;
122		let response;
123		const handleTerminalErrorOrResponse = () => {
124			if (response) {
125				addOrIncrementMetadataAttempts(response, attemptsCount);
126				return response;
127			} else {
128				addOrIncrementMetadataAttempts(error, attemptsCount);
129				throw error;
130			}
131		};
132		while (!(abortSignal === null || abortSignal === void 0 ? void 0 : abortSignal.aborted) && attemptsCount < maxAttempts) {
133			var _context$attemptsCoun2, _context$attemptsCoun3;
134			try {
135				response = await next(request);
136				error = void 0;
137			} catch (e) {
138				error = e;
139				response = void 0;
140			}
141			attemptsCount = ((_context$attemptsCoun2 = context.attemptsCount) !== null && _context$attemptsCoun2 !== void 0 ? _context$attemptsCoun2 : 0) > attemptsCount ? (_context$attemptsCoun3 = context.attemptsCount) !== null && _context$attemptsCoun3 !== void 0 ? _context$attemptsCoun3 : 0 : attemptsCount + 1;
142			context.attemptsCount = attemptsCount;
143			const { isCredentialsExpiredError, retryable } = await retryDecider(response, error, context);
144			if (retryable) {
145				context.isCredentialsExpired = !!isCredentialsExpiredError;
146				if (!(abortSignal === null || abortSignal === void 0 ? void 0 : abortSignal.aborted) && attemptsCount < maxAttempts) await cancellableSleep(computeDelay(attemptsCount), abortSignal);
147				continue;
148			} else return handleTerminalErrorOrResponse();
149		}
150		if (abortSignal === null || abortSignal === void 0 ? void 0 : abortSignal.aborted) throw new Error("Request aborted.");
151		else return handleTerminalErrorOrResponse();
152	};
153};
154var cancellableSleep = (timeoutMs, abortSignal) => {
155	if (abortSignal === null || abortSignal === void 0 ? void 0 : abortSignal.aborted) return Promise.resolve();
156	let timeoutId;
157	let sleepPromiseResolveFn;
158	const sleepPromise = new Promise((resolve) => {
159		sleepPromiseResolveFn = resolve;
160		timeoutId = setTimeout(resolve, timeoutMs);
161	});
162	abortSignal === null || abortSignal === void 0 || abortSignal.addEventListener("abort", function cancelSleep(_) {
163		clearTimeout(timeoutId);
164		abortSignal === null || abortSignal === void 0 || abortSignal.removeEventListener("abort", cancelSleep);
165		sleepPromiseResolveFn();
166	});
167	return sleepPromise;
168};
169var addOrIncrementMetadataAttempts = (nextHandlerOutput, attempts) => {
170	var _nextHandlerOutput$$m;
171	if (Object.prototype.toString.call(nextHandlerOutput) !== "[object Object]") return;
172	nextHandlerOutput.$metadata = _objectSpread2(_objectSpread2({}, (_nextHandlerOutput$$m = nextHandlerOutput.$metadata) !== null && _nextHandlerOutput$$m !== void 0 ? _nextHandlerOutput$$m : {}), {}, { attempts });
173};
174var amplifyUuid = v4_default;
175var amzSdkInvocationIdHeaderMiddlewareFactory = () => (next) => {
176	return async function amzSdkInvocationIdHeaderMiddleware(request) {
177		if (!request.headers["amz-sdk-invocation-id"]) request.headers[AMZ_SDK_INVOCATION_ID_HEADER] = amplifyUuid();
178		return next(request);
179	};
180};
181var amzSdkRequestHeaderMiddlewareFactory = ({ maxAttempts = 3 }) => (next, context) => {
182	return async function amzSdkRequestHeaderMiddleware(request) {
183		var _context$attemptsCoun;
184		const attemptsCount = (_context$attemptsCoun = context.attemptsCount) !== null && _context$attemptsCoun !== void 0 ? _context$attemptsCoun : 0;
185		request.headers[AMZ_SDK_REQUEST_HEADER] = `attempt=${attemptsCount + 1}; max=${maxAttempts}`;
186		return next(request);
187	};
188};
189var userAgentMiddlewareFactory = ({ userAgentHeader = "x-amz-user-agent", userAgentValue = "" }) => (next) => {
190	return async function userAgentMiddleware(request) {
191		if (userAgentValue.trim().length === 0) return await next(request);
192		else {
193			const headerName = userAgentHeader.toLowerCase();
194			request.headers[headerName] = request.headers[headerName] ? `${request.headers[headerName]} ${userAgentValue}` : userAgentValue;
195			return await next(request);
196		}
197	};
198};
199var composeTransferHandler = (coreHandler, middleware) => (request, options) => {
200	const context = {};
201	let composedHandler = (composeHandlerRequest) => coreHandler(composeHandlerRequest, options);
202	for (let i = middleware.length - 1; i >= 0; i--) {
203		const m = middleware[i];
204		composedHandler = m(options)(composedHandler, context);
205	}
206	return composedHandler(request);
207};
208var withMemoization = (payloadAccessor) => {
209	let cached;
210	return () => {
211		if (!cached) cached = payloadAccessor();
212		return cached;
213	};
214};
215var defaultPartition = {
216	id: "aws",
217	outputs: { dnsSuffix: "amazonaws.com" },
218	regionRegex: "^(us|eu|ap|sa|ca|me|af)\\-\\w+\\-\\d+$",
219	regions: ["aws-global"]
220};
221var partitionsInfo = { partitions: [defaultPartition, {
222	id: "aws-cn",
223	outputs: { dnsSuffix: "amazonaws.com.cn" },
224	regionRegex: "^cn\\-\\w+\\-\\d+$",
225	regions: ["aws-cn-global"]
226}] };
227var getDnsSuffix = (region) => {
228	const { partitions } = partitionsInfo;
229	for (const { regions, outputs, regionRegex } of partitions) {
230		const regex = new RegExp(regionRegex);
231		if (regions.includes(region) || regex.test(region)) return outputs.dnsSuffix;
232	}
233	return defaultPartition.outputs.dnsSuffix;
234};
235var AmplifyUrl = URL;
236var AmplifyUrlSearchParams = URLSearchParams;
237export { composeTransferHandler as a, amzSdkInvocationIdHeaderMiddlewareFactory as c, jitteredBackoff$1 as d, composeServiceApi as f, withMemoization as i, retryMiddlewareFactory as l, AmplifyUrlSearchParams as n, userAgentMiddlewareFactory as o, parseMetadata as p, getDnsSuffix as r, amzSdkRequestHeaderMiddlewareFactory as s, AmplifyUrl as t, getRetryDecider as u };
238
239//# sourceMappingURL=amplifyUrl-DhBXUoj8.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.