Rocky_Mountain_Vending/.pnpm-store/v10/files/d3/e0d182b99a80ba078dc6a58b8a33e274d0f553a57641e73df363c199a52a7f11a288f67392f5568a35e589b2c22b764564ae9751c0b5495f90dbba8f84da4c
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

1 line
No EOL
3.4 KiB
Text

{"version":3,"sources":["../../../src/client/components/promise-queue.ts"],"sourcesContent":["/*\n This is a simple promise queue that allows you to limit the number of concurrent promises\n that are running at any given time. It's used to limit the number of concurrent\n prefetch requests that are being made to the server but could be used for other\n things as well.\n*/\nexport class PromiseQueue {\n #maxConcurrency: number\n #runningCount: number\n #queue: Array<{\n promiseFn: Promise<any>\n task: () => void\n }>\n\n constructor(maxConcurrency = 5) {\n this.#maxConcurrency = maxConcurrency\n this.#runningCount = 0\n this.#queue = []\n }\n\n enqueue<T>(promiseFn: () => Promise<T>): Promise<T> {\n let taskResolve: (value: T | PromiseLike<T>) => void\n let taskReject: (reason?: any) => void\n\n const taskPromise = new Promise((resolve, reject) => {\n taskResolve = resolve\n taskReject = reject\n }) as Promise<T>\n\n const task = async () => {\n try {\n this.#runningCount++\n const result = await promiseFn()\n taskResolve(result)\n } catch (error) {\n taskReject(error)\n } finally {\n this.#runningCount--\n this.#processNext()\n }\n }\n\n const enqueueResult = { promiseFn: taskPromise, task }\n // wonder if we should take a LIFO approach here\n this.#queue.push(enqueueResult)\n this.#processNext()\n\n return taskPromise\n }\n\n bump(promiseFn: Promise<any>) {\n const index = this.#queue.findIndex((item) => item.promiseFn === promiseFn)\n\n if (index > -1) {\n const bumpedItem = this.#queue.splice(index, 1)[0]\n this.#queue.unshift(bumpedItem)\n this.#processNext(true)\n }\n }\n\n #processNext(forced = false) {\n if (\n (this.#runningCount < this.#maxConcurrency || forced) &&\n this.#queue.length > 0\n ) {\n this.#queue.shift()?.task()\n }\n }\n}\n"],"names":["PromiseQueue","constructor","maxConcurrency","enqueue","promiseFn","taskResolve","taskReject","taskPromise","Promise","resolve","reject","task","result","error","enqueueResult","push","bump","index","findIndex","item","bumpedItem","splice","unshift","forced","length","shift"],"mappings":"AAAA;;;;;AAKA;;;;+BACaA;;;eAAAA;;;AAAN,MAAMA;IACX,CAAA,cAAe,CAAQ;IACvB,CAAA,YAAa,CAAQ;IACrB,CAAA,KAAM,CAGJ;IAEFC,YAAYC,iBAAiB,CAAC,CAAE;QAC9B,IAAI,CAAC,CAAA,cAAe,GAAGA;QACvB,IAAI,CAAC,CAAA,YAAa,GAAG;QACrB,IAAI,CAAC,CAAA,KAAM,GAAG,EAAE;IAClB;IAEAC,QAAWC,SAA2B,EAAc;QAClD,IAAIC;QACJ,IAAIC;QAEJ,MAAMC,cAAc,IAAIC,QAAQ,CAACC,SAASC;YACxCL,cAAcI;YACdH,aAAaI;QACf;QAEA,MAAMC,OAAO;YACX,IAAI;gBACF,IAAI,CAAC,CAAA,YAAa;gBAClB,MAAMC,SAAS,MAAMR;gBACrBC,YAAYO;YACd,EAAE,OAAOC,OAAO;gBACdP,WAAWO;YACb,SAAU;gBACR,IAAI,CAAC,CAAA,YAAa;gBAClB,IAAI,CAAC,CAAA,WAAY;YACnB;QACF;QAEA,MAAMC,gBAAgB;YAAEV,WAAWG;YAAaI;QAAK;QACrD,gDAAgD;QAChD,IAAI,CAAC,CAAA,KAAM,CAACI,IAAI,CAACD;QACjB,IAAI,CAAC,CAAA,WAAY;QAEjB,OAAOP;IACT;IAEAS,KAAKZ,SAAuB,EAAE;QAC5B,MAAMa,QAAQ,IAAI,CAAC,CAAA,KAAM,CAACC,SAAS,CAAC,CAACC,OAASA,KAAKf,SAAS,KAAKA;QAEjE,IAAIa,QAAQ,CAAC,GAAG;YACd,MAAMG,aAAa,IAAI,CAAC,CAAA,KAAM,CAACC,MAAM,CAAC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