sanity 3.94.1 → 3.94.2-next.1.a8381d7633

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 (113) hide show
  1. package/lib/_chunks-cjs/version.js +1 -1
  2. package/lib/_chunks-es/version.mjs +1 -1
  3. package/package.json +25 -25
  4. package/dist/BehaviorSubject-CU-WJrzA.mjs +0 -30
  5. package/dist/BehaviorSubject-CU-WJrzA.mjs.map +0 -1
  6. package/dist/BroadcastDisplayedDocument-BSV9T3BU.mjs +0 -20
  7. package/dist/BroadcastDisplayedDocument-BSV9T3BU.mjs.map +0 -1
  8. package/dist/DisplayedDocumentBroadcaster-DZ65n35Q.mjs +0 -62
  9. package/dist/DisplayedDocumentBroadcaster-DZ65n35Q.mjs.map +0 -1
  10. package/dist/LiveQueries-Crz53eU5.mjs +0 -407
  11. package/dist/LiveQueries-Crz53eU5.mjs.map +0 -1
  12. package/dist/Observable-CCQtH8Gg.mjs +0 -546
  13. package/dist/Observable-CCQtH8Gg.mjs.map +0 -1
  14. package/dist/PostMessageDocuments-BjgsJxz4.mjs +0 -72
  15. package/dist/PostMessageDocuments-BjgsJxz4.mjs.map +0 -1
  16. package/dist/PostMessagePerspective-pucY-E6a.mjs +0 -22
  17. package/dist/PostMessagePerspective-pucY-E6a.mjs.map +0 -1
  18. package/dist/PostMessagePreviewSnapshots-CRQgRg4_.mjs +0 -71
  19. package/dist/PostMessagePreviewSnapshots-CRQgRg4_.mjs.map +0 -1
  20. package/dist/PostMessageRefreshMutations-D944RbO3.mjs +0 -66
  21. package/dist/PostMessageRefreshMutations-D944RbO3.mjs.map +0 -1
  22. package/dist/PostMessageSchema-3eOtr1bs.mjs +0 -516
  23. package/dist/PostMessageSchema-3eOtr1bs.mjs.map +0 -1
  24. package/dist/PostMessageTelemetry-DMTQDJeN.mjs +0 -20
  25. package/dist/PostMessageTelemetry-DMTQDJeN.mjs.map +0 -1
  26. package/dist/PresentationToolGrantsCheck-B0q4AQ3b.mjs +0 -3999
  27. package/dist/PresentationToolGrantsCheck-B0q4AQ3b.mjs.map +0 -1
  28. package/dist/QRCodeSVG-hyTW2xeN.mjs +0 -648
  29. package/dist/QRCodeSVG-hyTW2xeN.mjs.map +0 -1
  30. package/dist/Refractor-Zss2QEe8.mjs +0 -2568
  31. package/dist/Refractor-Zss2QEe8.mjs.map +0 -1
  32. package/dist/SourceContext-QxJD1Wrm.mjs +0 -111
  33. package/dist/SourceContext-QxJD1Wrm.mjs.map +0 -1
  34. package/dist/StructureToolProvider-B-7cwz7l.mjs +0 -2287
  35. package/dist/StructureToolProvider-B-7cwz7l.mjs.map +0 -1
  36. package/dist/ViteDevServerStopped-CgIEqy9p.mjs +0 -57
  37. package/dist/ViteDevServerStopped-CgIEqy9p.mjs.map +0 -1
  38. package/dist/_createContext.mjs +0 -38
  39. package/dist/_createContext.mjs.map +0 -1
  40. package/dist/_singletons.mjs +0 -216
  41. package/dist/_singletons.mjs.map +0 -1
  42. package/dist/browser-B0Q9qZJS.mjs +0 -478
  43. package/dist/browser-B0Q9qZJS.mjs.map +0 -1
  44. package/dist/browser-DmX5VEcE.mjs +0 -324
  45. package/dist/browser-DmX5VEcE.mjs.map +0 -1
  46. package/dist/desk.mjs +0 -53
  47. package/dist/desk.mjs.map +0 -1
  48. package/dist/first-Cz545eV-.mjs +0 -42
  49. package/dist/first-Cz545eV-.mjs.map +0 -1
  50. package/dist/index-B2GCDfau.mjs +0 -96
  51. package/dist/index-B2GCDfau.mjs.map +0 -1
  52. package/dist/index-BRIelBPK.mjs +0 -6946
  53. package/dist/index-BRIelBPK.mjs.map +0 -1
  54. package/dist/index-BUB137yJ.mjs +0 -144
  55. package/dist/index-BUB137yJ.mjs.map +0 -1
  56. package/dist/index-C3PGPrdL.mjs +0 -1192
  57. package/dist/index-C3PGPrdL.mjs.map +0 -1
  58. package/dist/index-C9NvTy6s.mjs +0 -319
  59. package/dist/index-C9NvTy6s.mjs.map +0 -1
  60. package/dist/index-DCkQlgdi.mjs +0 -4001
  61. package/dist/index-DCkQlgdi.mjs.map +0 -1
  62. package/dist/index-DG-3plB0.mjs +0 -71
  63. package/dist/index-DG-3plB0.mjs.map +0 -1
  64. package/dist/index-RoxwhtVB.mjs +0 -5600
  65. package/dist/index-RoxwhtVB.mjs.map +0 -1
  66. package/dist/index-iMZR29eF.mjs +0 -756
  67. package/dist/index-iMZR29eF.mjs.map +0 -1
  68. package/dist/index-wVXq9rWS.mjs +0 -244
  69. package/dist/index-wVXq9rWS.mjs.map +0 -1
  70. package/dist/index.mjs +0 -137385
  71. package/dist/index.mjs.map +0 -1
  72. package/dist/lodash-Vz5dH_Dm.mjs +0 -3679
  73. package/dist/lodash-Vz5dH_Dm.mjs.map +0 -1
  74. package/dist/pane-Bm_57XKB.mjs +0 -5
  75. package/dist/pane-Bm_57XKB.mjs.map +0 -1
  76. package/dist/pane-Dopl4BjD.mjs +0 -5
  77. package/dist/pane-Dopl4BjD.mjs.map +0 -1
  78. package/dist/presentation-DsIky7Cj.mjs +0 -556
  79. package/dist/presentation-DsIky7Cj.mjs.map +0 -1
  80. package/dist/presentation.mjs +0 -10
  81. package/dist/presentation.mjs.map +0 -1
  82. package/dist/publishReplay-PuJoYJpp.mjs +0 -92
  83. package/dist/publishReplay-PuJoYJpp.mjs.map +0 -1
  84. package/dist/refractor-Bg1S3YDK.mjs +0 -26
  85. package/dist/refractor-Bg1S3YDK.mjs.map +0 -1
  86. package/dist/resources-BQsCEzu1.mjs +0 -60
  87. package/dist/resources-BQsCEzu1.mjs.map +0 -1
  88. package/dist/resources-BahMtJuO.mjs +0 -177
  89. package/dist/resources-BahMtJuO.mjs.map +0 -1
  90. package/dist/resources-CjkBN4z6.mjs +0 -126
  91. package/dist/resources-CjkBN4z6.mjs.map +0 -1
  92. package/dist/resources-Dc-6ZcPg.mjs +0 -157
  93. package/dist/resources-Dc-6ZcPg.mjs.map +0 -1
  94. package/dist/resources-DqxSuDsr.mjs +0 -37
  95. package/dist/resources-DqxSuDsr.mjs.map +0 -1
  96. package/dist/resources-_gTjFWLH.mjs +0 -517
  97. package/dist/resources-_gTjFWLH.mjs.map +0 -1
  98. package/dist/resources-kA1bao30.mjs +0 -358
  99. package/dist/resources-kA1bao30.mjs.map +0 -1
  100. package/dist/router.mjs +0 -721
  101. package/dist/router.mjs.map +0 -1
  102. package/dist/stegaEncodeSourceMap-DCG9Ba1H.mjs +0 -358
  103. package/dist/stegaEncodeSourceMap-DCG9Ba1H.mjs.map +0 -1
  104. package/dist/structure.mjs +0 -57
  105. package/dist/structure.mjs.map +0 -1
  106. package/dist/structureTool-Bth1vd8r.mjs +0 -13150
  107. package/dist/structureTool-Bth1vd8r.mjs.map +0 -1
  108. package/dist/switchMap-DHVUskpL.mjs +0 -54
  109. package/dist/switchMap-DHVUskpL.mjs.map +0 -1
  110. package/dist/v4-zH-CAum7.mjs +0 -24798
  111. package/dist/v4-zH-CAum7.mjs.map +0 -1
  112. package/dist/version-DoE_JnhG.mjs +0 -5
  113. package/dist/version-DoE_JnhG.mjs.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"LiveQueries-Crz53eU5.mjs","sources":["../../../node_modules/.pnpm/@sanity+client@7.6.0_debug@4.4.1/node_modules/@sanity/client/dist/_chunks-es/config.js","../../../node_modules/.pnpm/@sanity+client@7.6.0_debug@4.4.1/node_modules/@sanity/client/dist/csm.js","../src/presentation/loader/useLiveEvents.ts","../src/presentation/loader/utils.ts","../src/presentation/loader/useLiveQueries.ts","../src/presentation/loader/LiveQueries.tsx"],"sourcesContent":["const BASE_URL = \"https://www.sanity.io/help/\";\nfunction generateHelpUrl(slug) {\n return BASE_URL + slug;\n}\nconst VALID_ASSET_TYPES = [\"image\", \"file\"], VALID_INSERT_LOCATIONS = [\"before\", \"after\", \"replace\"], dataset = (name) => {\n if (!/^(~[a-z0-9]{1}[-\\w]{0,63}|[a-z0-9]{1}[-\\w]{0,63})$/.test(name))\n throw new Error(\n \"Datasets can only contain lowercase characters, numbers, underscores and dashes, and start with tilde, and be maximum 64 characters\"\n );\n}, projectId = (id) => {\n if (!/^[-a-z0-9]+$/i.test(id))\n throw new Error(\"`projectId` can only contain only a-z, 0-9 and dashes\");\n}, validateAssetType = (type) => {\n if (VALID_ASSET_TYPES.indexOf(type) === -1)\n throw new Error(`Invalid asset type: ${type}. Must be one of ${VALID_ASSET_TYPES.join(\", \")}`);\n}, validateObject = (op, val) => {\n if (val === null || typeof val != \"object\" || Array.isArray(val))\n throw new Error(`${op}() takes an object of properties`);\n}, validateDocumentId = (op, id) => {\n if (typeof id != \"string\" || !/^[a-z0-9_][a-z0-9_.-]{0,127}$/i.test(id) || id.includes(\"..\"))\n throw new Error(`${op}(): \"${id}\" is not a valid document ID`);\n}, requireDocumentId = (op, doc) => {\n if (!doc._id)\n throw new Error(`${op}() requires that the document contains an ID (\"_id\" property)`);\n validateDocumentId(op, doc._id);\n}, validateDocumentType = (op, type) => {\n if (typeof type != \"string\")\n throw new Error(`\\`${op}()\\`: \\`${type}\\` is not a valid document type`);\n}, requireDocumentType = (op, doc) => {\n if (!doc._type)\n throw new Error(`\\`${op}()\\` requires that the document contains a type (\\`_type\\` property)`);\n validateDocumentType(op, doc._type);\n}, validateVersionIdMatch = (builtVersionId, document) => {\n if (document._id && document._id !== builtVersionId)\n throw new Error(\n `The provided document ID (\\`${document._id}\\`) does not match the generated version ID (\\`${builtVersionId}\\`)`\n );\n}, validateInsert = (at, selector, items) => {\n const signature = \"insert(at, selector, items)\";\n if (VALID_INSERT_LOCATIONS.indexOf(at) === -1) {\n const valid = VALID_INSERT_LOCATIONS.map((loc) => `\"${loc}\"`).join(\", \");\n throw new Error(`${signature} takes an \"at\"-argument which is one of: ${valid}`);\n }\n if (typeof selector != \"string\")\n throw new Error(`${signature} takes a \"selector\"-argument which must be a string`);\n if (!Array.isArray(items))\n throw new Error(`${signature} takes an \"items\"-argument which must be an array`);\n}, hasDataset = (config) => {\n if (!config.dataset)\n throw new Error(\"`dataset` must be provided to perform queries\");\n return config.dataset || \"\";\n}, requestTag = (tag) => {\n if (typeof tag != \"string\" || !/^[a-z0-9._-]{1,75}$/i.test(tag))\n throw new Error(\n \"Tag can only contain alphanumeric characters, underscores, dashes and dots, and be between one and 75 characters long.\"\n );\n return tag;\n}, resourceConfig = (config) => {\n if (!config[\"~experimental_resource\"])\n throw new Error(\"`resource` must be provided to perform resource queries\");\n const { type, id } = config[\"~experimental_resource\"];\n switch (type) {\n case \"dataset\": {\n if (id.split(\".\").length !== 2)\n throw new Error('Dataset resource ID must be in the format \"project.dataset\"');\n return;\n }\n case \"dashboard\":\n case \"media-library\":\n case \"canvas\":\n return;\n default:\n throw new Error(`Unsupported resource type: ${type.toString()}`);\n }\n}, resourceGuard = (service, config) => {\n if (config[\"~experimental_resource\"])\n throw new Error(`\\`${service}\\` does not support resource-based operations`);\n};\nfunction once(fn) {\n let didCall = !1, returnValue;\n return (...args) => (didCall || (returnValue = fn(...args), didCall = !0), returnValue);\n}\nconst createWarningPrinter = (message) => (\n // eslint-disable-next-line no-console\n once((...args) => console.warn(message.join(\" \"), ...args))\n), printCdnAndWithCredentialsWarning = createWarningPrinter([\n \"Because you set `withCredentials` to true, we will override your `useCdn`\",\n \"setting to be false since (cookie-based) credentials are never set on the CDN\"\n]), printCdnWarning = createWarningPrinter([\n \"Since you haven't set a value for `useCdn`, we will deliver content using our\",\n \"global, edge-cached API-CDN. If you wish to have content delivered faster, set\",\n \"`useCdn: false` to use the Live API. Note: You may incur higher costs using the live API.\"\n]), printCdnPreviewDraftsWarning = createWarningPrinter([\n \"The Sanity client is configured with the `perspective` set to `drafts` or `previewDrafts`, which doesn't support the API-CDN.\",\n \"The Live API will be used instead. Set `useCdn: false` in your configuration to hide this warning.\"\n]), printPreviewDraftsDeprecationWarning = createWarningPrinter([\n \"The `previewDrafts` perspective has been renamed to `drafts` and will be removed in a future API version\"\n]), printBrowserTokenWarning = createWarningPrinter([\n \"You have configured Sanity client to use a token in the browser. This may cause unintentional security issues.\",\n `See ${generateHelpUrl(\n \"js-client-browser-token\"\n )} for more information and how to hide this warning.`\n]), printCredentialedTokenWarning = createWarningPrinter([\n \"You have configured Sanity client to use a token, but also provided `withCredentials: true`.\",\n \"This is no longer supported - only token will be used - remove `withCredentials: true`.\"\n]), printNoApiVersionSpecifiedWarning = createWarningPrinter([\n \"Using the Sanity client without specifying an API version is deprecated.\",\n `See ${generateHelpUrl(\"js-client-api-version\")}`\n]), printNoDefaultExport = createWarningPrinter([\n \"The default export of @sanity/client has been deprecated. Use the named export `createClient` instead.\"\n]), defaultCdnHost = \"apicdn.sanity.io\", defaultConfig = {\n apiHost: \"https://api.sanity.io\",\n apiVersion: \"1\",\n useProjectHostname: !0,\n stega: { enabled: !1 }\n}, LOCALHOSTS = [\"localhost\", \"127.0.0.1\", \"0.0.0.0\"], isLocal = (host) => LOCALHOSTS.indexOf(host) !== -1;\nfunction validateApiVersion(apiVersion) {\n if (apiVersion === \"1\" || apiVersion === \"X\")\n return;\n const apiDate = new Date(apiVersion);\n if (!(/^\\d{4}-\\d{2}-\\d{2}$/.test(apiVersion) && apiDate instanceof Date && apiDate.getTime() > 0))\n throw new Error(\"Invalid API version string, expected `1` or date in format `YYYY-MM-DD`\");\n}\nfunction validateApiPerspective(perspective) {\n if (Array.isArray(perspective) && perspective.length > 1 && perspective.includes(\"raw\"))\n throw new TypeError(\n 'Invalid API perspective value: \"raw\". The raw-perspective can not be combined with other perspectives'\n );\n}\nconst initConfig = (config, prevConfig) => {\n const specifiedConfig = {\n ...prevConfig,\n ...config,\n stega: {\n ...typeof prevConfig.stega == \"boolean\" ? { enabled: prevConfig.stega } : prevConfig.stega || defaultConfig.stega,\n ...typeof config.stega == \"boolean\" ? { enabled: config.stega } : config.stega || {}\n }\n };\n specifiedConfig.apiVersion || printNoApiVersionSpecifiedWarning();\n const newConfig = {\n ...defaultConfig,\n ...specifiedConfig\n }, projectBased = newConfig.useProjectHostname && !newConfig[\"~experimental_resource\"];\n if (typeof Promise > \"u\") {\n const helpUrl = generateHelpUrl(\"js-client-promise-polyfill\");\n throw new Error(`No native Promise-implementation found, polyfill needed - see ${helpUrl}`);\n }\n if (projectBased && !newConfig.projectId)\n throw new Error(\"Configuration must contain `projectId`\");\n if (newConfig[\"~experimental_resource\"] && resourceConfig(newConfig), typeof newConfig.perspective < \"u\" && validateApiPerspective(newConfig.perspective), \"encodeSourceMap\" in newConfig)\n throw new Error(\n \"It looks like you're using options meant for '@sanity/preview-kit/client'. 'encodeSourceMap' is not supported in '@sanity/client'. Did you mean 'stega.enabled'?\"\n );\n if (\"encodeSourceMapAtPath\" in newConfig)\n throw new Error(\n \"It looks like you're using options meant for '@sanity/preview-kit/client'. 'encodeSourceMapAtPath' is not supported in '@sanity/client'. Did you mean 'stega.filter'?\"\n );\n if (typeof newConfig.stega.enabled != \"boolean\")\n throw new Error(`stega.enabled must be a boolean, received ${newConfig.stega.enabled}`);\n if (newConfig.stega.enabled && newConfig.stega.studioUrl === void 0)\n throw new Error(\"stega.studioUrl must be defined when stega.enabled is true\");\n if (newConfig.stega.enabled && typeof newConfig.stega.studioUrl != \"string\" && typeof newConfig.stega.studioUrl != \"function\")\n throw new Error(\n `stega.studioUrl must be a string or a function, received ${newConfig.stega.studioUrl}`\n );\n const isBrowser = typeof window < \"u\" && window.location && window.location.hostname, isLocalhost = isBrowser && isLocal(window.location.hostname), hasToken = !!newConfig.token;\n newConfig.withCredentials && hasToken && (printCredentialedTokenWarning(), newConfig.withCredentials = !1), isBrowser && isLocalhost && hasToken && newConfig.ignoreBrowserTokenWarning !== !0 ? printBrowserTokenWarning() : typeof newConfig.useCdn > \"u\" && printCdnWarning(), projectBased && projectId(newConfig.projectId), newConfig.dataset && dataset(newConfig.dataset), \"requestTagPrefix\" in newConfig && (newConfig.requestTagPrefix = newConfig.requestTagPrefix ? requestTag(newConfig.requestTagPrefix).replace(/\\.+$/, \"\") : void 0), newConfig.apiVersion = `${newConfig.apiVersion}`.replace(/^v/, \"\"), newConfig.isDefaultApi = newConfig.apiHost === defaultConfig.apiHost, newConfig.useCdn === !0 && newConfig.withCredentials && printCdnAndWithCredentialsWarning(), newConfig.useCdn = newConfig.useCdn !== !1 && !newConfig.withCredentials, validateApiVersion(newConfig.apiVersion);\n const hostParts = newConfig.apiHost.split(\"://\", 2), protocol = hostParts[0], host = hostParts[1], cdnHost = newConfig.isDefaultApi ? defaultCdnHost : host;\n return projectBased ? (newConfig.url = `${protocol}://${newConfig.projectId}.${host}/v${newConfig.apiVersion}`, newConfig.cdnUrl = `${protocol}://${newConfig.projectId}.${cdnHost}/v${newConfig.apiVersion}`) : (newConfig.url = `${newConfig.apiHost}/v${newConfig.apiVersion}`, newConfig.cdnUrl = newConfig.url), newConfig;\n};\nexport {\n dataset,\n defaultConfig,\n hasDataset,\n initConfig,\n printCdnPreviewDraftsWarning,\n printNoDefaultExport,\n printPreviewDraftsDeprecationWarning,\n requestTag,\n requireDocumentId,\n requireDocumentType,\n resourceConfig,\n resourceGuard,\n validateApiPerspective,\n validateAssetType,\n validateDocumentId,\n validateInsert,\n validateObject,\n validateVersionIdMatch\n};\n//# sourceMappingURL=config.js.map\n","import { getVersionId, getDraftId, getPublishedId, walkMap, resolveMapping, parseJsonPath, toString, get, jsonPath, studioPathToJsonPath, resolveEditInfo, createEditUrl } from \"./_chunks-es/resolveEditInfo.js\";\nimport { DRAFTS_FOLDER, VERSION_FOLDER, getVersionFromId, isDraftId, isPublishedId, isVersionId, jsonPathToStudioPath, studioPath } from \"./_chunks-es/resolveEditInfo.js\";\nimport { validateApiPerspective } from \"./_chunks-es/config.js\";\nfunction resolvePerspectives(perspective) {\n if (validateApiPerspective(perspective), Array.isArray(perspective))\n return perspective.includes(\"published\") ? perspective : [...perspective, \"published\"];\n switch (perspective) {\n case \"previewDrafts\":\n case \"drafts\":\n return [\"drafts\", \"published\"];\n case \"published\":\n default:\n return [\"published\"];\n }\n}\nfunction createSourceDocumentResolver(getCachedDocument, _perspective) {\n const perspectives = resolvePerspectives(_perspective);\n function findDocument(sourceDocument) {\n for (const perspective of perspectives) {\n let match = null;\n if (perspective.startsWith(\"r\") && (match = getCachedDocument({\n ...sourceDocument,\n _id: getVersionId(sourceDocument._id, perspective)\n })), perspective === \"drafts\" && (match = getCachedDocument({\n ...sourceDocument,\n _id: getDraftId(sourceDocument._id)\n })), perspective === \"published\" && (match = getCachedDocument({\n ...sourceDocument,\n _id: getPublishedId(sourceDocument._id)\n })), match)\n return { ...match, _id: getPublishedId(match._id), _originalId: match._id };\n }\n return null;\n }\n return function(sourceDocument) {\n return findDocument(sourceDocument);\n };\n}\nfunction applySourceDocuments(result, resultSourceMap, getCachedDocument, updateFn, perspective) {\n if (!resultSourceMap) return result;\n const resolveDocument = createSourceDocumentResolver(getCachedDocument, perspective), cachedDocuments = resultSourceMap.documents?.map?.(resolveDocument) || [];\n return walkMap(JSON.parse(JSON.stringify(result)), (value, path) => {\n const resolveMappingResult = resolveMapping(path, resultSourceMap);\n if (!resolveMappingResult)\n return value;\n const { mapping, pathSuffix } = resolveMappingResult;\n if (mapping.type !== \"value\" || mapping.source.type !== \"documentValue\")\n return value;\n const sourceDocument = resultSourceMap.documents[mapping.source.document], sourcePath = resultSourceMap.paths[mapping.source.path];\n if (sourceDocument) {\n const parsedPath = parseJsonPath(sourcePath + pathSuffix), stringifiedPath = toString(parsedPath), cachedDocument = cachedDocuments[mapping.source.document];\n if (!cachedDocument)\n return value;\n const changedValue = cachedDocument ? get(cachedDocument, stringifiedPath, value) : value;\n return value === changedValue ? value : updateFn(changedValue, {\n cachedDocument,\n previousValue: value,\n sourceDocument,\n sourcePath: parsedPath\n });\n }\n return value;\n });\n}\nfunction resolvedKeyedSourcePath(options) {\n const { keyedResultPath, pathSuffix, sourceBasePath } = options, inferredResultPath = pathSuffix === void 0 ? [] : parseJsonPath(pathSuffix), inferredPath = keyedResultPath.slice(keyedResultPath.length - inferredResultPath.length), inferredPathSuffix = inferredPath.length ? jsonPath(inferredPath).slice(1) : \"\";\n return parseJsonPath(sourceBasePath + inferredPathSuffix);\n}\nfunction resolveEditUrl(options) {\n const { resultSourceMap, studioUrl } = options, resultPath = studioPathToJsonPath(options.resultPath), editInfo = resolveEditInfo({\n resultPath,\n resultSourceMap,\n studioUrl\n });\n if (editInfo)\n return createEditUrl(editInfo);\n}\nexport {\n DRAFTS_FOLDER,\n VERSION_FOLDER,\n applySourceDocuments,\n createEditUrl,\n getDraftId,\n getPublishedId,\n getVersionFromId,\n getVersionId,\n isDraftId,\n isPublishedId,\n isVersionId,\n jsonPath,\n jsonPathToStudioPath,\n parseJsonPath,\n resolveEditInfo,\n resolveEditUrl,\n resolveMapping,\n resolvedKeyedSourcePath,\n studioPath,\n studioPathToJsonPath,\n walkMap\n};\n//# sourceMappingURL=csm.js.map\n","import {type LiveEvent, type LiveEventMessage} from '@sanity/client'\nimport {useDeferredValue, useEffect, useReducer, useState} from 'react'\nimport {type SanityClient} from 'sanity'\n\ntype State = {\n /**\n * Growing list over live events with Sync Tags,\n * that can be used to refetch with Sanity Client, using the id as the lastLiveEventId parameter\n */\n messages: LiveEventMessage[]\n /**\n * If the connection experiences a reconnect, or a restart event is received, the counter is incremented.\n * This counter is suitable as a `key` on React Components as a way to reset its internal state and refetch.\n */\n resets: number\n}\n\nexport function reducer(state: State, event: LiveEvent): State {\n switch (event.type) {\n case 'message':\n return {\n ...state,\n messages: [...state.messages, event],\n }\n case 'reconnect':\n case 'restart':\n return {\n ...state,\n messages: [],\n resets: state.resets + 1,\n }\n case 'welcome':\n // no-op\n return state\n default:\n throw Error(\n `Unknown event: ${\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (event as any).type\n }`,\n {cause: event},\n )\n }\n}\n\nexport const initialState: State = {\n messages: [],\n resets: 0,\n}\n\nexport function useLiveEvents(client: SanityClient): State {\n const [state, dispatch] = useReducer(reducer, initialState)\n const [error, setError] = useState<unknown>(null)\n if (error !== null) {\n // Push error to nearest error boundary\n throw error\n }\n\n useEffect(() => {\n const subscription = client.live\n .events({includeDrafts: true, tag: 'presentation-loader'})\n .subscribe({\n next: dispatch,\n error: (err) =>\n setError(\n err instanceof Error\n ? err\n : new Error('Unexpected error in useLiveEvents', {cause: err}),\n ),\n })\n return () => subscription.unsubscribe()\n }, [client.live])\n\n return useDeferredValue(state)\n}\n","import {toPlainText} from '@portabletext/react'\nimport {isPortableTextBlock} from '@portabletext/toolkit'\nimport {type ClientPerspective, type QueryParams} from '@sanity/client'\nimport {type ApplySourceDocumentsUpdateFunction} from '@sanity/client/csm'\nimport {type FIXME} from 'sanity'\n\n/**\n * Used by `applySourceDocuments`\n * @internal\n */\nexport const mapChangedValue: ApplySourceDocumentsUpdateFunction = (\n changedValue: FIXME,\n {previousValue},\n) => {\n if (typeof previousValue === 'string') {\n if (typeof changedValue === 'number') {\n // If the string() function was used in the query, we need to convert the source value to a string as well\n return `${changedValue}`\n }\n // If it's an array in the source, but a string in the query response, it could be pt::text\n if (Array.isArray(changedValue)) {\n if (changedValue.length === 0) {\n // If it's empty assume it's PT and return an empty string\n return ''\n }\n // If the array contains any valid block type, assume the GROQ initially used pt::text on it and do the same conversion\n if (changedValue.some((node) => typeof node === 'object' && isPortableTextBlock(node))) {\n return toPlainText(changedValue)\n }\n }\n }\n\n return changedValue\n}\n\n/**\n * @internal\n */\nexport type QueryCacheKey = `${string}:${string}:${string}`\n/**\n * @internal\n */\nexport function getQueryCacheKey(\n perspective: ClientPerspective,\n query: string,\n params: QueryParams,\n): QueryCacheKey {\n return `${perspective}:${query}:${JSON.stringify(params)}`\n}\n","import {type ClientPerspective} from '@sanity/client'\nimport isEqual from 'fast-deep-equal'\nimport {useDeferredValue, useEffect, useReducer} from 'react'\nimport {type QueryParams} from 'sanity'\n\nimport {LOADER_QUERY_GC_INTERVAL} from '../constants'\nimport {getQueryCacheKey, type QueryCacheKey} from './utils'\n\ntype LiveQueriesState = Map<\n QueryCacheKey,\n {\n query: string\n params: QueryParams\n perspective: ClientPerspective\n }\n>\n\ntype State = {\n queries: LiveQueriesState\n heartbeats: Map<\n QueryCacheKey,\n {\n receivedAt: number\n /**\n * If false it means the query can't safely be garbage collected,\n * as older versions of \\@sanity/core-loader doesn't fire listen events\n * on an interval.\n */\n heartbeat: number | false\n }\n >\n}\n\ntype QueryListenAction = {\n type: 'query-listen'\n payload: {\n perspective: ClientPerspective\n query: string\n params: QueryParams\n heartbeat: number | false\n }\n}\ntype GarbageCollectAction = {type: 'gc'}\ntype Action = QueryListenAction | GarbageCollectAction\n\nfunction gc(state: State): State {\n if (state.queries.size < 1) {\n return state\n }\n\n const now = Date.now()\n const hasAnyExpired = Array.from(state.heartbeats.values()).some(\n (entry) => entry.heartbeat !== false && now > entry.receivedAt + entry.heartbeat,\n )\n if (!hasAnyExpired) {\n return state\n }\n const nextHeartbeats = new Map()\n const nextQueries = new Map()\n for (const [key, entry] of state.heartbeats.entries()) {\n if (entry.heartbeat !== false && now > entry.receivedAt + entry.heartbeat) {\n continue\n }\n nextHeartbeats.set(key, entry)\n nextQueries.set(key, state.queries.get(key))\n }\n\n return {...state, queries: nextQueries, heartbeats: nextHeartbeats}\n}\nfunction queryListen(state: State, {payload}: QueryListenAction): State {\n const key = getQueryCacheKey(payload.perspective, payload.query, payload.params)\n const data = {query: payload.query, params: payload.params, perspective: payload.perspective}\n\n const nextHeartbeats = new Map(state.heartbeats)\n nextHeartbeats.set(key, {\n receivedAt: Date.now(),\n heartbeat: payload.heartbeat,\n })\n\n let nextQueries = state.queries\n /**\n * The data comes from a postMessage event, which uses the structured clone algorithm to serialize state (https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage#message).\n * This impacts `params`, which is an object, as it will be a new object every time even if the sender is sending the same object instance on their end.\n * It also impacts `perspective`, as it's no longer just a string, but can also be an array of strings.\n * Both cases are handled by fast-deep-equal, which is used to compare the data before deciding wether the state should be updated.\n */\n if (!state.queries.has(key) || !isEqual(state.queries.get(key), data)) {\n nextQueries = new Map(state.queries)\n nextQueries.set(key, data)\n }\n\n return {heartbeats: nextHeartbeats, queries: nextQueries}\n}\n\nexport function reducer(state: State, action: Action): State {\n switch (action.type) {\n case 'query-listen':\n return queryListen(state, action)\n case 'gc':\n return gc(state)\n default:\n throw Error(\n `Unknown action: ${\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (action as any).type\n }`,\n {cause: action},\n )\n }\n}\n\nexport const initialState: State = {\n queries: new Map(),\n heartbeats: new Map(),\n}\n\nexport function useLiveQueries(): [LiveQueriesState, React.ActionDispatch<[action: Action]>] {\n const [state, dispatch] = useReducer(reducer, initialState)\n\n useEffect(() => {\n const interval = setInterval(() => dispatch({type: 'gc'}), LOADER_QUERY_GC_INTERVAL)\n return () => clearInterval(interval)\n }, [])\n\n const queries = useDeferredValue(state.queries)\n return [queries, dispatch]\n}\n","import {\n type ClientPerspective,\n type ContentSourceMap,\n type LiveEventMessage,\n type QueryParams,\n type SyncTag,\n} from '@sanity/client'\nimport {applySourceDocuments, getPublishedId} from '@sanity/client/csm'\nimport {\n type ChannelInstance,\n type Controller,\n createConnectionMachine,\n type StatusEvent,\n} from '@sanity/comlink'\nimport {\n createCompatibilityActors,\n type LoaderControllerMsg,\n type LoaderNodeMsg,\n} from '@sanity/presentation-comlink'\nimport isEqual from 'fast-deep-equal'\nimport {memo, startTransition, useDeferredValue, useEffect, useMemo, useState} from 'react'\nimport {\n isReleasePerspective,\n RELEASES_STUDIO_CLIENT_OPTIONS,\n type SanityClient,\n type SanityDocument,\n useClient,\n useDataset,\n useProjectId,\n} from 'sanity'\nimport {useEffectEvent} from 'use-effect-event'\n\nimport {API_VERSION, MIN_LOADER_QUERY_LISTEN_HEARTBEAT_INTERVAL} from '../constants'\nimport {type LoaderConnection, type PresentationPerspective} from '../types'\nimport {type DocumentOnPage} from '../useDocumentsOnPage'\nimport {useLiveEvents} from './useLiveEvents'\nimport {useLiveQueries} from './useLiveQueries'\nimport {mapChangedValue} from './utils'\n\nexport interface LiveQueriesProps {\n liveDocument: Partial<SanityDocument> | null | undefined\n controller: Controller | undefined\n perspective: ClientPerspective\n onLoadersConnection: (event: StatusEvent) => void\n onDocumentsOnPage: (\n key: string,\n perspective: PresentationPerspective,\n state: DocumentOnPage[],\n ) => void\n}\n\nexport default function LiveQueries(props: LiveQueriesProps): React.JSX.Element {\n const {controller, perspective: activePerspective, onLoadersConnection, onDocumentsOnPage} = props\n\n const [comlink, setComlink] = useState<ChannelInstance<LoaderControllerMsg, LoaderNodeMsg>>()\n const [liveQueries, liveQueriesDispatch] = useLiveQueries()\n\n const projectId = useProjectId()\n const dataset = useDataset()\n\n useEffect((): (() => void) => {\n if (controller) {\n const nextComlink = controller.createChannel<LoaderControllerMsg, LoaderNodeMsg>(\n {\n name: 'presentation',\n connectTo: 'loaders',\n heartbeat: true,\n },\n createConnectionMachine<LoaderControllerMsg, LoaderNodeMsg>().provide({\n actors: createCompatibilityActors<LoaderControllerMsg>(),\n }),\n )\n setComlink(nextComlink)\n\n nextComlink.onStatus(onLoadersConnection)\n\n nextComlink.on('loader/documents', (data) => {\n if (data.projectId === projectId && data.dataset === dataset) {\n onDocumentsOnPage(\n 'loaders',\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n data.perspective as unknown as any,\n data.documents,\n )\n }\n })\n\n nextComlink.on('loader/query-listen', (data) => {\n if (data.projectId === projectId && data.dataset === dataset) {\n if (\n typeof data.heartbeat === 'number' &&\n data.heartbeat < MIN_LOADER_QUERY_LISTEN_HEARTBEAT_INTERVAL\n ) {\n throw new Error(\n `Loader query listen heartbeat interval must be at least ${MIN_LOADER_QUERY_LISTEN_HEARTBEAT_INTERVAL}ms`,\n )\n }\n liveQueriesDispatch({\n type: 'query-listen',\n payload: {\n perspective: data.perspective,\n query: data.query,\n params: data.params,\n heartbeat: data.heartbeat ?? false,\n },\n })\n }\n })\n\n return nextComlink.start()\n }\n return () => undefined\n }, [controller, dataset, liveQueriesDispatch, onDocumentsOnPage, onLoadersConnection, projectId])\n\n const studioClient = useClient(\n isReleasePerspective(activePerspective)\n ? RELEASES_STUDIO_CLIENT_OPTIONS\n : {apiVersion: API_VERSION},\n )\n const client = useMemo(\n () =>\n studioClient.withConfig({\n resultSourceMap: 'withKeyArraySelector',\n }),\n [studioClient],\n )\n useEffect(() => {\n if (comlink) {\n comlink.post('loader/perspective', {\n projectId,\n dataset,\n perspective: activePerspective,\n })\n }\n }, [comlink, activePerspective, projectId, dataset])\n\n /**\n * Defer the liveDocument to avoid unnecessary rerenders on rapid edits\n */\n const liveDocument = useDeferredValue(props.liveDocument)\n\n const liveEvents = useLiveEvents(client)\n\n return (\n <>\n {[...liveQueries.entries()].map(([key, {query, params, perspective}]) => (\n <QuerySubscription\n key={`${liveEvents.resets}:${key}`}\n projectId={projectId}\n dataset={dataset}\n perspective={perspective}\n query={query}\n params={params}\n comlink={comlink}\n client={client}\n liveDocument={liveDocument}\n liveEventsMessages={liveEvents.messages}\n />\n ))}\n </>\n )\n}\n\ninterface SharedProps {\n /**\n * The Sanity client to use for fetching data and listening to mutations.\n */\n client: SanityClient\n}\n\ninterface QuerySubscriptionProps\n extends Pick<UseQuerySubscriptionProps, 'client' | 'liveDocument' | 'liveEventsMessages'> {\n projectId: string\n dataset: string\n perspective: ClientPerspective\n query: string\n params: QueryParams\n comlink: LoaderConnection | undefined\n}\nfunction QuerySubscriptionComponent(props: QuerySubscriptionProps) {\n const {\n projectId,\n dataset,\n perspective,\n query,\n client,\n liveDocument,\n params,\n comlink,\n liveEventsMessages,\n } = props\n\n const {\n result,\n resultSourceMap,\n syncTags: tags,\n } = useQuerySubscription({\n client,\n liveDocument,\n params,\n perspective,\n query,\n liveEventsMessages,\n }) || {}\n\n /* eslint-disable @typescript-eslint/no-shadow,max-params */\n const handleQueryChange = useEffectEvent(\n (\n comlink: LoaderConnection | undefined,\n perspective: ClientPerspective,\n query: string,\n params: QueryParams,\n result: unknown,\n resultSourceMap: ContentSourceMap | undefined,\n tags: `s1:${string}`[] | undefined,\n ) => {\n comlink?.post('loader/query-change', {\n projectId,\n dataset,\n perspective,\n query,\n params,\n result,\n resultSourceMap,\n tags,\n })\n },\n )\n /* eslint-enable @typescript-eslint/no-shadow,max-params */\n\n useEffect(() => {\n if (resultSourceMap) {\n handleQueryChange(comlink, perspective, query, params, result, resultSourceMap, tags)\n }\n return undefined\n }, [comlink, params, perspective, query, result, resultSourceMap, tags])\n\n return null\n}\nconst QuerySubscription = memo(QuerySubscriptionComponent)\nQuerySubscription.displayName = 'Memo(QuerySubscription)'\n\ninterface UseQuerySubscriptionProps extends Required<Pick<SharedProps, 'client'>> {\n liveDocument: Partial<SanityDocument> | null | undefined\n query: string\n params: QueryParams\n perspective: ClientPerspective\n liveEventsMessages: LiveEventMessage[]\n}\nfunction useQuerySubscription(props: UseQuerySubscriptionProps) {\n const {liveDocument, client, query, params, perspective, liveEventsMessages} = props\n const [result, setResult] = useState<unknown>(null)\n const [resultSourceMap, setResultSourceMap] = useState<ContentSourceMap | null | undefined>(null)\n const [syncTags, setSyncTags] = useState<SyncTag[] | undefined>(undefined)\n const [skipEventIds] = useState(() => new Set(liveEventsMessages.map((msg) => msg.id)))\n const recentLiveEvents = liveEventsMessages.filter((msg) => !skipEventIds.has(msg.id))\n const lastLiveEvent = recentLiveEvents.findLast((msg) =>\n msg.tags.some((tag) => syncTags?.includes(tag)),\n )\n const lastLiveEventId = lastLiveEvent?.id\n\n // Make sure any async errors bubble up to the nearest error boundary\n const [error, setError] = useState<unknown>(null)\n if (error) throw error\n\n /* eslint-disable max-nested-callbacks */\n useEffect(() => {\n const controller = new AbortController()\n\n client\n .fetch(query, params, {\n lastLiveEventId,\n tag: 'presentation-loader',\n signal: controller.signal,\n perspective,\n filterResponse: false,\n returnQuery: false,\n })\n .then((response) => {\n startTransition(() => {\n // eslint-disable-next-line max-nested-callbacks\n setResult((prev: unknown) => (isEqual(prev, response.result) ? prev : response.result))\n setResultSourceMap((prev) =>\n isEqual(prev, response.resultSourceMap) ? prev : response.resultSourceMap,\n )\n setSyncTags((prev) => (isEqual(prev, response.syncTags) ? prev : response.syncTags))\n })\n })\n .catch((err) => {\n if (typeof err !== 'object' || err?.name !== 'AbortError') {\n setError(err)\n }\n })\n\n return () => {\n controller.abort()\n }\n }, [client, lastLiveEventId, params, perspective, query])\n /* eslint-enable max-nested-callbacks */\n\n return useMemo(() => {\n if (liveDocument && resultSourceMap) {\n return {\n result: turboChargeResultIfSourceMap(liveDocument, result, perspective, resultSourceMap),\n resultSourceMap,\n syncTags,\n }\n }\n return {result, resultSourceMap, syncTags}\n }, [liveDocument, perspective, result, resultSourceMap, syncTags])\n}\n\nexport function turboChargeResultIfSourceMap<T = unknown>(\n liveDocument: Partial<SanityDocument> | null | undefined,\n result: T,\n perspective: ClientPerspective,\n resultSourceMap?: ContentSourceMap,\n): T {\n if (perspective === 'raw') {\n throw new Error('turboChargeResultIfSourceMap does not support raw perspective')\n }\n return applySourceDocuments(\n result,\n resultSourceMap,\n (sourceDocument) => {\n // If there's a displayed document, always prefer it\n if (\n // If _projectId is set, it's a cross dataset reference and we should skip it\n !sourceDocument._projectId &&\n liveDocument?._id &&\n getPublishedId(liveDocument._id) === getPublishedId(sourceDocument._id)\n ) {\n if (typeof liveDocument._id === 'string' && typeof sourceDocument._type === 'string') {\n return liveDocument as unknown as Required<Pick<SanityDocument, '_id' | '_type'>>\n }\n return {\n ...liveDocument,\n _id: liveDocument._id || sourceDocument._id,\n _type: liveDocument._type || sourceDocument._type,\n }\n }\n return null\n },\n mapChangedValue,\n perspective,\n )\n}\n"],"names":["validateApiPerspective","perspective","resolvePerspectives","createSourceDocumentResolver","getCachedDocument","_perspective","perspectives","findDocument","sourceDocument","match","getVersionId","getDraftId","getPublishedId","applySourceDocuments","result","resultSourceMap","updateFn","resolveDocument","cachedDocuments","_b","_a","walkMap","value","path","resolveMappingResult","resolveMapping","mapping","pathSuffix","sourcePath","parsedPath","parseJsonPath","stringifiedPath","toString","cachedDocument","changedValue","get","reducer","state","event","type","messages","resets","Error","cause","initialState","useLiveEvents","client","$","_c","dispatch","useReducer","error","setError","useState","t0","t1","live","subscription","events","includeDrafts","tag","subscribe","next","err","unsubscribe","useEffect","useDeferredValue","mapChangedValue","previousValue","Array","isArray","length","some","node","isPortableTextBlock","toPlainText","getQueryCacheKey","query","params","JSON","stringify","gc","queries","size","now","Date","from","heartbeats","values","entry","heartbeat","receivedAt","nextHeartbeats","Map","nextQueries","key","entries","set","queryListen","payload","data","has","isEqual","action","useLiveQueries","Symbol","for","interval","setInterval","LOADER_QUERY_GC_INTERVAL","clearInterval","t2","LiveQueries","props","controller","activePerspective","onLoadersConnection","onDocumentsOnPage","comlink","setComlink","liveQueries","liveQueriesDispatch","projectId","useProjectId","dataset","useDataset","nextComlink","createChannel","name","connectTo","createConnectionMachine","provide","actors","createCompatibilityActors","onStatus","on","documents","data_0","MIN_LOADER_QUERY_LISTEN_HEARTBEAT_INTERVAL","start","_temp","isReleasePerspective","RELEASES_STUDIO_CLIENT_OPTIONS","apiVersion","API_VERSION","studioClient","useClient","t3","t4","withConfig","t5","t6","post","liveDocument","liveEvents","t7","t8","map","t9","t10","QuerySubscription","QuerySubscriptionComponent","liveEventsMessages","syncTags","tags","useQuerySubscription","comlink_0","perspective_0","query_0","params_0","result_0","resultSourceMap_0","tags_0","handleQueryChange","useEffectEvent","memo","displayName","setResult","setResultSourceMap","setSyncTags","undefined","Set","_temp2","skipEventIds","msg_0","msg","id","recentLiveEvents","filter","msg_1","includes","findLast","lastLiveEvent","lastLiveEventId","AbortController","fetch","signal","filterResponse","returnQuery","then","response","startTransition","prev","prev_0","prev_1","catch","abort","bb0","turboChargeResultIfSourceMap","_projectId","_id","_type"],"mappings":";;;;;;;;;;;AA2HA,SAASA,GAAuBC,GAAa;AAC3C,MAAI,MAAM,QAAQA,CAAW,KAAKA,EAAY,SAAS,KAAKA,EAAY,SAAS,KAAK;AACpF,UAAM,IAAI;AAAA,MACR;AAAA,IACD;AACL;AC7HA,SAASC,GAAoBD,GAAa;AACxC,MAAID,GAAuBC,CAAW,GAAG,MAAM,QAAQA,CAAW;AAChE,WAAOA,EAAY,SAAS,W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Ab,GACAc,GACG;AACH,MAAId,MAAgB;AACZ,UAAA,IAAIyC,MAAM,+DAA+D;AAE1E7B,SAAAA,GACLC,GACAC,GACCP,CAAmBA;AAAA;AAAA,IAIhB,CAACA,EAAeyM,eAChBxD,KAAAA,QAAAA,EAAcyD,QACdtM,EAAe6I,EAAayD,GAAG,MAAMtM,EAAeJ,EAAe0M,GAAG,IAElE,OAAOzD,EAAayD,OAAQ,YAAY,OAAO1M,EAAe2M,SAAU,WACnE1D,IAEF;AAAA,MACL,GAAGA;AAAAA,MACHyD,KAAKzD,EAAayD,OAAO1M,EAAe0M;AAAAA,MACxCC,OAAO1D,EAAa0D,SAAS3M,EAAe2M;AAAAA,IAC9C,IAEK;AAAA,KAEThJ,IACAlE,CACF;AACF;","x_google_ignoreList":[0,1]}
@@ -1,546 +0,0 @@
1
- var w = function(r, e) {
2
- return w = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t, i) {
3
- t.__proto__ = i;
4
- } || function(t, i) {
5
- for (var o in i) Object.prototype.hasOwnProperty.call(i, o) && (t[o] = i[o]);
6
- }, w(r, e);
7
- };
8
- function k(r, e) {
9
- if (typeof e != "function" && e !== null)
10
- throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
11
- w(r, e);
12
- function t() {
13
- this.constructor = r;
14
- }
15
- r.prototype = e === null ? Object.create(e) : (t.prototype = e.prototype, new t());
16
- }
17
- var P = function() {
18
- return P = Object.assign || function(e) {
19
- for (var t, i = 1, o = arguments.length; i < o; i++) {
20
- t = arguments[i];
21
- for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]);
22
- }
23
- return e;
24
- }, P.apply(this, arguments);
25
- };
26
- function X(r, e, t, i) {
27
- function o(n) {
28
- return n instanceof t ? n : new t(function(u) {
29
- u(n);
30
- });
31
- }
32
- return new (t || (t = Promise))(function(n, u) {
33
- function a(l) {
34
- try {
35
- s(i.next(l));
36
- } catch (y) {
37
- u(y);
38
- }
39
- }
40
- function f(l) {
41
- try {
42
- s(i.throw(l));
43
- } catch (y) {
44
- u(y);
45
- }
46
- }
47
- function s(l) {
48
- l.done ? n(l.value) : o(l.value).then(a, f);
49
- }
50
- s((i = i.apply(r, e || [])).next());
51
- });
52
- }
53
- function Z(r, e) {
54
- var t = { label: 0, sent: function() {
55
- if (n[0] & 1) throw n[1];
56
- return n[1];
57
- }, trys: [], ops: [] }, i, o, n, u = Object.create((typeof Iterator == "function" ? Iterator : Object).prototype);
58
- return u.next = a(0), u.throw = a(1), u.return = a(2), typeof Symbol == "function" && (u[Symbol.iterator] = function() {
59
- return this;
60
- }), u;
61
- function a(s) {
62
- return function(l) {
63
- return f([s, l]);
64
- };
65
- }
66
- function f(s) {
67
- if (i) throw new TypeError("Generator is already executing.");
68
- for (; u && (u = 0, s[0] && (t = 0)), t; ) try {
69
- if (i = 1, o && (n = s[0] & 2 ? o.return : s[0] ? o.throw || ((n = o.return) && n.call(o), 0) : o.next) && !(n = n.call(o, s[1])).done) return n;
70
- switch (o = 0, n && (s = [s[0] & 2, n.value]), s[0]) {
71
- case 0:
72
- case 1:
73
- n = s;
74
- break;
75
- case 4:
76
- return t.label++, { value: s[1], done: !1 };
77
- case 5:
78
- t.label++, o = s[1], s = [0];
79
- continue;
80
- case 7:
81
- s = t.ops.pop(), t.trys.pop();
82
- continue;
83
- default:
84
- if (n = t.trys, !(n = n.length > 0 && n[n.length - 1]) && (s[0] === 6 || s[0] === 2)) {
85
- t = 0;
86
- continue;
87
- }
88
- if (s[0] === 3 && (!n || s[1] > n[0] && s[1] < n[3])) {
89
- t.label = s[1];
90
- break;
91
- }
92
- if (s[0] === 6 && t.label < n[1]) {
93
- t.label = n[1], n = s;
94
- break;
95
- }
96
- if (n && t.label < n[2]) {
97
- t.label = n[2], t.ops.push(s);
98
- break;
99
- }
100
- n[2] && t.ops.pop(), t.trys.pop();
101
- continue;
102
- }
103
- s = e.call(r, t);
104
- } catch (l) {
105
- s = [6, l], o = 0;
106
- } finally {
107
- i = n = 0;
108
- }
109
- if (s[0] & 5) throw s[1];
110
- return { value: s[0] ? s[1] : void 0, done: !0 };
111
- }
112
- }
113
- function m(r) {
114
- var e = typeof Symbol == "function" && Symbol.iterator, t = e && r[e], i = 0;
115
- if (t) return t.call(r);
116
- if (r && typeof r.length == "number") return {
117
- next: function() {
118
- return r && i >= r.length && (r = void 0), { value: r && r[i++], done: !r };
119
- }
120
- };
121
- throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.");
122
- }
123
- function g(r, e) {
124
- var t = typeof Symbol == "function" && r[Symbol.iterator];
125
- if (!t) return r;
126
- var i = t.call(r), o, n = [], u;
127
- try {
128
- for (; (e === void 0 || e-- > 0) && !(o = i.next()).done; ) n.push(o.value);
129
- } catch (a) {
130
- u = { error: a };
131
- } finally {
132
- try {
133
- o && !o.done && (t = i.return) && t.call(i);
134
- } finally {
135
- if (u) throw u.error;
136
- }
137
- }
138
- return n;
139
- }
140
- function _(r, e, t) {
141
- if (t || arguments.length === 2) for (var i = 0, o = e.length, n; i < o; i++)
142
- (n || !(i in e)) && (n || (n = Array.prototype.slice.call(e, 0, i)), n[i] = e[i]);
143
- return r.concat(n || Array.prototype.slice.call(e));
144
- }
145
- function x(r) {
146
- return this instanceof x ? (this.v = r, this) : new x(r);
147
- }
148
- function $(r, e, t) {
149
- if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
150
- var i = t.apply(r, e || []), o, n = [];
151
- return o = Object.create((typeof AsyncIterator == "function" ? AsyncIterator : Object).prototype), a("next"), a("throw"), a("return", u), o[Symbol.asyncIterator] = function() {
152
- return this;
153
- }, o;
154
- function u(c) {
155
- return function(p) {
156
- return Promise.resolve(p).then(c, y);
157
- };
158
- }
159
- function a(c, p) {
160
- i[c] && (o[c] = function(h) {
161
- return new Promise(function(Y, F) {
162
- n.push([c, h, Y, F]) > 1 || f(c, h);
163
- });
164
- }, p && (o[c] = p(o[c])));
165
- }
166
- function f(c, p) {
167
- try {
168
- s(i[c](p));
169
- } catch (h) {
170
- v(n[0][3], h);
171
- }
172
- }
173
- function s(c) {
174
- c.value instanceof x ? Promise.resolve(c.value.v).then(l, y) : v(n[0][2], c);
175
- }
176
- function l(c) {
177
- f("next", c);
178
- }
179
- function y(c) {
180
- f("throw", c);
181
- }
182
- function v(c, p) {
183
- c(p), n.shift(), n.length && f(n[0][0], n[0][1]);
184
- }
185
- }
186
- function z(r) {
187
- if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
188
- var e = r[Symbol.asyncIterator], t;
189
- return e ? e.call(r) : (r = typeof m == "function" ? m(r) : r[Symbol.iterator](), t = {}, i("next"), i("throw"), i("return"), t[Symbol.asyncIterator] = function() {
190
- return this;
191
- }, t);
192
- function i(n) {
193
- t[n] = r[n] && function(u) {
194
- return new Promise(function(a, f) {
195
- u = r[n](u), o(a, f, u.done, u.value);
196
- });
197
- };
198
- }
199
- function o(n, u, a, f) {
200
- Promise.resolve(f).then(function(s) {
201
- n({ value: s, done: a });
202
- }, u);
203
- }
204
- }
205
- function b(r) {
206
- return typeof r == "function";
207
- }
208
- function q(r) {
209
- var e = function(i) {
210
- Error.call(i), i.stack = new Error().stack;
211
- }, t = r(e);
212
- return t.prototype = Object.create(Error.prototype), t.prototype.constructor = t, t;
213
- }
214
- var S = q(function(r) {
215
- return function(t) {
216
- r(this), this.message = t ? t.length + ` errors occurred during unsubscription:
217
- ` + t.map(function(i, o) {
218
- return o + 1 + ") " + i.toString();
219
- }).join(`
220
- `) : "", this.name = "UnsubscriptionError", this.errors = t;
221
- };
222
- });
223
- function T(r, e) {
224
- if (r) {
225
- var t = r.indexOf(e);
226
- 0 <= t && r.splice(t, 1);
227
- }
228
- }
229
- var E = function() {
230
- function r(e) {
231
- this.initialTeardown = e, this.closed = !1, this._parentage = null, this._finalizers = null;
232
- }
233
- return r.prototype.unsubscribe = function() {
234
- var e, t, i, o, n;
235
- if (!this.closed) {
236
- this.closed = !0;
237
- var u = this._parentage;
238
- if (u)
239
- if (this._parentage = null, Array.isArray(u))
240
- try {
241
- for (var a = m(u), f = a.next(); !f.done; f = a.next()) {
242
- var s = f.value;
243
- s.remove(this);
244
- }
245
- } catch (h) {
246
- e = { error: h };
247
- } finally {
248
- try {
249
- f && !f.done && (t = a.return) && t.call(a);
250
- } finally {
251
- if (e) throw e.error;
252
- }
253
- }
254
- else
255
- u.remove(this);
256
- var l = this.initialTeardown;
257
- if (b(l))
258
- try {
259
- l();
260
- } catch (h) {
261
- n = h instanceof S ? h.errors : [h];
262
- }
263
- var y = this._finalizers;
264
- if (y) {
265
- this._finalizers = null;
266
- try {
267
- for (var v = m(y), c = v.next(); !c.done; c = v.next()) {
268
- var p = c.value;
269
- try {
270
- A(p);
271
- } catch (h) {
272
- n = n ?? [], h instanceof S ? n = _(_([], g(n)), g(h.errors)) : n.push(h);
273
- }
274
- }
275
- } catch (h) {
276
- i = { error: h };
277
- } finally {
278
- try {
279
- c && !c.done && (o = v.return) && o.call(v);
280
- } finally {
281
- if (i) throw i.error;
282
- }
283
- }
284
- }
285
- if (n)
286
- throw new S(n);
287
- }
288
- }, r.prototype.add = function(e) {
289
- var t;
290
- if (e && e !== this)
291
- if (this.closed)
292
- A(e);
293
- else {
294
- if (e instanceof r) {
295
- if (e.closed || e._hasParent(this))
296
- return;
297
- e._addParent(this);
298
- }
299
- (this._finalizers = (t = this._finalizers) !== null && t !== void 0 ? t : []).push(e);
300
- }
301
- }, r.prototype._hasParent = function(e) {
302
- var t = this._parentage;
303
- return t === e || Array.isArray(t) && t.includes(e);
304
- }, r.prototype._addParent = function(e) {
305
- var t = this._parentage;
306
- this._parentage = Array.isArray(t) ? (t.push(e), t) : t ? [t, e] : e;
307
- }, r.prototype._removeParent = function(e) {
308
- var t = this._parentage;
309
- t === e ? this._parentage = null : Array.isArray(t) && T(t, e);
310
- }, r.prototype.remove = function(e) {
311
- var t = this._finalizers;
312
- t && T(t, e), e instanceof r && e._removeParent(this);
313
- }, r.EMPTY = function() {
314
- var e = new r();
315
- return e.closed = !0, e;
316
- }(), r;
317
- }(), N = E.EMPTY;
318
- function U(r) {
319
- return r instanceof E || r && "closed" in r && b(r.remove) && b(r.add) && b(r.unsubscribe);
320
- }
321
- function A(r) {
322
- b(r) ? r() : r.unsubscribe();
323
- }
324
- var B = {
325
- Promise: void 0
326
- }, G = {
327
- setTimeout: function(r, e) {
328
- for (var t = [], i = 2; i < arguments.length; i++)
329
- t[i - 2] = arguments[i];
330
- return setTimeout.apply(void 0, _([r, e], g(t)));
331
- },
332
- clearTimeout: function(r) {
333
- return clearTimeout(r);
334
- },
335
- delegate: void 0
336
- };
337
- function V(r) {
338
- G.setTimeout(function() {
339
- throw r;
340
- });
341
- }
342
- function I() {
343
- }
344
- function C(r) {
345
- r();
346
- }
347
- var R = function(r) {
348
- k(e, r);
349
- function e(t) {
350
- var i = r.call(this) || this;
351
- return i.isStopped = !1, t ? (i.destination = t, U(t) && t.add(i)) : i.destination = J, i;
352
- }
353
- return e.create = function(t, i, o) {
354
- return new O(t, i, o);
355
- }, e.prototype.next = function(t) {
356
- this.isStopped || this._next(t);
357
- }, e.prototype.error = function(t) {
358
- this.isStopped || (this.isStopped = !0, this._error(t));
359
- }, e.prototype.complete = function() {
360
- this.isStopped || (this.isStopped = !0, this._complete());
361
- }, e.prototype.unsubscribe = function() {
362
- this.closed || (this.isStopped = !0, r.prototype.unsubscribe.call(this), this.destination = null);
363
- }, e.prototype._next = function(t) {
364
- this.destination.next(t);
365
- }, e.prototype._error = function(t) {
366
- try {
367
- this.destination.error(t);
368
- } finally {
369
- this.unsubscribe();
370
- }
371
- }, e.prototype._complete = function() {
372
- try {
373
- this.destination.complete();
374
- } finally {
375
- this.unsubscribe();
376
- }
377
- }, e;
378
- }(E), H = function() {
379
- function r(e) {
380
- this.partialObserver = e;
381
- }
382
- return r.prototype.next = function(e) {
383
- var t = this.partialObserver;
384
- if (t.next)
385
- try {
386
- t.next(e);
387
- } catch (i) {
388
- d(i);
389
- }
390
- }, r.prototype.error = function(e) {
391
- var t = this.partialObserver;
392
- if (t.error)
393
- try {
394
- t.error(e);
395
- } catch (i) {
396
- d(i);
397
- }
398
- else
399
- d(e);
400
- }, r.prototype.complete = function() {
401
- var e = this.partialObserver;
402
- if (e.complete)
403
- try {
404
- e.complete();
405
- } catch (t) {
406
- d(t);
407
- }
408
- }, r;
409
- }(), O = function(r) {
410
- k(e, r);
411
- function e(t, i, o) {
412
- var n = r.call(this) || this, u;
413
- return b(t) || !t ? u = {
414
- next: t ?? void 0,
415
- error: i ?? void 0,
416
- complete: o ?? void 0
417
- } : u = t, n.destination = new H(u), n;
418
- }
419
- return e;
420
- }(R);
421
- function d(r) {
422
- V(r);
423
- }
424
- function D(r) {
425
- throw r;
426
- }
427
- var J = {
428
- closed: !0,
429
- next: I,
430
- error: D,
431
- complete: I
432
- }, K = function() {
433
- return typeof Symbol == "function" && Symbol.observable || "@@observable";
434
- }();
435
- function L(r) {
436
- return r;
437
- }
438
- function tt() {
439
- for (var r = [], e = 0; e < arguments.length; e++)
440
- r[e] = arguments[e];
441
- return M(r);
442
- }
443
- function M(r) {
444
- return r.length === 0 ? L : r.length === 1 ? r[0] : function(t) {
445
- return r.reduce(function(i, o) {
446
- return o(i);
447
- }, t);
448
- };
449
- }
450
- var rt = function() {
451
- function r(e) {
452
- e && (this._subscribe = e);
453
- }
454
- return r.prototype.lift = function(e) {
455
- var t = new r();
456
- return t.source = this, t.operator = e, t;
457
- }, r.prototype.subscribe = function(e, t, i) {
458
- var o = this, n = W(e) ? e : new O(e, t, i);
459
- return C(function() {
460
- var u = o, a = u.operator, f = u.source;
461
- n.add(a ? a.call(n, f) : f ? o._subscribe(n) : o._trySubscribe(n));
462
- }), n;
463
- }, r.prototype._trySubscribe = function(e) {
464
- try {
465
- return this._subscribe(e);
466
- } catch (t) {
467
- e.error(t);
468
- }
469
- }, r.prototype.forEach = function(e, t) {
470
- var i = this;
471
- return t = j(t), new t(function(o, n) {
472
- var u = new O({
473
- next: function(a) {
474
- try {
475
- e(a);
476
- } catch (f) {
477
- n(f), u.unsubscribe();
478
- }
479
- },
480
- error: n,
481
- complete: o
482
- });
483
- i.subscribe(u);
484
- });
485
- }, r.prototype._subscribe = function(e) {
486
- var t;
487
- return (t = this.source) === null || t === void 0 ? void 0 : t.subscribe(e);
488
- }, r.prototype[K] = function() {
489
- return this;
490
- }, r.prototype.pipe = function() {
491
- for (var e = [], t = 0; t < arguments.length; t++)
492
- e[t] = arguments[t];
493
- return M(e)(this);
494
- }, r.prototype.toPromise = function(e) {
495
- var t = this;
496
- return e = j(e), new e(function(i, o) {
497
- var n;
498
- t.subscribe(function(u) {
499
- return n = u;
500
- }, function(u) {
501
- return o(u);
502
- }, function() {
503
- return i(n);
504
- });
505
- });
506
- }, r.create = function(e) {
507
- return new r(e);
508
- }, r;
509
- }();
510
- function j(r) {
511
- var e;
512
- return (e = r ?? B.Promise) !== null && e !== void 0 ? e : Promise;
513
- }
514
- function Q(r) {
515
- return r && b(r.next) && b(r.error) && b(r.complete);
516
- }
517
- function W(r) {
518
- return r && r instanceof R || Q(r) && U(r);
519
- }
520
- export {
521
- N as E,
522
- rt as O,
523
- E as S,
524
- k as _,
525
- T as a,
526
- m as b,
527
- q as c,
528
- b as d,
529
- C as e,
530
- _ as f,
531
- g,
532
- O as h,
533
- L as i,
534
- R as j,
535
- $ as k,
536
- Z as l,
537
- x as m,
538
- I as n,
539
- K as o,
540
- tt as p,
541
- X as q,
542
- V as r,
543
- z as s,
544
- P as t
545
- };
546
- //# sourceMappingURL=Observable-CCQtH8Gg.mjs.map