Rocky_Mountain_Vending/.pnpm-store/v10/files/ff/42d592187f4be24f834d07e868f0d862d8bac57e2efe38486a5216721bd0d021e049ebf53c6ef676e3ed080637e5311e90e904bb8225faf01d60b86f9c7158
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

51 lines
No EOL
1.2 KiB
Text

/**
* @license
* Copyright 2024 Google Inc.
* SPDX-License-Identifier: Apache-2.0
*/
import { source as injectedSource } from '../generated/injected.js';
/**
* @internal
*/
export class ScriptInjector {
#updated = false;
#amendments = new Set();
// Appends a statement of the form `(PuppeteerUtil) => {...}`.
append(statement) {
this.#update(() => {
this.#amendments.add(statement);
});
}
pop(statement) {
this.#update(() => {
this.#amendments.delete(statement);
});
}
inject(inject, force = false) {
if (this.#updated || force) {
inject(this.#get());
}
this.#updated = false;
}
#update(callback) {
callback();
this.#updated = true;
}
#get() {
return `(() => {
const module = {};
${injectedSource}
${[...this.#amendments]
.map(statement => {
return `(${statement})(module.exports.default);`;
})
.join('')}
return module.exports.default;
})()`;
}
}
/**
* @internal
*/
export const scriptInjector = new ScriptInjector();
//# sourceMappingURL=ScriptInjector.js.map