Rocky_Mountain_Vending/.pnpm-store/v10/files/76/6e99e3083ae48e7ac15dc3dc750522e43823c9575e4d613882e44c37906952a170db5e6f0706b820d8bb0d56e23723af38437c82a879ba216b4a1cb87c38a5
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

66 lines
No EOL
3.3 KiB
Text

import { ReflectAdapter } from '../../server/web/spec-extension/adapters/reflect';
import { describeStringPropertyAccess, describeHasCheckingStringProperty, wellKnownProperties } from '../../shared/lib/utils/reflect-utils';
const CachedSearchParams = new WeakMap();
function makeUntrackedSearchParamsWithDevWarnings(underlyingSearchParams) {
const cachedSearchParams = CachedSearchParams.get(underlyingSearchParams);
if (cachedSearchParams) {
return cachedSearchParams;
}
const proxiedProperties = new Set();
const promise = Promise.resolve(underlyingSearchParams);
Object.keys(underlyingSearchParams).forEach((prop)=>{
if (wellKnownProperties.has(prop)) {
// These properties cannot be shadowed because they need to be the
// true underlying value for Promises to work correctly at runtime
} else {
proxiedProperties.add(prop);
}
});
const proxiedPromise = new Proxy(promise, {
get (target, prop, receiver) {
if (typeof prop === 'string') {
if (!wellKnownProperties.has(prop) && (proxiedProperties.has(prop) || // We are accessing a property that doesn't exist on the promise nor
// the underlying searchParams.
Reflect.has(target, prop) === false)) {
const expression = describeStringPropertyAccess('searchParams', prop);
warnForSyncAccess(expression);
}
}
return ReflectAdapter.get(target, prop, receiver);
},
set (target, prop, value, receiver) {
if (typeof prop === 'string') {
proxiedProperties.delete(prop);
}
return Reflect.set(target, prop, value, receiver);
},
has (target, prop) {
if (typeof prop === 'string') {
if (!wellKnownProperties.has(prop) && (proxiedProperties.has(prop) || // We are accessing a property that doesn't exist on the promise nor
// the underlying searchParams.
Reflect.has(target, prop) === false)) {
const expression = describeHasCheckingStringProperty('searchParams', prop);
warnForSyncAccess(expression);
}
}
return Reflect.has(target, prop);
},
ownKeys (target) {
warnForSyncSpread();
return Reflect.ownKeys(target);
}
});
CachedSearchParams.set(underlyingSearchParams, proxiedPromise);
return proxiedPromise;
}
function warnForSyncAccess(expression) {
console.error(`A searchParam property was accessed directly with ${expression}. ` + `\`searchParams\` is a Promise and must be unwrapped with \`React.use()\` before accessing its properties. ` + `Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`);
}
function warnForSyncSpread() {
console.error(`The keys of \`searchParams\` were accessed directly. ` + `\`searchParams\` is a Promise and must be unwrapped with \`React.use()\` before accessing its properties. ` + `Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis`);
}
export function createRenderSearchParamsFromClient(underlyingSearchParams) {
return makeUntrackedSearchParamsWithDevWarnings(underlyingSearchParams);
}
//# sourceMappingURL=search-params.browser.dev.js.map