bitsnap-react 1.20.0 → 1.21.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (124) hide show
  1. package/dist/BitsnapCart-3RSI3PIM.mjs +2 -0
  2. package/dist/BitsnapCart-4DKJ7OXL.js +2 -0
  3. package/dist/BitsnapCart-4DKJ7OXL.js.map +1 -0
  4. package/dist/{CartProvider-G7FQUPXL.mjs → CartProvider-TXRCAXOT.mjs} +2 -2
  5. package/dist/CartProvider-ZAGTSCHJ.js +2 -0
  6. package/dist/CartProvider-ZAGTSCHJ.js.map +1 -0
  7. package/dist/PanelModelFiles-EKQRLF46.js.map +1 -1
  8. package/dist/analytics.js +1 -1
  9. package/dist/analytics.js.map +1 -1
  10. package/dist/analytics.mjs +1 -1
  11. package/dist/catalog.js +1 -1
  12. package/dist/catalog.js.map +1 -1
  13. package/dist/catalog.mjs +1 -1
  14. package/dist/chat.d.mts +2 -2
  15. package/dist/chat.d.ts +2 -2
  16. package/dist/chat.js +1 -1
  17. package/dist/chat.js.map +1 -1
  18. package/dist/chat.mjs +1 -1
  19. package/dist/chat.mjs.map +1 -1
  20. package/dist/{chunk-A2ZDFN3J.mjs → chunk-2HINORSP.mjs} +2 -2
  21. package/dist/{chunk-EFN4OW2C.js → chunk-3TUL63IC.js} +2 -2
  22. package/dist/chunk-3TUL63IC.js.map +1 -0
  23. package/dist/chunk-56X4DBMQ.mjs +5 -0
  24. package/dist/chunk-56X4DBMQ.mjs.map +1 -0
  25. package/dist/{chunk-4Y233NII.js → chunk-6DEKVABT.js} +2 -2
  26. package/dist/chunk-6DEKVABT.js.map +1 -0
  27. package/dist/chunk-6Q3VGPSF.js.map +1 -1
  28. package/dist/{chunk-LHQEM3CU.mjs → chunk-7WTQGXPQ.mjs} +2 -2
  29. package/dist/{chunk-IRZJIPUF.js → chunk-EK3D44XW.js} +2 -2
  30. package/dist/chunk-EK3D44XW.js.map +1 -0
  31. package/dist/{chunk-BTERIY6N.mjs → chunk-EXC5Z5VM.mjs} +2 -2
  32. package/dist/{chunk-IXQCN7MR.mjs → chunk-FG7NLLJV.mjs} +2 -2
  33. package/dist/{chunk-RJPQMDIQ.js → chunk-FPCMLZFM.js} +2 -2
  34. package/dist/chunk-FPCMLZFM.js.map +1 -0
  35. package/dist/{chunk-2G46TAUX.mjs → chunk-GLKBCVNH.mjs} +2 -2
  36. package/dist/{chunk-2G46TAUX.mjs.map → chunk-GLKBCVNH.mjs.map} +1 -1
  37. package/dist/{chunk-AQYHQY2Y.js → chunk-J4GUVJP4.js} +2 -2
  38. package/dist/chunk-J4GUVJP4.js.map +1 -0
  39. package/dist/{chunk-TW25G7XX.mjs → chunk-J6WKSO33.mjs} +2 -2
  40. package/dist/{chunk-TW25G7XX.mjs.map → chunk-J6WKSO33.mjs.map} +1 -1
  41. package/dist/{chunk-GHBRR665.js → chunk-J6YI6FJN.js} +2 -2
  42. package/dist/chunk-J6YI6FJN.js.map +1 -0
  43. package/dist/chunk-JSDGZ4NY.js.map +1 -1
  44. package/dist/{chunk-HP3I6D2R.js → chunk-K2HIALKR.js} +2 -2
  45. package/dist/chunk-K2HIALKR.js.map +1 -0
  46. package/dist/chunk-KOYBZORL.js.map +1 -1
  47. package/dist/chunk-MDAFPGPA.js.map +1 -1
  48. package/dist/{chunk-YPA6MMGJ.js → chunk-MMQTRSI5.js} +2 -2
  49. package/dist/chunk-MMQTRSI5.js.map +1 -0
  50. package/dist/chunk-NW5PFIZB.js +2 -0
  51. package/dist/chunk-NW5PFIZB.js.map +1 -0
  52. package/dist/{chunk-C736F727.js → chunk-OCJ7YWFX.js} +2 -2
  53. package/dist/chunk-OCJ7YWFX.js.map +1 -0
  54. package/dist/chunk-Q337IQNA.js.map +1 -1
  55. package/dist/{chunk-URQBHNJK.mjs → chunk-QWQPAN4F.mjs} +2 -2
  56. package/dist/{chunk-KO7ZERN5.mjs → chunk-QXCL5CE6.mjs} +2 -2
  57. package/dist/chunk-TWZQ4CBY.js +5 -0
  58. package/dist/chunk-TWZQ4CBY.js.map +1 -0
  59. package/dist/{chunk-IXX6SUMB.mjs → chunk-VU2MX5HY.mjs} +2 -2
  60. package/dist/chunk-W3RGQYPD.js.map +1 -1
  61. package/dist/{chunk-LHNTSQYO.mjs → chunk-YV3UGLQ3.mjs} +2 -2
  62. package/dist/chunk-Z3YOJ6NZ.js.map +1 -1
  63. package/dist/consent.js.map +1 -1
  64. package/dist/course.js +1 -1
  65. package/dist/course.js.map +1 -1
  66. package/dist/course.mjs +1 -1
  67. package/dist/embed/analytics.js +1 -1
  68. package/dist/errors.js.map +1 -1
  69. package/dist/index.css +1 -1
  70. package/dist/index.css.map +1 -1
  71. package/dist/index.d.mts +2 -2
  72. package/dist/index.d.ts +2 -2
  73. package/dist/index.js +1 -1
  74. package/dist/index.js.map +1 -1
  75. package/dist/index.mjs +1 -1
  76. package/dist/index.mjs.map +1 -1
  77. package/dist/internal.js.map +1 -1
  78. package/dist/methods-27HZQY5L.js +2 -0
  79. package/dist/methods-27HZQY5L.js.map +1 -0
  80. package/dist/methods-27JU6IH7.mjs +2 -0
  81. package/dist/model-files-client-P4PORZJ6.js.map +1 -1
  82. package/dist/models.js.map +1 -1
  83. package/dist/returns.js +1 -1
  84. package/dist/returns.js.map +1 -1
  85. package/dist/returns.mjs +1 -1
  86. package/dist/viewer3d.js.map +1 -1
  87. package/dist/viewer3d.mjs +1 -1
  88. package/dist/{widgets-Bsojw94g.d.ts → widgets-BL6pCMdc.d.ts} +34 -2
  89. package/dist/{widgets-u7xMJbsY.d.mts → widgets-DmHlIbp8.d.mts} +34 -2
  90. package/package.json +1 -1
  91. package/dist/BitsnapCart-V4S4EXYV.js +0 -2
  92. package/dist/BitsnapCart-V4S4EXYV.js.map +0 -1
  93. package/dist/BitsnapCart-Z6JFYNH2.mjs +0 -2
  94. package/dist/CartProvider-5NP4WACK.js +0 -2
  95. package/dist/CartProvider-5NP4WACK.js.map +0 -1
  96. package/dist/chunk-4Y233NII.js.map +0 -1
  97. package/dist/chunk-5M3OUOMU.mjs +0 -5
  98. package/dist/chunk-5M3OUOMU.mjs.map +0 -1
  99. package/dist/chunk-AQYHQY2Y.js.map +0 -1
  100. package/dist/chunk-C736F727.js.map +0 -1
  101. package/dist/chunk-EFN4OW2C.js.map +0 -1
  102. package/dist/chunk-GHBRR665.js.map +0 -1
  103. package/dist/chunk-HP3I6D2R.js.map +0 -1
  104. package/dist/chunk-IRZJIPUF.js.map +0 -1
  105. package/dist/chunk-KDL35KEI.js +0 -2
  106. package/dist/chunk-KDL35KEI.js.map +0 -1
  107. package/dist/chunk-KZWCVKLU.js +0 -5
  108. package/dist/chunk-KZWCVKLU.js.map +0 -1
  109. package/dist/chunk-RJPQMDIQ.js.map +0 -1
  110. package/dist/chunk-YPA6MMGJ.js.map +0 -1
  111. package/dist/methods-33CWGKNA.mjs +0 -2
  112. package/dist/methods-4GB652MQ.js +0 -2
  113. package/dist/methods-4GB652MQ.js.map +0 -1
  114. /package/dist/{BitsnapCart-Z6JFYNH2.mjs.map → BitsnapCart-3RSI3PIM.mjs.map} +0 -0
  115. /package/dist/{CartProvider-G7FQUPXL.mjs.map → CartProvider-TXRCAXOT.mjs.map} +0 -0
  116. /package/dist/{chunk-A2ZDFN3J.mjs.map → chunk-2HINORSP.mjs.map} +0 -0
  117. /package/dist/{chunk-LHQEM3CU.mjs.map → chunk-7WTQGXPQ.mjs.map} +0 -0
  118. /package/dist/{chunk-BTERIY6N.mjs.map → chunk-EXC5Z5VM.mjs.map} +0 -0
  119. /package/dist/{chunk-IXQCN7MR.mjs.map → chunk-FG7NLLJV.mjs.map} +0 -0
  120. /package/dist/{chunk-URQBHNJK.mjs.map → chunk-QWQPAN4F.mjs.map} +0 -0
  121. /package/dist/{chunk-KO7ZERN5.mjs.map → chunk-QXCL5CE6.mjs.map} +0 -0
  122. /package/dist/{chunk-IXX6SUMB.mjs.map → chunk-VU2MX5HY.mjs.map} +0 -0
  123. /package/dist/{chunk-LHNTSQYO.mjs.map → chunk-YV3UGLQ3.mjs.map} +0 -0
  124. /package/dist/{methods-33CWGKNA.mjs.map → methods-27JU6IH7.mjs.map} +0 -0
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkIRZJIPUFjs = require('./chunk-IRZJIPUF.js');var s="X-Bitsnap-Client",n=`bitsnap-react@${_chunkIRZJIPUFjs.a}`,i="bs_client",E= exports.a ={[s]:n},T= exports.b =t=>e=>(e.header.set(s,n),t(e));function C(t){let e=t.indexOf("#"),o=e===-1?t:t.slice(0,e),c=e===-1?"":t.slice(e),p=o.includes("?")?/[?&]$/.test(o)?"":"&":"?";return`${o}${p}${i}=${encodeURIComponent(n)}${c}`}var a="https://bitsnap.pl",l= exports.e =a;function _(t){console.log("setCustomHost",t),l= exports.e =t}var _clsx = require('clsx');var _tailwindmerge = require('tailwind-merge');function H(...t){return _tailwindmerge.twMerge.call(void 0, _clsx.clsx.call(void 0, t))}exports.a = E; exports.b = T; exports.c = C; exports.d = a; exports.e = l; exports.f = _; exports.g = H;
2
- //# sourceMappingURL=chunk-4Y233NII.js.map
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkEK3D44XWjs = require('./chunk-EK3D44XW.js');var s="X-Bitsnap-Client",n=`bitsnap-react@${_chunkEK3D44XWjs.a}`,i="bs_client",E= exports.a ={[s]:n},T= exports.b =t=>e=>(e.header.set(s,n),t(e));function C(t){let e=t.indexOf("#"),o=e===-1?t:t.slice(0,e),c=e===-1?"":t.slice(e),p=o.includes("?")?/[?&]$/.test(o)?"":"&":"?";return`${o}${p}${i}=${encodeURIComponent(n)}${c}`}var a="https://bitsnap.pl",l= exports.e =a;function _(t){console.log("setCustomHost",t),l= exports.e =t}var _clsx = require('clsx');var _tailwindmerge = require('tailwind-merge');function H(...t){return _tailwindmerge.twMerge.call(void 0, _clsx.clsx.call(void 0, t))}exports.a = E; exports.b = T; exports.c = C; exports.d = a; exports.e = l; exports.f = _; exports.g = H;
2
+ //# sourceMappingURL=chunk-6DEKVABT.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["/home/emems/.t3/worktrees/bitsnap-react-panel-key/dist/chunk-6DEKVABT.js","../src/lib/client-header.ts"],"names":["CLIENT_HEADER_NAME","CLIENT_HEADER_VALUE","SDK_VERSION"],"mappings":"AAAA,+HAAuC,ICG1BA,CAAAA,CAAqB,kBAAA,CACrBC,CAAAA,CAAsB,CAAA,cAAA,EAAiBC,kBAAW,CAAA,CAAA","file":"/home/emems/.t3/worktrees/bitsnap-react-panel-key/dist/chunk-6DEKVABT.js","sourcesContent":[null,"import type { Interceptor } from \"@connectrpc/connect\";\nimport { SDK_VERSION } from \"../version\";\n\nexport const CLIENT_HEADER_NAME = \"X-Bitsnap-Client\";\nexport const CLIENT_HEADER_VALUE = `bitsnap-react@${SDK_VERSION}`;\n\nexport const CLIENT_QUERY_PARAM = \"bs_client\";\n\n/**\n * Spread into the `headers` of a fetch that already triggers a CORS preflight\n * (JSON POST, Connect RPC). Never use it on a simple cross-origin GET: the\n * custom header would force a preflight that older servers and merchant\n * proxies do not allow. Use `withClientParam` there.\n */\nexport const clientHeaders: Record<string, string> = {\n [CLIENT_HEADER_NAME]: CLIENT_HEADER_VALUE,\n};\n\n/** Connect interceptor adding the client header to every RPC. */\nexport const clientHeaderInterceptor: Interceptor = (next) => (req) => {\n req.header.set(CLIENT_HEADER_NAME, CLIENT_HEADER_VALUE);\n return next(req);\n};\n\n/** Adds `bs_client=<pkg>@<ver>` to a URL, for simple GETs that must stay preflight-free. */\nexport function withClientParam(url: string): string {\n const hash = url.indexOf(\"#\");\n const base = hash === -1 ? url : url.slice(0, hash);\n const fragment = hash === -1 ? \"\" : url.slice(hash);\n const separator = base.includes(\"?\") ? (/[?&]$/.test(base) ? \"\" : \"&\") : \"?\";\n return `${base}${separator}${CLIENT_QUERY_PARAM}=${encodeURIComponent(CLIENT_HEADER_VALUE)}${fragment}`;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/gen/proto/public/v1/model_delivery_pb.ts"],"names":["file_public_v1_model_delivery","fileDesc","ModelFileState","ModelDeliveryService","serviceDesc"],"mappings":"AAMA,kIAA6D,IAMhDA,CAAAA,CACXC,iCAAAA,4iFAAqjF,CAAA,CAwYhjF,IAAKC,CAAAA,CAAAA,CAAAA,CAAAA,EAAAA,CAIVA,CAAAA,CAAAA,CAAAA,CAAA,WAAA,CAAc,CAAA,CAAA,CAAd,aAAA,CAKAA,CAAAA,CAAAA,CAAAA,CAAA,SAAA,CAAY,CAAA,CAAA,CAAZ,WAAA,CAOAA,CAAAA,CAAAA,CAAAA,CAAA,OAAA,CAAU,CAAA,CAAA,CAAV,SAAA,CAOAA,CAAAA,CAAAA,CAAAA,CAAA,OAAA,CAAU,CAAA,CAAA,CAAV,SAAA,CAvBUA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,EAAA,CAAA,CAAA,CAAA,CA4CL,IAAMC,CAAAA,CAsBXC,oCAAAA,CAAYJ,CAA+B,CAAC,CAAA,CAAA,6BAAA","file":"/home/emems/.t3/worktrees/bitsnap-react/chat-free-pwyw/dist/chunk-6Q3VGPSF.js","sourcesContent":["// @generated by protoc-gen-es v2.10.0 with parameter \"target=ts,ts_nocheck=true\"\n// @generated from file public/v1/model_delivery.proto (package public.v1, syntax proto3)\n/* eslint-disable */\n// @ts-nocheck\n\nimport type { GenEnum, GenFile, GenMessage, GenService } from \"@bufbuild/protobuf/codegenv2\";\nimport { enumDesc, fileDesc, messageDesc, serviceDesc } from \"@bufbuild/protobuf/codegenv2\";\nimport type { Message } from \"@bufbuild/protobuf\";\n\n/**\n * Describes the file public/v1/model_delivery.proto.\n */\nexport const file_public_v1_model_delivery: GenFile = /*@__PURE__*/\n fileDesc(\"Ch5wdWJsaWMvdjEvbW9kZWxfZGVsaXZlcnkucHJvdG8SCXB1YmxpYy52MSJBChVMaXN0TW9kZWxGaWxlc1JlcXVlc3QSFAoMYWNjZXNzX3Rva2VuGAEgASg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cChhNT0RFTF9GSUxFX1NUQVRFX0VYUElSRUQQAzLfAQoUTW9kZWxEZWxpdmVyeVNlcnZpY2USVQoOTGlzdE1vZGVsRmlsZXMSIC5wdWJsaWMudjEuTGlzdE1vZGVsRmlsZXNSZXF1ZXN0GiEucHVibGljLnYxLkxpc3RNb2RlbEZpbGVzUmVzcG9uc2UScAoXR2V0TW9kZWxGaWxlRG93bmxvYWRVcmwSKS5wdWJsaWMudjEuR2V0TW9kZWxGaWxlRG93bmxvYWRVcmxSZXF1ZXN0GioucHVibGljLnYxLkdldE1vZGVsRmlsZURvd25sb2FkVXJsUmVzcG9uc2ViBnByb3RvMw\");\n\n/**\n * @generated from message public.v1.ListModelFilesRequest\n */\nexport type ListModelFilesRequest = Message<\"public.v1.ListModelFilesRequest\"> & {\n /**\n * @generated from field: string access_token = 1;\n */\n accessToken: string;\n\n /**\n * Hashed project id of the panel; empty = every shop.\n *\n * @generated from field: string project_id = 2;\n */\n projectId: string;\n};\n\n/**\n * Describes the message public.v1.ListModelFilesRequest.\n * Use `create(ListModelFilesRequestSchema)` to create a new message.\n */\nexport const ListModelFilesRequestSchema: GenMessage<ListModelFilesRequest> = /*@__PURE__*/\n messageDesc(file_public_v1_model_delivery, 0);\n\n/**\n * @generated from message public.v1.ModelFileLicence\n */\nexport type ModelFileLicence = Message<\"public.v1.ModelFileLicence\"> & {\n /**\n * @generated from field: string name = 1;\n */\n name: string;\n\n /**\n * Where the licence text is: the seller's URL, the licence page of the\n * order line, or the buyer regulations for the default licence.\n *\n * @generated from field: string url = 2;\n */\n url: string;\n\n /**\n * The default personal-use licence of the buyer regulations (D15).\n *\n * @generated from field: bool is_default = 3;\n */\n isDefault: boolean;\n};\n\n/**\n * Describes the message public.v1.ModelFileLicence.\n * Use `create(ModelFileLicenceSchema)` to create a new message.\n */\nexport const ModelFileLicenceSchema: GenMessage<ModelFileLicence> = /*@__PURE__*/\n messageDesc(file_public_v1_model_delivery, 1);\n\n/**\n * @generated from message public.v1.ModelSellerContact\n */\nexport type ModelSellerContact = Message<\"public.v1.ModelSellerContact\"> & {\n /**\n * @generated from field: string name = 1;\n */\n name: string;\n\n /**\n * @generated from field: string email = 2;\n */\n email: string;\n};\n\n/**\n * Describes the message public.v1.ModelSellerContact.\n * Use `create(ModelSellerContactSchema)` to create a new message.\n */\nexport const ModelSellerContactSchema: GenMessage<ModelSellerContact> = /*@__PURE__*/\n messageDesc(file_public_v1_model_delivery, 2);\n\n/**\n * @generated from message public.v1.PurchasedModelFile\n */\nexport type PurchasedModelFile = Message<\"public.v1.PurchasedModelFile\"> & {\n /**\n * Position in the files of the line (v1: always 0, the GLB).\n *\n * @generated from field: int32 index = 1;\n */\n index: number;\n\n /**\n * @generated from field: string file_name = 2;\n */\n fileName: string;\n\n /**\n * @generated from field: int64 file_size = 3;\n */\n fileSize: bigint;\n\n /**\n * \"glb\" in v1.\n *\n * @generated from field: string format = 4;\n */\n format: string;\n};\n\n/**\n * Describes the message public.v1.PurchasedModelFile.\n * Use `create(PurchasedModelFileSchema)` to create a new message.\n */\nexport const PurchasedModelFileSchema: GenMessage<PurchasedModelFile> = /*@__PURE__*/\n messageDesc(file_public_v1_model_delivery, 3);\n\n/**\n * @generated from message public.v1.PurchasedModel\n */\nexport type PurchasedModel = Message<\"public.v1.PurchasedModel\"> & {\n /**\n * Hashed id of the order.\n *\n * @generated from field: string order_id = 1;\n */\n orderId: string;\n\n /**\n * The product id of the order line, as the order stores it.\n *\n * @generated from field: string line_id = 2;\n */\n lineId: string;\n\n /**\n * @generated from field: string project_id = 3;\n */\n projectId: string;\n\n /**\n * @generated from field: string shop_name = 4;\n */\n shopName: string;\n\n /**\n * @generated from field: string product_name = 5;\n */\n productName: string;\n\n /**\n * @generated from field: string variant_name = 6;\n */\n variantName: string;\n\n /**\n * @generated from field: int64 purchased_at = 7;\n */\n purchasedAt: bigint;\n\n /**\n * @generated from field: public.v1.ModelFileState state = 8;\n */\n state: ModelFileState;\n\n /**\n * @generated from field: repeated public.v1.PurchasedModelFile files = 9;\n */\n files: PurchasedModelFile[];\n\n /**\n * @generated from field: public.v1.ModelFileLicence licence = 10;\n */\n licence?: ModelFileLicence;\n\n /**\n * @generated from field: public.v1.ModelSellerContact seller = 11;\n */\n seller?: ModelSellerContact;\n\n /**\n * @generated from field: optional int64 access_expires_at = 12;\n */\n accessExpiresAt?: bigint;\n\n /**\n * @generated from field: string thumbnail_url = 13;\n */\n thumbnailUrl: string;\n};\n\n/**\n * Describes the message public.v1.PurchasedModel.\n * Use `create(PurchasedModelSchema)` to create a new message.\n */\nexport const PurchasedModelSchema: GenMessage<PurchasedModel> = /*@__PURE__*/\n messageDesc(file_public_v1_model_delivery, 4);\n\n/**\n * @generated from message public.v1.ListModelFilesResponse\n */\nexport type ListModelFilesResponse = Message<\"public.v1.ListModelFilesResponse\"> & {\n /**\n * @generated from oneof public.v1.ListModelFilesResponse.result\n */\n result: {\n /**\n * @generated from field: public.v1.ListModelFilesResponse.Success success = 1;\n */\n value: ListModelFilesResponse_Success;\n case: \"success\";\n } | {\n /**\n * @generated from field: public.v1.ModelDeliveryFailure failure = 2;\n */\n value: ModelDeliveryFailure;\n case: \"failure\";\n } | { case: undefined; value?: undefined };\n};\n\n/**\n * Describes the message public.v1.ListModelFilesResponse.\n * Use `create(ListModelFilesResponseSchema)` to create a new message.\n */\nexport const ListModelFilesResponseSchema: GenMessage<ListModelFilesResponse> = /*@__PURE__*/\n messageDesc(file_public_v1_model_delivery, 5);\n\n/**\n * @generated from message public.v1.ListModelFilesResponse.Success\n */\nexport type ListModelFilesResponse_Success = Message<\"public.v1.ListModelFilesResponse.Success\"> & {\n /**\n * @generated from field: repeated public.v1.PurchasedModel models = 1;\n */\n models: PurchasedModel[];\n};\n\n/**\n * Describes the message public.v1.ListModelFilesResponse.Success.\n * Use `create(ListModelFilesResponse_SuccessSchema)` to create a new message.\n */\nexport const ListModelFilesResponse_SuccessSchema: GenMessage<ListModelFilesResponse_Success> = /*@__PURE__*/\n messageDesc(file_public_v1_model_delivery, 5, 0);\n\n/**\n * @generated from message public.v1.GetModelFileDownloadUrlRequest\n */\nexport type GetModelFileDownloadUrlRequest = Message<\"public.v1.GetModelFileDownloadUrlRequest\"> & {\n /**\n * @generated from field: string access_token = 1;\n */\n accessToken: string;\n\n /**\n * @generated from field: string order_id = 2;\n */\n orderId: string;\n\n /**\n * @generated from field: string line_id = 3;\n */\n lineId: string;\n\n /**\n * @generated from field: int32 file_index = 4;\n */\n fileIndex: number;\n};\n\n/**\n * Describes the message public.v1.GetModelFileDownloadUrlRequest.\n * Use `create(GetModelFileDownloadUrlRequestSchema)` to create a new message.\n */\nexport const GetModelFileDownloadUrlRequestSchema: GenMessage<GetModelFileDownloadUrlRequest> = /*@__PURE__*/\n messageDesc(file_public_v1_model_delivery, 6);\n\n/**\n * @generated from message public.v1.GetModelFileDownloadUrlResponse\n */\nexport type GetModelFileDownloadUrlResponse = Message<\"public.v1.GetModelFileDownloadUrlResponse\"> & {\n /**\n * @generated from oneof public.v1.GetModelFileDownloadUrlResponse.result\n */\n result: {\n /**\n * @generated from field: public.v1.GetModelFileDownloadUrlResponse.Success success = 1;\n */\n value: GetModelFileDownloadUrlResponse_Success;\n case: \"success\";\n } | {\n /**\n * @generated from field: public.v1.ModelDeliveryFailure failure = 2;\n */\n value: ModelDeliveryFailure;\n case: \"failure\";\n } | { case: undefined; value?: undefined };\n};\n\n/**\n * Describes the message public.v1.GetModelFileDownloadUrlResponse.\n * Use `create(GetModelFileDownloadUrlResponseSchema)` to create a new message.\n */\nexport const GetModelFileDownloadUrlResponseSchema: GenMessage<GetModelFileDownloadUrlResponse> = /*@__PURE__*/\n messageDesc(file_public_v1_model_delivery, 7);\n\n/**\n * @generated from message public.v1.GetModelFileDownloadUrlResponse.Success\n */\nexport type GetModelFileDownloadUrlResponse_Success = Message<\"public.v1.GetModelFileDownloadUrlResponse.Success\"> & {\n /**\n * @generated from field: string url = 1;\n */\n url: string;\n\n /**\n * @generated from field: string file_name = 2;\n */\n fileName: string;\n\n /**\n * @generated from field: int64 expires_at = 3;\n */\n expiresAt: bigint;\n};\n\n/**\n * Describes the message public.v1.GetModelFileDownloadUrlResponse.Success.\n * Use `create(GetModelFileDownloadUrlResponse_SuccessSchema)` to create a new message.\n */\nexport const GetModelFileDownloadUrlResponse_SuccessSchema: GenMessage<GetModelFileDownloadUrlResponse_Success> = /*@__PURE__*/\n messageDesc(file_public_v1_model_delivery, 7, 0);\n\n/**\n * @generated from enum public.v1.ModelDeliveryFailure\n */\nexport enum ModelDeliveryFailure {\n /**\n * @generated from enum value: MODEL_DELIVERY_FAILURE_UNSPECIFIED = 0;\n */\n UNSPECIFIED = 0,\n\n /**\n * No or an expired panel session.\n *\n * @generated from enum value: MODEL_DELIVERY_FAILURE_UNAUTHORIZED = 1;\n */\n UNAUTHORIZED = 1,\n\n /**\n * No such order line for this buyer (or it holds no 3D file).\n *\n * @generated from enum value: MODEL_DELIVERY_FAILURE_NOT_FOUND = 2;\n */\n NOT_FOUND = 2,\n\n /**\n * The order was refunded or canceled.\n *\n * @generated from enum value: MODEL_DELIVERY_FAILURE_REFUNDED = 3;\n */\n REFUNDED = 3,\n\n /**\n * The access of the order line ended (access expiry of the variant).\n *\n * @generated from enum value: MODEL_DELIVERY_FAILURE_EXPIRED = 4;\n */\n EXPIRED = 4,\n\n /**\n * The seller removed the file (no model on the variant or the product).\n *\n * @generated from enum value: MODEL_DELIVERY_FAILURE_REMOVED = 5;\n */\n REMOVED = 5,\n\n /**\n * The order is not paid.\n *\n * @generated from enum value: MODEL_DELIVERY_FAILURE_UNPAID = 6;\n */\n UNPAID = 6,\n}\n\n/**\n * Describes the enum public.v1.ModelDeliveryFailure.\n */\nexport const ModelDeliveryFailureSchema: GenEnum<ModelDeliveryFailure> = /*@__PURE__*/\n enumDesc(file_public_v1_model_delivery, 0);\n\n/**\n * @generated from enum public.v1.ModelFileState\n */\nexport enum ModelFileState {\n /**\n * @generated from enum value: MODEL_FILE_STATE_UNSPECIFIED = 0;\n */\n UNSPECIFIED = 0,\n\n /**\n * @generated from enum value: MODEL_FILE_STATE_AVAILABLE = 1;\n */\n AVAILABLE = 1,\n\n /**\n * The seller removed the file: `seller` says how to reach them.\n *\n * @generated from enum value: MODEL_FILE_STATE_REMOVED = 2;\n */\n REMOVED = 2,\n\n /**\n * The access ended: `access_expires_at` says when.\n *\n * @generated from enum value: MODEL_FILE_STATE_EXPIRED = 3;\n */\n EXPIRED = 3,\n}\n\n/**\n * Describes the enum public.v1.ModelFileState.\n */\nexport const ModelFileStateSchema: GenEnum<ModelFileState> = /*@__PURE__*/\n enumDesc(file_public_v1_model_delivery, 1);\n\n/**\n * Delivery of purchased 3D model files to the buyer (docs/3d-products-plan.md,\n * \"Delivery after purchase (D7)\").\n *\n * Every call is authenticated as the buyer with the customer panel session\n * (`access_token`, the same token as `PublicApiService.UserPanel*`). It is not\n * a merchant RPC: there is no project permission, the buyer sees the files of\n * their own paid, not refunded orders only. The entitlement is re-checked on\n * every call; a download URL is short-lived and signed on request.\n *\n * @generated from service public.v1.ModelDeliveryService\n */\nexport const ModelDeliveryService: GenService<{\n /**\n * The 3D files of the buyer's orders (optionally of one shop).\n *\n * @generated from rpc public.v1.ModelDeliveryService.ListModelFiles\n */\n listModelFiles: {\n methodKind: \"unary\";\n input: typeof ListModelFilesRequestSchema;\n output: typeof ListModelFilesResponseSchema;\n },\n /**\n * A short-lived signed download URL of one file of one order line.\n *\n * @generated from rpc public.v1.ModelDeliveryService.GetModelFileDownloadUrl\n */\n getModelFileDownloadUrl: {\n methodKind: \"unary\";\n input: typeof GetModelFileDownloadUrlRequestSchema;\n output: typeof GetModelFileDownloadUrlResponseSchema;\n },\n}> = /*@__PURE__*/\n serviceDesc(file_public_v1_model_delivery, 0);\n\n"]}
1
+ {"version":3,"sources":["../src/gen/proto/public/v1/model_delivery_pb.ts"],"names":["file_public_v1_model_delivery","fileDesc","ModelFileState","ModelDeliveryService","serviceDesc"],"mappings":"AAMA,kIAA6D,IAMhDA,CAAAA,CACXC,iCAAAA,4iFAAqjF,CAAA,CAwYhjF,IAAKC,CAAAA,CAAAA,CAAAA,CAAAA,EAAAA,CAIVA,CAAAA,CAAAA,CAAAA,CAAA,WAAA,CAAc,CAAA,CAAA,CAAd,aAAA,CAKAA,CAAAA,CAAAA,CAAAA,CAAA,SAAA,CAAY,CAAA,CAAA,CAAZ,WAAA,CAOAA,CAAAA,CAAAA,CAAAA,CAAA,OAAA,CAAU,CAAA,CAAA,CAAV,SAAA,CAOAA,CAAAA,CAAAA,CAAAA,CAAA,OAAA,CAAU,CAAA,CAAA,CAAV,SAAA,CAvBUA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,EAAA,CAAA,CAAA,CAAA,CA4CL,IAAMC,CAAAA,CAsBXC,oCAAAA,CAAYJ,CAA+B,CAAC,CAAA,CAAA,6BAAA","file":"/home/emems/.t3/worktrees/bitsnap-react-panel-key/dist/chunk-6Q3VGPSF.js","sourcesContent":["// @generated by protoc-gen-es v2.10.0 with parameter \"target=ts,ts_nocheck=true\"\n// @generated from file public/v1/model_delivery.proto (package public.v1, syntax proto3)\n/* eslint-disable */\n// @ts-nocheck\n\nimport type { GenEnum, GenFile, GenMessage, GenService } from \"@bufbuild/protobuf/codegenv2\";\nimport { enumDesc, fileDesc, messageDesc, serviceDesc } from \"@bufbuild/protobuf/codegenv2\";\nimport type { Message } from \"@bufbuild/protobuf\";\n\n/**\n * Describes the file public/v1/model_delivery.proto.\n */\nexport const file_public_v1_model_delivery: GenFile = /*@__PURE__*/\n fileDesc(\"Ch5wdWJsaWMvdjEvbW9kZWxfZGVsaXZlcnkucHJvdG8SCXB1YmxpYy52MSJBChVMaXN0TW9kZWxGaWxlc1JlcXVlc3QSFAoMYWNjZXNzX3Rva2VuGAEgASgJEhIKCnByb2plY3RfaWQYAiABKAkiQQoQTW9kZWxGaWxlTGljZW5jZRIMCgRuYW1lGAEgASgJEgsKA3VybBgCIAEoCRISCgppc19kZWZhdWx0GAMgASgIIjEKEk1vZGVs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VsRmlsZXNSZXF1ZXN0GiEucHVibGljLnYxLkxpc3RNb2RlbEZpbGVzUmVzcG9uc2UScAoXR2V0TW9kZWxGaWxlRG93bmxvYWRVcmwSKS5wdWJsaWMudjEuR2V0TW9kZWxGaWxlRG93bmxvYWRVcmxSZXF1ZXN0GioucHVibGljLnYxLkdldE1vZGVsRmlsZURvd25sb2FkVXJsUmVzcG9uc2ViBnByb3RvMw\");\n\n/**\n * @generated from message public.v1.ListModelFilesRequest\n */\nexport type ListModelFilesRequest = Message<\"public.v1.ListModelFilesRequest\"> & {\n /**\n * @generated from field: string access_token = 1;\n */\n accessToken: string;\n\n /**\n * Hashed project id of the panel; empty = every shop.\n *\n * @generated from field: string project_id = 2;\n */\n projectId: string;\n};\n\n/**\n * Describes the message public.v1.ListModelFilesRequest.\n * Use `create(ListModelFilesRequestSchema)` to create a new message.\n */\nexport const ListModelFilesRequestSchema: GenMessage<ListModelFilesRequest> = /*@__PURE__*/\n messageDesc(file_public_v1_model_delivery, 0);\n\n/**\n * @generated from message public.v1.ModelFileLicence\n */\nexport type ModelFileLicence = Message<\"public.v1.ModelFileLicence\"> & {\n /**\n * @generated from field: string name = 1;\n */\n name: string;\n\n /**\n * Where the licence text is: the seller's URL, the licence page of the\n * order line, or the buyer regulations for the default licence.\n *\n * @generated from field: string url = 2;\n */\n url: string;\n\n /**\n * The default personal-use licence of the buyer regulations (D15).\n *\n * @generated from field: bool is_default = 3;\n */\n isDefault: boolean;\n};\n\n/**\n * Describes the message public.v1.ModelFileLicence.\n * Use `create(ModelFileLicenceSchema)` to create a new message.\n */\nexport const ModelFileLicenceSchema: GenMessage<ModelFileLicence> = /*@__PURE__*/\n messageDesc(file_public_v1_model_delivery, 1);\n\n/**\n * @generated from message public.v1.ModelSellerContact\n */\nexport type ModelSellerContact = Message<\"public.v1.ModelSellerContact\"> & {\n /**\n * @generated from field: string name = 1;\n */\n name: string;\n\n /**\n * @generated from field: string email = 2;\n */\n email: string;\n};\n\n/**\n * Describes the message public.v1.ModelSellerContact.\n * Use `create(ModelSellerContactSchema)` to create a new message.\n */\nexport const ModelSellerContactSchema: GenMessage<ModelSellerContact> = /*@__PURE__*/\n messageDesc(file_public_v1_model_delivery, 2);\n\n/**\n * @generated from message public.v1.PurchasedModelFile\n */\nexport type PurchasedModelFile = Message<\"public.v1.PurchasedModelFile\"> & {\n /**\n * Position in the files of the line (v1: always 0, the GLB).\n *\n * @generated from field: int32 index = 1;\n */\n index: number;\n\n /**\n * @generated from field: string file_name = 2;\n */\n fileName: string;\n\n /**\n * @generated from field: int64 file_size = 3;\n */\n fileSize: bigint;\n\n /**\n * \"glb\" in v1.\n *\n * @generated from field: string format = 4;\n */\n format: string;\n};\n\n/**\n * Describes the message public.v1.PurchasedModelFile.\n * Use `create(PurchasedModelFileSchema)` to create a new message.\n */\nexport const PurchasedModelFileSchema: GenMessage<PurchasedModelFile> = /*@__PURE__*/\n messageDesc(file_public_v1_model_delivery, 3);\n\n/**\n * @generated from message public.v1.PurchasedModel\n */\nexport type PurchasedModel = Message<\"public.v1.PurchasedModel\"> & {\n /**\n * Hashed id of the order.\n *\n * @generated from field: string order_id = 1;\n */\n orderId: string;\n\n /**\n * The product id of the order line, as the order stores it.\n *\n * @generated from field: string line_id = 2;\n */\n lineId: string;\n\n /**\n * @generated from field: string project_id = 3;\n */\n projectId: string;\n\n /**\n * @generated from field: string shop_name = 4;\n */\n shopName: string;\n\n /**\n * @generated from field: string product_name = 5;\n */\n productName: string;\n\n /**\n * @generated from field: string variant_name = 6;\n */\n variantName: string;\n\n /**\n * @generated from field: int64 purchased_at = 7;\n */\n purchasedAt: bigint;\n\n /**\n * @generated from field: public.v1.ModelFileState state = 8;\n */\n state: ModelFileState;\n\n /**\n * @generated from field: repeated public.v1.PurchasedModelFile files = 9;\n */\n files: PurchasedModelFile[];\n\n /**\n * @generated from field: public.v1.ModelFileLicence licence = 10;\n */\n licence?: ModelFileLicence;\n\n /**\n * @generated from field: public.v1.ModelSellerContact seller = 11;\n */\n seller?: ModelSellerContact;\n\n /**\n * @generated from field: optional int64 access_expires_at = 12;\n */\n accessExpiresAt?: bigint;\n\n /**\n * @generated from field: string thumbnail_url = 13;\n */\n thumbnailUrl: string;\n};\n\n/**\n * Describes the message public.v1.PurchasedModel.\n * Use `create(PurchasedModelSchema)` to create a new message.\n */\nexport const PurchasedModelSchema: GenMessage<PurchasedModel> = /*@__PURE__*/\n messageDesc(file_public_v1_model_delivery, 4);\n\n/**\n * @generated from message public.v1.ListModelFilesResponse\n */\nexport type ListModelFilesResponse = Message<\"public.v1.ListModelFilesResponse\"> & {\n /**\n * @generated from oneof public.v1.ListModelFilesResponse.result\n */\n result: {\n /**\n * @generated from field: public.v1.ListModelFilesResponse.Success success = 1;\n */\n value: ListModelFilesResponse_Success;\n case: \"success\";\n } | {\n /**\n * @generated from field: public.v1.ModelDeliveryFailure failure = 2;\n */\n value: ModelDeliveryFailure;\n case: \"failure\";\n } | { case: undefined; value?: undefined };\n};\n\n/**\n * Describes the message public.v1.ListModelFilesResponse.\n * Use `create(ListModelFilesResponseSchema)` to create a new message.\n */\nexport const ListModelFilesResponseSchema: GenMessage<ListModelFilesResponse> = /*@__PURE__*/\n messageDesc(file_public_v1_model_delivery, 5);\n\n/**\n * @generated from message public.v1.ListModelFilesResponse.Success\n */\nexport type ListModelFilesResponse_Success = Message<\"public.v1.ListModelFilesResponse.Success\"> & {\n /**\n * @generated from field: repeated public.v1.PurchasedModel models = 1;\n */\n models: PurchasedModel[];\n};\n\n/**\n * Describes the message public.v1.ListModelFilesResponse.Success.\n * Use `create(ListModelFilesResponse_SuccessSchema)` to create a new message.\n */\nexport const ListModelFilesResponse_SuccessSchema: GenMessage<ListModelFilesResponse_Success> = /*@__PURE__*/\n messageDesc(file_public_v1_model_delivery, 5, 0);\n\n/**\n * @generated from message public.v1.GetModelFileDownloadUrlRequest\n */\nexport type GetModelFileDownloadUrlRequest = Message<\"public.v1.GetModelFileDownloadUrlRequest\"> & {\n /**\n * @generated from field: string access_token = 1;\n */\n accessToken: string;\n\n /**\n * @generated from field: string order_id = 2;\n */\n orderId: string;\n\n /**\n * @generated from field: string line_id = 3;\n */\n lineId: string;\n\n /**\n * @generated from field: int32 file_index = 4;\n */\n fileIndex: number;\n};\n\n/**\n * Describes the message public.v1.GetModelFileDownloadUrlRequest.\n * Use `create(GetModelFileDownloadUrlRequestSchema)` to create a new message.\n */\nexport const GetModelFileDownloadUrlRequestSchema: GenMessage<GetModelFileDownloadUrlRequest> = /*@__PURE__*/\n messageDesc(file_public_v1_model_delivery, 6);\n\n/**\n * @generated from message public.v1.GetModelFileDownloadUrlResponse\n */\nexport type GetModelFileDownloadUrlResponse = Message<\"public.v1.GetModelFileDownloadUrlResponse\"> & {\n /**\n * @generated from oneof public.v1.GetModelFileDownloadUrlResponse.result\n */\n result: {\n /**\n * @generated from field: public.v1.GetModelFileDownloadUrlResponse.Success success = 1;\n */\n value: GetModelFileDownloadUrlResponse_Success;\n case: \"success\";\n } | {\n /**\n * @generated from field: public.v1.ModelDeliveryFailure failure = 2;\n */\n value: ModelDeliveryFailure;\n case: \"failure\";\n } | { case: undefined; value?: undefined };\n};\n\n/**\n * Describes the message public.v1.GetModelFileDownloadUrlResponse.\n * Use `create(GetModelFileDownloadUrlResponseSchema)` to create a new message.\n */\nexport const GetModelFileDownloadUrlResponseSchema: GenMessage<GetModelFileDownloadUrlResponse> = /*@__PURE__*/\n messageDesc(file_public_v1_model_delivery, 7);\n\n/**\n * @generated from message public.v1.GetModelFileDownloadUrlResponse.Success\n */\nexport type GetModelFileDownloadUrlResponse_Success = Message<\"public.v1.GetModelFileDownloadUrlResponse.Success\"> & {\n /**\n * @generated from field: string url = 1;\n */\n url: string;\n\n /**\n * @generated from field: string file_name = 2;\n */\n fileName: string;\n\n /**\n * @generated from field: int64 expires_at = 3;\n */\n expiresAt: bigint;\n};\n\n/**\n * Describes the message public.v1.GetModelFileDownloadUrlResponse.Success.\n * Use `create(GetModelFileDownloadUrlResponse_SuccessSchema)` to create a new message.\n */\nexport const GetModelFileDownloadUrlResponse_SuccessSchema: GenMessage<GetModelFileDownloadUrlResponse_Success> = /*@__PURE__*/\n messageDesc(file_public_v1_model_delivery, 7, 0);\n\n/**\n * @generated from enum public.v1.ModelDeliveryFailure\n */\nexport enum ModelDeliveryFailure {\n /**\n * @generated from enum value: MODEL_DELIVERY_FAILURE_UNSPECIFIED = 0;\n */\n UNSPECIFIED = 0,\n\n /**\n * No or an expired panel session.\n *\n * @generated from enum value: MODEL_DELIVERY_FAILURE_UNAUTHORIZED = 1;\n */\n UNAUTHORIZED = 1,\n\n /**\n * No such order line for this buyer (or it holds no 3D file).\n *\n * @generated from enum value: MODEL_DELIVERY_FAILURE_NOT_FOUND = 2;\n */\n NOT_FOUND = 2,\n\n /**\n * The order was refunded or canceled.\n *\n * @generated from enum value: MODEL_DELIVERY_FAILURE_REFUNDED = 3;\n */\n REFUNDED = 3,\n\n /**\n * The access of the order line ended (access expiry of the variant).\n *\n * @generated from enum value: MODEL_DELIVERY_FAILURE_EXPIRED = 4;\n */\n EXPIRED = 4,\n\n /**\n * The seller removed the file (no model on the variant or the product).\n *\n * @generated from enum value: MODEL_DELIVERY_FAILURE_REMOVED = 5;\n */\n REMOVED = 5,\n\n /**\n * The order is not paid.\n *\n * @generated from enum value: MODEL_DELIVERY_FAILURE_UNPAID = 6;\n */\n UNPAID = 6,\n}\n\n/**\n * Describes the enum public.v1.ModelDeliveryFailure.\n */\nexport const ModelDeliveryFailureSchema: GenEnum<ModelDeliveryFailure> = /*@__PURE__*/\n enumDesc(file_public_v1_model_delivery, 0);\n\n/**\n * @generated from enum public.v1.ModelFileState\n */\nexport enum ModelFileState {\n /**\n * @generated from enum value: MODEL_FILE_STATE_UNSPECIFIED = 0;\n */\n UNSPECIFIED = 0,\n\n /**\n * @generated from enum value: MODEL_FILE_STATE_AVAILABLE = 1;\n */\n AVAILABLE = 1,\n\n /**\n * The seller removed the file: `seller` says how to reach them.\n *\n * @generated from enum value: MODEL_FILE_STATE_REMOVED = 2;\n */\n REMOVED = 2,\n\n /**\n * The access ended: `access_expires_at` says when.\n *\n * @generated from enum value: MODEL_FILE_STATE_EXPIRED = 3;\n */\n EXPIRED = 3,\n}\n\n/**\n * Describes the enum public.v1.ModelFileState.\n */\nexport const ModelFileStateSchema: GenEnum<ModelFileState> = /*@__PURE__*/\n enumDesc(file_public_v1_model_delivery, 1);\n\n/**\n * Delivery of purchased 3D model files to the buyer (docs/3d-products-plan.md,\n * \"Delivery after purchase (D7)\").\n *\n * Every call is authenticated as the buyer with the customer panel session\n * (`access_token`, the same token as `PublicApiService.UserPanel*`). It is not\n * a merchant RPC: there is no project permission, the buyer sees the files of\n * their own paid, not refunded orders only. The entitlement is re-checked on\n * every call; a download URL is short-lived and signed on request.\n *\n * @generated from service public.v1.ModelDeliveryService\n */\nexport const ModelDeliveryService: GenService<{\n /**\n * The 3D files of the buyer's orders (optionally of one shop).\n *\n * @generated from rpc public.v1.ModelDeliveryService.ListModelFiles\n */\n listModelFiles: {\n methodKind: \"unary\";\n input: typeof ListModelFilesRequestSchema;\n output: typeof ListModelFilesResponseSchema;\n },\n /**\n * A short-lived signed download URL of one file of one order line.\n *\n * @generated from rpc public.v1.ModelDeliveryService.GetModelFileDownloadUrl\n */\n getModelFileDownloadUrl: {\n methodKind: \"unary\";\n input: typeof GetModelFileDownloadUrlRequestSchema;\n output: typeof GetModelFileDownloadUrlResponseSchema;\n },\n}> = /*@__PURE__*/\n serviceDesc(file_public_v1_model_delivery, 0);\n\n"]}
@@ -1,2 +1,2 @@
1
- import{j as i}from"./chunk-LHNTSQYO.mjs";import{b as t}from"./chunk-CUPG4B5W.mjs";import{l as o,n as r}from"./chunk-TW25G7XX.mjs";import{createContext as p,useContext as P}from"react";import{jsx as e}from"react/jsx-runtime";var a=p(t()),u=({children:c,analytics:s})=>{let n=t(),l=r(n.projectID,s,"panel");return e(i,{children:e(a.Provider,{value:{...n},children:e(o,{value:l,children:e("div",{className:"bitsnap-react",children:c})})})})},C=()=>P(a);export{u as a,C as b};
2
- //# sourceMappingURL=chunk-LHQEM3CU.mjs.map
1
+ import{j as i}from"./chunk-YV3UGLQ3.mjs";import{b as t}from"./chunk-CUPG4B5W.mjs";import{l as o,n as r}from"./chunk-J6WKSO33.mjs";import{createContext as p,useContext as P}from"react";import{jsx as e}from"react/jsx-runtime";var a=p(t()),u=({children:c,analytics:s})=>{let n=t(),l=r(n.projectID,s,"panel");return e(i,{children:e(a.Provider,{value:{...n},children:e(o,{value:l,children:e("div",{className:"bitsnap-react",children:c})})})})},C=()=>P(a);export{u as a,C as b};
2
+ //# sourceMappingURL=chunk-7WTQGXPQ.mjs.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunkW3RGQYPDjs = require('./chunk-W3RGQYPD.js');var Oe=Symbol.for("bitsnap.pageViews");function ye(e){let t=e;return t[Oe]??={path:null,starters:new Set,watching:!1}}function De(e,t){let n=()=>{try{t()}catch (e2){}};for(let o of["pushState","replaceState"]){let a=e.history[o];e.history[o]=function(...i){let c=a.apply(this,i);return n(),c}}e.addEventListener("popstate",n)}function A(e,t=window){try{let n=ye(t),o=()=>e();n.watching||(n.watching=!0,De(t,()=>{let i=t.location.pathname;i===n.path||n.starters.size===0||(n.path=i,_optionalChain([n, 'access', _2 => _2.starters, 'access', _3 => _3.values, 'call', _4 => _4(), 'access', _5 => _5.next, 'call', _6 => _6(), 'access', _7 => _7.value, 'optionalCall', _8 => _8()]))})),n.starters.add(o);let a=t.location.pathname;return a!==n.path&&(n.path=a,o()),()=>void n.starters.delete(o)}catch (e3){return()=>{}}}function ge(e=window){let t=ye(e);t.path=null,t.starters.clear()}var ve="1.20.0";function I(e){let t=new Uint8Array(e),n=typeof crypto<"u"?crypto:void 0;if(n&&typeof n.getRandomValues=="function")n.getRandomValues(t);else for(let o=0;o<e;o++)t[o]=Math.floor(Math.random()*256);return t}var me="X-Bitsnap-Visitor",$e=390*24*60*60,Me=/^[A-Za-z0-9_-]{22}$/;function R(e){return e.BitsnapConsent}function je(e,t){for(let n of e.cookie.split(";")){let o=n.indexOf("=");if(o!==-1&&n.slice(0,o).trim()===t)return n.slice(o+1).trim()}return null}function He(e){let t=e.toLowerCase();return t==="bitsnap.pl"||t.endsWith(".bitsnap.pl")}function F(e,t){try{let n=R(e);if(!n)return!1;if(n.scope==="project")return n.projectKey===t;let o=He(e.location.hostname);return n.scope==="global"?!o:!1}catch (e4){return!1}}function J(e,t){try{return _optionalChain([R, 'call', _9 => _9(e), 'optionalAccess', _10 => _10.get, 'call', _11 => _11(), 'optionalAccess', _12 => _12.c, 'access', _13 => _13.analytics])===!0&&F(e,t)}catch (e5){return!1}}function he(){let e="";return I(16).forEach(t=>e+=String.fromCharCode(t)),btoa(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function Ee(e,t){try{return je(e,_chunkW3RGQYPDjs.g.call(void 0, t))}catch (e6){return null}}function B(e,t){let n=Ee(e,t);return n!==null&&Me.test(n)?n:null}function ke(e,t,n){try{let o=e.document,a=`${_chunkW3RGQYPDjs.g.call(void 0, t)}=${n}; Max-Age=${$e}; Path=/; SameSite=Lax`+(e.location.protocol==="https:"?"; Secure":"");for(let i of _chunkW3RGQYPDjs.o.call(void 0, e.location.hostname).reverse())if(o.cookie=`${a}; Domain=${i}`,B(o,t)===n)return;o.cookie=a}catch (e7){}}function be(e,t){try{let n=e.document;if(Ee(n,t)===null)return;let o=`${_chunkW3RGQYPDjs.g.call(void 0, t)}=; Max-Age=0; Path=/; SameSite=Lax`+(e.location.protocol==="https:"?"; Secure":"");n.cookie=o;for(let a of _chunkW3RGQYPDjs.o.call(void 0, e.location.hostname))n.cookie=`${o}; Domain=${a}`}catch (e8){}}function N(e,t){try{let n=e.navigator;return _optionalChain([n, 'optionalAccess', _14 => _14.globalPrivacyControl])===!0||_optionalChain([n, 'optionalAccess', _15 => _15.webdriver])===!0?null:J(e,t)?B(e.document,t):null}catch (e9){return null}}var Ue="https://collect.bitsnap.pl",Ke=5e3,Ge=20,Te=32*1024,ze=60*1024,xe=/^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;function _e(e){return typeof TextEncoder=="function"?new TextEncoder().encode(e).length:unescape(encodeURIComponent(e)).length}var y={track(){},page(){},clientId:()=>null,flush(){},setEnabled(){},onEvent:()=>()=>{},configure(){},destroy(){}};function Ye(e=Date.now()){let t=I(16),n=e;for(let a=5;a>=0;a--)t[a]=n%256,n=Math.floor(n/256);t[6]=t[6]&15|112,t[8]=t[8]&63|128;let o=Array.from(t,a=>a.toString(16).padStart(2,"0")).join("");return`${o.slice(0,8)}-${o.slice(8,12)}-${o.slice(12,16)}-${o.slice(16,20)}-${o.slice(20)}`}var Ce="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";function Fe(){return Array.from(I(16),e=>Ce[e%Ce.length]).join("")}function Je(e,t,n=!1){let o=_e(JSON.stringify({k:e,events:[]})),a=[],i=[],c=o,s=()=>{i.length>0&&a.push({body:JSON.stringify({k:e,events:i}),bytes:c,count:i.length}),i=[],c=o};for(let u of t){let l=_e(JSON.stringify(u));o+l>Te||((i.length>=_chunkW3RGQYPDjs.a.maxBatchEvents||c+l+(i.length>0?1:0)>Te)&&s(),c+=l+(i.length>0?1:0),i.push(u))}if(s(),n){let u=0,l=a.length;for(;l>0&&u+a[l-1].bytes<=ze;)u+=a[l-1].bytes,l--;a=a.slice(l)}return a}function Xe(e){try{return typeof window>"u"||typeof document>"u"?y:qe(e,window)}catch (e10){return y}}function qe(e,t){let n=_chunkW3RGQYPDjs.c.call(void 0, _nullishCoalesce(e.projectKey, () => (""))),o=!!e.debug,a=(...r)=>{o&&console.warn("[bitsnap analytics]",...r)};if(!n)return a("invalid projectKey, tracking is off"),y;let i=n,c=r=>`${(r||Ue).replace(/\/+$/,"")}/e`,s=c(e.endpoint),u=_nullishCoalesce(e.source, () => ("sdk_react")),l=_nullishCoalesce(e.channel, () => ("embed")),b=`bitsnap-react@${ve}`,M=Fe(),T=_chunkW3RGQYPDjs.e.call(void 0, t.location.href),j=_nullishCoalesce(e.env, () => ("live"));if(!e.env)try{new URLSearchParams(t.location.search).has("test")&&(j="test")}catch (e11){}let Le=_chunkW3RGQYPDjs.f.call(void 0, document.referrer),H=e.enabled!==!1,ee=null,Re=0,p=[],h=null,C=new Set;e.onEvent&&C.add(e.onEvent);let E=[],g,m=!0;function W(){let r=R(t);!r||r===g||(g=r,m=!r.ready,_optionalChain([r, 'access', _16 => _16.ready, 'optionalAccess', _17 => _17.then, 'call', _18 => _18(()=>{g===r&&(m=!0,re())},()=>{g===r&&(m=!0)})]))}function te(){W();try{if(!g)return!1;let r=g.get();return!!g.denied&&g.denied("analytics")||!!r&&r.c.analytics===!1}catch (e12){return!1}}function ne(r){C.forEach(f=>{try{f(r)}catch (e13){}})}function U(r){try{if(W(),!g||!F(t,i))return;J(t,i)?P()&&B(t.document,i)===null&&ke(t,i,he()):r&&be(t,i)}catch (e14){}}function re(){if(U(!0),te())p=[],E=[],w();else{if(m&&E.length>0){let r=E;E=[],r.forEach(ne)}p.length>0&&x()}}function P(){if(!H)return!1;let r=t.navigator;return r&&(r.globalPrivacyControl===!0||r.webdriver===!0)?!1:!te()}function w(){h!==null&&clearTimeout(h),h=null}function Be(){h===null&&(h=setTimeout(()=>{h=null,x()},Ke),_optionalChain([h, 'access', _19 => _19.unref, 'optionalCall', _20 => _20()]))}function Ne(r){try{if(typeof fetch=="function"){fetch(s,{method:"POST",body:r,keepalive:!0,credentials:"omit",headers:{"Content-Type":"text/plain"}}).catch(()=>{});return}}catch (e15){}try{let f=t.navigator;f&&typeof f.sendBeacon=="function"&&f.sendBeacon(s,new Blob([r],{type:"text/plain"}))}catch (e16){}}function x(r=!1){try{if(w(),p.length===0)return;if(!P()){p=[];return}if(!m)return;U(m);let f=N(t,i),d=f?p.map(k=>({...k,client_id:f})):p;p=[],Je(i,d,r).forEach(k=>Ne(k.body))}catch (e17){}}function oe(r,f,d){if(!P())return;let k=_chunkW3RGQYPDjs.h.call(void 0, r,f);if(!k.ok){a("dropped",r,k.reason);return}let se=_chunkW3RGQYPDjs.e.call(void 0, t.location.href),K={event_id:_optionalChain([d, 'optionalAccess', _21 => _21.event_id])&&xe.test(d.event_id)?d.event_id:Ye(),event:r,ts:Date.now(),schema_version:1,env:j,source:u,channel:l,sdk:b,page_id:M,page_type:_optionalChain([d, 'optionalAccess', _22 => _22.page_type])!==void 0?d.page_type:ee,host:_nullishCoalesce(_optionalChain([se, 'optionalAccess', _23 => _23.host]), () => (null)),path:_optionalChain([d, 'optionalAccess', _24 => _24.path])?_chunkW3RGQYPDjs.d.call(void 0, d.path.split(/[?#]/)[0]):_nullishCoalesce(_optionalChain([se, 'optionalAccess', _25 => _25.path]), () => (null)),referrer_host:Le,utm_source:_nullishCoalesce(_optionalChain([T, 'optionalAccess', _26 => _26.utm_source]), () => (null)),utm_medium:_nullishCoalesce(_optionalChain([T, 'optionalAccess', _27 => _27.utm_medium]), () => (null)),utm_campaign:_nullishCoalesce(_optionalChain([T, 'optionalAccess', _28 => _28.utm_campaign]), () => (null)),utm_content:_nullishCoalesce(_optionalChain([T, 'optionalAccess', _29 => _29.utm_content]), () => (null)),utm_term:_nullishCoalesce(_optionalChain([T, 'optionalAccess', _30 => _30.utm_term]), () => (null)),ref_code:_nullishCoalesce(_optionalChain([T, 'optionalAccess', _31 => _31.ref_code]), () => (null)),product_id:_nullishCoalesce(_optionalChain([d, 'optionalAccess', _32 => _32.product_id]), () => (null)),variant_id:_nullishCoalesce(_optionalChain([d, 'optionalAccess', _33 => _33.variant_id]), () => (null)),order_ref:_nullishCoalesce(_optionalChain([d, 'optionalAccess', _34 => _34.order_ref]), () => (null)),props:k.props};_optionalChain([d, 'optionalAccess', _35 => _35.event_id])&&!xe.test(d.event_id)&&a("ignored invalid event_id",r),u==="dashboard"&&e.visitorId&&(K.visitor_id=e.visitorId);let ce=_chunkW3RGQYPDjs.i.call(void 0, K);if(!ce.ok){a("dropped",r,ce.reason);return}let G=K;m?ne(G):E.push(G),p.push(G),p.length>=Ge?x():Be()}let ie=()=>x(!0),ae=()=>{document.visibilityState==="hidden"&&x(!0)},S=()=>re();return t.addEventListener("pagehide",ie),document.addEventListener("visibilitychange",ae),t.addEventListener("bitsnap:consent",S),t.addEventListener("bitsnap:consent:ready",S),W(),U(m),{track(r,f,d){try{oe(r,f,d)}catch (e18){}},page(r,f){try{r!==void 0&&(ee=r),oe("page_view",{landing:Re++===0},f)}catch (e19){}},clientId(r){try{return r!==void 0&&_chunkW3RGQYPDjs.c.call(void 0, r)!==i?null:P()?N(t,i):null}catch (e20){return null}},flush:()=>x(),setEnabled(r){H=!!r,H||(p=[],E=[],w())},configure(r){try{(r.env==="live"||r.env==="test")&&(j=r.env),typeof r.endpoint=="string"&&r.endpoint&&(s=c(r.endpoint))}catch (e21){}},onEvent(r){return C.add(r),()=>void C.delete(r)},destroy(){p=[],E=[],w(),C.clear(),t.removeEventListener("pagehide",ie),document.removeEventListener("visibilitychange",ae),t.removeEventListener("bitsnap:consent",S),t.removeEventListener("bitsnap:consent:ready",S)}}}var v,O=null;function D(e){if(!v){let t=Xe(e);return t===y||(v=t,O=_chunkW3RGQYPDjs.c.call(void 0, _nullishCoalesce(e.projectKey, () => ("")))),t}try{let t=_chunkW3RGQYPDjs.c.call(void 0, _nullishCoalesce(e.projectKey, () => ("")));t!==O&&e.debug&&console.warn("[bitsnap analytics]","tracker already started for another projectKey, ignoring",e.projectKey),t===O&&((e.env||e.endpoint)&&v.configure({env:e.env,endpoint:e.endpoint}),e.enabled!=null&&v.setEnabled(e.enabled))}catch (e22){}return v}function Ae(){return v}function xt(){typeof window<"u"&&ge(window),_optionalChain([v, 'optionalAccess', _36 => _36.destroy, 'call', _37 => _37()]),v=void 0,O=null}function _t(e){try{if(typeof window>"u")return{};let t=v,n=null;if(t)n=t.clientId(e);else{let o=e?_chunkW3RGQYPDjs.c.call(void 0, e):null;n=o?N(window,o):null}return n?{[me]:n}:{}}catch (e23){return{}}}var _react = require('react');var nt={track:y.track,page:y.page},Pe=_react.createContext.call(void 0, nt);function St({projectKey:e,env:t,enabled:n,endpoint:o,onEvent:a,autoPageViews:i,children:c}){let s=_react.useMemo.call(void 0, ()=>D({projectKey:e,env:t,endpoint:o,enabled:n}),[e,t,o]),u=_react.useRef.call(void 0, a);u.current=a,_chunkW3RGQYPDjs.q.call(void 0, ()=>{s.setEnabled(n!==!1)},[s,n]),_chunkW3RGQYPDjs.q.call(void 0, ()=>{if(!(i===!1||n===!1||s===y))return A(()=>s.page(null))},[s,i,n]),_chunkW3RGQYPDjs.q.call(void 0, ()=>s.onEvent(b=>_optionalChain([u, 'access', _38 => _38.current, 'optionalCall', _39 => _39(b)])),[s]);let l=_react.useMemo.call(void 0, ()=>({track:s.track.bind(s),page:s.page.bind(s)}),[s]);return _react.createElement.call(void 0, Pe.Provider,{value:l},c)}function we(){return _react.useContext.call(void 0, Pe)}var $={track(){}},X=null;function lt(e){let t=Symbol("bitsnap-instrument");function n(){if(typeof window>"u")return null;let{projectKey:i,analytics:c,provided:s}=e();return c===!1?null:s||(i?D({projectKey:i,source:"sdk_react",channel:"embed",env:typeof c=="object"?c.env:void 0}):null)}let o={track(i,c,s){try{let u=n();if(!u)return;let{analytics:l,pageType:b}=e(),M=b&&_optionalChain([s, 'optionalAccess', _40 => _40.page_type])===void 0?{...s,page_type:b}:s;X=typeof l=="object"&&l.onEvent?t:null,u.track(i,c,M)}catch (e24){}finally{X=null}}};function a(){try{if(!n())return()=>{};let i=Ae();if(!i)return()=>{};let c=e().provided?()=>{}:A(()=>i.page(_nullishCoalesce(e().pageType, () => (null)))),s=i.onEvent(u=>{if(X===t)try{let{analytics:l}=e();typeof l=="object"&&_optionalChain([l, 'access', _41 => _41.onEvent, 'optionalCall', _42 => _42(u)])}catch (e25){}});return()=>{c(),s()}}catch (e26){return()=>{}}}return{instrument:o,attach:a}}var Z=_react.createContext.call(void 0, null);function Nt({value:e,children:t}){return _react.createElement.call(void 0, Z.Provider,{value:e},t)}function Ot(){return _nullishCoalesce(_react.useContext.call(void 0, Z), () => ($))}function Dt(e,t,n){let o=_react.useContext.call(void 0, Z),a=we(),i=a.track===y.track?null:a,c=_react.useRef.call(void 0, {projectKey:e,analytics:t,pageType:n,provided:i});c.current={projectKey:e,analytics:t,pageType:n,provided:i};let s=_react.useMemo.call(void 0, ()=>lt(()=>c.current),[]),u=t===void 0&&o!==null,l=typeof t=="object"&&!!t.onEvent;return _react.useLayoutEffect.call(void 0, ()=>{if(!u)return s.attach()},[s,u,l,e]),u?o:s.instrument}var Q=$;function Se(e){Q=_nullishCoalesce(e, () => ($))}var q=0;function $t(){return q>0?$:Q}async function Mt(e){q++;try{return await e()}finally{q--}}function jt(e){_react.useEffect.call(void 0, ()=>(Se(e),()=>{Q===e&&Se(null)}),[e])}function Ht(e){let t=Number.isFinite(e)?Math.max(0,Math.min(100,e)):0;return t>=100?"100":t>=75?"75-99":t>=50?"50-74":t>=25?"25-49":"0-24"}function Wt(e,t){let n=[];for(let o of[25,50,75,100])e>=o&&!t.has(o)&&(t.add(o),n.push(o));return n}exports.a = ve; exports.b = A; exports.c = Ue; exports.d = Xe; exports.e = D; exports.f = Ae; exports.g = xt; exports.h = _t; exports.i = St; exports.j = we; exports.k = $; exports.l = Nt; exports.m = Ot; exports.n = Dt; exports.o = $t; exports.p = Mt; exports.q = jt; exports.r = Ht; exports.s = Wt;
2
- //# sourceMappingURL=chunk-IRZJIPUF.js.map
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunkW3RGQYPDjs = require('./chunk-W3RGQYPD.js');var Oe=Symbol.for("bitsnap.pageViews");function ye(e){let t=e;return t[Oe]??={path:null,starters:new Set,watching:!1}}function De(e,t){let n=()=>{try{t()}catch (e2){}};for(let o of["pushState","replaceState"]){let a=e.history[o];e.history[o]=function(...i){let c=a.apply(this,i);return n(),c}}e.addEventListener("popstate",n)}function A(e,t=window){try{let n=ye(t),o=()=>e();n.watching||(n.watching=!0,De(t,()=>{let i=t.location.pathname;i===n.path||n.starters.size===0||(n.path=i,_optionalChain([n, 'access', _2 => _2.starters, 'access', _3 => _3.values, 'call', _4 => _4(), 'access', _5 => _5.next, 'call', _6 => _6(), 'access', _7 => _7.value, 'optionalCall', _8 => _8()]))})),n.starters.add(o);let a=t.location.pathname;return a!==n.path&&(n.path=a,o()),()=>void n.starters.delete(o)}catch (e3){return()=>{}}}function ge(e=window){let t=ye(e);t.path=null,t.starters.clear()}var ve="1.21.0";function I(e){let t=new Uint8Array(e),n=typeof crypto<"u"?crypto:void 0;if(n&&typeof n.getRandomValues=="function")n.getRandomValues(t);else for(let o=0;o<e;o++)t[o]=Math.floor(Math.random()*256);return t}var me="X-Bitsnap-Visitor",$e=390*24*60*60,Me=/^[A-Za-z0-9_-]{22}$/;function R(e){return e.BitsnapConsent}function je(e,t){for(let n of e.cookie.split(";")){let o=n.indexOf("=");if(o!==-1&&n.slice(0,o).trim()===t)return n.slice(o+1).trim()}return null}function He(e){let t=e.toLowerCase();return t==="bitsnap.pl"||t.endsWith(".bitsnap.pl")}function F(e,t){try{let n=R(e);if(!n)return!1;if(n.scope==="project")return n.projectKey===t;let o=He(e.location.hostname);return n.scope==="global"?!o:!1}catch (e4){return!1}}function J(e,t){try{return _optionalChain([R, 'call', _9 => _9(e), 'optionalAccess', _10 => _10.get, 'call', _11 => _11(), 'optionalAccess', _12 => _12.c, 'access', _13 => _13.analytics])===!0&&F(e,t)}catch (e5){return!1}}function he(){let e="";return I(16).forEach(t=>e+=String.fromCharCode(t)),btoa(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function Ee(e,t){try{return je(e,_chunkW3RGQYPDjs.g.call(void 0, t))}catch (e6){return null}}function B(e,t){let n=Ee(e,t);return n!==null&&Me.test(n)?n:null}function ke(e,t,n){try{let o=e.document,a=`${_chunkW3RGQYPDjs.g.call(void 0, t)}=${n}; Max-Age=${$e}; Path=/; SameSite=Lax`+(e.location.protocol==="https:"?"; Secure":"");for(let i of _chunkW3RGQYPDjs.o.call(void 0, e.location.hostname).reverse())if(o.cookie=`${a}; Domain=${i}`,B(o,t)===n)return;o.cookie=a}catch (e7){}}function be(e,t){try{let n=e.document;if(Ee(n,t)===null)return;let o=`${_chunkW3RGQYPDjs.g.call(void 0, t)}=; Max-Age=0; Path=/; SameSite=Lax`+(e.location.protocol==="https:"?"; Secure":"");n.cookie=o;for(let a of _chunkW3RGQYPDjs.o.call(void 0, e.location.hostname))n.cookie=`${o}; Domain=${a}`}catch (e8){}}function N(e,t){try{let n=e.navigator;return _optionalChain([n, 'optionalAccess', _14 => _14.globalPrivacyControl])===!0||_optionalChain([n, 'optionalAccess', _15 => _15.webdriver])===!0?null:J(e,t)?B(e.document,t):null}catch (e9){return null}}var Ue="https://collect.bitsnap.pl",Ke=5e3,Ge=20,Te=32*1024,ze=60*1024,xe=/^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;function _e(e){return typeof TextEncoder=="function"?new TextEncoder().encode(e).length:unescape(encodeURIComponent(e)).length}var y={track(){},page(){},clientId:()=>null,flush(){},setEnabled(){},onEvent:()=>()=>{},configure(){},destroy(){}};function Ye(e=Date.now()){let t=I(16),n=e;for(let a=5;a>=0;a--)t[a]=n%256,n=Math.floor(n/256);t[6]=t[6]&15|112,t[8]=t[8]&63|128;let o=Array.from(t,a=>a.toString(16).padStart(2,"0")).join("");return`${o.slice(0,8)}-${o.slice(8,12)}-${o.slice(12,16)}-${o.slice(16,20)}-${o.slice(20)}`}var Ce="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";function Fe(){return Array.from(I(16),e=>Ce[e%Ce.length]).join("")}function Je(e,t,n=!1){let o=_e(JSON.stringify({k:e,events:[]})),a=[],i=[],c=o,s=()=>{i.length>0&&a.push({body:JSON.stringify({k:e,events:i}),bytes:c,count:i.length}),i=[],c=o};for(let u of t){let l=_e(JSON.stringify(u));o+l>Te||((i.length>=_chunkW3RGQYPDjs.a.maxBatchEvents||c+l+(i.length>0?1:0)>Te)&&s(),c+=l+(i.length>0?1:0),i.push(u))}if(s(),n){let u=0,l=a.length;for(;l>0&&u+a[l-1].bytes<=ze;)u+=a[l-1].bytes,l--;a=a.slice(l)}return a}function Xe(e){try{return typeof window>"u"||typeof document>"u"?y:qe(e,window)}catch (e10){return y}}function qe(e,t){let n=_chunkW3RGQYPDjs.c.call(void 0, _nullishCoalesce(e.projectKey, () => (""))),o=!!e.debug,a=(...r)=>{o&&console.warn("[bitsnap analytics]",...r)};if(!n)return a("invalid projectKey, tracking is off"),y;let i=n,c=r=>`${(r||Ue).replace(/\/+$/,"")}/e`,s=c(e.endpoint),u=_nullishCoalesce(e.source, () => ("sdk_react")),l=_nullishCoalesce(e.channel, () => ("embed")),b=`bitsnap-react@${ve}`,M=Fe(),T=_chunkW3RGQYPDjs.e.call(void 0, t.location.href),j=_nullishCoalesce(e.env, () => ("live"));if(!e.env)try{new URLSearchParams(t.location.search).has("test")&&(j="test")}catch (e11){}let Le=_chunkW3RGQYPDjs.f.call(void 0, document.referrer),H=e.enabled!==!1,ee=null,Re=0,p=[],h=null,C=new Set;e.onEvent&&C.add(e.onEvent);let E=[],g,m=!0;function W(){let r=R(t);!r||r===g||(g=r,m=!r.ready,_optionalChain([r, 'access', _16 => _16.ready, 'optionalAccess', _17 => _17.then, 'call', _18 => _18(()=>{g===r&&(m=!0,re())},()=>{g===r&&(m=!0)})]))}function te(){W();try{if(!g)return!1;let r=g.get();return!!g.denied&&g.denied("analytics")||!!r&&r.c.analytics===!1}catch (e12){return!1}}function ne(r){C.forEach(f=>{try{f(r)}catch (e13){}})}function U(r){try{if(W(),!g||!F(t,i))return;J(t,i)?P()&&B(t.document,i)===null&&ke(t,i,he()):r&&be(t,i)}catch (e14){}}function re(){if(U(!0),te())p=[],E=[],w();else{if(m&&E.length>0){let r=E;E=[],r.forEach(ne)}p.length>0&&x()}}function P(){if(!H)return!1;let r=t.navigator;return r&&(r.globalPrivacyControl===!0||r.webdriver===!0)?!1:!te()}function w(){h!==null&&clearTimeout(h),h=null}function Be(){h===null&&(h=setTimeout(()=>{h=null,x()},Ke),_optionalChain([h, 'access', _19 => _19.unref, 'optionalCall', _20 => _20()]))}function Ne(r){try{if(typeof fetch=="function"){fetch(s,{method:"POST",body:r,keepalive:!0,credentials:"omit",headers:{"Content-Type":"text/plain"}}).catch(()=>{});return}}catch (e15){}try{let f=t.navigator;f&&typeof f.sendBeacon=="function"&&f.sendBeacon(s,new Blob([r],{type:"text/plain"}))}catch (e16){}}function x(r=!1){try{if(w(),p.length===0)return;if(!P()){p=[];return}if(!m)return;U(m);let f=N(t,i),d=f?p.map(k=>({...k,client_id:f})):p;p=[],Je(i,d,r).forEach(k=>Ne(k.body))}catch (e17){}}function oe(r,f,d){if(!P())return;let k=_chunkW3RGQYPDjs.h.call(void 0, r,f);if(!k.ok){a("dropped",r,k.reason);return}let se=_chunkW3RGQYPDjs.e.call(void 0, t.location.href),K={event_id:_optionalChain([d, 'optionalAccess', _21 => _21.event_id])&&xe.test(d.event_id)?d.event_id:Ye(),event:r,ts:Date.now(),schema_version:1,env:j,source:u,channel:l,sdk:b,page_id:M,page_type:_optionalChain([d, 'optionalAccess', _22 => _22.page_type])!==void 0?d.page_type:ee,host:_nullishCoalesce(_optionalChain([se, 'optionalAccess', _23 => _23.host]), () => (null)),path:_optionalChain([d, 'optionalAccess', _24 => _24.path])?_chunkW3RGQYPDjs.d.call(void 0, d.path.split(/[?#]/)[0]):_nullishCoalesce(_optionalChain([se, 'optionalAccess', _25 => _25.path]), () => (null)),referrer_host:Le,utm_source:_nullishCoalesce(_optionalChain([T, 'optionalAccess', _26 => _26.utm_source]), () => (null)),utm_medium:_nullishCoalesce(_optionalChain([T, 'optionalAccess', _27 => _27.utm_medium]), () => (null)),utm_campaign:_nullishCoalesce(_optionalChain([T, 'optionalAccess', _28 => _28.utm_campaign]), () => (null)),utm_content:_nullishCoalesce(_optionalChain([T, 'optionalAccess', _29 => _29.utm_content]), () => (null)),utm_term:_nullishCoalesce(_optionalChain([T, 'optionalAccess', _30 => _30.utm_term]), () => (null)),ref_code:_nullishCoalesce(_optionalChain([T, 'optionalAccess', _31 => _31.ref_code]), () => (null)),product_id:_nullishCoalesce(_optionalChain([d, 'optionalAccess', _32 => _32.product_id]), () => (null)),variant_id:_nullishCoalesce(_optionalChain([d, 'optionalAccess', _33 => _33.variant_id]), () => (null)),order_ref:_nullishCoalesce(_optionalChain([d, 'optionalAccess', _34 => _34.order_ref]), () => (null)),props:k.props};_optionalChain([d, 'optionalAccess', _35 => _35.event_id])&&!xe.test(d.event_id)&&a("ignored invalid event_id",r),u==="dashboard"&&e.visitorId&&(K.visitor_id=e.visitorId);let ce=_chunkW3RGQYPDjs.i.call(void 0, K);if(!ce.ok){a("dropped",r,ce.reason);return}let G=K;m?ne(G):E.push(G),p.push(G),p.length>=Ge?x():Be()}let ie=()=>x(!0),ae=()=>{document.visibilityState==="hidden"&&x(!0)},S=()=>re();return t.addEventListener("pagehide",ie),document.addEventListener("visibilitychange",ae),t.addEventListener("bitsnap:consent",S),t.addEventListener("bitsnap:consent:ready",S),W(),U(m),{track(r,f,d){try{oe(r,f,d)}catch (e18){}},page(r,f){try{r!==void 0&&(ee=r),oe("page_view",{landing:Re++===0},f)}catch (e19){}},clientId(r){try{return r!==void 0&&_chunkW3RGQYPDjs.c.call(void 0, r)!==i?null:P()?N(t,i):null}catch (e20){return null}},flush:()=>x(),setEnabled(r){H=!!r,H||(p=[],E=[],w())},configure(r){try{(r.env==="live"||r.env==="test")&&(j=r.env),typeof r.endpoint=="string"&&r.endpoint&&(s=c(r.endpoint))}catch (e21){}},onEvent(r){return C.add(r),()=>void C.delete(r)},destroy(){p=[],E=[],w(),C.clear(),t.removeEventListener("pagehide",ie),document.removeEventListener("visibilitychange",ae),t.removeEventListener("bitsnap:consent",S),t.removeEventListener("bitsnap:consent:ready",S)}}}var v,O=null;function D(e){if(!v){let t=Xe(e);return t===y||(v=t,O=_chunkW3RGQYPDjs.c.call(void 0, _nullishCoalesce(e.projectKey, () => ("")))),t}try{let t=_chunkW3RGQYPDjs.c.call(void 0, _nullishCoalesce(e.projectKey, () => ("")));t!==O&&e.debug&&console.warn("[bitsnap analytics]","tracker already started for another projectKey, ignoring",e.projectKey),t===O&&((e.env||e.endpoint)&&v.configure({env:e.env,endpoint:e.endpoint}),e.enabled!=null&&v.setEnabled(e.enabled))}catch (e22){}return v}function Ae(){return v}function xt(){typeof window<"u"&&ge(window),_optionalChain([v, 'optionalAccess', _36 => _36.destroy, 'call', _37 => _37()]),v=void 0,O=null}function _t(e){try{if(typeof window>"u")return{};let t=v,n=null;if(t)n=t.clientId(e);else{let o=e?_chunkW3RGQYPDjs.c.call(void 0, e):null;n=o?N(window,o):null}return n?{[me]:n}:{}}catch (e23){return{}}}var _react = require('react');var nt={track:y.track,page:y.page},Pe=_react.createContext.call(void 0, nt);function St({projectKey:e,env:t,enabled:n,endpoint:o,onEvent:a,autoPageViews:i,children:c}){let s=_react.useMemo.call(void 0, ()=>D({projectKey:e,env:t,endpoint:o,enabled:n}),[e,t,o]),u=_react.useRef.call(void 0, a);u.current=a,_chunkW3RGQYPDjs.q.call(void 0, ()=>{s.setEnabled(n!==!1)},[s,n]),_chunkW3RGQYPDjs.q.call(void 0, ()=>{if(!(i===!1||n===!1||s===y))return A(()=>s.page(null))},[s,i,n]),_chunkW3RGQYPDjs.q.call(void 0, ()=>s.onEvent(b=>_optionalChain([u, 'access', _38 => _38.current, 'optionalCall', _39 => _39(b)])),[s]);let l=_react.useMemo.call(void 0, ()=>({track:s.track.bind(s),page:s.page.bind(s)}),[s]);return _react.createElement.call(void 0, Pe.Provider,{value:l},c)}function we(){return _react.useContext.call(void 0, Pe)}var $={track(){}},X=null;function lt(e){let t=Symbol("bitsnap-instrument");function n(){if(typeof window>"u")return null;let{projectKey:i,analytics:c,provided:s}=e();return c===!1?null:s||(i?D({projectKey:i,source:"sdk_react",channel:"embed",env:typeof c=="object"?c.env:void 0}):null)}let o={track(i,c,s){try{let u=n();if(!u)return;let{analytics:l,pageType:b}=e(),M=b&&_optionalChain([s, 'optionalAccess', _40 => _40.page_type])===void 0?{...s,page_type:b}:s;X=typeof l=="object"&&l.onEvent?t:null,u.track(i,c,M)}catch (e24){}finally{X=null}}};function a(){try{if(!n())return()=>{};let i=Ae();if(!i)return()=>{};let c=e().provided?()=>{}:A(()=>i.page(_nullishCoalesce(e().pageType, () => (null)))),s=i.onEvent(u=>{if(X===t)try{let{analytics:l}=e();typeof l=="object"&&_optionalChain([l, 'access', _41 => _41.onEvent, 'optionalCall', _42 => _42(u)])}catch (e25){}});return()=>{c(),s()}}catch (e26){return()=>{}}}return{instrument:o,attach:a}}var Z=_react.createContext.call(void 0, null);function Nt({value:e,children:t}){return _react.createElement.call(void 0, Z.Provider,{value:e},t)}function Ot(){return _nullishCoalesce(_react.useContext.call(void 0, Z), () => ($))}function Dt(e,t,n){let o=_react.useContext.call(void 0, Z),a=we(),i=a.track===y.track?null:a,c=_react.useRef.call(void 0, {projectKey:e,analytics:t,pageType:n,provided:i});c.current={projectKey:e,analytics:t,pageType:n,provided:i};let s=_react.useMemo.call(void 0, ()=>lt(()=>c.current),[]),u=t===void 0&&o!==null,l=typeof t=="object"&&!!t.onEvent;return _react.useLayoutEffect.call(void 0, ()=>{if(!u)return s.attach()},[s,u,l,e]),u?o:s.instrument}var Q=$;function Se(e){Q=_nullishCoalesce(e, () => ($))}var q=0;function $t(){return q>0?$:Q}async function Mt(e){q++;try{return await e()}finally{q--}}function jt(e){_react.useEffect.call(void 0, ()=>(Se(e),()=>{Q===e&&Se(null)}),[e])}function Ht(e){let t=Number.isFinite(e)?Math.max(0,Math.min(100,e)):0;return t>=100?"100":t>=75?"75-99":t>=50?"50-74":t>=25?"25-49":"0-24"}function Wt(e,t){let n=[];for(let o of[25,50,75,100])e>=o&&!t.has(o)&&(t.add(o),n.push(o));return n}exports.a = ve; exports.b = A; exports.c = Ue; exports.d = Xe; exports.e = D; exports.f = Ae; exports.g = xt; exports.h = _t; exports.i = St; exports.j = we; exports.k = $; exports.l = Nt; exports.m = Ot; exports.n = Dt; exports.o = $t; exports.p = Mt; exports.q = jt; exports.r = Ht; exports.s = Wt;
2
+ //# sourceMappingURL=chunk-EK3D44XW.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["/home/emems/.t3/worktrees/bitsnap-react-panel-key/dist/chunk-EK3D44XW.js","../src/analytics/pageviews.ts","../src/version.ts","../src/analytics/random.ts","../src/analytics/visitor.ts"],"names":["REGISTRY","registry","win","holder","watchNavigation","onChange","check","name","original","args","result","startAutoPageViews","send","reg","starter","path","resetAutoPageViews","SDK_VERSION","randomBytes","n","bytes","c","i","VISITOR_HEADER","MAX_AGE_SECONDS","VISITOR_ID_RE","consentApi","readCookie","doc","part","index","isBitsnapHost","hostname","host","consentBelongsTo","projectKey","api","onBitsnap","analyticsGranted","newVisitorId","binary","byte","rawVisitorCookie","clientIdCookieName","readVisitorCookie","value","writeVisitorCookie","id","base"],"mappings":"AAAA,uuBAA2G,ICYrGA,EAAAA,CAAW,MAAA,CAAO,GAAA,CAAI,mBAAmB,CAAA,CAE/C,SAASC,EAAAA,CAASC,CAAAA,CAAuB,CACvC,IAAMC,CAAAA,CAASD,CAAAA,CACf,OAAQC,CAAAA,CAAOH,EAAQ,CAAA,GAAM,CAAE,IAAA,CAAM,IAAA,CAAM,QAAA,CAAU,IAAI,GAAA,CAAO,QAAA,CAAU,CAAA,CAAM,CAClF,CAGA,SAASI,EAAAA,CAAgBF,CAAAA,CAAaG,CAAAA,CAAsB,CAC1D,IAAMC,CAAAA,CAAQ,CAAA,CAAA,EAAM,CAClB,GAAI,CACFD,CAAAA,CAAS,CACX,CAAA,UAAQ,CAAC,CACX,CAAA,CACA,GAAA,CAAA,IAAWE,EAAAA,EAAQ,CAAC,WAAA,CAAa,cAAc,CAAA,CAAY,CACzD,IAAMC,CAAAA,CAAWN,CAAAA,CAAI,OAAA,CAAQK,CAAI,CAAA,CACjCL,CAAAA,CAAI,OAAA,CAAQK,CAAI,CAAA,CAAI,QAAA,CAAA,GAA4BE,CAAAA,CAAwC,CACtF,IAAMC,CAAAA,CAASF,CAAAA,CAAS,KAAA,CAAM,IAAA,CAAMC,CAAI,CAAA,CACxC,OAAAH,CAAAA,CAAM,CAAA,CACCI,CACT,CACF,CACAR,CAAAA,CAAI,gBAAA,CAAiB,UAAA,CAAYI,CAAK,CACxC,CAQO,SAASK,CAAAA,CAAmBC,CAAAA,CAAkBV,CAAAA,CAAc,MAAA,CAAoB,CACrF,GAAI,CACF,IAAMW,CAAAA,CAAMZ,EAAAA,CAASC,CAAG,CAAA,CAClBY,CAAAA,CAAU,CAAA,CAAA,EAAMF,CAAAA,CAAK,CAAA,CACtBC,CAAAA,CAAI,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CAAA,UAAQ,CACN,OAAO,IACT,CACF,CAGO,SAASC,CAAAA,CAAkBhB,CAAAA,CAAeO,CAAAA,CAAmC,CAClF,IAAMU,CAAAA,CAAQH,EAAAA,CAAiBd,CAAAA,CAAKO,CAAU,CAAA,CAC9C,OAAOU,CAAAA,GAAU,IAAA,EAAQpB,EAAAA,CAAc,IAAA,CAAKoB,CAAK,CAAA,CAAIA,CAAAA,CAAQ,IAC/D,CAOO,SAASC,EAAAA,CAAmB5C,CAAAA,CAAaiC,CAAAA,CAAoBY,CAAAA,CAAkB,CACpF,GAAI,CACF,IAAMnB,CAAAA,CAAM1B,CAAAA,CAAI,QAAA,CACV8C,CAAAA,CACJ,CAAA,EAAA","file":"/home/emems/.t3/worktrees/bitsnap-react-panel-key/dist/chunk-EK3D44XW.js","sourcesContent":[null,"/**\n * Page-wide state of the automatic page views. It lives on `window`, so the\n * npm package, a second copy of it and the `analytics.js` script agree on who\n * reports a path and the history is patched once.\n */\ntype Registry = {\n /** Last path some starter reported. */\n path: string | null;\n starters: Set<() => void>;\n watching: boolean;\n};\n\nconst REGISTRY = Symbol.for(\"bitsnap.pageViews\");\n\nfunction registry(win: Window): Registry {\n const holder = win as unknown as Record<symbol, Registry | undefined>;\n return (holder[REGISTRY] ??= { path: null, starters: new Set(), watching: false });\n}\n\n/** Calls `onChange` when the path changes through `history.pushState`/`replaceState` or Back/Forward. */\nfunction watchNavigation(win: Window, onChange: () => void) {\n const check = () => {\n try {\n onChange();\n } catch {}\n };\n for (const name of [\"pushState\", \"replaceState\"] as const) {\n const original = win.history[name];\n win.history[name] = function (this: History, ...args: Parameters<History[typeof name]>) {\n const result = original.apply(this, args);\n check();\n return result;\n };\n }\n win.addEventListener(\"popstate\", check);\n}\n\n/**\n * Calls `send` for the current path and again on every path change, unless\n * another starter on the page already reported that path: the page gets one\n * `page_view` per path change however many providers, components and embeds\n * start it. Returns the function that stops this starter.\n */\nexport function startAutoPageViews(send: () => void, win: Window = window): () => void {\n try {\n const reg = registry(win);\n const starter = () => send();\n if (!reg.watching) {\n reg.watching = true;\n watchNavigation(win, () => {\n const path = win.location.pathname;\n // Nobody listening: leave the path unreported so the next starter sends it.\n if (path === reg.path || reg.starters.size === 0) return;\n reg.path = path;\n reg.starters.values().next().value?.();\n });\n }\n reg.starters.add(starter);\n const path = win.location.pathname;\n if (path !== reg.path) {\n reg.path = path;\n starter();\n }\n return () => void reg.starters.delete(starter);\n } catch {\n return () => {};\n }\n}\n\n/** Forgets the reported path and the starters (tests, hot reload). The history patch stays. */\nexport function resetAutoPageViews(win: Window = window) {\n const reg = registry(win);\n reg.path = null;\n reg.starters.clear();\n}\n","// Generated by scripts/write-version.mjs from package.json. Do not edit.\nexport const SDK_VERSION = \"1.21.0\";\n","export function randomBytes(n: number): Uint8Array {\n const bytes = new Uint8Array(n);\n const c = typeof crypto !== \"undefined\" ? crypto : undefined;\n if (c && typeof c.getRandomValues === \"function\") c.getRandomValues(bytes);\n else for (let i = 0; i < n; i++) bytes[i] = Math.floor(Math.random() * 256);\n return bytes;\n}\n","import { domainCandidates } from \"../consent/core/cookie\";\nimport { clientIdCookieName } from \"./contract\";\nimport { randomBytes } from \"./random\";\n\n/** The part of `window.BitsnapConsent` (`bitsnap-react/consent`) the tracker reads. */\nexport type ConsentLike = {\n /** Absent on a consent script older than 1.9.0, which never counts as the project's banner. */\n scope?: \"global\" | \"project\";\n projectKey?: string | null;\n get(): { c: { analytics?: boolean } } | null;\n /** Also true for a refusal made on an older banner version, which `get()` no longer returns. */\n denied?(category: \"analytics\"): boolean;\n ready?: Promise<unknown>;\n};\n\n/** Sent to the Bitsnap server on the requests that create a checkout or payment link. */\nexport const VISITOR_HEADER = \"X-Bitsnap-Visitor\";\n// 390 days, under the 13 months CNIL allows. Set once, never extended.\nconst MAX_AGE_SECONDS = 390 * 24 * 60 * 60;\nconst VISITOR_ID_RE = /^[A-Za-z0-9_-]{22}$/;\n\nexport function consentApi(win: Window): ConsentLike | undefined {\n return (win as unknown as { BitsnapConsent?: ConsentLike }).BitsnapConsent;\n}\n\nfunction readCookie(doc: Document, name: string): string | null {\n for (const part of doc.cookie.split(\";\")) {\n const index = part.indexOf(\"=\");\n if (index !== -1 && part.slice(0, index).trim() === name) return part.slice(index + 1).trim();\n }\n return null;\n}\n\n/** bitsnap.pl and its subdomains: many merchants share them, and the site-wide choice is bitsnap's own. */\nfunction isBitsnapHost(hostname: string): boolean {\n const host = hostname.toLowerCase();\n return host === \"bitsnap.pl\" || host.endsWith(\".bitsnap.pl\");\n}\n\n/**\n * Whether the page's consent banner speaks for `projectKey`: a project-scope banner of that\n * key, or a site-scope banner on a merchant's own site. On bitsnap.pl a site-scope choice is\n * bitsnap's own, so only a project-scope one counts.\n */\nexport function consentBelongsTo(win: Window, projectKey: string): boolean {\n try {\n const api = consentApi(win);\n if (!api) return false;\n if (api.scope === \"project\") return api.projectKey === projectKey;\n const onBitsnap = isBitsnapHost(win.location.hostname);\n if (api.scope === \"global\") return !onBitsnap;\n // A consent script from before the scope info: it cannot be told apart from another project's banner.\n return false;\n } catch {\n return false;\n }\n}\n\n/** `true` only while a banner that speaks for `projectKey` holds a valid choice that grants `analytics`. */\nexport function analyticsGranted(win: Window, projectKey: string): boolean {\n try {\n return consentApi(win)?.get()?.c.analytics === true && consentBelongsTo(win, projectKey);\n } catch {\n return false;\n }\n}\n\n/** 16 random bytes as 22 base64url characters. */\nexport function newVisitorId(): string {\n let binary = \"\";\n randomBytes(16).forEach((byte) => (binary += String.fromCharCode(byte)));\n return btoa(binary).replace(/\\+/g, \"-\").replace(/\\//g, \"_\").replace(/=+$/, \"\");\n}\n\n/** Value of the `bs_vid_<projectKey>` cookie, whatever it holds; `null` when it is absent. */\nfunction rawVisitorCookie(doc: Document, projectKey: string): string | null {\n try {\n return readCookie(doc, clientIdCookieName(projectKey));\n } catch {\n return null;\n }\n}\n\n/** The project's client id from its first-party cookie (`bs_vid_<projectKey>`), or `null` if absent or malformed. */\nexport function readVisitorCookie(doc: Document, projectKey: string): string | null {\n const value = rawVisitorCookie(doc, projectKey);\n return value !== null && VISITOR_ID_RE.test(value) ? value : null;\n}\n\n/**\n * Sets the cookie on the widest registrable domain the browser accepts\n * (shortest suffix with two labels first, so `shop.example.co.uk` skips the\n * refused `co.uk`), host-only where no domain sticks (localhost, IP hosts).\n */\nexport function writeVisitorCookie(win: Window, projectKey: string, id: string): void {\n try {\n const doc = win.document;\n const base =\n `${clientIdCookieName(projectKey)}=${id}; Max-Age=${MAX_AGE_SECONDS}; Path=/; SameSite=Lax` +\n (win.location.protocol === \"https:\" ? \"; Secure\" : \"\");\n for (const domain of domainCandidates(win.location.hostname).reverse()) {\n doc.cookie = `${base}; Domain=${domain}`;\n if (readVisitorCookie(doc, projectKey) === id) return;\n }\n doc.cookie = base;\n } catch {\n // cookies blocked (sandboxed frame)\n }\n}\n\n/** Expires the cookie on the host and on every parent domain it may have been set on. */\nexport function deleteVisitorCookie(win: Window, projectKey: string): void {\n try {\n const doc = win.document;\n // Present under any value: a malformed one must go too.\n if (rawVisitorCookie(doc, projectKey) === null) return;\n const base =\n `${clientIdCookieName(projectKey)}=; Max-Age=0; Path=/; SameSite=Lax` +\n (win.location.protocol === \"https:\" ? \"; Secure\" : \"\");\n doc.cookie = base;\n for (const domain of domainCandidates(win.location.hostname)) doc.cookie = `${base}; Domain=${domain}`;\n } catch {\n // best effort\n }\n}\n\n/**\n * The project's client id to send, or `null`: analytics consent is granted,\n * Global Privacy Control is off, the browser is not automated and the cookie exists.\n */\nexport function readVisitorId(win: Window, projectKey: string): string | null {\n try {\n const nav = win.navigator as { globalPrivacyControl?: boolean; webdriver?: boolean } | undefined;\n if (nav?.globalPrivacyControl === true || nav?.webdriver === true) return null;\n return analyticsGranted(win, projectKey) ? readVisitorCookie(win.document, projectKey) : null;\n } catch {\n return null;\n }\n}\n"]}
@@ -1,2 +1,2 @@
1
- import{a as s}from"./chunk-TW25G7XX.mjs";var r="X-Bitsnap-Client",o=`bitsnap-react@${s}`,i="bs_client",l={[r]:o},m=t=>e=>(e.header.set(r,o),t(e));function _(t){let e=t.indexOf("#"),n=e===-1?t:t.slice(0,e),c=e===-1?"":t.slice(e),p=n.includes("?")?/[?&]$/.test(n)?"":"&":"?";return`${n}${p}${i}=${encodeURIComponent(o)}${c}`}var a="https://bitsnap.pl",E=a;function H(t){console.log("setCustomHost",t),E=t}export{l as a,m as b,_ as c,a as d,E as e,H as f};
2
- //# sourceMappingURL=chunk-BTERIY6N.mjs.map
1
+ import{a as s}from"./chunk-J6WKSO33.mjs";var r="X-Bitsnap-Client",o=`bitsnap-react@${s}`,i="bs_client",l={[r]:o},m=t=>e=>(e.header.set(r,o),t(e));function _(t){let e=t.indexOf("#"),n=e===-1?t:t.slice(0,e),c=e===-1?"":t.slice(e),p=n.includes("?")?/[?&]$/.test(n)?"":"&":"?";return`${n}${p}${i}=${encodeURIComponent(o)}${c}`}var a="https://bitsnap.pl",E=a;function H(t){console.log("setCustomHost",t),E=t}export{l as a,m as b,_ as c,a as d,E as e,H as f};
2
+ //# sourceMappingURL=chunk-EXC5Z5VM.mjs.map