Rocky_Mountain_Vending/.pnpm-store/v10/files/e7/7850e5d6043dae2e89263d1e6aba57ce1b03d8e69cbcf5bebd2b903a7a49ec72f3498d91088b365778b9ac60d855d9e9bc352b9efceba842324453e06bff59
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.3 KiB
Text

{"version":3,"sources":["../../../src/shared/lib/server-reference-info.ts"],"sourcesContent":["export interface ServerReferenceInfo {\n type: 'server-action' | 'use-cache'\n usedArgs: [boolean, boolean, boolean, boolean, boolean, boolean]\n hasRestArgs: boolean\n}\n\n/**\n * Extracts info about the server reference for the given server reference ID by\n * parsing the first byte of the hex-encoded ID.\n *\n * ```\n * Bit positions: [7] [6] [5] [4] [3] [2] [1] [0]\n * Bits: typeBit argMask restArgs\n * ```\n *\n * If the `typeBit` is `1` the server reference represents a `\"use cache\"`\n * function, otherwise a server action.\n *\n * The `argMask` encodes whether the function uses the argument at the\n * respective position.\n *\n * The `restArgs` bit indicates whether the function uses a rest parameter. It's\n * also set to 1 if the function has more than 6 args.\n *\n * @param id hex-encoded server reference ID\n */\nexport function extractInfoFromServerReferenceId(\n id: string\n): ServerReferenceInfo {\n const infoByte = parseInt(id.slice(0, 2), 16)\n const typeBit = (infoByte >> 7) & 0x1\n const argMask = (infoByte >> 1) & 0x3f\n const restArgs = infoByte & 0x1\n const usedArgs = Array(6)\n\n for (let index = 0; index < 6; index++) {\n const bitPosition = 5 - index\n const bit = (argMask >> bitPosition) & 0x1\n usedArgs[index] = bit === 1\n }\n\n return {\n type: typeBit === 1 ? 'use-cache' : 'server-action',\n usedArgs: usedArgs as [\n boolean,\n boolean,\n boolean,\n boolean,\n boolean,\n boolean,\n ],\n hasRestArgs: restArgs === 1,\n }\n}\n\n/**\n * Creates a sparse array containing only the used arguments based on the\n * provided action info.\n */\nexport function omitUnusedArgs(\n args: unknown[],\n info: ServerReferenceInfo\n): unknown[] {\n const filteredArgs = new Array(args.length)\n\n for (let index = 0; index < args.length; index++) {\n if (\n (index < 6 && info.usedArgs[index]) ||\n // This assumes that the server reference info byte has the restArgs bit\n // set to 1 if there are more than 6 args.\n (index >= 6 && info.hasRestArgs)\n ) {\n filteredArgs[index] = args[index]\n }\n }\n\n return filteredArgs\n}\n"],"names":["extractInfoFromServerReferenceId","id","infoByte","parseInt","slice","typeBit","argMask","restArgs","usedArgs","Array","index","bitPosition","bit","type","hasRestArgs","omitUnusedArgs","args","info","filteredArgs","length"],"mappings":"AAMA;;;;;;;;;;;;;;;;;;;CAmBC,GACD,OAAO,SAASA,iCACdC,EAAU;IAEV,MAAMC,WAAWC,SAASF,GAAGG,KAAK,CAAC,GAAG,IAAI;IAC1C,MAAMC,UAAU,AAACH,YAAY,IAAK;IAClC,MAAMI,UAAU,AAACJ,YAAY,IAAK;IAClC,MAAMK,WAAWL,WAAW;IAC5B,MAAMM,WAAWC,MAAM;IAEvB,IAAK,IAAIC,QAAQ,GAAGA,QAAQ,GAAGA,QAAS;QACtC,MAAMC,cAAc,IAAID;QACxB,MAAME,MAAM,AAACN,WAAWK,cAAe;QACvCH,QAAQ,CAACE,MAAM,GAAGE,QAAQ;IAC5B;IAEA,OAAO;QACLC,MAAMR,YAAY,IAAI,cAAc;QACpCG,UAAUA;QAQVM,aAAaP,aAAa;IAC5B;AACF;AAEA;;;CAGC,GACD,OAAO,SAASQ,eACdC,IAAe,EACfC,IAAyB;IAEzB,MAAMC,eAAe,IAAIT,MAAMO,KAAKG,MAAM;IAE1C,IAAK,IAAIT,QAAQ,GAAGA,QAAQM,KAAKG,MAAM,EAAET,QAAS;QAChD,IACE,AAACA,QAAQ,KAAKO,KAAKT,QAAQ,CAACE,MAAM,IAClC,wEAAwE;QACxE,0CAA0C;QACzCA,SAAS,KAAKO,KAAKH,WAAW,EAC/B;YACAI,YAAY,CAACR,MAAM,GAAGM,IAAI,CAACN,MAAM;QACnC;IACF;IAEA,OAAOQ;AACT","ignoreList":[0]}