calmlens 0.31.1 → 0.32.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 (80) hide show
  1. package/bin/calmlens.js +47 -39
  2. package/cjs/{BrowserUpload-BwBE37LM.js → BrowserUpload-CbbFE-2v.js} +1 -1
  3. package/cjs/{BrowserUpload-BAH54V1q.d.ts → BrowserUpload-Dx2l9wC0.d.ts} +2 -2
  4. package/cjs/{CalmLensAppClient-D6Y7MgH_.js → CalmLensAppClient-DOYOJ70t.js} +4 -4
  5. package/cjs/{CalmLensAppClient-CdlcDd5l.d.ts → CalmLensAppClient-v1Ho7mJQ.d.ts} +3 -3
  6. package/cjs/{CalmLensCdn-Q68faCEE.js → CalmLensCdn-xQMrClXN.js} +56 -22
  7. package/cjs/{CalmLensConnection-j2aBsuNx.js → CalmLensConnection-DbsCA8xF.js} +7 -16
  8. package/cjs/{CalmLensServerClient-CtS66dCU.d.ts → CalmLensServerClient-CoiZN7Fr.d.ts} +9 -9
  9. package/cjs/{CalmLensServerClient-CjK691kq.js → CalmLensServerClient-DtqFQgUn.js} +12 -15
  10. package/cjs/{CalmLensTypes-87kiUg0H.d.ts → CalmLensTypes-DjuOXp3b.d.ts} +8 -15
  11. package/cjs/{Core-Dsj4tRNP.js → Core-BtFJ2xfb.js} +2 -2
  12. package/cjs/{Core-Ccy4-_sN.d.ts → Core-DaCkaDkb.d.ts} +2 -2
  13. package/cjs/{ReactUpload-B7SdNAel.js → ReactUpload-CRtUXzMP.js} +1 -1
  14. package/cjs/{ReactUpload-DBhppuxM.d.ts → ReactUpload-DMtaeFN2.d.ts} +1 -1
  15. package/{esm/TestTriggers-Daxebd0V.d.ts → cjs/TestTriggers-CjDhhz78.d.ts} +1 -11
  16. package/cjs/{UploadController-DsIENVY1.js → UploadController-tKqKphf3.js} +1 -1
  17. package/cjs/{WebhookPayload-B4rA_Dvm.d.ts → WebhookPayload-C3F9j4p7.d.ts} +1 -1
  18. package/cjs/app.d.ts +4 -4
  19. package/cjs/app.js +2 -2
  20. package/cjs/elements.d.ts +4 -4
  21. package/cjs/elements.js +4 -4
  22. package/cjs/{index-CWUnLKoF.d.ts → index-xF6Neq8A.d.ts} +2 -2
  23. package/cjs/index.d.ts +3 -3
  24. package/cjs/index.js +1 -1
  25. package/cjs/react-native.d.ts +2 -2
  26. package/cjs/react-native.js +4 -4
  27. package/cjs/react.d.ts +4 -4
  28. package/cjs/react.js +5 -5
  29. package/cjs/server.d.ts +4 -4
  30. package/cjs/server.js +2 -2
  31. package/cjs/test-inputs.d.ts +15 -3
  32. package/cjs/test-inputs.js +105 -2
  33. package/cjs/testing.d.ts +14 -6
  34. package/cjs/testing.js +113 -50
  35. package/cjs/{ui-BC70R8KT.js → ui-B5tgw_En.js} +8 -8
  36. package/cjs/{ui-sjnJhloQ.d.ts → ui-C_AhYdIA.d.ts} +2 -2
  37. package/cjs/ui.d.ts +2 -2
  38. package/cjs/ui.js +3 -3
  39. package/cjs/vue.d.ts +5 -5
  40. package/cjs/vue.js +4 -4
  41. package/esm/{BrowserUpload-DSLCpWgz.js → BrowserUpload-Dizcs8rx.js} +1 -1
  42. package/esm/{BrowserUpload-BAH54V1q.d.ts → BrowserUpload-Dx2l9wC0.d.ts} +2 -2
  43. package/esm/{CalmLensAppClient-BKanqwYL.js → CalmLensAppClient-C0Ud7eYa.js} +4 -4
  44. package/esm/{CalmLensAppClient-CdlcDd5l.d.ts → CalmLensAppClient-v1Ho7mJQ.d.ts} +3 -3
  45. package/esm/{CalmLensCdn-CL1P1v2t.js → CalmLensCdn--hZgorld.js} +39 -23
  46. package/esm/{CalmLensConnection-CHNNULpg.js → CalmLensConnection-dz5Kl3uC.js} +7 -16
  47. package/esm/{CalmLensServerClient-CBjSqROz.js → CalmLensServerClient-BBPwU8mm.js} +12 -15
  48. package/esm/{CalmLensServerClient-CtS66dCU.d.ts → CalmLensServerClient-CoiZN7Fr.d.ts} +9 -9
  49. package/esm/{CalmLensTypes-87kiUg0H.d.ts → CalmLensTypes-DjuOXp3b.d.ts} +8 -15
  50. package/esm/{Core-Ccy4-_sN.d.ts → Core-DaCkaDkb.d.ts} +2 -2
  51. package/esm/{Core-WxPuobo_.js → Core-Dti4LlA-.js} +2 -2
  52. package/esm/{ReactUpload-U49veoZl.js → ReactUpload-Cmz063Os.js} +1 -1
  53. package/esm/{ReactUpload-DBhppuxM.d.ts → ReactUpload-DMtaeFN2.d.ts} +1 -1
  54. package/{cjs/TestTriggers-Daxebd0V.d.ts → esm/TestTriggers-CjDhhz78.d.ts} +1 -11
  55. package/esm/{UploadController-X2gEFMGy.js → UploadController-D3um1cq9.js} +1 -1
  56. package/esm/{WebhookPayload-B4rA_Dvm.d.ts → WebhookPayload-C3F9j4p7.d.ts} +1 -1
  57. package/esm/app.d.ts +4 -4
  58. package/esm/app.js +2 -2
  59. package/esm/elements.d.ts +4 -4
  60. package/esm/elements.js +4 -4
  61. package/esm/{index-CWUnLKoF.d.ts → index-xF6Neq8A.d.ts} +2 -2
  62. package/esm/index.d.ts +3 -3
  63. package/esm/index.js +1 -1
  64. package/esm/react-native.d.ts +2 -2
  65. package/esm/react-native.js +4 -4
  66. package/esm/react.d.ts +4 -4
  67. package/esm/react.js +5 -5
  68. package/esm/server.d.ts +4 -4
  69. package/esm/server.js +2 -2
  70. package/esm/test-inputs.d.ts +15 -3
  71. package/esm/test-inputs.js +105 -2
  72. package/esm/testing.d.ts +14 -6
  73. package/esm/testing.js +113 -50
  74. package/esm/{ui-DS85DGfi.js → ui-B7Z6FH5F.js} +8 -8
  75. package/esm/{ui-sjnJhloQ.d.ts → ui-C_AhYdIA.d.ts} +2 -2
  76. package/esm/ui.d.ts +2 -2
  77. package/esm/ui.js +3 -3
  78. package/esm/vue.d.ts +5 -5
  79. package/esm/vue.js +4 -4
  80. package/package.json +1 -1
package/esm/react.js CHANGED
@@ -1,10 +1,10 @@
1
1
  "use client";
2
- import { a as ASSET_VIEWERS, c as getSpreadsheetPage, d as createDocumentViewer, f as DEFAULT_VIEWER_MESSAGES, h as loadPdfJs, i as isMountedViewerKind, l as parseSpreadsheetText, m as resolveViewerMessages, n as AssetViewerMount, o as createSpreadsheetViewer, p as formatViewerMessage, r as getMountedViewerOptions, s as createTextViewer, t as MediaStreamPlayer, u as spreadsheetColumnIndex } from "./ui-DS85DGfi.js";
3
- import { C as pickAssetSource, D as getAssetViewerKind, E as resolveTheme, O as isSpreadsheetFormat, S as isImageReady, T as CALMLENS_THEME, _ as getAssetAspectRatio, a as describeUploadItem, b as getPeakHeights, c as formatMessage, d as getUploadItemOutcome, f as resolveMessages, g as INSTANT_LOAD_MS, h as AssetSession, i as DEFAULT_MESSAGES, l as getDropzoneHint, m as ICON_ATTRIBUTES, n as CALMLENS_STYLES_ID, o as describeUploader, p as ICONS, r as ASSET_FILE_ICON_SIZE, s as formatBytes, t as CALMLENS_STYLES, u as getUploadItemMessage, v as getAssetView, w as VIEWER_STYLES, x as getPlayedPercent, y as getAssetViewKey } from "./Core-WxPuobo_.js";
4
- import { a as createProgressFetch, i as withProvidedOptions, r as isFileAccepted, t as UploadController } from "./UploadController-X2gEFMGy.js";
2
+ import { a as ASSET_VIEWERS, c as getSpreadsheetPage, d as createDocumentViewer, f as DEFAULT_VIEWER_MESSAGES, h as loadPdfJs, i as isMountedViewerKind, l as parseSpreadsheetText, m as resolveViewerMessages, n as AssetViewerMount, o as createSpreadsheetViewer, p as formatViewerMessage, r as getMountedViewerOptions, s as createTextViewer, t as MediaStreamPlayer, u as spreadsheetColumnIndex } from "./ui-B7Z6FH5F.js";
3
+ import { C as pickAssetSource, D as getAssetViewerKind, E as resolveTheme, O as isSpreadsheetFormat, S as isImageReady, T as CALMLENS_THEME, _ as getAssetAspectRatio, a as describeUploadItem, b as getPeakHeights, c as formatMessage, d as getUploadItemOutcome, f as resolveMessages, g as INSTANT_LOAD_MS, h as AssetSession, i as DEFAULT_MESSAGES, l as getDropzoneHint, m as ICON_ATTRIBUTES, n as CALMLENS_STYLES_ID, o as describeUploader, p as ICONS, r as ASSET_FILE_ICON_SIZE, s as formatBytes, t as CALMLENS_STYLES, u as getUploadItemMessage, v as getAssetView, w as VIEWER_STYLES, x as getPlayedPercent, y as getAssetViewKey } from "./Core-Dti4LlA-.js";
4
+ import { a as createProgressFetch, i as withProvidedOptions, r as isFileAccepted, t as UploadController } from "./UploadController-D3um1cq9.js";
5
5
  import { c as renderFileIconSvg } from "./FileIcons-M6dzjFxd.js";
6
- import { i as useUploadSnapshot, n as useCalmLensUpload$1, r as useOwnController, t as CalmLensProvider } from "./ReactUpload-U49veoZl.js";
7
- import { t as createUploadController } from "./BrowserUpload-DSLCpWgz.js";
6
+ import { i as useUploadSnapshot, n as useCalmLensUpload$1, r as useOwnController, t as CalmLensProvider } from "./ReactUpload-Cmz063Os.js";
7
+ import { t as createUploadController } from "./BrowserUpload-Dizcs8rx.js";
8
8
  import { useEffect, useLayoutEffect, useMemo, useRef, useState } from "react";
9
9
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
10
10
  const OPTION_NAMES = /* @__PURE__ */ new Set([
package/esm/server.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  import { a as ClassificationQualifierResults, c as HashList, d as ModerationContext, i as ClassificationNotEvaluatedReason, l as HashListEntry, n as ClassificationCategory, o as Likelihood, r as ClassificationCategoryReport, s as ModerationQualifier, t as ClassificationCategories, u as PolicyAction } from "./Classification-C3pkrGYS-B7EygpJn.js";
2
- import { $ as FolderPage, $t as UploadPresetSubmitAssetOptions, A as CdnAssetLocation, An as ProcessingFeatureId, At as ResetPolicyOptions, B as CreateHashListOptions, Bn as AssetInfo, Bt as StreamingFeatureOptions, C as AssetUploadStatus, Cn as ProjectSettingsResource, Ct as MultipartUploadPartOptions, D as BatchAssetsResponse, Dn as BoundingBox, Dt as RequestAssetReviewOptions, E as BatchAssetsOptions, En as AgeRange, Et as RemoveAssetContentOptions, F as CdnTransform, Fn as CursorPage, Ft as SetPolicyAutomaticUpdatesOptions, G as DeleteAssetOptions, Gn as AssetRenderedKind, Gt as UpdateLensOptions, H as CreateMultipartUploadPartOptions, Hn as AssetHlsRendition, Ht as UpdateAssetOptions, I as ClassifyTextOptions, In as LensType, It as SignAssetUrlOptions, J as EnsureLensesOptions, Jn as ExtractedText, Jt as UpgradePolicyOptions, K as DeleteMetadataFieldOptions, Kn as AssetSafetyHold, Kt as UpdatePolicyOptions, L as ClientRequestDefaults, Ln as AssetSearchMatchField, Lt as SignUploadTokenOptions, M as CdnAssetUrlOptions, Mn as ProcessingFeatureStage, Mt as RetrieveAssetOptions, N as CdnResource, Nn as ProcessingFeatures, Nt as RetryAssetOptions, O as CalmLensAppClientOptions, On as DetectedFace, Ot as RequestAttempt, P as CdnServeOptions, Pn as Policy, Pt as SearchAssetsOptions, Q as FolderIdOptions, Qt as UploadPresetPage, R as ConnectionOptions, Rn as AssetSearchQuery, Rt as SignedAssetUrl, S as AssetUpload, Sn as MetadataFieldsResource, St as MultipartUploadOptions, T as AssignPolicyOptions, Tn as UploadPreset, Tt as PolicyPage, U as CreatePolicyOptions, Un as AssetPreview, Ut as UpdateFolderOptions, V as CreateLensOptions, Vn as AssetHls, Vt as SubmitAssetOptions, W as DecideAssetOptions, Wn as AssetRendered, Wt as UpdateHashListOptions, X as EnsureUploadPresetsOptions, Xn as MetadataItem, Xt as UploadPresetDefinition, Y as EnsureMetadataFieldsOptions, Yn as FileMetadata, Yt as UploadAssetPartOptions, Z as EnsureUploadPresetsResponse, Zn as ProcessingOptions, Zt as UploadPresetIdOptions, _ as AssetPage, _n as EventResourceKind, _t as ListLensesOptions, a as AssetChecksums, an as WebhookPayloadInput, at as IdempotencyOptions, b as AssetTimelinePage, bt as MoveAssetOptions, c as AssetClassificationFailureReason, cn as AssetTimelineSegment, ct as LensIdOptions, d as AssetContentOptions, dn as EventResource, dt as ListAssetTimelineOptions, en as UploadedAsset, et as GetAssetInfoOptions, f as AssetContentRemovalReason, fn as TypedEvent, ft as ListAssetsOptions, g as AssetModerationStatus, gn as EventFacts, gt as ListHashListsOptions, h as AssetModerationDecision, hn as EventFactValues, ht as ListHashListEntriesOptions, i as AssetAvailability, in as WebhookHeadersInput, it as HashListPage, j as CdnAssetReference, jn as ProcessingFeatureResults, jt as RetrieveAssetByExternalIdOptions, k as CalmLensServerClientOptions, kn as DetectedPerson, kt as RequestOptions, l as AssetClassificationStatus, ln as GetEventsResponse, lt as LensPage, m as AssetModeration, mn as EventFact, mt as ListFoldersOptions, n as AppInfo, nn as ViewerClaims, nt as HashListEntryPage, o as AssetChildrenPage, on as AssetBatchOperation, ot as ImageTransformOptions, p as AssetContentStatus, pn as EventCategory, pt as ListEventsOptions, q as EnsureLensOptions, qn as AssetSafetyHoldReason, qt as UpdateProjectSettingsOptions, r as Asset, rn as WaitForAssetDecisionOptions, rt as HashListIdOptions, s as AssetClassification, sn as AssetReviewRequest, st as Lens, t as AddHashListEntryOptions, tn as VerifyWebhookSignatureOptions, tt as HashListEntryIdOptions, u as AssetContent, ut as ListAssetChildrenOptions, v as AssetSearchResponse, vn as EventSeverity, vt as ListPoliciesOptions, w as AssetVisibility, wn as PublicProjectSettings, wt as PolicyIdOptions, x as AssetType, xn as Folder, xt as MoveFolderOptions, y as AssetSearchResult, yn as EventType, yt as ListUploadPresetsOptions, z as CreateFolderOptions, zt as SignedUploadToken } from "./CalmLensTypes-87kiUg0H.js";
3
- import { a as getAssetInfo, i as CDN_RESOURCES, n as SDK_VERSION, r as DEFAULT_CDN_BASE_URL, t as ModerationContextItem } from "./index-CWUnLKoF.js";
4
- import { A as CalmLensRateLimitError, C as CalmLensErrorKind, D as CalmLensNotFoundError, E as CalmLensInvalidResponseError, F as SdkErrorCode, I as ApiErrorCode, M as CalmLensTimeoutError, N as CalmLensUnprocessableEntityError, O as CalmLensPayloadTooLargeError, P as CalmLensWebhookVerificationError, S as CalmLensErrorDetails, T as CalmLensInvalidArgumentError, _ as CalmLensConfigurationError, a as AUTO_PAGING_TO_ARRAY_MAX, b as CalmLensError, c as CalmLensLastResponse, d as ListPromise, f as CALMLENS_ERROR_CODES, g as CalmLensCancelledError, h as CalmLensBadRequestError, i as ServedAssetInfo, j as CalmLensServerError, k as CalmLensPermissionDeniedError, l as CalmLensResponse, m as CalmLensAuthenticationError, o as AutoPaging, p as CalmLensApiError, r as CdnResponse, s as AutoPagingToArrayOptions, t as ReceivedWebhookEventPayload, u as ListPage, v as CalmLensConflictError, w as CalmLensErrorOptions, x as CalmLensErrorCode, y as CalmLensConnectionError } from "./WebhookPayload-B4rA_Dvm.js";
5
- import { t as CalmLensServerClient } from "./CalmLensServerClient-CtS66dCU.js";
2
+ import { $ as FolderPage, $t as UploadPresetSubmitAssetOptions, A as CdnAssetLocation, An as ProcessingFeatureId, At as ResetPolicyOptions, B as CreateHashListOptions, Bn as AssetInfo, Bt as StreamingFeatureOptions, C as AssetUploadStatus, Cn as ProjectSettingsResource, Ct as MultipartUploadPartOptions, D as BatchAssetsResponse, Dn as BoundingBox, Dt as RequestAssetReviewOptions, E as BatchAssetsOptions, En as AgeRange, Et as RemoveAssetContentOptions, F as CdnTransform, Fn as CursorPage, Ft as SetPolicyAutomaticUpdatesOptions, G as DeleteAssetOptions, Gn as AssetRenderedKind, Gt as UpdateLensOptions, H as CreateMultipartUploadPartOptions, Hn as AssetHlsRendition, Ht as UpdateAssetOptions, I as ClassifyTextOptions, In as LensType, It as SignAssetUrlOptions, J as EnsureLensesOptions, Jn as ExtractedText, Jt as UpgradePolicyOptions, K as DeleteMetadataFieldOptions, Kn as AssetSafetyHold, Kt as UpdatePolicyOptions, L as ClientRequestDefaults, Ln as AssetSearchMatchField, Lt as SignUploadTokenOptions, M as CdnAssetUrlOptions, Mn as ProcessingFeatureStage, Mt as RetrieveAssetOptions, N as CdnResource, Nn as ProcessingFeatures, Nt as RetryAssetOptions, O as CalmLensAppClientOptions, On as DetectedFace, Ot as RequestAttempt, P as CdnServeOptions, Pn as Policy, Pt as SearchAssetsOptions, Q as FolderIdOptions, Qt as UploadPresetPage, R as ConnectionOptions, Rn as AssetSearchQuery, Rt as SignedAssetUrl, S as AssetUpload, Sn as MetadataFieldsResource, St as MultipartUploadOptions, T as AssignPolicyOptions, Tn as UploadPreset, Tt as PolicyPage, U as CreatePolicyOptions, Un as AssetPreview, Ut as UpdateFolderOptions, V as CreateLensOptions, Vn as AssetHls, Vt as SubmitAssetOptions, W as DecideAssetOptions, Wn as AssetRendered, Wt as UpdateHashListOptions, X as EnsureUploadPresetsOptions, Xn as MetadataItem, Xt as UploadPresetDefinition, Y as EnsureMetadataFieldsOptions, Yn as FileMetadata, Yt as UploadAssetPartOptions, Z as EnsureUploadPresetsResponse, Zn as ProcessingOptions, Zt as UploadPresetIdOptions, _ as AssetPage, _n as EventResourceKind, _t as ListLensesOptions, a as AssetChecksums, an as WebhookPayloadInput, at as IdempotencyOptions, b as AssetTimelinePage, bt as MoveAssetOptions, c as AssetClassificationFailureReason, cn as AssetTimelineSegment, ct as LensIdOptions, d as AssetContentOptions, dn as EventResource, dt as ListAssetTimelineOptions, en as UploadedAsset, et as GetAssetInfoOptions, f as AssetContentRemovalReason, fn as TypedEvent, ft as ListAssetsOptions, g as AssetModerationStatus, gn as EventFacts, gt as ListHashListsOptions, h as AssetModerationDecision, hn as EventFactValues, ht as ListHashListEntriesOptions, i as AssetAvailability, in as WebhookHeadersInput, it as HashListPage, j as CdnAssetReference, jn as ProcessingFeatureResults, jt as RetrieveAssetByExternalIdOptions, k as CalmLensServerClientOptions, kn as DetectedPerson, kt as RequestOptions, l as AssetClassificationStatus, ln as GetEventsResponse, lt as LensPage, m as AssetModeration, mn as EventFact, mt as ListFoldersOptions, n as AppInfo, nn as ViewerClaims, nt as HashListEntryPage, o as AssetChildrenPage, on as AssetBatchOperation, ot as ImageTransformOptions, p as AssetContentStatus, pn as EventCategory, pt as ListEventsOptions, q as EnsureLensOptions, qn as AssetSafetyHoldReason, qt as UpdateProjectSettingsOptions, r as Asset, rn as WaitForAssetDecisionOptions, rt as HashListIdOptions, s as AssetClassification, sn as AssetReviewRequest, st as Lens, t as AddHashListEntryOptions, tn as VerifyWebhookSignatureOptions, tt as HashListEntryIdOptions, u as AssetContent, ut as ListAssetChildrenOptions, v as AssetSearchResponse, vn as EventSeverity, vt as ListPoliciesOptions, w as AssetVisibility, wn as PublicProjectSettings, wt as PolicyIdOptions, x as AssetType, xn as Folder, xt as MoveFolderOptions, y as AssetSearchResult, yn as EventType, yt as ListUploadPresetsOptions, z as CreateFolderOptions, zt as SignedUploadToken } from "./CalmLensTypes-DjuOXp3b.js";
3
+ import { a as getAssetInfo, i as CDN_RESOURCES, n as SDK_VERSION, r as DEFAULT_CDN_BASE_URL, t as ModerationContextItem } from "./index-xF6Neq8A.js";
4
+ import { A as CalmLensRateLimitError, C as CalmLensErrorKind, D as CalmLensNotFoundError, E as CalmLensInvalidResponseError, F as SdkErrorCode, I as ApiErrorCode, M as CalmLensTimeoutError, N as CalmLensUnprocessableEntityError, O as CalmLensPayloadTooLargeError, P as CalmLensWebhookVerificationError, S as CalmLensErrorDetails, T as CalmLensInvalidArgumentError, _ as CalmLensConfigurationError, a as AUTO_PAGING_TO_ARRAY_MAX, b as CalmLensError, c as CalmLensLastResponse, d as ListPromise, f as CALMLENS_ERROR_CODES, g as CalmLensCancelledError, h as CalmLensBadRequestError, i as ServedAssetInfo, j as CalmLensServerError, k as CalmLensPermissionDeniedError, l as CalmLensResponse, m as CalmLensAuthenticationError, o as AutoPaging, p as CalmLensApiError, r as CdnResponse, s as AutoPagingToArrayOptions, t as ReceivedWebhookEventPayload, u as ListPage, v as CalmLensConflictError, w as CalmLensErrorOptions, x as CalmLensErrorCode, y as CalmLensConnectionError } from "./WebhookPayload-C3F9j4p7.js";
5
+ import { t as CalmLensServerClient } from "./CalmLensServerClient-CoiZN7Fr.js";
6
6
  export declare const WEBHOOK_DELIVERY_HEADER = "x-calmlens-delivery";
7
7
  export declare const WEBHOOK_TIMESTAMP_HEADER = "x-calmlens-timestamp";
8
8
  export declare const WEBHOOK_SIGNATURE_HEADER = "x-calmlens-signature";
package/esm/server.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { _ as CalmLensTimeoutError, a as CalmLensCancelledError, c as CalmLensConnectionError, d as CalmLensInvalidResponseError, f as CalmLensNotFoundError, g as CalmLensServerError, h as CalmLensRateLimitError, i as CalmLensBadRequestError, l as CalmLensError, m as CalmLensPermissionDeniedError, n as CalmLensApiError, o as CalmLensConfigurationError, p as CalmLensPayloadTooLargeError, r as CalmLensAuthenticationError, s as CalmLensConflictError, t as CALMLENS_ERROR_CODES, u as CalmLensInvalidArgumentError, v as CalmLensUnprocessableEntityError, y as CalmLensWebhookVerificationError } from "./CalmLensError-C15tWu8W.js";
2
- import { I as AUTO_PAGING_TO_ARRAY_MAX, N as SDK_VERSION, n as CDN_RESOURCES, s as getAssetInfo, u as DEFAULT_CDN_BASE_URL } from "./CalmLensCdn-CL1P1v2t.js";
2
+ import { I as SDK_VERSION, n as CDN_RESOURCES, s as getAssetInfo, u as DEFAULT_CDN_BASE_URL, z as AUTO_PAGING_TO_ARRAY_MAX } from "./CalmLensCdn--hZgorld.js";
3
3
  import "./index.js";
4
- import { a as WEBHOOK_TIMESTAMP_HEADER, c as isNewerEvent, d as verifyWebhookSignature, i as WEBHOOK_SIGNATURE_TOLERANCE_SECONDS, l as isTestWebhookEvent, n as WEBHOOK_DELIVERY_HEADER, o as getEventFact, r as WEBHOOK_SIGNATURE_HEADER, s as getEventFacts, t as CalmLensServerClient, u as parseWebhookEvent } from "./CalmLensServerClient-CBjSqROz.js";
4
+ import { a as WEBHOOK_TIMESTAMP_HEADER, c as isNewerEvent, d as verifyWebhookSignature, i as WEBHOOK_SIGNATURE_TOLERANCE_SECONDS, l as isTestWebhookEvent, n as WEBHOOK_DELIVERY_HEADER, o as getEventFact, r as WEBHOOK_SIGNATURE_HEADER, s as getEventFacts, t as CalmLensServerClient, u as parseWebhookEvent } from "./CalmLensServerClient-BBPwU8mm.js";
5
5
  export { AUTO_PAGING_TO_ARRAY_MAX, CALMLENS_ERROR_CODES, CDN_RESOURCES, CalmLensApiError, CalmLensAuthenticationError, CalmLensBadRequestError, CalmLensCancelledError, CalmLensConfigurationError, CalmLensConflictError, CalmLensConnectionError, CalmLensError, CalmLensInvalidArgumentError, CalmLensInvalidResponseError, CalmLensNotFoundError, CalmLensPayloadTooLargeError, CalmLensPermissionDeniedError, CalmLensRateLimitError, CalmLensServerClient, CalmLensServerError, CalmLensTimeoutError, CalmLensUnprocessableEntityError, CalmLensWebhookVerificationError, DEFAULT_CDN_BASE_URL, SDK_VERSION, WEBHOOK_DELIVERY_HEADER, WEBHOOK_SIGNATURE_HEADER, WEBHOOK_SIGNATURE_TOLERANCE_SECONDS, WEBHOOK_TIMESTAMP_HEADER, getAssetInfo, getEventFact, getEventFacts, isNewerEvent, isTestWebhookEvent, parseWebhookEvent, verifyWebhookSignature };
@@ -1,6 +1,18 @@
1
- import { a as TEST_FACE_AGE_PRESETS, c as TestDetections, d as detectTestTrigger, f as getImageTestCategories, i as TEST_FACE_AGE_MAX, l as TestInput, m as testInputForSignal, n as TEST_DETECTIONS_MAX, o as TEST_INPUT_KEY_PATTERN, p as paintTestImage$1, r as TEST_DETECTION_BOX_MAX, s as TEST_INPUT_PRESETS, t as ClassificationTestSignal, u as detectTestImage } from "./TestTriggers-Daxebd0V.js";
1
+ import { a as TEST_FACE_AGE_PRESETS, c as TestDetections, d as detectTestTrigger, f as getImageTestCategories, i as TEST_FACE_AGE_MAX, l as TestInput, n as TEST_DETECTIONS_MAX, o as TEST_INPUT_KEY_PATTERN, p as testInputForSignal, r as TEST_DETECTION_BOX_MAX, s as TEST_INPUT_PRESETS, t as ClassificationTestSignal, u as detectTestImage } from "./TestTriggers-CjDhhz78.js";
2
2
  /** A text code for `scenario`, signed with the project's test input key. */
3
3
  export declare const generateTestTextCode: (scenario: TestInput | ClassificationTestSignal, key: string) => Promise<string>;
4
- /** An RGBA test image for `scenario`, signed with the project's test input key. */
5
- export declare const paintTestImage: (scenario: TestInput | ClassificationTestSignal, key: string) => ReturnType<typeof paintTestImage$1>;
4
+ /** A painted test image: its RGBA pixels, row by row, and the same image as PNG bytes. */
5
+ export interface TestImage {
6
+ width: number;
7
+ height: number;
8
+ rgba: Uint8Array;
9
+ /** The image as a PNG, to upload as it is. */
10
+ png: Uint8Array;
11
+ }
12
+ /**
13
+ * The test image for `scenario`, signed with the project's test input key. Upload its `png` bytes
14
+ * (or encode `rgba` in another format: the image survives lossy formats and resizing) as the whole
15
+ * image, optionally on a plain single-colour border.
16
+ */
17
+ export declare const paintTestImage: (scenario: TestInput | ClassificationTestSignal, key: string) => Promise<TestImage>;
6
18
  export { type ClassificationTestSignal, TEST_DETECTIONS_MAX, TEST_DETECTION_BOX_MAX, TEST_FACE_AGE_MAX, TEST_FACE_AGE_PRESETS, TEST_INPUT_KEY_PATTERN, TEST_INPUT_PRESETS, type TestDetections, type TestInput, detectTestImage, detectTestTrigger, getImageTestCategories, testInputForSignal };
@@ -1,4 +1,97 @@
1
1
  import { a as TEST_FACE_AGE_PRESETS, c as detectTestImage, d as getImageTestCategories, i as TEST_FACE_AGE_MAX, l as detectTestTrigger, m as testInputForSignal, n as TEST_DETECTIONS_MAX, o as TEST_INPUT_KEY_PATTERN, p as paintTestImage$1, r as TEST_DETECTION_BOX_MAX, s as TEST_INPUT_PRESETS, t as withValidTestInputArguments, u as generateTestTextCode$1 } from "./CalmLensTestInputArguments-CqPADTkl.js";
2
+ // src/client/TestImagePng.ts
3
+ /**
4
+ * Encodes a painted test image as a PNG: 8-bit RGBA rows without filtering in stored deflate
5
+ * blocks, as every SDK writes it, so the bytes match across SDKs. Runs anywhere, with no
6
+ * compression library.
7
+ */
8
+ function encodeTestImagePng(width, height, rgba) {
9
+ const stride = width * 4;
10
+ const raw = new Uint8Array((stride + 1) * height);
11
+ for (let row = 0; row < height; row++) raw.set(rgba.subarray(row * stride, (row + 1) * stride), row * (stride + 1) + 1);
12
+ const blocks = Math.max(1, Math.ceil(raw.length / 65535));
13
+ const stream = new Uint8Array(2 + raw.length + blocks * 5 + 4);
14
+ stream.set([120, 1]);
15
+ let position = 2;
16
+ for (let offset = 0; offset < raw.length || position === 2; offset += 65535) {
17
+ const block = raw.subarray(offset, offset + 65535);
18
+ const length = block.length;
19
+ stream.set([
20
+ offset + length >= raw.length ? 1 : 0,
21
+ length & 255,
22
+ length >> 8,
23
+ ~length & 255,
24
+ ~length >> 8 & 255
25
+ ], position);
26
+ stream.set(block, position + 5);
27
+ position += 5 + length;
28
+ }
29
+ writeUint32(stream, position, adler32(raw));
30
+ const header = /* @__PURE__ */ new Uint8Array(13);
31
+ writeUint32(header, 0, width);
32
+ writeUint32(header, 4, height);
33
+ header.set([
34
+ 8,
35
+ 6,
36
+ 0,
37
+ 0,
38
+ 0
39
+ ], 8);
40
+ return concat([
41
+ Uint8Array.of(137, 80, 78, 71, 13, 10, 26, 10),
42
+ chunk("IHDR", header),
43
+ chunk("IDAT", stream),
44
+ chunk("IEND", /* @__PURE__ */ new Uint8Array(0))
45
+ ]);
46
+ }
47
+ function chunk(kind, body) {
48
+ const typed = new Uint8Array(4 + body.length);
49
+ for (let i = 0; i < 4; i++) typed[i] = kind.charCodeAt(i);
50
+ typed.set(body, 4);
51
+ const out = new Uint8Array(12 + body.length);
52
+ writeUint32(out, 0, body.length);
53
+ out.set(typed, 4);
54
+ writeUint32(out, 8 + body.length, crc32(typed));
55
+ return out;
56
+ }
57
+ function writeUint32(target, offset, value) {
58
+ target[offset] = value >>> 24;
59
+ target[offset + 1] = value >>> 16 & 255;
60
+ target[offset + 2] = value >>> 8 & 255;
61
+ target[offset + 3] = value & 255;
62
+ }
63
+ function concat(parts) {
64
+ const out = new Uint8Array(parts.reduce((total, part) => total + part.length, 0));
65
+ let offset = 0;
66
+ for (const part of parts) {
67
+ out.set(part, offset);
68
+ offset += part.length;
69
+ }
70
+ return out;
71
+ }
72
+ let crcTable;
73
+ function crc32(bytes) {
74
+ if (!crcTable) {
75
+ crcTable = /* @__PURE__ */ new Uint32Array(256);
76
+ for (let n = 0; n < 256; n++) {
77
+ let c = n;
78
+ for (let k = 0; k < 8; k++) c = c & 1 ? 3988292384 ^ c >>> 1 : c >>> 1;
79
+ crcTable[n] = c >>> 0;
80
+ }
81
+ }
82
+ let crc = 4294967295;
83
+ for (const byte of bytes) crc = crcTable[(crc ^ byte) & 255] ^ crc >>> 8;
84
+ return (crc ^ 4294967295) >>> 0;
85
+ }
86
+ function adler32(bytes) {
87
+ let a = 1;
88
+ let b = 0;
89
+ for (const byte of bytes) {
90
+ a = (a + byte) % 65521;
91
+ b = (b + a) % 65521;
92
+ }
93
+ return (b << 16 | a) >>> 0;
94
+ }
2
95
  // src/test-inputs.ts
3
96
  /**
4
97
  * Portable test inputs: presets and custom instances share one authenticated format. CalmLens
@@ -7,6 +100,16 @@ import { a as TEST_FACE_AGE_PRESETS, c as detectTestImage, d as getImageTestCate
7
100
  */
8
101
  /** A text code for `scenario`, signed with the project's test input key. */
9
102
  const generateTestTextCode = (scenario, key) => withValidTestInputArguments(key, () => generateTestTextCode$1(scenario, key));
10
- /** An RGBA test image for `scenario`, signed with the project's test input key. */
11
- const paintTestImage = (scenario, key) => withValidTestInputArguments(key, () => paintTestImage$1(scenario, key));
103
+ /**
104
+ * The test image for `scenario`, signed with the project's test input key. Upload its `png` bytes
105
+ * (or encode `rgba` in another format: the image survives lossy formats and resizing) as the whole
106
+ * image, optionally on a plain single-colour border.
107
+ */
108
+ const paintTestImage = async (scenario, key) => {
109
+ const image = await withValidTestInputArguments(key, () => paintTestImage$1(scenario, key));
110
+ return {
111
+ ...image,
112
+ png: encodeTestImagePng(image.width, image.height, image.rgba)
113
+ };
114
+ };
12
115
  export { TEST_DETECTIONS_MAX, TEST_DETECTION_BOX_MAX, TEST_FACE_AGE_MAX, TEST_FACE_AGE_PRESETS, TEST_INPUT_KEY_PATTERN, TEST_INPUT_PRESETS, detectTestImage, detectTestTrigger, generateTestTextCode, getImageTestCategories, paintTestImage, testInputForSignal };
package/esm/testing.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- import { Lt as SignUploadTokenOptions, O as CalmLensAppClientOptions, Xt as UploadPresetDefinition, bn as PermissionGrant, fn as TypedEvent, k as CalmLensServerClientOptions, m as AssetModeration, r as Asset, xn as Folder, zn as AssetBinaryPayloadInput, zt as SignedUploadToken } from "./CalmLensTypes-87kiUg0H.js";
2
- import { t as CalmLensAppClient } from "./CalmLensAppClient-CdlcDd5l.js";
3
- import { I as ApiErrorCode, n as WebhookEventPayload } from "./WebhookPayload-B4rA_Dvm.js";
4
- import { t as CalmLensServerClient } from "./CalmLensServerClient-CtS66dCU.js";
5
- import { t as ClassificationTestSignal } from "./TestTriggers-Daxebd0V.js";
1
+ import { Lt as SignUploadTokenOptions, O as CalmLensAppClientOptions, Xt as UploadPresetDefinition, bn as PermissionGrant, fn as TypedEvent, k as CalmLensServerClientOptions, m as AssetModeration, r as Asset, xn as Folder, zn as AssetBinaryPayloadInput, zt as SignedUploadToken } from "./CalmLensTypes-DjuOXp3b.js";
2
+ import { t as CalmLensAppClient } from "./CalmLensAppClient-v1Ho7mJQ.js";
3
+ import { I as ApiErrorCode, n as WebhookEventPayload } from "./WebhookPayload-C3F9j4p7.js";
4
+ import { t as CalmLensServerClient } from "./CalmLensServerClient-CoiZN7Fr.js";
5
+ import { t as ClassificationTestSignal } from "./TestTriggers-CjDhhz78.js";
6
6
  import "zod";
7
7
  /**
8
8
  * Signs a single-use upload token with `apiKey`, locally. `CalmLensServerClient` and
@@ -381,7 +381,7 @@ export declare class MockCalmLensServerClient extends CalmLensServerClient {
381
381
  callsTo(operation: MockCalmLensOperation): MockCalmLensCall[];
382
382
  /**
383
383
  * Fetches a URL of the mock's CDN as a browser would, without the API key: a signed asset URL
384
- * from `cdn.signAssetUrl` (with a resource appended), or a public one from `cdn.getAssetUrl`.
384
+ * from `cdn.signAssetUrl`, or a public one from `cdn.getAssetUrl`.
385
385
  * The request is recorded like any other.
386
386
  */
387
387
  fetchCdn(url: string, init?: RequestInit): Promise<Response>;
@@ -410,6 +410,14 @@ export declare class MockCalmLensServerClient extends CalmLensServerClient {
410
410
  * is typed by its path's extension, and has no content.
411
411
  */
412
412
  serveUrl(url: string, content: MockServedUrl): void;
413
+ /**
414
+ * Makes the mock hash an image upload of exactly `content` (bytes, or text as UTF-8) as `hash`, a
415
+ * PDQ hash of 64 hexadecimal characters, with `quality` (0 to 100, default 100), instead of the
416
+ * SHA-256 of its bytes. Hash list entries match hashes up to 31 bits away, as in CalmLens, so a
417
+ * test can make a resized or recompressed copy a near match of a listed image: declare the
418
+ * copy's hash a few bits from the entry's.
419
+ */
420
+ setPerceptualHash(content: Uint8Array | ArrayBuffer | string, hash: string, quality?: number): void;
413
421
  /**
414
422
  * Changes the grants of the mock's API key, as editing the key in the portal would: later
415
423
  * requests, such as `cdn.serve`, use them. The key itself stays the same, so idempotency keys
package/esm/testing.js CHANGED
@@ -1,10 +1,10 @@
1
1
  import { C as invalidConfig, S as invalidArgument, T as API_ERROR_DEFINITIONS, l as CalmLensError, w as API_ERROR_CODES, x as SDK_ERROR_CODES } from "./CalmLensError-C15tWu8W.js";
2
- import { A as normalizeUploadMimeType, D as MAX_IMAGE_UPLOAD_BYTES, M as sleep, S as validateAppClientOptions, _ as randomUuid, f as checkTransformOptions, h as parseTransformSelector, k as getRejectedUploadMimeTypeError, m as isAcceptedUploadMimeType, t as ASSET_RESOURCE_PATHS, w as validateServerClientOptions } from "./CalmLensCdn-CL1P1v2t.js";
3
- import { a as WEBHOOK_TIMESTAMP_HEADER, f as signUploadTokenWithApiKey, m as stringifyJsonCanonical, n as WEBHOOK_DELIVERY_HEADER, p as decodeUploadToken, r as WEBHOOK_SIGNATURE_HEADER, t as CalmLensServerClient } from "./CalmLensServerClient-CBjSqROz.js";
4
- import { _ as validateAssetPayload, g as assetToData, h as assetDataToUint8Array, n as MOCK_HOOKS } from "./CalmLensConnection-CHNNULpg.js";
2
+ import { F as sleep, M as getRejectedUploadMimeTypeError, N as normalizeUploadMimeType, O as MAX_IMAGE_UPLOAD_BYTES, S as validateAppClientOptions, _ as randomUuid, f as checkTransformOptions, h as parseTransformSelector, m as isAcceptedUploadMimeType, t as ASSET_RESOURCE_PATHS, w as validateServerClientOptions } from "./CalmLensCdn--hZgorld.js";
3
+ import { a as WEBHOOK_TIMESTAMP_HEADER, f as signUploadTokenWithApiKey, m as stringifyJsonCanonical, n as WEBHOOK_DELIVERY_HEADER, p as decodeUploadToken, r as WEBHOOK_SIGNATURE_HEADER, t as CalmLensServerClient } from "./CalmLensServerClient-BBPwU8mm.js";
4
+ import { _ as validateAssetPayload, g as assetToData, h as assetDataToUint8Array, n as MOCK_HOOKS } from "./CalmLensConnection-dz5Kl3uC.js";
5
5
  import { t as hmacSha256Hex } from "./CryptoUtils-BLCa-oZe-DKr3LmN6.js";
6
- import { t as CalmLensAppClient } from "./CalmLensAppClient-BKanqwYL.js";
7
- import { o as placeholderHashToDataURL, r as isFileAccepted } from "./UploadController-X2gEFMGy.js";
6
+ import { t as CalmLensAppClient } from "./CalmLensAppClient-C0Ud7eYa.js";
7
+ import { o as placeholderHashToDataURL, r as isFileAccepted } from "./UploadController-D3um1cq9.js";
8
8
  import { f as getTestInputTag, g as CLASSIFICATION_CATEGORIES, h as lazySchema, t as withValidTestInputArguments } from "./CalmLensTestInputArguments-CqPADTkl.js";
9
9
  import * as zod from "zod";
10
10
  // src/contract/MediaTestTriggers.js
@@ -8700,20 +8700,6 @@ const MOCK_ASSET_FILTER_FIELDS = {
8700
8700
  "=out="
8701
8701
  ]
8702
8702
  },
8703
- description: {
8704
- kind: "text",
8705
- nullable: true,
8706
- operators: [
8707
- "==",
8708
- "!=",
8709
- ">",
8710
- ">=",
8711
- "<",
8712
- "<=",
8713
- "=in=",
8714
- "=out="
8715
- ]
8716
- },
8717
8703
  externalId: {
8718
8704
  kind: "text",
8719
8705
  nullable: true,
@@ -9232,17 +9218,20 @@ const filterAssets = (items, filter) => {
9232
9218
  return items.filter((item) => matchesNode(item, node));
9233
9219
  };
9234
9220
  const MAX_SEARCH_TOKENS = 8;
9235
- /** The keyword fields the API searches, in the order it reports matches. */
9236
- const searchFieldValues = (asset) => [
9221
+ /**
9222
+ * The keyword fields the API searches, in the order it reports matches. `extractedText` is the
9223
+ * asset's retained text: empty unless its content is stored.
9224
+ */
9225
+ const searchFieldValues = (asset, extractedText) => [
9237
9226
  ["name", asset.name],
9238
9227
  ["id", asset.id],
9239
9228
  ["externalId", asset.externalId ?? ""],
9240
- ["description", asset.description ?? ""],
9241
9229
  ["tags", asset.tags?.join(" ") ?? ""],
9242
9230
  ["type", asset.type],
9243
9231
  ["content.format", asset.content?.format ?? ""],
9244
9232
  ["content.extension", asset.content?.extension ?? ""],
9245
- ["classification.moderation.decision", asset.classification.moderation.decision ?? "pending"]
9233
+ ["classification.moderation.decision", asset.classification.moderation.decision ?? "pending"],
9234
+ ["content.extractedText", extractedText]
9246
9235
  ];
9247
9236
  /** The API's keyword score for the whole lowercased query. */
9248
9237
  const keywordScore = (values, query) => {
@@ -9261,15 +9250,15 @@ const keywordScore = (values, query) => {
9261
9250
  };
9262
9251
  /**
9263
9252
  * Keyword search as the API runs it: every whitespace-separated token (case-insensitive, at
9264
- * most 8) must appear in some searchable field. Results are ranked by the API's score, then
9265
- * newest first.
9253
+ * most 8) must appear in some searchable field, including the asset's retained text, which
9254
+ * `extractedTexts` maps by asset ID. Results are ranked by the API's score, then newest first.
9266
9255
  */
9267
- const searchAssets = (assets, query, limit) => {
9256
+ const searchAssets = (assets, extractedTexts, query, limit) => {
9268
9257
  const normalized = query.trim().toLowerCase();
9269
9258
  const tokens = [...new Set(normalized.split(/\s+/).filter(Boolean))].slice(0, MAX_SEARCH_TOKENS);
9270
9259
  if (tokens.length === 0) return [];
9271
9260
  return assets.map((asset) => {
9272
- const fields = searchFieldValues(asset).map(([field, value]) => [field, value.toLowerCase()]);
9261
+ const fields = searchFieldValues(asset, extractedTexts.get(asset.id) ?? "").map(([field, value]) => [field, value.toLowerCase()]);
9273
9262
  return {
9274
9263
  asset,
9275
9264
  matches: tokens.every((token) => fields.some(([, value]) => value.includes(token))),
@@ -9379,8 +9368,12 @@ const checkMockUploadPreset = (preset) => {
9379
9368
  if (unknown.length) throw invalidArgument(`Unknown mockOptions.preset key${unknown.length > 1 ? "s" : ""}: ${unknown.join(", ")}`, { options: unknown });
9380
9369
  };
9381
9370
  const MAX_PAGE_SIZE = 100;
9382
- /** Entries with a lower PDQ quality never match (HashList.ts, HASH_MATCH_MIN_QUALITY). */
9371
+ /** Hashes with a lower PDQ quality never match (HashList.ts, HASH_MATCH_MIN_QUALITY). */
9383
9372
  const HASH_MATCH_MIN_QUALITY = 50;
9373
+ /** Hashes this many bits apart or fewer match (HashList.ts, HASH_MATCH_MAX_DISTANCE). */
9374
+ const HASH_MATCH_MAX_DISTANCE = 31;
9375
+ /** A block list blocks only matches this close; looser ones are flagged (HASH_BLOCK_MAX_DISTANCE). */
9376
+ const HASH_BLOCK_MAX_DISTANCE = 16;
9384
9377
  /** The most hash matches an asset records (HashList.ts). */
9385
9378
  const MAX_RECORDED_HASH_MATCHES = 10;
9386
9379
  const MAX_DECISION_NOTE_LENGTH = 1499;
@@ -9625,7 +9618,6 @@ const invalidField = (code, path) => new ApiFailure(400, API_ERROR_CODES.INVALID
9625
9618
  /** The asset fields an upload carries in its body; the API refuses them in the query string. */
9626
9619
  const UPLOAD_OPTION_KEYS = [
9627
9620
  "name",
9628
- "description",
9629
9621
  "processingOptions",
9630
9622
  "visibility",
9631
9623
  "metadata",
@@ -9864,6 +9856,7 @@ var MockCalmLensApi = class {
9864
9856
  this.idempotentResults = /* @__PURE__ */ new Map();
9865
9857
  this.pendingFailures = [];
9866
9858
  this.servedUrls = /* @__PURE__ */ new Map();
9859
+ this.perceptualHashes = [];
9867
9860
  this.pendingReviews = /* @__PURE__ */ new Map();
9868
9861
  this.requestCount = 0;
9869
9862
  this.useTimers = false;
@@ -9928,6 +9921,24 @@ var MockCalmLensApi = class {
9928
9921
  type: type.trim()
9929
9922
  });
9930
9923
  }
9924
+ /**
9925
+ * Makes an image upload of exactly `content` hash as `hash` (64 hexadecimal characters, a PDQ
9926
+ * hash) with `quality`, instead of the SHA-256 of its bytes.
9927
+ */
9928
+ setPerceptualHash(content, hash, quality = 100) {
9929
+ const bytes = typeof content === "string" ? new TextEncoder().encode(content) : content instanceof ArrayBuffer ? new Uint8Array(content.slice(0)) : content instanceof Uint8Array ? new Uint8Array(content) : void 0;
9930
+ if (!bytes) throw invalidArgument("content must be bytes or a string");
9931
+ if (typeof hash !== "string" || !/^[0-9a-f]{64}$/i.test(hash.trim())) throw invalidArgument("hash must be a PDQ hash of 64 hexadecimal characters");
9932
+ if (typeof quality !== "number" || !Number.isInteger(quality) || quality < 0 || quality > 100) throw invalidArgument("quality must be a whole number from 0 to 100");
9933
+ const declared = {
9934
+ bytes,
9935
+ hash: hash.trim().toLowerCase(),
9936
+ quality
9937
+ };
9938
+ const index = this.perceptualHashes.findIndex((known) => sameBytes(known.bytes, bytes));
9939
+ if (index === -1) this.perceptualHashes.push(declared);
9940
+ else this.perceptualHashes[index] = declared;
9941
+ }
9931
9942
  /** A `fetch` that answers a client's requests from memory; app clients pass their session. */
9932
9943
  createFetch(endpoints, session) {
9933
9944
  return ((input, init) => this.handle(input, init, endpoints(), session));
@@ -10733,8 +10744,9 @@ var MockCalmLensApi = class {
10733
10744
  }
10734
10745
  /**
10735
10746
  * Keyword search like the API's: every whitespace-separated token must appear,
10736
- * case-insensitively, in the asset's name, ID, external ID, description, tags, type, content
10737
- * format or extension, or moderation status. There is no semantic search.
10747
+ * case-insensitively, in the asset's name, ID, external ID, tags, type, content format or
10748
+ * extension, moderation status, or retained text while its content is stored. There is no
10749
+ * semantic search.
10738
10750
  */
10739
10751
  async searchAssets(params) {
10740
10752
  const query = (params.get("query") ?? "").trim();
@@ -10743,9 +10755,11 @@ var MockCalmLensApi = class {
10743
10755
  const pageSize = this.integer(params, "pageSize", 10);
10744
10756
  if (pageSize < 1) throw invalidField("validation/too-small", "pageSize");
10745
10757
  if (pageSize > MAX_SEARCH_PAGE_SIZE) throw invalidField("validation/too-big", "pageSize");
10758
+ const assets = await this.databaseStorage.listAssets(this.projectId);
10759
+ const extractedTexts = new Map(await Promise.all(assets.map(async (asset) => [asset.id, await this.searchText(asset)])));
10746
10760
  return {
10747
10761
  query,
10748
- items: searchAssets(await this.databaseStorage.listAssets(this.projectId), query, pageSize),
10762
+ items: searchAssets(assets, extractedTexts, query, pageSize),
10749
10763
  semanticStatus: "disabled"
10750
10764
  };
10751
10765
  }
@@ -11088,7 +11102,6 @@ var MockCalmLensApi = class {
11088
11102
  createdAt: now,
11089
11103
  updatedAt: now,
11090
11104
  name: fields.name,
11091
- description: fields.description ?? null,
11092
11105
  externalId: fields.externalId ?? null,
11093
11106
  externalUrl: fields.url ?? fields.externalUrl ?? null,
11094
11107
  type,
@@ -11285,10 +11298,19 @@ var MockCalmLensApi = class {
11285
11298
  }
11286
11299
  /** An earlier post's text, to the most CalmLens reads of one post; empty once its content is gone. */
11287
11300
  async contextText(asset) {
11301
+ const text = (await this.retainedText(asset)).trim();
11302
+ return Array.from(text).slice(0, MODERATION_CONTEXT_MAX_ITEM_CHARACTERS).join("");
11303
+ }
11304
+ /** The text keyword search reads, like the API: the retained text, only while content is stored. */
11305
+ async searchText(asset) {
11306
+ return asset.content.status === "stored" ? this.retainedText(asset) : "";
11307
+ }
11308
+ /** A text upload's stored bytes, or the text extracted from its content (such as OCR). */
11309
+ async retainedText(asset) {
11288
11310
  const extracted = asset.content.extractedText;
11289
11311
  const bytes = asset.type === "plaintext-document" && await this.storedBytes(asset);
11290
- const text = (bytes ? new TextDecoder().decode(bytes) : extracted?.type === "string" ? extracted.content : "").trim();
11291
- return Array.from(text).slice(0, MODERATION_CONTEXT_MAX_ITEM_CHARACTERS).join("");
11312
+ if (bytes) return new TextDecoder().decode(bytes);
11313
+ return extracted?.type === "string" ? extracted.content : "";
11292
11314
  }
11293
11315
  async storedBytes(asset) {
11294
11316
  if (asset.content.status === "removed") return null;
@@ -11299,28 +11321,40 @@ var MockCalmLensApi = class {
11299
11321
  }
11300
11322
  /**
11301
11323
  * A decided image with its hash and the project's hash list matches, as the API records them
11302
- * (AssetClassification.ts, Project.ts and HashList.ts). The mock computes no PDQ hash: an
11324
+ * (AssetClassification.ts, HashMatching.ts and HashList.ts). The mock computes no PDQ hash: an
11303
11325
  * image's `content.perceptualHash` is the SHA-256 of its bytes in lowercase hex, with quality
11304
- * 100, so an entry matches an image whose bytes equal those it was taken from, at distance 0.
11305
- * Entries below quality 50 never match. Each match takes its list's action, blocking matches
11306
- * first; a block raises an allowed, limited or age-restricted decision to `blocked`, with
11307
- * `source: "hash-list"`, and a flag only records the match.
11326
+ * 100, unless `setPerceptualHash` declared one for those bytes. An entry matches a hash up to 31
11327
+ * bits away, so different images' SHA-256 stand-ins never match, and an entry taken from an
11328
+ * image matches the same bytes at distance 0. Hashes below quality 50 never match. A match takes
11329
+ * its list's action, except that a block list only flags matches more than 16 bits away;
11330
+ * blocking matches come first, then the closest. A block raises an allowed, limited or
11331
+ * age-restricted decision to `blocked`, with `source: "hash-list"`, and a flag only records the
11332
+ * match.
11308
11333
  */
11309
11334
  async withHashMatches(asset, bytes) {
11310
- const hash = [...new Uint8Array(await crypto.subtle.digest("SHA-256", bytes))].map((byte) => byte.toString(16).padStart(2, "0")).join("");
11311
- const matches = [...this.hashListEntries.values()].filter((entry) => entry.hash === hash && (entry.quality === null || entry.quality >= HASH_MATCH_MIN_QUALITY) && this.hashLists.has(entry.hashListId)).map((entry) => ({
11312
- source: "hash-list",
11313
- hashListId: entry.hashListId,
11314
- hashListEntryId: entry.id,
11315
- distance: 0,
11316
- action: this.hashLists.get(entry.hashListId).action
11317
- })).sort((a, b) => Number(b.action === "block") - Number(a.action === "block")).slice(0, MAX_RECORDED_HASH_MATCHES);
11335
+ const { hash, quality } = this.perceptualHashes.find((known) => sameBytes(known.bytes, bytes)) ?? {
11336
+ hash: await sha256Hex(bytes),
11337
+ quality: 100
11338
+ };
11339
+ const matches = [...this.hashListEntries.values()].flatMap((entry) => {
11340
+ const list = this.hashLists.get(entry.hashListId);
11341
+ const distance = hashDistance(hash, entry.hash);
11342
+ if (!list || quality < HASH_MATCH_MIN_QUALITY || entry.quality !== null && entry.quality < HASH_MATCH_MIN_QUALITY || distance > HASH_MATCH_MAX_DISTANCE) return [];
11343
+ const action = list.action === "block" && distance <= HASH_BLOCK_MAX_DISTANCE ? "block" : "flag";
11344
+ return [{
11345
+ source: "hash-list",
11346
+ hashListId: entry.hashListId,
11347
+ hashListEntryId: entry.id,
11348
+ distance,
11349
+ action
11350
+ }];
11351
+ }).sort((a, b) => Number(b.action === "block") - Number(a.action === "block") || a.distance - b.distance).slice(0, MAX_RECORDED_HASH_MATCHES);
11318
11352
  const hashed = {
11319
11353
  ...asset,
11320
11354
  content: {
11321
11355
  ...asset.content,
11322
11356
  perceptualHash: hash,
11323
- perceptualHashQuality: 100
11357
+ perceptualHashQuality: quality
11324
11358
  }
11325
11359
  };
11326
11360
  if (!matches.length) return hashed;
@@ -12243,6 +12277,25 @@ var MockCalmLensApi = class {
12243
12277
  });
12244
12278
  }
12245
12279
  };
12280
+ /** The SHA-256 of `bytes` in lowercase hex. */
12281
+ async function sha256Hex(bytes) {
12282
+ return [...new Uint8Array(await crypto.subtle.digest("SHA-256", bytes))].map((byte) => byte.toString(16).padStart(2, "0")).join("");
12283
+ }
12284
+ /** How many bits two 64-character hex hashes differ by. */
12285
+ function hashDistance(a, b) {
12286
+ let distance = 0;
12287
+ for (let i = 0; i < 64; i += 8) {
12288
+ let bits = (Number.parseInt(a.slice(i, i + 8), 16) ^ Number.parseInt(b.slice(i, i + 8), 16)) >>> 0;
12289
+ while (bits) {
12290
+ bits &= bits - 1;
12291
+ distance++;
12292
+ }
12293
+ }
12294
+ return distance;
12295
+ }
12296
+ function sameBytes(a, b) {
12297
+ return a.length === b.length && a.every((byte, i) => byte === b[i]);
12298
+ }
12246
12299
  // src/testing/MockStorage.ts
12247
12300
  var InMemoryMockImageStorage = class {
12248
12301
  constructor() {
@@ -12428,7 +12481,7 @@ var MockCalmLensServerClient = class extends CalmLensServerClient {
12428
12481
  }
12429
12482
  /**
12430
12483
  * Fetches a URL of the mock's CDN as a browser would, without the API key: a signed asset URL
12431
- * from `cdn.signAssetUrl` (with a resource appended), or a public one from `cdn.getAssetUrl`.
12484
+ * from `cdn.signAssetUrl`, or a public one from `cdn.getAssetUrl`.
12432
12485
  * The request is recorded like any other.
12433
12486
  */
12434
12487
  fetchCdn(url, init) {
@@ -12474,6 +12527,16 @@ var MockCalmLensServerClient = class extends CalmLensServerClient {
12474
12527
  this.#api.serveUrl(url, content);
12475
12528
  }
12476
12529
  /**
12530
+ * Makes the mock hash an image upload of exactly `content` (bytes, or text as UTF-8) as `hash`, a
12531
+ * PDQ hash of 64 hexadecimal characters, with `quality` (0 to 100, default 100), instead of the
12532
+ * SHA-256 of its bytes. Hash list entries match hashes up to 31 bits away, as in CalmLens, so a
12533
+ * test can make a resized or recompressed copy a near match of a listed image: declare the
12534
+ * copy's hash a few bits from the entry's.
12535
+ */
12536
+ setPerceptualHash(content, hash, quality = 100) {
12537
+ this.#api.setPerceptualHash(content, hash, quality);
12538
+ }
12539
+ /**
12477
12540
  * Changes the grants of the mock's API key, as editing the key in the portal would: later
12478
12541
  * requests, such as `cdn.serve`, use them. The key itself stays the same, so idempotency keys
12479
12542
  * it used still replay.
@@ -1,5 +1,5 @@
1
- import { r as appendAssetLocation } from "./CalmLensCdn-CL1P1v2t.js";
2
- import "./Core-WxPuobo_.js";
1
+ import { a as assetUrlOf, r as appendAssetLocation } from "./CalmLensCdn--hZgorld.js";
2
+ import "./Core-Dti4LlA-.js";
3
3
  // src/ui/viewers/PdfLoader.ts
4
4
  let loading;
5
5
  /**
@@ -81,11 +81,11 @@ const responseCode = async (response) => {
81
81
  }
82
82
  };
83
83
  /**
84
- * The CDN URLs a viewer loads: resource paths beneath the asset URL (`src`), public or signed,
85
- * with the viewer claims that say something. When a URL stops working (`refresh`), as an expired
86
- * signed one does, it asks `onExpired` once for a fresh asset URL, and again only after that one
87
- * has worked (`loaded`), so a URL that keeps failing ends in the viewer's fallback. Without
88
- * `onExpired` nothing is refreshed.
84
+ * The CDN URLs a viewer loads: resource paths beneath the asset URL of `src` (a public or signed
85
+ * asset URL, or a resource URL beneath one), with the viewer claims that say something. When a URL
86
+ * stops working (`refresh`), as an expired signed one does, it asks `onExpired` once for a fresh
87
+ * URL, and again only after that one has worked (`loaded`), so a URL that keeps failing ends in the
88
+ * viewer's fallback. Without `onExpired` nothing is refreshed.
89
89
  */
90
90
  var ViewerUrls = class {
91
91
  #options;
@@ -112,7 +112,7 @@ var ViewerUrls = class {
112
112
  /** A resource's URL beneath the asset URL. The placeholder is never age-gated, so it needs no age claim. */
113
113
  url(resource, transform) {
114
114
  const { viewerClaims } = this.#options;
115
- return appendAssetLocation(this.#src, {
115
+ return appendAssetLocation(assetUrlOf(this.#src), {
116
116
  resource,
117
117
  transform,
118
118
  viewerClaims: resource === "placeholder" && viewerClaims ? { region: viewerClaims.region } : viewerClaims
@@ -1,5 +1,5 @@
1
- import "./CalmLensTypes-87kiUg0H.js";
2
- import { K as AssetOptions, Z as AssetView, ct as DocumentViewerOptions, dt as TextViewerOptions, lt as PdfAssetOptions, pt as ViewerOptions, q as AssetSession, ut as SpreadsheetViewerOptions } from "./Core-Ccy4-_sN.js";
1
+ import "./CalmLensTypes-DjuOXp3b.js";
2
+ import { K as AssetOptions, Z as AssetView, ct as DocumentViewerOptions, dt as TextViewerOptions, lt as PdfAssetOptions, pt as ViewerOptions, q as AssetSession, ut as SpreadsheetViewerOptions } from "./Core-DaCkaDkb.js";
3
3
  import "pdfjs-dist";
4
4
  /** A viewer mounted into an element, which it owns the children of. */
5
5
  interface AssetViewer<O extends ViewerOptions = ViewerOptions> {
package/esm/ui.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- import { $ as MediaPlayback, A as CustomUploadContext, B as isFileAccepted, C as formatMessage, D as resolveMessages, E as getUploadItemOutcome, F as UploadFile, G as AssetImageSource, H as AssetDisplay, I as UploadItem, J as AssetSessionState, K as AssetOptions, L as UploadSnapshot, M as UploadClient, N as UploadController, O as CalmLensProvidedOptions, P as UploadControllerOptions, Q as INSTANT_LOAD_MS, R as UploadStage, S as formatBytes, T as getUploadItemMessage, U as AssetDocumentOptions, V as withProvidedOptions, W as AssetImageOptions, X as AssetVideoOptions, Y as AssetSpreadsheetOptions, Z as AssetView, _ as DEFAULT_MESSAGES, _t as DEFAULT_VIEWER_MESSAGES, a as ProgressFetchOptions, at as isImageReady, b as describeUploadItem, bt as resolveViewerMessages, c as ICON_ATTRIBUTES, ct as DocumentViewerOptions, d as AssetDisplayOptions, dt as TextViewerOptions, et as getAssetAspectRatio, f as AssetEventHandlers, ft as ViewerAsset, g as CalmLensMessages, gt as isSpreadsheetFormat, h as UploaderProps, ht as getAssetViewerKind, i as CALMLENS_STYLES, it as getPlayedPercent, j as CustomUploadResult, k as CalmLensUpload, l as IconName, lt as PdfAssetOptions, m as UploaderDisplayOptions, mt as ViewerTextOptions, n as CalmLensTheme, nt as getAssetViewKey, o as createProgressFetch, ot as pickAssetSource, p as AssetProps, pt as ViewerOptions, q as AssetSession, r as resolveTheme, rt as getPeakHeights, s as ICONS, st as AssetViewerKind, t as CALMLENS_THEME, tt as getAssetView, u as ASSET_FILE_ICON_SIZE, ut as SpreadsheetViewerOptions, v as UploadItemView, vt as ViewerMessages, w as getDropzoneHint, x as describeUploader, y as UploaderView, yt as formatViewerMessage, z as createUploadController } from "./Core-Ccy4-_sN.js";
2
- import { _ as spreadsheetColumnIndex, a as isMountedViewerKind, b as AssetViewer, c as AssetViewerOptionsByKind, d as createTextViewer, f as SpreadsheetCell, g as parseSpreadsheetText, h as getSpreadsheetPage, i as getMountedViewerOptions, l as VIEWER_STYLES, m as SpreadsheetSheet, n as AssetViewerMount, o as ASSET_VIEWERS, p as SpreadsheetRow, r as MountedViewerKind, s as AssetViewerName, t as MediaStreamPlayer, u as createSpreadsheetViewer, v as loadPdfJs, x as ViewerState, y as createDocumentViewer } from "./ui-sjnJhloQ.js";
1
+ import { $ as MediaPlayback, A as CustomUploadContext, B as isFileAccepted, C as formatMessage, D as resolveMessages, E as getUploadItemOutcome, F as UploadFile, G as AssetImageSource, H as AssetDisplay, I as UploadItem, J as AssetSessionState, K as AssetOptions, L as UploadSnapshot, M as UploadClient, N as UploadController, O as CalmLensProvidedOptions, P as UploadControllerOptions, Q as INSTANT_LOAD_MS, R as UploadStage, S as formatBytes, T as getUploadItemMessage, U as AssetDocumentOptions, V as withProvidedOptions, W as AssetImageOptions, X as AssetVideoOptions, Y as AssetSpreadsheetOptions, Z as AssetView, _ as DEFAULT_MESSAGES, _t as DEFAULT_VIEWER_MESSAGES, a as ProgressFetchOptions, at as isImageReady, b as describeUploadItem, bt as resolveViewerMessages, c as ICON_ATTRIBUTES, ct as DocumentViewerOptions, d as AssetDisplayOptions, dt as TextViewerOptions, et as getAssetAspectRatio, f as AssetEventHandlers, ft as ViewerAsset, g as CalmLensMessages, gt as isSpreadsheetFormat, h as UploaderProps, ht as getAssetViewerKind, i as CALMLENS_STYLES, it as getPlayedPercent, j as CustomUploadResult, k as CalmLensUpload, l as IconName, lt as PdfAssetOptions, m as UploaderDisplayOptions, mt as ViewerTextOptions, n as CalmLensTheme, nt as getAssetViewKey, o as createProgressFetch, ot as pickAssetSource, p as AssetProps, pt as ViewerOptions, q as AssetSession, r as resolveTheme, rt as getPeakHeights, s as ICONS, st as AssetViewerKind, t as CALMLENS_THEME, tt as getAssetView, u as ASSET_FILE_ICON_SIZE, ut as SpreadsheetViewerOptions, v as UploadItemView, vt as ViewerMessages, w as getDropzoneHint, x as describeUploader, y as UploaderView, yt as formatViewerMessage, z as createUploadController } from "./Core-DaCkaDkb.js";
2
+ import { _ as spreadsheetColumnIndex, a as isMountedViewerKind, b as AssetViewer, c as AssetViewerOptionsByKind, d as createTextViewer, f as SpreadsheetCell, g as parseSpreadsheetText, h as getSpreadsheetPage, i as getMountedViewerOptions, l as VIEWER_STYLES, m as SpreadsheetSheet, n as AssetViewerMount, o as ASSET_VIEWERS, p as SpreadsheetRow, r as MountedViewerKind, s as AssetViewerName, t as MediaStreamPlayer, u as createSpreadsheetViewer, v as loadPdfJs, x as ViewerState, y as createDocumentViewer } from "./ui-C_AhYdIA.js";
3
3
  export { ASSET_FILE_ICON_SIZE, ASSET_VIEWERS, type AssetDisplay, type AssetDisplayOptions, type AssetDocumentOptions, type AssetEventHandlers, type AssetImageOptions, type AssetImageSource, type AssetOptions, type AssetProps, AssetSession, type AssetSessionState, type AssetSpreadsheetOptions, type AssetVideoOptions, type AssetView, type AssetViewer, type AssetViewerKind, AssetViewerMount, AssetViewerName, AssetViewerOptionsByKind, CALMLENS_STYLES, CALMLENS_THEME, type CalmLensMessages, type CalmLensProvidedOptions, type CalmLensTheme, type CalmLensUpload, type CustomUploadContext, type CustomUploadResult, DEFAULT_MESSAGES, DEFAULT_VIEWER_MESSAGES, type DocumentViewerOptions, ICONS, ICON_ATTRIBUTES, INSTANT_LOAD_MS, type IconName, type MediaPlayback, MediaStreamPlayer, type MountedViewerKind, type PdfAssetOptions, type ProgressFetchOptions, type SpreadsheetCell, type SpreadsheetRow, type SpreadsheetSheet, type SpreadsheetViewerOptions, type TextViewerOptions, type UploadClient, UploadController, type UploadControllerOptions, type UploadFile, type UploadItem, type UploadItemView, type UploadSnapshot, type UploadStage, type UploaderDisplayOptions, type UploaderProps, type UploaderView, VIEWER_STYLES, type ViewerAsset, type ViewerMessages, type ViewerOptions, type ViewerState, type ViewerTextOptions, createDocumentViewer, createProgressFetch, createSpreadsheetViewer, createTextViewer, createUploadController, describeUploadItem, describeUploader, formatBytes, formatMessage, formatViewerMessage, getAssetAspectRatio, getAssetView, getAssetViewKey, getAssetViewerKind, getDropzoneHint, getMountedViewerOptions, getPeakHeights, getPlayedPercent, getSpreadsheetPage, getUploadItemMessage, getUploadItemOutcome, isFileAccepted, isImageReady, isMountedViewerKind, isSpreadsheetFormat, loadPdfJs, parseSpreadsheetText, pickAssetSource, resolveMessages, resolveTheme, resolveViewerMessages, spreadsheetColumnIndex, withProvidedOptions };
package/esm/ui.js CHANGED
@@ -1,4 +1,4 @@
1
- import { a as ASSET_VIEWERS, c as getSpreadsheetPage, d as createDocumentViewer, f as DEFAULT_VIEWER_MESSAGES, h as loadPdfJs, i as isMountedViewerKind, l as parseSpreadsheetText, m as resolveViewerMessages, n as AssetViewerMount, o as createSpreadsheetViewer, p as formatViewerMessage, r as getMountedViewerOptions, s as createTextViewer, t as MediaStreamPlayer, u as spreadsheetColumnIndex } from "./ui-DS85DGfi.js";
2
- import { C as pickAssetSource, D as getAssetViewerKind, E as resolveTheme, O as isSpreadsheetFormat, S as isImageReady, T as CALMLENS_THEME, _ as getAssetAspectRatio, a as describeUploadItem, b as getPeakHeights, c as formatMessage, d as getUploadItemOutcome, f as resolveMessages, g as INSTANT_LOAD_MS, h as AssetSession, i as DEFAULT_MESSAGES, l as getDropzoneHint, m as ICON_ATTRIBUTES, o as describeUploader, p as ICONS, r as ASSET_FILE_ICON_SIZE, s as formatBytes, t as CALMLENS_STYLES, u as getUploadItemMessage, v as getAssetView, w as VIEWER_STYLES, x as getPlayedPercent, y as getAssetViewKey } from "./Core-WxPuobo_.js";
3
- import { a as createProgressFetch, i as withProvidedOptions, n as createUploadController, r as isFileAccepted, t as UploadController } from "./UploadController-X2gEFMGy.js";
1
+ import { a as ASSET_VIEWERS, c as getSpreadsheetPage, d as createDocumentViewer, f as DEFAULT_VIEWER_MESSAGES, h as loadPdfJs, i as isMountedViewerKind, l as parseSpreadsheetText, m as resolveViewerMessages, n as AssetViewerMount, o as createSpreadsheetViewer, p as formatViewerMessage, r as getMountedViewerOptions, s as createTextViewer, t as MediaStreamPlayer, u as spreadsheetColumnIndex } from "./ui-B7Z6FH5F.js";
2
+ import { C as pickAssetSource, D as getAssetViewerKind, E as resolveTheme, O as isSpreadsheetFormat, S as isImageReady, T as CALMLENS_THEME, _ as getAssetAspectRatio, a as describeUploadItem, b as getPeakHeights, c as formatMessage, d as getUploadItemOutcome, f as resolveMessages, g as INSTANT_LOAD_MS, h as AssetSession, i as DEFAULT_MESSAGES, l as getDropzoneHint, m as ICON_ATTRIBUTES, o as describeUploader, p as ICONS, r as ASSET_FILE_ICON_SIZE, s as formatBytes, t as CALMLENS_STYLES, u as getUploadItemMessage, v as getAssetView, w as VIEWER_STYLES, x as getPlayedPercent, y as getAssetViewKey } from "./Core-Dti4LlA-.js";
3
+ import { a as createProgressFetch, i as withProvidedOptions, n as createUploadController, r as isFileAccepted, t as UploadController } from "./UploadController-D3um1cq9.js";
4
4
  export { ASSET_FILE_ICON_SIZE, ASSET_VIEWERS, AssetSession, AssetViewerMount, CALMLENS_STYLES, CALMLENS_THEME, DEFAULT_MESSAGES, DEFAULT_VIEWER_MESSAGES, ICONS, ICON_ATTRIBUTES, INSTANT_LOAD_MS, MediaStreamPlayer, UploadController, VIEWER_STYLES, createDocumentViewer, createProgressFetch, createSpreadsheetViewer, createTextViewer, createUploadController, describeUploadItem, describeUploader, formatBytes, formatMessage, formatViewerMessage, getAssetAspectRatio, getAssetView, getAssetViewKey, getAssetViewerKind, getDropzoneHint, getMountedViewerOptions, getPeakHeights, getPlayedPercent, getSpreadsheetPage, getUploadItemMessage, getUploadItemOutcome, isFileAccepted, isImageReady, isMountedViewerKind, isSpreadsheetFormat, loadPdfJs, parseSpreadsheetText, pickAssetSource, resolveMessages, resolveTheme, resolveViewerMessages, spreadsheetColumnIndex, withProvidedOptions };