calmlens 0.27.5 → 0.28.0

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 (85) hide show
  1. package/README.md +2 -2
  2. package/bin/calmlens.js +48 -26
  3. package/cjs/{BrowserUpload-DJZY1LSU.d.ts → BrowserUpload-CRbCsX7a.d.ts} +2 -2
  4. package/cjs/{BrowserUpload-DhruIgFN.js → BrowserUpload-Dz4UwTTJ.js} +1 -1
  5. package/cjs/{CalmLensAppClient-BA_xaNHY.js → CalmLensAppClient-B0QZ1oJV.js} +3 -3
  6. package/{esm/CalmLensAppClient-DzoSqUgG.d.ts → cjs/CalmLensAppClient-B3u6BlP5.d.ts} +2 -2
  7. package/cjs/{CalmLensOptionKeys-BvLQghl-.js → CalmLensOptionKeys-Cat8CgOn.js} +2 -2
  8. package/cjs/{CalmLensServerClient-D3K5HS9v.d.ts → CalmLensServerClient-B8ntjNL3.d.ts} +6 -6
  9. package/cjs/{CalmLensServerClient-D55xDZm4.js → CalmLensServerClient-CQdvhCGg.js} +14 -14
  10. package/cjs/{CalmLensTypes-OWZsGvBX.d.ts → CalmLensTypes-CtO4Dieu.d.ts} +79 -8
  11. package/{esm/Core-CTO_Eh0l.d.ts → cjs/Core-BJaLU71Q.d.ts} +2 -2
  12. package/cjs/{Core-kKGmyk5V.js → Core-DCnnUsgF.js} +7 -4
  13. package/cjs/{CryptoUtils-B_x8lMIx-YBW1-bvL.js → CryptoUtils-BLCa-oZe-leCkr1ko.js} +1 -2
  14. package/cjs/{ModerationContextLimits-Cxaob3tc.js → ModerationContextLimits-_knOVCH0.js} +63 -8
  15. package/cjs/{ReactUpload-BDXV4aHT.d.ts → ReactUpload-BGUkcMpg.d.ts} +1 -1
  16. package/cjs/{ReactUpload-Cx3Hi7xt.js → ReactUpload-BtmIrdky.js} +1 -1
  17. package/{esm/TestTriggers-Dnukm-jm-DoEB7jJc.d.ts → cjs/TestTriggers-dognME9k-PWyIfHMI.d.ts} +1 -2
  18. package/cjs/{TestTriggers-Cvi7e2KA-DcT1pc_W.js → TestTriggers-uL2Ec8Vt-cPmmKvYd.js} +14 -15
  19. package/cjs/{UploadController-CC1afxmL.js → UploadController-CEL3N4Ae.js} +2 -2
  20. package/cjs/{WebhookPayload-CrMU6lg0.d.ts → WebhookPayload-DZadhbAJ.d.ts} +5 -1
  21. package/cjs/app.d.ts +4 -4
  22. package/cjs/app.js +2 -2
  23. package/cjs/elements.d.ts +4 -4
  24. package/cjs/elements.js +4 -4
  25. package/cjs/{index-BDxmVi-G.d.ts → index-DQUZYLVY.d.ts} +2 -2
  26. package/cjs/index.d.ts +3 -3
  27. package/cjs/index.js +1 -1
  28. package/cjs/react-native.d.ts +2 -2
  29. package/cjs/react-native.js +5 -5
  30. package/cjs/react.d.ts +4 -4
  31. package/cjs/react.js +5 -5
  32. package/cjs/server.d.ts +4 -4
  33. package/cjs/server.js +2 -2
  34. package/cjs/test-inputs.d.ts +1 -1
  35. package/cjs/test-inputs.js +13 -13
  36. package/cjs/testing.d.ts +36 -7
  37. package/cjs/testing.js +112 -43
  38. package/cjs/{ui-DAbpyM2Z.d.ts → ui-BGywTQ2M.d.ts} +2 -2
  39. package/cjs/{ui-I75EvP9r.js → ui-DVQm0TFJ.js} +2 -2
  40. package/cjs/ui.d.ts +2 -2
  41. package/cjs/ui.js +3 -3
  42. package/cjs/vue.d.ts +5 -5
  43. package/cjs/vue.js +4 -4
  44. package/esm/{BrowserUpload-DJZY1LSU.d.ts → BrowserUpload-CRbCsX7a.d.ts} +2 -2
  45. package/esm/{BrowserUpload-CejeWw5r.js → BrowserUpload-DSq5Ezo1.js} +1 -1
  46. package/esm/{CalmLensAppClient-BxkCVPCl.js → CalmLensAppClient-B1QpSXYm.js} +3 -3
  47. package/{cjs/CalmLensAppClient-DzoSqUgG.d.ts → esm/CalmLensAppClient-B3u6BlP5.d.ts} +2 -2
  48. package/esm/{CalmLensOptionKeys-DC9FUO43.js → CalmLensOptionKeys-BYqFZ0FP.js} +2 -2
  49. package/esm/{CalmLensServerClient-D3K5HS9v.d.ts → CalmLensServerClient-B8ntjNL3.d.ts} +6 -6
  50. package/esm/{CalmLensServerClient-D-TIIQp2.js → CalmLensServerClient-D2Vr_jTR.js} +10 -10
  51. package/esm/{CalmLensTypes-OWZsGvBX.d.ts → CalmLensTypes-CtO4Dieu.d.ts} +79 -8
  52. package/{cjs/Core-CTO_Eh0l.d.ts → esm/Core-BJaLU71Q.d.ts} +2 -2
  53. package/esm/{Core-B85V5dxv.js → Core-Dz7BAias.js} +7 -4
  54. package/esm/{CryptoUtils-B_x8lMIx-DhuWGzqn.js → CryptoUtils-BLCa-oZe-DKr3LmN6.js} +1 -2
  55. package/esm/{ModerationContextLimits-Tev2lxE0.js → ModerationContextLimits-DaFaXt45.js} +46 -9
  56. package/esm/{ReactUpload-BDXV4aHT.d.ts → ReactUpload-BGUkcMpg.d.ts} +1 -1
  57. package/esm/{ReactUpload-B7QXMSWJ.js → ReactUpload-kSzn3SOj.js} +1 -1
  58. package/{cjs/TestTriggers-Dnukm-jm-DoEB7jJc.d.ts → esm/TestTriggers-dognME9k-PWyIfHMI.d.ts} +1 -2
  59. package/esm/{TestTriggers-Cvi7e2KA-BA83CRJb.js → TestTriggers-uL2Ec8Vt-DYbTEJWm.js} +11 -12
  60. package/esm/{UploadController-D7XmzO-p.js → UploadController--Qz3DP2W.js} +2 -2
  61. package/esm/{WebhookPayload-CrMU6lg0.d.ts → WebhookPayload-DZadhbAJ.d.ts} +5 -1
  62. package/esm/app.d.ts +4 -4
  63. package/esm/app.js +2 -2
  64. package/esm/elements.d.ts +4 -4
  65. package/esm/elements.js +4 -4
  66. package/esm/{index-BDxmVi-G.d.ts → index-DQUZYLVY.d.ts} +2 -2
  67. package/esm/index.d.ts +3 -3
  68. package/esm/index.js +1 -1
  69. package/esm/react-native.d.ts +2 -2
  70. package/esm/react-native.js +5 -5
  71. package/esm/react.d.ts +4 -4
  72. package/esm/react.js +5 -5
  73. package/esm/server.d.ts +4 -4
  74. package/esm/server.js +2 -2
  75. package/esm/test-inputs.d.ts +1 -1
  76. package/esm/test-inputs.js +1 -1
  77. package/esm/testing.d.ts +36 -7
  78. package/esm/testing.js +103 -34
  79. package/esm/{ui-cE1lyljs.js → ui-B951EpwC.js} +2 -2
  80. package/esm/{ui-DAbpyM2Z.d.ts → ui-BGywTQ2M.d.ts} +2 -2
  81. package/esm/ui.d.ts +2 -2
  82. package/esm/ui.js +3 -3
  83. package/esm/vue.d.ts +5 -5
  84. package/esm/vue.js +4 -4
  85. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import { At as RetrieveAssetOptions, M as CdnAssetUrlOptions, O as CalmLensAppClientOptions, Ot as RequestOptions, Qt as UploadedAsset, Zt as UploadPresetSubmitAssetOptions, qt as UploadAssetPartOptions } from "./CalmLensTypes-OWZsGvBX.js";
1
+ import { At as RetrieveAssetOptions, M as CdnAssetUrlOptions, O as CalmLensAppClientOptions, Ot as RequestOptions, Qt as UploadedAsset, Zt as UploadPresetSubmitAssetOptions, qt as UploadAssetPartOptions } from "./CalmLensTypes-CtO4Dieu.js";
2
2
  declare const inspectSymbol: unique symbol;
3
3
  declare class CalmLensAppClient {
4
4
  #private;
@@ -37,7 +37,7 @@ declare class CalmLensAppClient {
37
37
  * mode, chosen when it started, applies when the final part arrives.
38
38
  */
39
39
  uploadPart: (partOptions: UploadAssetPartOptions, requestOptions?: RequestOptions) => Promise<UploadedAsset>;
40
- /** Checks an upload this client made. `status` is present when the preset shows decisions. */
40
+ /** Checks an upload this client made. `classification.moderation.decision` is present when the preset shows decisions. */
41
41
  retrieve: (options: RetrieveAssetOptions, requestOptions?: RequestOptions) => Promise<UploadedAsset>;
42
42
  };
43
43
  }
@@ -1,4 +1,4 @@
1
- import { B as resolveLogLevel, D as MAX_IMAGE_UPLOAD_BYTES, E as MAX_DIRECT_IMAGE_UPLOAD_BYTES, M as sleep, O as MAX_NON_IMAGE_UPLOAD_BYTES, Y as CalmLensError, _ as randomUuid, j as CalmLensTransport, k as getRejectedUploadMimeTypeError, lt as API_ERROR_CODES, m as isAcceptedUploadMimeType, ot as SDK_ERROR_CODES, r as selectModerationContextItems, st as invalidArgument, y as stringifyQuery } from "./ModerationContextLimits-Tev2lxE0.js";
1
+ import { A as MAX_IMAGE_UPLOAD_BYTES, F as sleep, M as getRejectedUploadMimeTypeError, P as CalmLensTransport, Q as CalmLensError, S as stringifyQuery, U as resolveLogLevel, _ as isAcceptedUploadMimeType, b as randomUuid, ft as API_ERROR_CODES, j as MAX_NON_IMAGE_UPLOAD_BYTES, k as MAX_DIRECT_IMAGE_UPLOAD_BYTES, lt as SDK_ERROR_CODES, r as selectModerationContextItems, ut as invalidArgument } from "./ModerationContextLimits-DaFaXt45.js";
2
2
  // src/contract/AssetPayload.js
3
3
  const bufferInputToBytes = (value) => {
4
4
  if (value instanceof ArrayBuffer) return new Uint8Array(value);
@@ -746,9 +746,9 @@ const SERVER_OPTION_KEYS = {
746
746
  "expiresIn",
747
747
  "externalId",
748
748
  "lens",
749
- "original",
750
749
  "projectId",
751
750
  "resource",
751
+ "resource",
752
752
  "transform",
753
753
  "viewerClaims"
754
754
  ],
@@ -1,6 +1,6 @@
1
1
  import { d as HashListEntry, u as HashList } from "./Classification-CMM2tZpJ-IdIh63n0.js";
2
- import { $ as FolderPage, $t as VerifyWebhookSignatureOptions, An as Policy, At as RetrieveAssetOptions, B as CreateHashListOptions, Bt as UpdateAssetOptions, D as BatchAssetsResponse, E as BatchAssetsOptions, Et as RemoveAssetContentOptions, Ft as SignUploadTokenOptions, G as DeleteAssetOptions, Gt as UpdateProjectSettingsOptions, Ht as UpdateHashListOptions, I as ClassifyTextOptions, In as AssetInfo, It as SignedAssetUrl, J as EnsureLensesOptions, K as DeleteMetadataFieldOptions, Kt as UpgradePolicyOptions, Lt as SignedUploadToken, M as CdnAssetUrlOptions, Nt as SetPolicyAutomaticUpdatesOptions, Ot as RequestOptions, P as CdnServeOptions, Pn as AssetSearchQuery, Pt as SignAssetUrlOptions, Q as FolderIdOptions, T as AssignPolicyOptions, Tt as PolicyPage, U as CreatePolicyOptions, Ut as UpdateLensOptions, V as CreateLensOptions, Vt as UpdateFolderOptions, W as DecideAssetOptions, Wt as UpdatePolicyOptions, X as EnsureUploadPresetsOptions, Xt as UploadPresetPage, Y as EnsureMetadataFieldsOptions, Yt as UploadPresetIdOptions, Z as EnsureUploadPresetsResponse, _ as AssetPage, _n as Folder, _t as ListLensesOptions, b as AssetTimelinePage, bt as MoveAssetOptions, ct as LensIdOptions, dt as ListAssetTimelineOptions, et as GetAssetInfoOptions, ft as ListAssetsOptions, gt as ListHashListsOptions, ht as ListHashListEntriesOptions, it as HashListPage, jt as RetryAssetOptions, k as CalmLensServerClientOptions, kt as ResetPolicyOptions, lt as LensPage, mt as ListFoldersOptions, nt as HashListEntryPage, o as AssetChildrenPage, on as GetEventsResponse, pt as ListEventsOptions, q as EnsureLensOptions, qt as UploadAssetPartOptions, r as Asset, rt as HashListIdOptions, st as Lens, t as AddHashListEntryOptions, tn as WaitForAssetDecisionOptions, tt as HashListEntryIdOptions, ut as ListAssetChildrenOptions, v as AssetSearchResponse, vn as MetadataFieldsResource, vt as ListPoliciesOptions, wt as PolicyIdOptions, xt as MoveFolderOptions, yn as ProjectSettingsResource, yt as ListUploadPresetsOptions, z as CreateFolderOptions, zt as SubmitAssetOptions } from "./CalmLensTypes-OWZsGvBX.js";
3
- import { d as ListPromise, l as CalmLensResponse, r as CdnResponse } from "./WebhookPayload-CrMU6lg0.js";
2
+ import { $ as FolderPage, $t as VerifyWebhookSignatureOptions, An as Policy, At as RetrieveAssetOptions, B as CreateHashListOptions, Bt as UpdateAssetOptions, D as BatchAssetsResponse, E as BatchAssetsOptions, Et as RemoveAssetContentOptions, Ft as SignUploadTokenOptions, G as DeleteAssetOptions, Gt as UpdateProjectSettingsOptions, Ht as UpdateHashListOptions, I as ClassifyTextOptions, In as AssetInfo, It as SignedAssetUrl, J as EnsureLensesOptions, K as DeleteMetadataFieldOptions, Kt as UpgradePolicyOptions, Lt as SignedUploadToken, M as CdnAssetUrlOptions, Nt as SetPolicyAutomaticUpdatesOptions, Ot as RequestOptions, P as CdnServeOptions, Pn as AssetSearchQuery, Pt as SignAssetUrlOptions, Q as FolderIdOptions, T as AssignPolicyOptions, Tt as PolicyPage, U as CreatePolicyOptions, Ut as UpdateLensOptions, V as CreateLensOptions, Vt as UpdateFolderOptions, W as DecideAssetOptions, Wt as UpdatePolicyOptions, X as EnsureUploadPresetsOptions, Xt as UploadPresetPage, Y as EnsureMetadataFieldsOptions, Yt as UploadPresetIdOptions, Z as EnsureUploadPresetsResponse, _ as AssetPage, _n as Folder, _t as ListLensesOptions, b as AssetTimelinePage, bt as MoveAssetOptions, ct as LensIdOptions, dt as ListAssetTimelineOptions, et as GetAssetInfoOptions, ft as ListAssetsOptions, gt as ListHashListsOptions, ht as ListHashListEntriesOptions, it as HashListPage, jt as RetryAssetOptions, k as CalmLensServerClientOptions, kt as ResetPolicyOptions, lt as LensPage, mt as ListFoldersOptions, nt as HashListEntryPage, o as AssetChildrenPage, on as GetEventsResponse, pt as ListEventsOptions, q as EnsureLensOptions, qt as UploadAssetPartOptions, r as Asset, rt as HashListIdOptions, st as Lens, t as AddHashListEntryOptions, tn as WaitForAssetDecisionOptions, tt as HashListEntryIdOptions, ut as ListAssetChildrenOptions, v as AssetSearchResponse, vn as MetadataFieldsResource, vt as ListPoliciesOptions, wt as PolicyIdOptions, xt as MoveFolderOptions, yn as ProjectSettingsResource, yt as ListUploadPresetsOptions, z as CreateFolderOptions, zt as SubmitAssetOptions } from "./CalmLensTypes-CtO4Dieu.js";
3
+ import { d as ListPromise, l as CalmLensResponse, r as CdnResponse } from "./WebhookPayload-DZadhbAJ.js";
4
4
  interface TransportRequest {
5
5
  /** The client method sending the request, such as `assets.retrieve`, for hooks and logs. */
6
6
  operation?: string;
@@ -83,10 +83,10 @@ declare class CalmLensServerClient {
83
83
  getAssetUrl: (urlOptions: CdnAssetUrlOptions) => string;
84
84
  /**
85
85
  * Signs a private asset's URL on your server, so browsers and apps can load it without an API
86
- * key until it expires. Every resource is a path beneath it, as beneath a public asset URL;
87
- * `/original` only when signed with `original: true`. With `resource`, returns that resource's
88
- * URL beneath the grant; lenses, transforms and viewer claims are appended as `getAssetUrl`
89
- * appends them and aren't part of the signature.
86
+ * key until it expires. With `resource`, it is signed for that resource and ends in it; only a
87
+ * URL signed for `original` serves the exact uploaded file, and any other serves every other
88
+ * resource beneath its grant. Lenses, transforms and viewer claims are appended as
89
+ * `getAssetUrl` appends them and aren't part of the signature.
90
90
  */
91
91
  signAssetUrl: (signOptions: SignAssetUrlOptions, requestOptions?: RequestOptions) => Promise<CalmLensResponse<SignedAssetUrl>>;
92
92
  /**
@@ -1,6 +1,6 @@
1
- import { C as validateBatchAssetsOptions, F as isReactNativeRuntime, L as copyLastResponse, P as isBrowserRuntime, R as listPages, Y as CalmLensError, a as appendAssetLocation, b as toTextAssetOptions, ct as invalidConfig, d as checkOptionKeys, g as pollForDecision, l as validateSignAssetUrlOptions, o as buildAssetUrl, ot as SDK_ERROR_CODES, p as encodePathSegment, s as getAssetInfo, st as invalidArgument, u as DEFAULT_CDN_BASE_URL, w as validateServerClientOptions, y as stringifyQuery, z as readEnv } from "./ModerationContextLimits-Tev2lxE0.js";
2
- import { c as getMockHooks, d as prepareSubmitAssetOptions, f as resolveConnectionOptions, i as CalmLensConnection, l as invalidPayload, m as validateCallOptions, n as NULLABLE_OPTION_KEYS, o as expectAsset, p as splitsIntoParts, r as SERVER_OPTION_KEYS, u as newIdempotencyKey } from "./CalmLensOptionKeys-DC9FUO43.js";
3
- import { n as sha256Hex, r as timingSafeEqual, t as hmacSha256Hex } from "./CryptoUtils-B_x8lMIx-DhuWGzqn.js";
1
+ import { B as copyLastResponse, C as toTextAssetOptions, D as validateServerClientOptions, E as validateBatchAssetsOptions, H as readEnv, L as isBrowserRuntime, Q as CalmLensError, R as isReactNativeRuntime, S as stringifyQuery, V as listPages, dt as invalidConfig, f as validateSignAssetUrlOptions, g as encodePathSegment, l as buildAssetUrl, lt as SDK_ERROR_CODES, m as checkOptionKeys, p as DEFAULT_CDN_BASE_URL, s as appendSignedLocation, u as getAssetInfo, ut as invalidArgument, y as pollForDecision } from "./ModerationContextLimits-DaFaXt45.js";
2
+ import { c as getMockHooks, d as prepareSubmitAssetOptions, f as resolveConnectionOptions, i as CalmLensConnection, l as invalidPayload, m as validateCallOptions, n as NULLABLE_OPTION_KEYS, o as expectAsset, p as splitsIntoParts, r as SERVER_OPTION_KEYS, u as newIdempotencyKey } from "./CalmLensOptionKeys-BYqFZ0FP.js";
3
+ import { n as sha256Hex, r as timingSafeEqual, t as hmacSha256Hex } from "./CryptoUtils-BLCa-oZe-DKr3LmN6.js";
4
4
  // src/contract/JsonUtils.js
5
5
  const stringifyJsonCanonical = (value) => JSON.stringify(value, (_key, nestedValue) => {
6
6
  if (!nestedValue || typeof nestedValue !== "object" || Array.isArray(nestedValue)) return nestedValue;
@@ -426,24 +426,24 @@ var CalmLensServerClient = class {
426
426
  },
427
427
  /**
428
428
  * Signs a private asset's URL on your server, so browsers and apps can load it without an API
429
- * key until it expires. Every resource is a path beneath it, as beneath a public asset URL;
430
- * `/original` only when signed with `original: true`. With `resource`, returns that resource's
431
- * URL beneath the grant; lenses, transforms and viewer claims are appended as `getAssetUrl`
432
- * appends them and aren't part of the signature.
429
+ * key until it expires. With `resource`, it is signed for that resource and ends in it; only a
430
+ * URL signed for `original` serves the exact uploaded file, and any other serves every other
431
+ * resource beneath its grant. Lenses, transforms and viewer claims are appended as
432
+ * `getAssetUrl` appends them and aren't part of the signature.
433
433
  */
434
434
  signAssetUrl: async (signOptions, requestOptions) => {
435
435
  const options = checked("cdn.signAssetUrl", signOptions);
436
436
  validateSignAssetUrlOptions(options);
437
- const { projectId, assetId, externalId, expiresIn, original, ...location } = options;
437
+ const { projectId, assetId, externalId, expiresIn, ...location } = options;
438
438
  const project = requireId(projectId ?? this.#settings.projectId, "Project ID");
439
439
  const signed = await this.#send("cdn.signAssetUrl", requestOptions, "POST", `/projects/${project}/signed-asset-urls`, { body: {
440
440
  ...assetId !== void 0 ? { assetId } : { externalId },
441
441
  expiresIn: expiresIn ?? 900,
442
- original: original ?? false
442
+ ...location.resource !== void 0 ? { resource: location.resource } : {}
443
443
  } });
444
444
  if (!signed || typeof signed.url !== "string" || !signed.url || typeof signed.expiresAt !== "number") throw new CalmLensError(SDK_ERROR_CODES.INVALID_RESPONSE, { message: "The API returned no signed asset URL" });
445
445
  return copyLastResponse({
446
- url: appendAssetLocation(signed.url, location),
446
+ url: appendSignedLocation(signed.url, location),
447
447
  expiresAt: signed.expiresAt
448
448
  }, signed);
449
449
  },
@@ -5017,11 +5017,11 @@ declare const ASSET_CLASSIFICATION_SCHEMA: zod.ZodObject<{
5017
5017
  "processing-error": "processing-error";
5018
5018
  "resolution-limit": "resolution-limit";
5019
5019
  "too-many-items": "too-many-items";
5020
- "website-unavailable": "website-unavailable";
5021
5020
  "type-mismatch": "type-mismatch";
5022
5021
  "undecodable-content": "undecodable-content";
5023
5022
  "unsupported-format": "unsupported-format";
5024
5023
  "uploads-paused": "uploads-paused";
5024
+ "website-unavailable": "website-unavailable";
5025
5025
  }>>;
5026
5026
  updatedAt: zod.ZodNullable<zod.ZodNumber>;
5027
5027
  completedAt: zod.ZodNullable<zod.ZodNumber>;
@@ -10140,11 +10140,11 @@ declare const ASSET_SCHEMA: zod.ZodObject<{
10140
10140
  "processing-error": "processing-error";
10141
10141
  "resolution-limit": "resolution-limit";
10142
10142
  "too-many-items": "too-many-items";
10143
- "website-unavailable": "website-unavailable";
10144
10143
  "type-mismatch": "type-mismatch";
10145
10144
  "undecodable-content": "undecodable-content";
10146
10145
  "unsupported-format": "unsupported-format";
10147
10146
  "uploads-paused": "uploads-paused";
10147
+ "website-unavailable": "website-unavailable";
10148
10148
  }>>;
10149
10149
  updatedAt: zod.ZodNullable<zod.ZodNumber>;
10150
10150
  completedAt: zod.ZodNullable<zod.ZodNumber>;
@@ -15396,11 +15396,11 @@ declare const ASSET_SEARCH_RESULT_SCHEMA: zod.ZodObject<{
15396
15396
  "processing-error": "processing-error";
15397
15397
  "resolution-limit": "resolution-limit";
15398
15398
  "too-many-items": "too-many-items";
15399
- "website-unavailable": "website-unavailable";
15400
15399
  "type-mismatch": "type-mismatch";
15401
15400
  "undecodable-content": "undecodable-content";
15402
15401
  "unsupported-format": "unsupported-format";
15403
15402
  "uploads-paused": "uploads-paused";
15403
+ "website-unavailable": "website-unavailable";
15404
15404
  }>>;
15405
15405
  updatedAt: zod.ZodNullable<zod.ZodNumber>;
15406
15406
  completedAt: zod.ZodNullable<zod.ZodNumber>;
@@ -36368,11 +36368,11 @@ declare const EVENT_TYPE_INFO: {
36368
36368
  "processing-error": "processing-error";
36369
36369
  "resolution-limit": "resolution-limit";
36370
36370
  "too-many-items": "too-many-items";
36371
- "website-unavailable": "website-unavailable";
36372
36371
  "type-mismatch": "type-mismatch";
36373
36372
  "undecodable-content": "undecodable-content";
36374
36373
  "unsupported-format": "unsupported-format";
36375
36374
  "uploads-paused": "uploads-paused";
36375
+ "website-unavailable": "website-unavailable";
36376
36376
  }>>;
36377
36377
  };
36378
36378
  /** Example data, used for synthetic test sends (`createSampleEvent`). */
@@ -36431,11 +36431,11 @@ declare const EVENT_TYPE_INFO: {
36431
36431
  "processing-error": "processing-error";
36432
36432
  "resolution-limit": "resolution-limit";
36433
36433
  "too-many-items": "too-many-items";
36434
- "website-unavailable": "website-unavailable";
36435
36434
  "type-mismatch": "type-mismatch";
36436
36435
  "undecodable-content": "undecodable-content";
36437
36436
  "unsupported-format": "unsupported-format";
36438
36437
  "uploads-paused": "uploads-paused";
36438
+ "website-unavailable": "website-unavailable";
36439
36439
  }>;
36440
36440
  }, zod.core.$strip>;
36441
36441
  };
@@ -36511,6 +36511,72 @@ declare const EVENT_TYPE_INFO: {
36511
36511
  totalSections: zod.ZodNumber;
36512
36512
  }, zod.core.$strip>;
36513
36513
  };
36514
+ readonly "asset.media-ready": {
36515
+ id: "asset.media-ready";
36516
+ name: string;
36517
+ description: string;
36518
+ category: EventCategory;
36519
+ severity: EventSeverity;
36520
+ /** Whether the in-app connector (notification bell) subscribes to the type by default. */
36521
+ notify: boolean;
36522
+ /**
36523
+ * The project-wide permission needed to see events of this type (portal feed, public events
36524
+ * feed) and to subscribe a connector to it.
36525
+ */
36526
+ permission: PermissionAction;
36527
+ /** Types of unreleased features are left out of the published contract until enabled. */
36528
+ enabled?: boolean;
36529
+ fields: {
36530
+ assetName: EventFieldDefinition<zod.ZodOptional<zod.ZodNullable<zod.ZodString>>>;
36531
+ assetType: EventFieldDefinition<zod.ZodOptional<zod.ZodNullable<zod.ZodEnum<{
36532
+ audio: "audio";
36533
+ file: "file";
36534
+ image: "image";
36535
+ "multimedia-document": "multimedia-document";
36536
+ "plaintext-document": "plaintext-document";
36537
+ video: "video";
36538
+ website: "website";
36539
+ }>>>>;
36540
+ };
36541
+ /** Example data, used for synthetic test sends (`createSampleEvent`). */
36542
+ example: NoInfer<{
36543
+ assetName?: string | null | undefined;
36544
+ assetType?: "audio" | "file" | "image" | "multimedia-document" | "plaintext-document" | "video" | "website" | null | undefined;
36545
+ }>;
36546
+ factInfo: {
36547
+ label: string;
36548
+ description: string;
36549
+ display: EventFieldDisplay;
36550
+ /** Kept in the data but left out of rendered messages (usually an ID shown by another field). */
36551
+ hidden?: boolean;
36552
+ /**
36553
+ * Personal or account-level data that stays in the portal. Webhook, Slack and email deliveries,
36554
+ * and the public events feed, leave the fact out and word the title and description without it.
36555
+ */
36556
+ inAppOnly?: boolean;
36557
+ /**
36558
+ * A person's name: `actor` names the event's `actor`, `member` the member in the `member-user-id`
36559
+ * fact. Deleting their account removes it from the events that name them.
36560
+ */
36561
+ names?: "actor" | "member";
36562
+ /** Display names for `enum` and `list` values that don't read well humanized. */
36563
+ valueLabels?: Readonly<Record<string, string>>;
36564
+ schema: zod.ZodType<unknown, unknown, zod.core.$ZodTypeInternals<unknown, unknown>>;
36565
+ key: string;
36566
+ }[];
36567
+ values: zod.ZodObject<{
36568
+ assetName: zod.ZodOptional<zod.ZodNullable<zod.ZodString>>;
36569
+ assetType: zod.ZodOptional<zod.ZodNullable<zod.ZodEnum<{
36570
+ audio: "audio";
36571
+ file: "file";
36572
+ image: "image";
36573
+ "multimedia-document": "multimedia-document";
36574
+ "plaintext-document": "plaintext-document";
36575
+ video: "video";
36576
+ website: "website";
36577
+ }>>>;
36578
+ }, zod.core.$strip>;
36579
+ };
36514
36580
  readonly "asset.deleted": {
36515
36581
  id: "asset.deleted";
36516
36582
  name: string;
@@ -38176,6 +38242,7 @@ declare const PUBLIC_EVENT_SCHEMA: zod.ZodObject<{
38176
38242
  "asset.hash-matched": "asset.hash-matched";
38177
38243
  "asset.limited": "asset.limited";
38178
38244
  "asset.link-flagged": "asset.link-flagged";
38245
+ "asset.media-ready": "asset.media-ready";
38179
38246
  "asset.progress-updated": "asset.progress-updated";
38180
38247
  "asset.purged": "asset.purged";
38181
38248
  "asset.region-restricted": "asset.region-restricted";
@@ -42376,6 +42443,7 @@ declare const GET_EVENTS_QUERY_SCHEMA: zod.ZodObject<{
42376
42443
  "asset.hash-matched": "asset.hash-matched";
42377
42444
  "asset.limited": "asset.limited";
42378
42445
  "asset.link-flagged": "asset.link-flagged";
42446
+ "asset.media-ready": "asset.media-ready";
42379
42447
  "asset.progress-updated": "asset.progress-updated";
42380
42448
  "asset.purged": "asset.purged";
42381
42449
  "asset.region-restricted": "asset.region-restricted";
@@ -42844,7 +42912,7 @@ interface IdempotencyOptions {
42844
42912
  }
42845
42913
  /**
42846
42914
  * What a resource URL beneath an asset URL serves: the `original` file exactly as uploaded (with a
42847
- * signed URL, only when signed with `original`); the `rendered` file for display (an image in the
42915
+ * signed URL, only one signed for `original`); the `rendered` file for display (an image in the
42848
42916
  * best format the client accepts, a PDF, or browser-safe video or audio); the `preview` still;
42849
42917
  * the blurred `placeholder` PNG (private or blocked assets require a signed URL or download permission); the `hls` stream of audio or video (its
42850
42918
  * master playlist); the `embed` page, which shows the asset in an iframe; or the `info` JSON that
@@ -42905,11 +42973,14 @@ type CdnServeOptions = CdnAssetUrlOptions & {
42905
42973
  resource?: CdnResource;
42906
42974
  init?: RequestInit;
42907
42975
  };
42976
+ /**
42977
+ * `resource` is the resource the URL is signed for, and it ends in it. Only a URL signed for
42978
+ * `original` serves the exact uploaded file; any other, or one without a resource, serves every
42979
+ * other resource beneath its grant.
42980
+ */
42908
42981
  type SignAssetUrlOptions = CdnAssetUrlOptions & {
42909
42982
  /** How long the URL works, in seconds, from 1 to 86400 (24 hours). Defaults to 900. */
42910
42983
  expiresIn?: number;
42911
- /** Whether the URL also serves `/original`, the exact uploaded file. Defaults to `false`. */
42912
- original?: boolean;
42913
42984
  };
42914
42985
  /** Options for `getAssetInfo`. */
42915
42986
  interface GetAssetInfoOptions {
@@ -1,5 +1,5 @@
1
- import { F as CdnTransform, O as CalmLensAppClientOptions, en as ViewerClaims, g as AssetModerationStatus, i as AssetAvailability } from "./CalmLensTypes-OWZsGvBX.js";
2
- import { t as CalmLensAppClient } from "./CalmLensAppClient-DzoSqUgG.js";
1
+ import { F as CdnTransform, O as CalmLensAppClientOptions, en as ViewerClaims, g as AssetModerationStatus, i as AssetAvailability } from "./CalmLensTypes-CtO4Dieu.js";
2
+ import { t as CalmLensAppClient } from "./CalmLensAppClient-B3u6BlP5.js";
3
3
  import { o as UploadFileIconFamily } from "./FileIcons-4qSX7DW2.js";
4
4
  /**
5
5
  * The text the asset viewers show, keyed by name. `{name}` placeholders are filled in when shown.
@@ -1,5 +1,5 @@
1
- import { Y as CalmLensError, a as appendAssetLocation, c as toUrlViewerClaims, s as getAssetInfo, v as serializeTransform, x as transformSelector } from "./ModerationContextLimits-Tev2lxE0.js";
2
- import { o as placeholderHashToDataURL } from "./UploadController-D7XmzO-p.js";
1
+ import { Q as CalmLensError, c as assetUrlOf, d as toUrlViewerClaims, o as appendAssetLocation, u as getAssetInfo, w as transformSelector, x as serializeTransform } from "./ModerationContextLimits-DaFaXt45.js";
2
+ import { o as placeholderHashToDataURL } from "./UploadController--Qz3DP2W.js";
3
3
  import { a as getFileIcon, c as renderFileIconSvg } from "./FileIcons-M6dzjFxd.js";
4
4
  // src/ui/viewers/ViewerAsset.ts
5
5
  /** Spreadsheet MIME types, as `content.format` reports them (compared lower-cased). */
@@ -207,8 +207,11 @@ const pageLink = (address) => {
207
207
  return;
208
208
  }
209
209
  };
210
- /** The asset URL without any query; claims are added per resource. */
211
- const baseOf = (src) => src.split("?", 1)[0].replace(/\/+$/, "");
210
+ /**
211
+ * The asset URL without any query; claims are added per resource. A resource URL beneath it, such
212
+ * as a URL signed for `original`, gives the asset URL its resources load beneath.
213
+ */
214
+ const baseOf = (src) => assetUrlOf(src);
212
215
  /** The viewer claims an asset URL carries in its query, if any. */
213
216
  const claimsOf = (src) => {
214
217
  const query = src.split("?", 2)[1];
@@ -1,8 +1,7 @@
1
- // src/contract/CryptoUtils-B_x8lMIx.js
1
+ // src/contract/CryptoUtils-BLCa-oZe.js
2
2
  const encoder = new TextEncoder();
3
3
  /** Lowercase hex of `bytes`, two characters per byte. */
4
4
  const bytesToHex = (bytes) => Array.from(bytes instanceof Uint8Array ? bytes : new Uint8Array(bytes), (byte) => byte.toString(16).padStart(2, "0")).join("");
5
- /** SHA-256 of the UTF-8 encoding of `value`, as lowercase hex. */
6
5
  const sha256Hex = async (value) => bytesToHex(await crypto.subtle.digest("SHA-256", encoder.encode(value)));
7
6
  /** HMAC-SHA256 of `message` keyed with `secret` (both UTF-8 encoded), as lowercase hex. */
8
7
  const hmacSha256Hex = async (secret, message) => {
@@ -40,6 +40,7 @@ const API_ERROR_CODES = {
40
40
  INVALID_IMAGE: "image/invalid",
41
41
  IMAGE_TOO_LARGE: "image/too-large",
42
42
  FREE_UPLOADS_EXHAUSTED: "usage/free-uploads-exhausted",
43
+ WEBSITE_BILLING_REQUIRED: "payment/billing-required",
43
44
  UPLOADS_PAUSED: "usage/uploads-paused",
44
45
  UNSUPPORTED_UPLOAD_TYPE: "upload/unsupported-type",
45
46
  INVALID_UPLOAD_PAYLOAD: "upload-payload/invalid",
@@ -79,6 +80,7 @@ const API_ERROR_CODES = {
79
80
  HASH_LIST_ENTRY_NOT_FOUND: "hash-list-entry/not-found",
80
81
  HASH_LIST_LIMIT_REACHED: "hash-list/limit-reached",
81
82
  HASH_LIST_ENTRY_LIMIT_REACHED: "hash-list-entry/limit-reached",
83
+ HASH_LIST_ENTRY_QUALITY_TOO_LOW: "hash-list-entry/quality-too-low",
82
84
  HASH_LIST_ASSET_NOT_HASHED: "hash-list/asset-not-hashed",
83
85
  POLICY_NOT_FOUND: "policy/not-found",
84
86
  POLICY_REVISION_CONFLICT: "policy/revision-conflict",
@@ -151,7 +153,7 @@ const API_ERROR_DEFINITIONS = {
151
153
  },
152
154
  "signed-url/original-not-granted": {
153
155
  status: 403,
154
- message: "This signed asset URL doesn't grant the original file. Sign it with original access."
156
+ message: "This signed asset URL doesn't grant the original file. Sign a URL for the original resource."
155
157
  },
156
158
  "validation/invalid-request": {
157
159
  status: 400,
@@ -277,6 +279,10 @@ const API_ERROR_DEFINITIONS = {
277
279
  status: 403,
278
280
  message: "This project's organisation has used its free uploads. Set up billing to continue uploading."
279
281
  },
282
+ "payment/billing-required": {
283
+ status: 409,
284
+ message: "Set up billing to upload websites."
285
+ },
280
286
  "usage/uploads-paused": {
281
287
  status: 402,
282
288
  message: "This upload would pass its organisation's usage limits, so it was refused. See details.reason; an owner can review them in Billing."
@@ -433,6 +439,10 @@ const API_ERROR_DEFINITIONS = {
433
439
  status: 409,
434
440
  message: "This project's hash lists hold the most entries they can. Remove entries to add more."
435
441
  },
442
+ "hash-list-entry/quality-too-low": {
443
+ status: 422,
444
+ message: "This hash cannot be matched. Use a more detailed image or a hash of higher quality."
445
+ },
436
446
  "hash-list/asset-not-hashed": {
437
447
  status: 409,
438
448
  message: "This asset has no perceptual hash. Only image assets that finished processing can be added."
@@ -1052,7 +1062,7 @@ const listPages = (fetchPage, { cursor, feed = false } = {}) => {
1052
1062
  };
1053
1063
  // src/client/CalmLensVersion.ts
1054
1064
  /** This SDK's version, from its package.json. */
1055
- const SDK_VERSION = "0.27.5";
1065
+ const SDK_VERSION = "0.28.0";
1056
1066
  const runtimeName = () => {
1057
1067
  const runtime = globalThis;
1058
1068
  if (isReactNativeRuntime()) return "react-native";
@@ -1432,7 +1442,7 @@ var CalmLensTransport = class {
1432
1442
  }
1433
1443
  }
1434
1444
  };
1435
- // src/contract/SharedConstants-DxUCZwLZ.js
1445
+ // src/contract/SharedConstants-D-QkbICw.js
1436
1446
  const IMPERSONATION_COOKIE_NAME = "CL_impersonation";
1437
1447
  const DAY_MS = 864e5;
1438
1448
  const YEAR_MS = 365 * DAY_MS;
@@ -1545,7 +1555,7 @@ const FIRST_PARTY_COOKIES = {
1545
1555
  },
1546
1556
  ASSET_DASHBOARD_STATE: {
1547
1557
  name: "CL_assetDashboardState",
1548
- description: "Remembers your asset dashboard view (view mode, filters, sorting and folder)",
1558
+ description: "Remembers your asset dashboard view (view mode and metadata grouping)",
1549
1559
  expirationDescription: "1 year",
1550
1560
  expirationMs: YEAR_MS,
1551
1561
  type: "functional",
@@ -1593,6 +1603,14 @@ const FIRST_PARTY_COOKIES = {
1593
1603
  type: "functional",
1594
1604
  providerName: "CalmLens"
1595
1605
  },
1606
+ CHATGPT_AD_CLICK: {
1607
+ name: "CL_chatgptAdClick",
1608
+ description: "Links a ChatGPT ad click to signups, moderation checks and credit checkouts",
1609
+ expirationDescription: "30 days",
1610
+ expirationMs: 30 * DAY_MS,
1611
+ type: "marketing",
1612
+ providerName: "CalmLens"
1613
+ },
1596
1614
  SEARCH_SDK_LANGUAGE: {
1597
1615
  name: "CL_searchSdkLanguage",
1598
1616
  description: "Remembers the SDK you chose to filter documentation search results by",
@@ -2272,6 +2290,15 @@ const appendAssetLocation = (assetUrl, location) => {
2272
2290
  }
2273
2291
  return `${path}${viewerClaimsQuery(viewerClaims)}`;
2274
2292
  };
2293
+ /**
2294
+ * The lens, transform and viewer claims added to a URL the API signed for `location.resource`,
2295
+ * which already ends in that resource.
2296
+ */
2297
+ const appendSignedLocation = (signedUrl, location) => {
2298
+ const resourcePath = location.resource === void 0 ? "" : `/${ASSET_RESOURCE_PATHS[location.resource]}`;
2299
+ if (!signedUrl.endsWith(resourcePath)) throw new CalmLensError(SDK_ERROR_CODES.INVALID_RESPONSE, { message: "The signed asset URL doesn't end in the resource it was signed for" });
2300
+ return `${signedUrl}${appendAssetLocation("", location).slice(resourcePath.length)}`;
2301
+ };
2275
2302
  /** An asset's public URL beneath a CDN base URL, with any resource, selector and claims. */
2276
2303
  const buildAssetUrl = (cdnBaseUrl, projectId, options) => {
2277
2304
  const { assetId, externalId, resource, lens, transform, viewerClaims } = options;
@@ -2288,16 +2315,26 @@ const buildAssetUrl = (cdnBaseUrl, projectId, options) => {
2288
2315
  };
2289
2316
  /** Checks `signAssetUrl`'s own options as the API does, before anything is sent. */
2290
2317
  const validateSignAssetUrlOptions = (options) => {
2291
- const { expiresIn, original } = options;
2318
+ const { expiresIn } = options;
2292
2319
  if (expiresIn !== void 0 && (!Number.isInteger(expiresIn) || expiresIn < 1 || expiresIn > 86400)) throw invalidArgument(`expiresIn must be a whole number from 1 to ${MAX_SIGNED_URL_EXPIRES_IN}`);
2293
- if (original !== void 0 && typeof original !== "boolean") throw invalidArgument("original must be a boolean");
2294
2320
  getAssetSegment(options);
2295
2321
  appendAssetLocation("", options);
2296
2322
  };
2323
+ /**
2324
+ * The asset URL of `url`, without its query: an asset URL (`…/assets/{projectId}/{asset}`) as it
2325
+ * is, and a resource URL beneath one, such as a URL signed for `original` or a rendered image's
2326
+ * lens URL, cut back to the asset URL its resources are paths beneath.
2327
+ */
2328
+ const assetUrlOf = (url) => {
2329
+ const path = (url.split("?", 1)[0] ?? "").replace(/\/+$/, "");
2330
+ const parts = path.split("/");
2331
+ const assets = parts.lastIndexOf("assets");
2332
+ return assets >= 3 && parts.length > assets + 3 ? parts.slice(0, assets + 3).join("/") : path;
2333
+ };
2297
2334
  /** An asset URL without its query: the viewer claims it carried, if any, are returned apart. */
2298
2335
  const splitAssetUrl = (url) => {
2299
- const [path = "", query] = url.split("?", 2);
2300
- const base = path.replace(/\/+$/, "");
2336
+ const query = url.split("?", 2)[1];
2337
+ const base = assetUrlOf(url);
2301
2338
  const raw = query ? new URLSearchParams(query).get("viewerClaims") : null;
2302
2339
  if (raw === null) return { base };
2303
2340
  try {
@@ -2382,4 +2419,4 @@ const selectModerationContextItems = (items) => {
2382
2419
  }
2383
2420
  return selected;
2384
2421
  };
2385
- export { CalmLensPayloadTooLargeError as $, normalizeUploadMimeType as A, resolveLogLevel as B, validateBatchAssetsOptions as C, MAX_IMAGE_UPLOAD_BYTES as D, MAX_DIRECT_IMAGE_UPLOAD_BYTES as E, isReactNativeRuntime as F, CalmLensCancelledError as G, CalmLensApiError as H, AUTO_PAGING_TO_ARRAY_MAX as I, CalmLensConnectionError as J, CalmLensConfigurationError as K, copyLastResponse as L, sleep as M, SDK_VERSION as N, MAX_NON_IMAGE_UPLOAD_BYTES as O, isBrowserRuntime as P, CalmLensNotFoundError as Q, listPages as R, validateAppClientOptions as S, DOMAIN as T, CalmLensAuthenticationError as U, CALMLENS_ERROR_CODES as V, CalmLensBadRequestError as W, CalmLensInvalidArgumentError as X, CalmLensError as Y, CalmLensInvalidResponseError as Z, randomUuid as _, appendAssetLocation as a, CalmLensWebhookVerificationError as at, toTextAssetOptions as b, toUrlViewerClaims as c, invalidConfig as ct, checkOptionKeys as d, CalmLensPermissionDeniedError as et, checkTransformOptions as f, pollForDecision as g, parseTransformSelector as h, CDN_RESOURCES as i, CalmLensUnprocessableEntityError as it, CalmLensTransport as j, getRejectedUploadMimeTypeError as k, validateSignAssetUrlOptions as l, API_ERROR_CODES as lt, isAcceptedUploadMimeType as m, MODERATION_CONTEXT_USED_ITEMS as n, CalmLensServerError as nt, buildAssetUrl as o, SDK_ERROR_CODES as ot, encodePathSegment as p, CalmLensConflictError as q, selectModerationContextItems as r, CalmLensTimeoutError as rt, getAssetInfo as s, invalidArgument as st, MODERATION_CONTEXT_USED_CHARACTERS as t, CalmLensRateLimitError as tt, DEFAULT_CDN_BASE_URL as u, API_ERROR_DEFINITIONS as ut, serializeTransform as v, validateServerClientOptions as w, transformSelector as x, stringifyQuery as y, readEnv as z };
2422
+ export { CalmLensInvalidArgumentError as $, MAX_IMAGE_UPLOAD_BYTES as A, copyLastResponse as B, toTextAssetOptions as C, validateServerClientOptions as D, validateBatchAssetsOptions as E, sleep as F, CalmLensApiError as G, readEnv as H, SDK_VERSION as I, CalmLensCancelledError as J, CalmLensAuthenticationError as K, isBrowserRuntime as L, getRejectedUploadMimeTypeError as M, normalizeUploadMimeType as N, DOMAIN as O, CalmLensTransport as P, CalmLensError as Q, isReactNativeRuntime as R, stringifyQuery as S, validateAppClientOptions as T, resolveLogLevel as U, listPages as V, CALMLENS_ERROR_CODES as W, CalmLensConflictError as X, CalmLensConfigurationError as Y, CalmLensConnectionError as Z, isAcceptedUploadMimeType as _, CDN_RESOURCES as a, CalmLensServerError as at, randomUuid as b, assetUrlOf as c, CalmLensWebhookVerificationError as ct, toUrlViewerClaims as d, invalidConfig as dt, CalmLensInvalidResponseError as et, validateSignAssetUrlOptions as f, API_ERROR_CODES as ft, encodePathSegment as g, checkTransformOptions as h, ASSET_RESOURCE_PATHS as i, CalmLensRateLimitError as it, MAX_NON_IMAGE_UPLOAD_BYTES as j, MAX_DIRECT_IMAGE_UPLOAD_BYTES as k, buildAssetUrl as l, SDK_ERROR_CODES as lt, checkOptionKeys as m, MODERATION_CONTEXT_USED_ITEMS as n, CalmLensPayloadTooLargeError as nt, appendAssetLocation as o, CalmLensTimeoutError as ot, DEFAULT_CDN_BASE_URL as p, API_ERROR_DEFINITIONS as pt, CalmLensBadRequestError as q, selectModerationContextItems as r, CalmLensPermissionDeniedError as rt, appendSignedLocation as s, CalmLensUnprocessableEntityError as st, MODERATION_CONTEXT_USED_CHARACTERS as t, CalmLensNotFoundError as tt, getAssetInfo as u, invalidArgument as ut, parseTransformSelector as v, transformSelector as w, serializeTransform as x, pollForDecision as y, AUTO_PAGING_TO_ARRAY_MAX as z };
@@ -1,4 +1,4 @@
1
- import { F as UploadFile, L as UploadSnapshot, N as UploadController, O as CalmLensProvidedOptions, P as UploadControllerOptions } from "./Core-CTO_Eh0l.js";
1
+ import { F as UploadFile, L as UploadSnapshot, N as UploadController, O as CalmLensProvidedOptions, P as UploadControllerOptions } from "./Core-BJaLU71Q.js";
2
2
  import { ReactNode } from "react";
3
3
  type CalmLensProviderProps<F extends UploadFile = File> = CalmLensProvidedOptions<F> & {
4
4
  children?: ReactNode;
@@ -1,4 +1,4 @@
1
- import { i as withProvidedOptions, n as createUploadController } from "./UploadController-D7XmzO-p.js";
1
+ import { i as withProvidedOptions, n as createUploadController } from "./UploadController--Qz3DP2W.js";
2
2
  import { createContext, createElement, useContext, useEffect, useMemo, useRef, useState, useSyncExternalStore } from "react";
3
3
  // src/ui/ReactUpload.ts
4
4
  const CalmLensContext = createContext(void 0);
@@ -88,7 +88,6 @@ declare const TEST_INPUT_SCHEMA: z.ZodObject<{
88
88
  score: z.ZodOptional<z.ZodNumber>;
89
89
  action: z.ZodOptional<z.ZodEnum<{
90
90
  "age-restrict": "age-restrict";
91
- allow: "allow";
92
91
  block: "block";
93
92
  limit: "limit";
94
93
  }>>;
@@ -396,7 +395,7 @@ declare function detectTestImage(image: RgbaImage, key: string,
396
395
  instances: {
397
396
  category: "criminal-activity" | "harassment" | "hate" | "personal-information" | "profanity" | "self-harm" | "sexual" | "violence";
398
397
  score?: number | undefined;
399
- action?: "age-restrict" | "allow" | "block" | "limit" | undefined;
398
+ action?: "age-restrict" | "block" | "limit" | undefined;
400
399
  qualifiers: ("criminal-activity-alcohol" | "criminal-activity-coded-incitement" | "criminal-activity-csam" | "criminal-activity-demonstration" | "criminal-activity-discussion" | "criminal-activity-documentary" | "criminal-activity-educational" | "criminal-activity-fictional" | "criminal-activity-fraud" | "criminal-activity-gambling" | "criminal-activity-graffiti" | "criminal-activity-grooming" | "criminal-activity-historical" | "criminal-activity-instructions" | "criminal-activity-preparation" | "criminal-activity-promotion" | "criminal-activity-request" | "criminal-activity-sexual-solicitation" | "criminal-activity-substances" | "criminal-activity-support-prevention" | "criminal-activity-tobacco" | "harassment-abuse" | "harassment-bullying" | "harassment-documentary" | "harassment-educational" | "harassment-encouragement" | "harassment-fictional" | "harassment-historical" | "harassment-mild" | "harassment-public-target" | "harassment-sexual" | "harassment-support-prevention" | "harassment-threat" | "hate-abuse" | "hate-adjudicated-nazi-crimes-denial" | "hate-counterspeech" | "hate-dehumanization" | "hate-documentary" | "hate-educational" | "hate-exclusion" | "hate-fictional" | "hate-historical" | "hate-hostility" | "hate-inferiority" | "hate-nazi-genocide-denial-or-approval" | "hate-nazi-genocide-public-peace" | "hate-nazi-insignia-public-display" | "hate-nazi-symbols-public-display" | "hate-personal" | "hate-slurs" | "hate-support-prevention" | "hate-symbol" | "hate-threat" | "personal-information-contact" | "personal-information-credentials" | "personal-information-documentary" | "personal-information-educational" | "personal-information-email" | "personal-information-fictional" | "personal-information-financial" | "personal-information-government-id" | "personal-information-historical" | "personal-information-identifiers" | "personal-information-location" | "personal-information-phone" | "personal-information-request" | "personal-information-self-disclosure" | "personal-information-support-prevention" | "personal-information-third-party" | "profanity-documentary" | "profanity-educational" | "profanity-fictional" | "profanity-historical" | "profanity-mild" | "profanity-obfuscated" | "profanity-slurs" | "profanity-strong" | "profanity-support-prevention" | "self-harm-act" | "self-harm-age-restricted" | "self-harm-documentary" | "self-harm-educational" | "self-harm-encouragement" | "self-harm-fictional" | "self-harm-historical" | "self-harm-methods" | "self-harm-preparation" | "self-harm-support-prevention" | "self-harm-thoughts" | "sexual-activity" | "sexual-adult-promotion" | "sexual-artistic" | "sexual-assault-media" | "sexual-discussion" | "sexual-documentary" | "sexual-educational" | "sexual-explicit-language" | "sexual-extreme" | "sexual-fictional" | "sexual-historical" | "sexual-incest" | "sexual-intimate-image-abuse" | "sexual-minors" | "sexual-non-consensual" | "sexual-non-erotic-nudity" | "sexual-nudity" | "sexual-paid" | "sexual-pornographic-media" | "sexual-revealing-clothing" | "sexual-solicitation" | "sexual-strangulation" | "sexual-suggestive" | "sexual-support-prevention" | "sexual-text" | "violence-attack" | "violence-coded-incitement" | "violence-decapitation-act" | "violence-discussion" | "violence-documentary" | "violence-educational" | "violence-encouragement" | "violence-extremism" | "violence-fantasy" | "violence-fictional" | "violence-gore" | "violence-graphic" | "violence-high-impact" | "violence-historical" | "violence-injury" | "violence-natural-death" | "violence-preparation" | "violence-sport" | "violence-support-prevention" | "violence-text" | "violence-threat" | "violence-violent-death" | "violence-weapon" | "violence-wish")[];
401
400
  }[];
402
401
  detections?: {
@@ -1,4 +1,4 @@
1
- import { r as timingSafeEqual, t as hmacSha256Hex } from "./CryptoUtils-B_x8lMIx-DhuWGzqn.js";
1
+ import { r as timingSafeEqual, t as hmacSha256Hex } from "./CryptoUtils-BLCa-oZe-DKr3LmN6.js";
2
2
  import * as z from "zod";
3
3
  import { globalRegistry } from "zod";
4
4
  // src/contract/ModerationCategories-CHFRoeWV.js
@@ -12,7 +12,7 @@ const CLASSIFICATION_CATEGORIES = [
12
12
  "personal-information",
13
13
  "profanity"
14
14
  ];
15
- // src/contract/LazySchema-D_3-dV1e.js
15
+ // src/contract/LazySchema-BKMpWIaF.js
16
16
  const registryMap = globalRegistry._map;
17
17
  /**
18
18
  * A schema built the first time anything reads it, rather than when its module loads. Building
@@ -34,9 +34,9 @@ const lazySchema = /* @__NO_SIDE_EFFECTS__ */ (build) => {
34
34
  if (!schema) {
35
35
  const built = build();
36
36
  schema = built;
37
+ const internals = built._zod;
37
38
  const meta = registryMap.get(built);
38
39
  if (meta !== void 0) registryMap.set(proxy, meta);
39
- const internals = built._zod;
40
40
  const process = internals.processJSONSchema;
41
41
  if (process) internals.processJSONSchema = (context, json, params) => {
42
42
  const record = context.seen.get(proxy);
@@ -82,7 +82,7 @@ const lazySchema = /* @__NO_SIDE_EFFECTS__ */ (build) => {
82
82
  });
83
83
  return proxy;
84
84
  };
85
- // src/contract/Jurisdiction-CQN8qnzX.js
85
+ // src/contract/Jurisdiction-uODFGQGo.js
86
86
  /**
87
87
  * Jurisdictions with legal rules always apply to every project. An optional jurisdiction is a
88
88
  * product standard rather than a legal floor: every project serves it unless it opts out.
@@ -134,7 +134,7 @@ Object.keys(JURISDICTIONS).filter((code) => !JURISDICTIONS[code].optional);
134
134
  Object.keys(JURISDICTIONS).filter((code) => JURISDICTIONS[code].optional);
135
135
  new Set("AD AE AF AG AI AL AM AO AQ AR AS AT AU AW AX AZ BA BB BD BE BF BG BH BI BJ BL BM BN BO BQ BR BS BT BV BW BY BZ CA CC CD CF CG CH CI CK CL CM CN CO CR CU CV CW CX CY CZ DE DJ DK DM DO DZ EC EE EG EH ER ES ET FI FJ FK FM FO FR GA GB GD GE GF GG GH GI GL GM GN GP GQ GR GS GT GU GW GY HK HM HN HR HT HU ID IE IL IM IN IO IQ IR IS IT JE JM JO JP KE KG KH KI KM KN KP KR KW KY KZ LA LB LC LI LK LR LS LT LU LV LY MA MC MD ME MF MG MH MK ML MM MN MO MP MQ MR MS MT MU MV MW MX MY MZ NA NC NE NF NG NI NL NO NP NR NU NZ OM PA PE PF PG PH PK PL PM PN PR PS PT PW PY QA RE RO RS RU RW SA SB SC SD SE SG SH SI SJ SK SL SM SN SO SR SS ST SV SX SY SZ TC TD TF TG TH TJ TK TL TM TN TO TR TT TV TW TZ UA UG UM US UY UZ VA VC VE VG VI VN VU WF WS YE YT ZA ZM ZW".split(" "));
136
136
  new Set("AT BE BG HR CY CZ DK EE FI FR DE GR HU IE IT LV LT LU MT NL PL PT RO SK SI ES SE".split(" "));
137
- // src/contract/TestRegionalActions-BhyWuU49.js
137
+ // src/contract/TestRegionalActions-Ce8EVv4q.js
138
138
  /**
139
139
  * Marks English text in shared, backend and data modules that the portal shows, so the app's
140
140
  * message catalog (packages/app/vite/messageCatalog.ts) extracts it and the portal can translate it
@@ -1165,7 +1165,7 @@ const TEST_REGIONAL_ACTIONS_SCHEMA = /* @__PURE__ */ lazySchema(() => z.array(z.
1165
1165
  "block"
1166
1166
  ])
1167
1167
  }).strict()).max(7).refine((entries) => new Set(entries.map((entry) => entry.region)).size === entries.length, "Choose each region once"));
1168
- // src/contract/TestTriggers-Cvi7e2KA.js
1168
+ // src/contract/TestTriggers-uL2Ec8Vt.js
1169
1169
  /**
1170
1170
  * The visual encoding of test images (shared by images and video frames), independent of what the
1171
1171
  * bytes mean. An odd N×N grid of square cells fills the image. Its outer ring alternates black and
@@ -1625,19 +1625,19 @@ const TEST_FACE_AGE_PRESETS = {
1625
1625
  }
1626
1626
  };
1627
1627
  const TEST_FACE_AGE_MAX = 120;
1628
- const basisPoints = z.number().int().min(0).max(TEST_DETECTION_BOX_MAX);
1628
+ const basisPoints = /* @__PURE__ */ lazySchema(() => z.number().int().min(0).max(TEST_DETECTION_BOX_MAX));
1629
1629
  const detectionShape = {
1630
- box: z.tuple([
1630
+ box: /* @__PURE__ */ lazySchema(() => z.tuple([
1631
1631
  basisPoints,
1632
1632
  basisPoints,
1633
1633
  basisPoints,
1634
1634
  basisPoints
1635
- ]),
1636
- confidence: z.number().int().min(0).max(100).optional()
1635
+ ])),
1636
+ confidence: /* @__PURE__ */ lazySchema(() => z.number().int().min(0).max(100).optional())
1637
1637
  };
1638
1638
  const fitsImage = ({ box: [left, top, width, height] }) => left + width <= 1e4 && top + height <= 1e4;
1639
1639
  const BOX_MESSAGE = msg("A box must lie inside the image: left + width and top + height are at most 10000.");
1640
- const ageYears = z.number().int().min(0).max(120);
1640
+ const ageYears = /* @__PURE__ */ lazySchema(() => z.number().int().min(0).max(120));
1641
1641
  const TEST_DETECTED_PERSON_SCHEMA = /* @__PURE__ */ lazySchema(() => z.object(detectionShape).strict().refine(fitsImage, BOX_MESSAGE));
1642
1642
  const TEST_DETECTED_FACE_SCHEMA = /* @__PURE__ */ lazySchema(() => z.object({
1643
1643
  ...detectionShape,
@@ -1659,7 +1659,6 @@ const TEST_INPUT_SCHEMA = /* @__PURE__ */ lazySchema(() => z.object({
1659
1659
  category: z.enum(CLASSIFICATION_CATEGORIES),
1660
1660
  score: z.number().min(0).max(1).optional(),
1661
1661
  action: z.enum([
1662
- "allow",
1663
1662
  "limit",
1664
1663
  "age-restrict",
1665
1664
  "block"
@@ -1,5 +1,5 @@
1
- import { Y as CalmLensError, ot as SDK_ERROR_CODES } from "./ModerationContextLimits-Tev2lxE0.js";
2
- import { t as CalmLensAppClient } from "./CalmLensAppClient-BxkCVPCl.js";
1
+ import { Q as CalmLensError, lt as SDK_ERROR_CODES } from "./ModerationContextLimits-DaFaXt45.js";
2
+ import { t as CalmLensAppClient } from "./CalmLensAppClient-B1QpSXYm.js";
3
3
  // src/contract/PlaceholderHashDecode.js
4
4
  /**
5
5
  * Decodes a ThumbHash to an RGBA image. RGB is not be premultiplied by A.