Rocky_Mountain_Vending/.pnpm-store/v10/files/f2/199efc196bf463ec453871e3b071cc6b76867031e0c5e9a104bff6150a81520837fc9d148c7611d45baa1d8951fda65fe49acba72fcc5f023c6d455cab55ea
DMleadgen 46d973904b
Initial commit: Rocky Mountain Vending website
Next.js website for Rocky Mountain Vending company featuring:
- Product catalog with Stripe integration
- Service areas and parts pages
- Admin dashboard with Clerk authentication
- SEO optimized pages with JSON-LD structured data

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 16:22:15 -07:00

34 lines
1.5 KiB
Text

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.resolveDefaultsModeConfig = void 0;
const property_provider_1 = require("@smithy/property-provider");
const constants_1 = require("./constants");
const resolveDefaultsModeConfig = ({ defaultsMode, } = {}) => (0, property_provider_1.memoize)(async () => {
const mode = typeof defaultsMode === "function" ? await defaultsMode() : defaultsMode;
switch (mode?.toLowerCase()) {
case "auto":
return Promise.resolve(useMobileConfiguration() ? "mobile" : "standard");
case "mobile":
case "in-region":
case "cross-region":
case "standard":
case "legacy":
return Promise.resolve(mode?.toLocaleLowerCase());
case undefined:
return Promise.resolve("legacy");
default:
throw new Error(`Invalid parameter for "defaultsMode", expect ${constants_1.DEFAULTS_MODE_OPTIONS.join(", ")}, got ${mode}`);
}
});
exports.resolveDefaultsModeConfig = resolveDefaultsModeConfig;
const useMobileConfiguration = () => {
const navigator = window?.navigator;
if (navigator?.connection) {
const { effectiveType, rtt, downlink } = navigator?.connection;
const slow = (typeof effectiveType === "string" && effectiveType !== "4g") || Number(rtt) > 100 || Number(downlink) < 10;
if (slow) {
return true;
}
}
return (navigator?.userAgentData?.mobile || (typeof navigator?.maxTouchPoints === "number" && navigator?.maxTouchPoints > 1));
};