@mountaya/studio 0.0.0-stage → 0.2.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.
- package/CHANGELOG.md +69 -0
- package/LICENCE.fr.txt +280 -0
- package/LICENSE.txt +262 -0
- package/README.md +917 -2
- package/dist/agent/index.cjs +2600 -0
- package/dist/agent/index.cjs.map +1 -0
- package/dist/agent/index.d.cts +1237 -0
- package/dist/agent/index.d.ts +1237 -0
- package/dist/agent/index.js +2581 -0
- package/dist/agent/index.js.map +1 -0
- package/dist/chunk-3Oi_Zrtm.js +9 -0
- package/dist/chunk-3Oi_Zrtm.js.map +1 -0
- package/dist/chunk-B18OPIu_.js +6 -0
- package/dist/chunk-B18OPIu_.js.map +1 -0
- package/dist/chunk-B5Uz3Qct.cjs +15 -0
- package/dist/chunk-B5Uz3Qct.cjs.map +1 -0
- package/dist/chunk-BBEJwkd3.d.cts +839 -0
- package/dist/chunk-BIEc_SkR.cjs +29 -0
- package/dist/chunk-BIEc_SkR.cjs.map +1 -0
- package/dist/chunk-BKMFOe-N.js +171 -0
- package/dist/chunk-BKMFOe-N.js.map +1 -0
- package/dist/chunk-BP4uy7E1.d.ts +11583 -0
- package/dist/chunk-BSHTsFiB.js +1403 -0
- package/dist/chunk-BSHTsFiB.js.map +1 -0
- package/dist/chunk-BTUUABGI.js +17 -0
- package/dist/chunk-BTUUABGI.js.map +1 -0
- package/dist/chunk-BaPiaz5X.cjs +115 -0
- package/dist/chunk-BaPiaz5X.cjs.map +1 -0
- package/dist/chunk-BeCVpkYr.cjs +542 -0
- package/dist/chunk-BeCVpkYr.cjs.map +1 -0
- package/dist/chunk-BgngsvK8.cjs +6202 -0
- package/dist/chunk-BgngsvK8.cjs.map +1 -0
- package/dist/chunk-BhInd7CJ.d.cts +253 -0
- package/dist/chunk-Bn6ZbxkS.cjs +27 -0
- package/dist/chunk-By9ZnkVI.js +60 -0
- package/dist/chunk-By9ZnkVI.js.map +1 -0
- package/dist/chunk-BzqPhxsz.cjs +367 -0
- package/dist/chunk-BzqPhxsz.cjs.map +1 -0
- package/dist/chunk-C2mMX81q.d.ts +443 -0
- package/dist/chunk-C2rr9Q0V.cjs +1402 -0
- package/dist/chunk-C2rr9Q0V.cjs.map +1 -0
- package/dist/chunk-CDJCbwIQ.d.cts +78 -0
- package/dist/chunk-CLGvBOVH.d.cts +1654 -0
- package/dist/chunk-COdw1dc6.d.ts +525 -0
- package/dist/chunk-CQCJnT2i.d.ts +511 -0
- package/dist/chunk-CSyHY67q.cjs +353 -0
- package/dist/chunk-CSyHY67q.cjs.map +1 -0
- package/dist/chunk-CiK1Iqrv.js +950 -0
- package/dist/chunk-CiK1Iqrv.js.map +1 -0
- package/dist/chunk-CmJBgSwZ.cjs +24 -0
- package/dist/chunk-CmJBgSwZ.cjs.map +1 -0
- package/dist/chunk-CnrsRK2u.cjs +83 -0
- package/dist/chunk-CnrsRK2u.cjs.map +1 -0
- package/dist/chunk-Co782_9r.js +326 -0
- package/dist/chunk-Co782_9r.js.map +1 -0
- package/dist/chunk-Csr3KDpZ.cjs +32 -0
- package/dist/chunk-Csr3KDpZ.cjs.map +1 -0
- package/dist/chunk-CwkmccXv.js +89 -0
- package/dist/chunk-CwkmccXv.js.map +1 -0
- package/dist/chunk-D0Q4iL9B.cjs +255 -0
- package/dist/chunk-D0Q4iL9B.cjs.map +1 -0
- package/dist/chunk-DFwiSzUS.cjs +72 -0
- package/dist/chunk-DFwiSzUS.cjs.map +1 -0
- package/dist/chunk-DIFayl2P.d.cts +443 -0
- package/dist/chunk-DIGF58ux.d.cts +525 -0
- package/dist/chunk-DKuuuld5.js +101 -0
- package/dist/chunk-DKuuuld5.js.map +1 -0
- package/dist/chunk-DMePkFEo.js +5054 -0
- package/dist/chunk-DMePkFEo.js.map +1 -0
- package/dist/chunk-DO5SIBgu.js +305 -0
- package/dist/chunk-DO5SIBgu.js.map +1 -0
- package/dist/chunk-DOQ_7eE5.d.ts +6662 -0
- package/dist/chunk-DThaaNeb.d.cts +15 -0
- package/dist/chunk-DThaaNeb.d.ts +15 -0
- package/dist/chunk-DUQzjUJy.d.ts +78 -0
- package/dist/chunk-DX37IPhV.cjs +1903 -0
- package/dist/chunk-DX37IPhV.cjs.map +1 -0
- package/dist/chunk-Damps5Tk.cjs +155 -0
- package/dist/chunk-Damps5Tk.cjs.map +1 -0
- package/dist/chunk-DbK5PhpJ.d.ts +1654 -0
- package/dist/chunk-De0vAASv.d.ts +253 -0
- package/dist/chunk-DhSZ7YZt.d.cts +6662 -0
- package/dist/chunk-DjEvqvPA.cjs +43 -0
- package/dist/chunk-DjEvqvPA.cjs.map +1 -0
- package/dist/chunk-DkwDzwvu.d.cts +121 -0
- package/dist/chunk-DkwDzwvu.d.ts +121 -0
- package/dist/chunk-Dmszv9If.js +71 -0
- package/dist/chunk-Dmszv9If.js.map +1 -0
- package/dist/chunk-Dp_ftNWY.d.cts +511 -0
- package/dist/chunk-DsHQySz0.js +31 -0
- package/dist/chunk-DsHQySz0.js.map +1 -0
- package/dist/chunk-DwoUyHHh.js +281 -0
- package/dist/chunk-DwoUyHHh.js.map +1 -0
- package/dist/chunk-IaIDQflj.d.cts +2315 -0
- package/dist/chunk-IaIDQflj.d.ts +2315 -0
- package/dist/chunk-cVXLsZfL.d.ts +839 -0
- package/dist/chunk-mIaCX9EJ.d.cts +11583 -0
- package/dist/chunk-nJQxbOwQ.cjs +8962 -0
- package/dist/chunk-nJQxbOwQ.cjs.map +1 -0
- package/dist/chunk-o9jaxhCO.js +8852 -0
- package/dist/chunk-o9jaxhCO.js.map +1 -0
- package/dist/chunk-p-Tt_Lwz.js +14 -0
- package/dist/chunk-p-Tt_Lwz.js.map +1 -0
- package/dist/engines/index.cjs +2091 -0
- package/dist/engines/index.cjs.map +1 -0
- package/dist/engines/index.d.cts +2176 -0
- package/dist/engines/index.d.ts +2176 -0
- package/dist/engines/index.js +2075 -0
- package/dist/engines/index.js.map +1 -0
- package/dist/handlers/index.cjs +53 -0
- package/dist/handlers/index.cjs.map +1 -0
- package/dist/handlers/index.d.cts +403 -0
- package/dist/handlers/index.d.ts +403 -0
- package/dist/handlers/index.js +33 -0
- package/dist/handlers/index.js.map +1 -0
- package/dist/index.cjs +3511 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +8 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +3033 -0
- package/dist/index.js.map +1 -0
- package/dist/plugins/index.cjs +510 -0
- package/dist/plugins/index.cjs.map +1 -0
- package/dist/plugins/index.d.cts +296 -0
- package/dist/plugins/index.d.ts +296 -0
- package/dist/plugins/index.js +489 -0
- package/dist/plugins/index.js.map +1 -0
- package/dist/seams/index.cjs +89 -0
- package/dist/seams/index.cjs.map +1 -0
- package/dist/seams/index.d.cts +452 -0
- package/dist/seams/index.d.ts +452 -0
- package/dist/seams/index.js +49 -0
- package/dist/seams/index.js.map +1 -0
- package/dist/strings/fr/index.cjs +2135 -0
- package/dist/strings/fr/index.cjs.map +1 -0
- package/dist/strings/fr/index.d.cts +17 -0
- package/dist/strings/fr/index.d.ts +17 -0
- package/dist/strings/fr/index.js +2130 -0
- package/dist/strings/fr/index.js.map +1 -0
- package/dist/strings/index.cjs +2384 -0
- package/dist/strings/index.cjs.map +1 -0
- package/dist/strings/index.d.cts +3 -0
- package/dist/strings/index.d.ts +3 -0
- package/dist/strings/index.js +2353 -0
- package/dist/strings/index.js.map +1 -0
- package/dist/testing/index.cjs +230 -0
- package/dist/testing/index.cjs.map +1 -0
- package/dist/testing/index.d.cts +246 -0
- package/dist/testing/index.d.ts +246 -0
- package/dist/testing/index.js +219 -0
- package/dist/testing/index.js.map +1 -0
- package/dist/time/index.cjs +28 -0
- package/dist/time/index.cjs.map +1 -0
- package/dist/time/index.d.cts +41 -0
- package/dist/time/index.d.ts +41 -0
- package/dist/time/index.js +23 -0
- package/dist/time/index.js.map +1 -0
- package/package.json +224 -4
- package/src/agent/engines/agentThreads.ts +1601 -0
- package/src/agent/engines/directorChat.ts +500 -0
- package/src/agent/index.ts +67 -0
- package/src/agent/rules/agentEditLock.ts +115 -0
- package/src/agent/rules/agentErrorCopy.ts +44 -0
- package/src/agent/rules/copilotOrganization.ts +36 -0
- package/src/agent/rules/playbook.gen.ts +444 -0
- package/src/agent/rules/router.ts +518 -0
- package/src/agent/rules/stateDelta.ts +29 -0
- package/src/agent/rules/studioRouter.ts +123 -0
- package/src/agent/rules/surfaces.gen.ts +633 -0
- package/src/agent/rules/threadsUrl.ts +48 -0
- package/src/agent/rules/transcriptObserver.ts +90 -0
- package/src/agent/stores/agentThreads.ts +451 -0
- package/src/bus/contracts/noData.ts +18 -0
- package/src/bus/contracts/shared.ts +172 -0
- package/src/bus/contracts/studioTools.ts +224 -0
- package/src/bus/rules/bus.ts +857 -0
- package/src/bus/rules/confirmation.ts +22 -0
- package/src/bus/rules/defineRegistry.ts +24 -0
- package/src/bus/rules/errors.ts +401 -0
- package/src/bus/rules/handlerErrors.ts +103 -0
- package/src/bus/rules/handlerRegistry.ts +627 -0
- package/src/bus/rules/inputSchema.ts +232 -0
- package/src/bus/rules/invalidInput.ts +441 -0
- package/src/bus/rules/lateBoundTools.ts +100 -0
- package/src/bus/rules/studioRegistry.ts +324 -0
- package/src/bus/rules/studioToolBus.ts +73 -0
- package/src/bus/rules/types.ts +804 -0
- package/src/chrome/contracts/alert.ts +42 -0
- package/src/chrome/contracts/itinerary.ts +26 -0
- package/src/chrome/contracts/map.ts +23 -0
- package/src/chrome/contracts/overlay.ts +46 -0
- package/src/chrome/contracts/panel.ts +29 -0
- package/src/chrome/contracts/question.ts +52 -0
- package/src/chrome/contracts/selection.ts +26 -0
- package/src/chrome/contracts/sidenav.ts +23 -0
- package/src/chrome/contracts/snapshot.ts +319 -0
- package/src/chrome/contracts/state.ts +22 -0
- package/src/chrome/contracts/tabs.ts +56 -0
- package/src/chrome/handlers/alert.ts +91 -0
- package/src/chrome/handlers/introspection.ts +180 -0
- package/src/chrome/handlers/panels.ts +42 -0
- package/src/chrome/handlers/question.ts +24 -0
- package/src/chrome/handlers/sidenav.ts +116 -0
- package/src/chrome/handlers/snapshot.ts +451 -0
- package/src/chrome/handlers/stateDelta.ts +125 -0
- package/src/chrome/handlers/tabs.ts +143 -0
- package/src/chrome/handlers/timestamp.ts +19 -0
- package/src/chrome/rules/agentSelectors.ts +210 -0
- package/src/chrome/rules/mapAlert.ts +13 -0
- package/src/chrome/rules/question.ts +25 -0
- package/src/chrome/rules/tabs.ts +13 -0
- package/src/chrome/stores/activeDraftSession.ts +134 -0
- package/src/chrome/stores/chrome.ts +527 -0
- package/src/chrome/stores/uiStore.ts +575 -0
- package/src/collab/contracts/collab.ts +261 -0
- package/src/collab/handlers/collab.ts +468 -0
- package/src/collab/rules/toolNames.ts +33 -0
- package/src/collab/stores/collab.ts +899 -0
- package/src/collections/contracts/collection.ts +182 -0
- package/src/collections/handlers/collectionAttach.ts +141 -0
- package/src/collections/handlers/collections.ts +499 -0
- package/src/collections/handlers/heldCollection.ts +42 -0
- package/src/collections/handlers/restCollections.ts +386 -0
- package/src/collections/rules/collections.ts +138 -0
- package/src/collections/rules/entityCollections.ts +53 -0
- package/src/collections/stores/collections.ts +133 -0
- package/src/data/contracts/data.ts +233 -0
- package/src/data/contracts/itinerary.ts +71 -0
- package/src/data/handlers/activityResolve.ts +76 -0
- package/src/data/handlers/data.ts +200 -0
- package/src/data/handlers/graphql.ts +26 -0
- package/src/data/handlers/mutationSink.ts +1577 -0
- package/src/data/handlers/profile.ts +83 -0
- package/src/data/handlers/writeThrough.ts +417 -0
- package/src/data/rules/cache.ts +181 -0
- package/src/data/rules/dataTypes.ts +40 -0
- package/src/data/rules/keys.ts +106 -0
- package/src/data/rules/persistence.ts +1058 -0
- package/src/data/rules/requestBody.ts +43 -0
- package/src/data/rules/restErrors.ts +354 -0
- package/src/data/rules/sessionSurface.ts +156 -0
- package/src/data/rules/toolResultData.ts +73 -0
- package/src/data/rules/uuid.ts +24 -0
- package/src/edit/contracts/edit.ts +37 -0
- package/src/edit/contracts/itinerary.ts +57 -0
- package/src/edit/handlers/draftCommit.ts +257 -0
- package/src/edit/handlers/editDiscard.ts +34 -0
- package/src/edit/handlers/editLock.ts +949 -0
- package/src/edit/handlers/editor.ts +203 -0
- package/src/edit/handlers/formUnsaved.ts +24 -0
- package/src/edit/rules/draftMetadata.ts +117 -0
- package/src/edit/rules/editKeyboard.ts +222 -0
- package/src/edit/rules/editShortcuts.ts +102 -0
- package/src/edit/rules/editTooltip.ts +174 -0
- package/src/edit/rules/editorTaken.ts +49 -0
- package/src/edit/rules/history.ts +26 -0
- package/src/edit/rules/unsavedWork.ts +60 -0
- package/src/edit/stores/editorReservation.ts +70 -0
- package/src/edit/stores/formsUnsaved.ts +54 -0
- package/src/embed/contracts/embed.ts +48 -0
- package/src/embed/engines/embedFraming.ts +1329 -0
- package/src/embed/engines/embedReady.ts +353 -0
- package/src/embed/engines/framingPageSession.ts +169 -0
- package/src/embed/handlers/embed.ts +130 -0
- package/src/embed/rules/allowedDomains.ts +71 -0
- package/src/embed/rules/bridgeMessages.ts +224 -0
- package/src/embed/rules/defaults.ts +173 -0
- package/src/embed/rules/displaySeed.ts +115 -0
- package/src/embed/rules/embedAllowlist.ts +146 -0
- package/src/embed/rules/embedConstraints.ts +215 -0
- package/src/embed/rules/embedElements.ts +277 -0
- package/src/embed/rules/embedSectionFields.ts +126 -0
- package/src/embed/rules/embedSecurity.ts +116 -0
- package/src/embed/rules/fieldDependencies.ts +89 -0
- package/src/embed/rules/fieldOptions.ts +138 -0
- package/src/embed/rules/layerOptions.ts +161 -0
- package/src/embed/rules/readyProtocol.ts +66 -0
- package/src/embed/rules/safetyRules.ts +215 -0
- package/src/embed/rules/snippet.ts +531 -0
- package/src/embed/rules/tableCode.ts +270 -0
- package/src/embed/stores/embed.ts +60 -0
- package/src/embed/stores/embedContent.ts +77 -0
- package/src/engines/index.ts +81 -0
- package/src/handlers/index.ts +66 -0
- package/src/index.ts +1065 -0
- package/src/itinerary/contracts/itinerary.ts +705 -0
- package/src/itinerary/engines/itineraryPace.ts +612 -0
- package/src/itinerary/engines/profileMarker.ts +238 -0
- package/src/itinerary/handlers/importStaging.ts +352 -0
- package/src/itinerary/handlers/itinerary.ts +572 -0
- package/src/itinerary/handlers/itineraryDuplicate.ts +177 -0
- package/src/itinerary/handlers/itineraryExport.ts +117 -0
- package/src/itinerary/handlers/itineraryImport.ts +783 -0
- package/src/itinerary/handlers/itineraryPublish.ts +118 -0
- package/src/itinerary/handlers/itinerarySelection.ts +354 -0
- package/src/itinerary/handlers/itinerarySuggest.ts +1186 -0
- package/src/itinerary/handlers/itineraryUnpublish.ts +101 -0
- package/src/itinerary/handlers/publicationScope.ts +118 -0
- package/src/itinerary/handlers/restItineraries.ts +752 -0
- package/src/itinerary/handlers/restItineraryExport.ts +70 -0
- package/src/itinerary/handlers/restItineraryImport.ts +311 -0
- package/src/itinerary/handlers/restItineraryPace.ts +87 -0
- package/src/itinerary/handlers/restItineraryRecord.ts +36 -0
- package/src/itinerary/handlers/suggestParams.ts +379 -0
- package/src/itinerary/handlers/suggestStaging.ts +363 -0
- package/src/itinerary/handlers/surfaceOpen.ts +389 -0
- package/src/itinerary/rules/activity.ts +139 -0
- package/src/itinerary/rules/analysis.ts +42 -0
- package/src/itinerary/rules/ceiling.ts +49 -0
- package/src/itinerary/rules/createFlow.ts +107 -0
- package/src/itinerary/rules/densify.ts +440 -0
- package/src/itinerary/rules/draftSurface.ts +219 -0
- package/src/itinerary/rules/editorView.ts +83 -0
- package/src/itinerary/rules/export.ts +159 -0
- package/src/itinerary/rules/friendlyName.ts +77 -0
- package/src/itinerary/rules/import.ts +1050 -0
- package/src/itinerary/rules/importFiles.ts +140 -0
- package/src/itinerary/rules/importTotals.ts +77 -0
- package/src/itinerary/rules/liveSegment.ts +712 -0
- package/src/itinerary/rules/lngLat.ts +17 -0
- package/src/itinerary/rules/mapSync.ts +100 -0
- package/src/itinerary/rules/previewRender.ts +416 -0
- package/src/itinerary/rules/profileReadout.ts +216 -0
- package/src/itinerary/rules/routing.ts +707 -0
- package/src/itinerary/rules/suggest.ts +522 -0
- package/src/itinerary/rules/suggestionPreview.ts +119 -0
- package/src/itinerary/rules/view.ts +61 -0
- package/src/itinerary/stores/importSession.ts +319 -0
- package/src/itinerary/stores/itinerary.ts +331 -0
- package/src/itinerary/stores/itineraryDuplicate.ts +76 -0
- package/src/itinerary/stores/sessionIdentity.ts +43 -0
- package/src/itinerary/stores/suggestSession.ts +418 -0
- package/src/layers/contracts/itinerary.ts +46 -0
- package/src/layers/contracts/overlay.ts +132 -0
- package/src/layers/handlers/enrichment.ts +36 -0
- package/src/layers/handlers/overlay.ts +406 -0
- package/src/layers/handlers/restLayers.ts +94 -0
- package/src/layers/handlers/tiles.ts +25 -0
- package/src/layers/rules/layers.ts +212 -0
- package/src/layers/rules/overlayInstant.ts +12 -0
- package/src/layers/rules/reachabilityIcon.ts +18 -0
- package/src/layers/rules/readout.ts +102 -0
- package/src/layers/stores/layers.ts +262 -0
- package/src/map/contracts/contextmenu.ts +33 -0
- package/src/map/contracts/geolocate.ts +37 -0
- package/src/map/contracts/map.ts +146 -0
- package/src/map/contracts/streetview.ts +53 -0
- package/src/map/contracts/terrain.ts +152 -0
- package/src/map/handlers/contextMenu.ts +135 -0
- package/src/map/handlers/geolocate.ts +52 -0
- package/src/map/handlers/map.ts +391 -0
- package/src/map/handlers/streetview.ts +94 -0
- package/src/map/handlers/terrain.ts +663 -0
- package/src/map/rules/baseTerrain.ts +75 -0
- package/src/map/rules/clickTargets.ts +464 -0
- package/src/map/rules/constraints.ts +32 -0
- package/src/map/rules/contextMenuReadout.ts +67 -0
- package/src/map/rules/coordinates.ts +71 -0
- package/src/map/rules/itineraryFit.ts +8 -0
- package/src/map/rules/mapEvents.ts +64 -0
- package/src/map/rules/mapProjection.ts +476 -0
- package/src/map/rules/terrainReading.ts +62 -0
- package/src/plugins/contracts/ids.ts +66 -0
- package/src/plugins/contracts/plugin.ts +202 -0
- package/src/plugins/contracts/slots.ts +137 -0
- package/src/plugins/engines/studioPlugin.ts +1365 -0
- package/src/plugins/index.ts +111 -0
- package/src/plugins/rules/contributions.ts +152 -0
- package/src/plugins/rules/errors.ts +60 -0
- package/src/plugins/rules/ids.ts +42 -0
- package/src/plugins/rules/validation.ts +249 -0
- package/src/rules/listeners.ts +57 -0
- package/src/rules/origin.ts +13 -0
- package/src/rules/storeWrite.ts +37 -0
- package/src/rules/types.ts +136 -0
- package/src/seams/index.ts +79 -0
- package/src/seams/rules/clock.ts +28 -0
- package/src/seams/rules/formatters.ts +211 -0
- package/src/seams/rules/ids.ts +102 -0
- package/src/seams/rules/links.ts +66 -0
- package/src/seams/rules/navigation.ts +222 -0
- package/src/seams/rules/notify.ts +49 -0
- package/src/seams/rules/persistenceDrawer.ts +220 -0
- package/src/seams/rules/saveFile.ts +101 -0
- package/src/seams/rules/seams.ts +156 -0
- package/src/seams/rules/storage.ts +116 -0
- package/src/search/contracts/overlay.ts +74 -0
- package/src/search/contracts/search.ts +197 -0
- package/src/search/handlers/pois.ts +57 -0
- package/src/search/handlers/search.ts +280 -0
- package/src/search/rules/params.ts +925 -0
- package/src/search/rules/poiGroups.ts +138 -0
- package/src/search/rules/searchFetch.ts +139 -0
- package/src/search/rules/timeWindow.ts +30 -0
- package/src/search/stores/search.ts +51 -0
- package/src/segments/contracts/itinerary.ts +433 -0
- package/src/segments/contracts/segment.ts +35 -0
- package/src/segments/engines/segmentDraft.ts +926 -0
- package/src/segments/handlers/chainGuards.ts +67 -0
- package/src/segments/handlers/directions.ts +44 -0
- package/src/segments/handlers/itineraryEcho.ts +45 -0
- package/src/segments/handlers/roadAccessDialog.ts +34 -0
- package/src/segments/handlers/segment.ts +111 -0
- package/src/segments/handlers/segmentEdit.ts +1341 -0
- package/src/segments/handlers/segmentGroups.ts +347 -0
- package/src/segments/handlers/segmentStructure.ts +1144 -0
- package/src/segments/rules/chain.ts +196 -0
- package/src/segments/rules/chainModel.ts +217 -0
- package/src/segments/rules/colors.ts +11 -0
- package/src/segments/rules/commit.ts +76 -0
- package/src/segments/rules/draft.ts +90 -0
- package/src/segments/rules/draftDisposition.ts +43 -0
- package/src/segments/rules/draftSegmentEdit.ts +129 -0
- package/src/segments/rules/engine.ts +222 -0
- package/src/segments/rules/groupSave.ts +234 -0
- package/src/segments/rules/hazardPrompt.ts +60 -0
- package/src/segments/rules/itineraryEcho.ts +40 -0
- package/src/segments/rules/liveSegmentProjection.ts +55 -0
- package/src/segments/rules/merge.ts +51 -0
- package/src/segments/rules/metrics.ts +456 -0
- package/src/segments/rules/naming.ts +168 -0
- package/src/segments/rules/segmentArming.ts +144 -0
- package/src/segments/rules/splitPick.ts +84 -0
- package/src/segments/rules/viaSimplify.ts +230 -0
- package/src/segments/stores/directions.ts +77 -0
- package/src/segments/stores/roadAccessDialog.ts +58 -0
- package/src/segments/stores/segmentEdit.ts +922 -0
- package/src/segments/stores/segmentGroupEdit.ts +84 -0
- package/src/segments/stores/segmentSplit.ts +77 -0
- package/src/share/contracts/share.ts +39 -0
- package/src/share/contracts/shareLink.ts +63 -0
- package/src/share/engines/shareLink.ts +1053 -0
- package/src/share/handlers/share.ts +47 -0
- package/src/share/handlers/shareLink.ts +231 -0
- package/src/share/handlers/shareScope.ts +54 -0
- package/src/share/rules/link.ts +89 -0
- package/src/share/rules/shareLink.ts +218 -0
- package/src/share/rules/targets.ts +92 -0
- package/src/share/rules/viewConfig.ts +95 -0
- package/src/share/stores/share.ts +58 -0
- package/src/strings/fr/index.ts +18 -0
- package/src/strings/fr/rules/fr.ts +2368 -0
- package/src/strings/index.ts +98 -0
- package/src/strings/rules/confirmCopy.ts +156 -0
- package/src/strings/rules/draftToolNames.ts +94 -0
- package/src/strings/rules/en.ts +2519 -0
- package/src/strings/rules/failureAlert.ts +115 -0
- package/src/strings/rules/formError.ts +400 -0
- package/src/strings/rules/maneuvers.ts +107 -0
- package/src/strings/rules/outputOptions.ts +126 -0
- package/src/strings/rules/publicationState.ts +100 -0
- package/src/strings/rules/routeHazardCopy.ts +62 -0
- package/src/strings/rules/searchLabels.ts +50 -0
- package/src/strings/rules/segmentChainVerbs.ts +62 -0
- package/src/strings/rules/studioCopy.ts +130 -0
- package/src/strings/rules/unitOptions.ts +119 -0
- package/src/testing/checkedBus.ts +226 -0
- package/src/testing/index.ts +30 -0
- package/src/testing/plugins.ts +106 -0
- package/src/testing/studio.ts +267 -0
- package/src/testing/urlSeam.ts +153 -0
- package/src/time/index.ts +12 -0
- package/src/time/rules/sun.ts +78 -0
- package/src/video/contracts/cameraSchemas.ts +266 -0
- package/src/video/contracts/profileSchemas.ts +37 -0
- package/src/video/contracts/video.ts +601 -0
- package/src/video/handlers/video.ts +1638 -0
- package/src/video/handlers/videoDirector.ts +114 -0
- package/src/video/rules/previewRefresh.ts +76 -0
- package/src/video/rules/profileSource.ts +51 -0
- package/src/video/rules/routeSpans.ts +79 -0
- package/src/video/rules/shotDefaults.ts +28 -0
- package/src/video/rules/stepOrder.ts +17 -0
- package/src/video/rules/videoSnapshot.ts +136 -0
- package/src/video/stores/directorThreads.ts +167 -0
- package/src/video/stores/videoExport.ts +290 -0
- package/src/viewer/contracts/preferences.ts +40 -0
- package/src/viewer/handlers/preferences.ts +91 -0
- package/src/viewer/rules/capabilities.ts +42 -0
- package/src/viewer/rules/config.ts +266 -0
- package/src/viewer/rules/context.ts +375 -0
- package/src/viewer/rules/ownership.ts +134 -0
- package/src/viewer/rules/platformViewer.ts +199 -0
- package/src/viewer/rules/scope.ts +197 -0
- package/src/viewer/rules/url.ts +145 -0
- package/src/viewer/rules/viewer.ts +307 -0
- package/src/viewer/rules/viewerSeam.ts +49 -0
- package/src/viewer/rules/viewerUnits.ts +34 -0
- package/src/waypoints/contracts/itinerary.ts +417 -0
- package/src/waypoints/handlers/poiWaypointStyle.ts +32 -0
- package/src/waypoints/handlers/waypointDetailsDialog.ts +38 -0
- package/src/waypoints/handlers/waypointEdit.ts +1073 -0
- package/src/waypoints/rules/amenities.ts +30 -0
- package/src/waypoints/rules/defaults.ts +31 -0
- package/src/waypoints/rules/details.ts +213 -0
- package/src/waypoints/rules/detailsDraft.ts +312 -0
- package/src/waypoints/rules/detailsPreview.ts +76 -0
- package/src/waypoints/rules/detailsSave.ts +356 -0
- package/src/waypoints/rules/draftDirty.ts +45 -0
- package/src/waypoints/rules/icons.ts +32 -0
- package/src/waypoints/rules/liveWaypoint.ts +63 -0
- package/src/waypoints/rules/naming.ts +185 -0
- package/src/waypoints/rules/sections.ts +77 -0
- package/src/waypoints/rules/waypointDraft.ts +62 -0
- package/src/waypoints/stores/waypointDetails.ts +62 -0
- package/src/waypoints/stores/waypointEdit.ts +566 -0
- package/src/zones/contracts/collection.ts +37 -0
- package/src/zones/contracts/zone.ts +528 -0
- package/src/zones/engines/zoneForm.ts +1773 -0
- package/src/zones/handlers/restZones.ts +287 -0
- package/src/zones/handlers/zonePublish.ts +206 -0
- package/src/zones/handlers/zoneUnpublish.ts +56 -0
- package/src/zones/handlers/zones.ts +2254 -0
- package/src/zones/rules/geometry.ts +946 -0
- package/src/zones/rules/zoneDefaults.ts +34 -0
- package/src/zones/rules/zoneDraft.ts +54 -0
- package/src/zones/rules/zoneForm.ts +563 -0
- package/src/zones/rules/zoneMetadata.ts +29 -0
- package/src/zones/rules/zoneSource.ts +87 -0
- package/src/zones/rules/zoneSourceRefusal.ts +104 -0
- package/src/zones/stores/zoneEdit.ts +998 -0
|
@@ -0,0 +1,1903 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const require_rolldown_runtime = require("./chunk-Bn6ZbxkS.cjs");
|
|
3
|
+
const require_scope = require("./chunk-C2rr9Q0V.cjs");
|
|
4
|
+
const require_viewer = require("./chunk-BgngsvK8.cjs");
|
|
5
|
+
const require_shareLink = require("./chunk-BeCVpkYr.cjs");
|
|
6
|
+
const require_listeners = require("./chunk-BIEc_SkR.cjs");
|
|
7
|
+
const require_errors = require("./chunk-Damps5Tk.cjs");
|
|
8
|
+
const require_seams = require("./chunk-D0Q4iL9B.cjs");
|
|
9
|
+
let zod = require("zod");
|
|
10
|
+
zod = require_rolldown_runtime.__toESM(zod);
|
|
11
|
+
let _mountaya_elements_geo = require("@mountaya/elements/geo");
|
|
12
|
+
let _mountaya_elements_errors = require("@mountaya/elements/errors");
|
|
13
|
+
let _mountaya_elements_layers = require("@mountaya/elements/layers");
|
|
14
|
+
let _mountaya_elements_style = require("@mountaya/elements/style");
|
|
15
|
+
let _mountaya_elements_profile = require("@mountaya/elements/profile");
|
|
16
|
+
let zustand_vanilla = require("zustand/vanilla");
|
|
17
|
+
const nameKeyedSchemaKeys = /* @__PURE__ */ new Set([
|
|
18
|
+
"$defs",
|
|
19
|
+
"patternProperties",
|
|
20
|
+
"properties"
|
|
21
|
+
]);
|
|
22
|
+
const valueKeyedSchemaKeys = /* @__PURE__ */ new Set([
|
|
23
|
+
"const",
|
|
24
|
+
"default",
|
|
25
|
+
"enum",
|
|
26
|
+
"examples"
|
|
27
|
+
]);
|
|
28
|
+
const kindsJsonCannotCarry = /* @__PURE__ */ new Set([
|
|
29
|
+
"bigint",
|
|
30
|
+
"date",
|
|
31
|
+
"map",
|
|
32
|
+
"nan",
|
|
33
|
+
"set",
|
|
34
|
+
"symbol"
|
|
35
|
+
]);
|
|
36
|
+
const UNION_KEYWORDS = ["anyOf", "oneOf"];
|
|
37
|
+
const isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
38
|
+
const isModelInert = (key, entry) => key === "$schema" || key === "additionalProperties" && (typeof entry === "boolean" || isRecord(entry) && Object.keys(entry).length === 0);
|
|
39
|
+
const acceptsNothing = (schema) => isRecord(schema) && isRecord(schema.not) && Object.keys(schema.not).length === 0;
|
|
40
|
+
const withoutUnsendableArms = (schema) => {
|
|
41
|
+
for (const keyword of UNION_KEYWORDS) {
|
|
42
|
+
const arms = schema[keyword];
|
|
43
|
+
if (!Array.isArray(arms)) continue;
|
|
44
|
+
const kept = arms.filter((arm) => !acceptsNothing(arm));
|
|
45
|
+
if (kept.length === arms.length) continue;
|
|
46
|
+
const beside = Object.entries(schema).filter(([key]) => key !== keyword);
|
|
47
|
+
const [only] = kept;
|
|
48
|
+
if (kept.length === 0) return {
|
|
49
|
+
...Object.fromEntries(beside),
|
|
50
|
+
not: {}
|
|
51
|
+
};
|
|
52
|
+
if (kept.length === 1 && isRecord(only)) return {
|
|
53
|
+
...only,
|
|
54
|
+
...Object.fromEntries(beside)
|
|
55
|
+
};
|
|
56
|
+
return Object.fromEntries(Object.entries(schema).map(([key, entry]) => [key, key === keyword ? kept : entry]));
|
|
57
|
+
}
|
|
58
|
+
return schema;
|
|
59
|
+
};
|
|
60
|
+
const slim = (value) => {
|
|
61
|
+
if (Array.isArray(value)) return value.map(slim);
|
|
62
|
+
if (!isRecord(value)) return value;
|
|
63
|
+
const slimmed = {};
|
|
64
|
+
for (const [key, entry] of Object.entries(value)) {
|
|
65
|
+
if (isModelInert(key, entry)) continue;
|
|
66
|
+
if (valueKeyedSchemaKeys.has(key)) slimmed[key] = entry;
|
|
67
|
+
else if (nameKeyedSchemaKeys.has(key) && isRecord(entry)) slimmed[key] = Object.fromEntries(Object.entries(entry).map(([name, schema]) => [name, slim(schema)]));
|
|
68
|
+
else slimmed[key] = slim(entry);
|
|
69
|
+
}
|
|
70
|
+
return withoutUnsendableArms(slimmed);
|
|
71
|
+
};
|
|
72
|
+
const renderedSchemas = /* @__PURE__ */ new WeakMap();
|
|
73
|
+
const renderInputSchema = (input) => {
|
|
74
|
+
const cached = renderedSchemas.get(input);
|
|
75
|
+
if (cached) return cached;
|
|
76
|
+
const rendered = slim(zod.toJSONSchema(input, {
|
|
77
|
+
io: "input",
|
|
78
|
+
override: ({ jsonSchema, zodSchema }) => {
|
|
79
|
+
const { def } = zodSchema._zod;
|
|
80
|
+
const coerced = "coerce" in def && def.coerce === true;
|
|
81
|
+
if (kindsJsonCannotCarry.has(def.type) && !coerced) jsonSchema.not = {};
|
|
82
|
+
},
|
|
83
|
+
unrepresentable: "any"
|
|
84
|
+
}));
|
|
85
|
+
renderedSchemas.set(input, rendered);
|
|
86
|
+
return rendered;
|
|
87
|
+
};
|
|
88
|
+
const MAX_LISTED_PARAMETERS = 8;
|
|
89
|
+
const MAX_LISTED_ENUM_VALUES = 12;
|
|
90
|
+
const MAX_LISTED_SHAPES = 6;
|
|
91
|
+
const isSchemaObject = (schema) => typeof schema === "object" && schema !== null;
|
|
92
|
+
const ROOT_POINTER = "#";
|
|
93
|
+
const DEFINITION_POINTER = "#/$defs/";
|
|
94
|
+
const targetOf = (pointer, root) => {
|
|
95
|
+
if (pointer === ROOT_POINTER) return root;
|
|
96
|
+
if (!pointer.startsWith(DEFINITION_POINTER) || root.$defs === void 0) return;
|
|
97
|
+
const name = pointer.slice(8);
|
|
98
|
+
return Object.hasOwn(root.$defs, name) ? root.$defs[name] : void 0;
|
|
99
|
+
};
|
|
100
|
+
const typeWord = (schema) => {
|
|
101
|
+
if (Array.isArray(schema.type)) return schema.type.join(" | ");
|
|
102
|
+
return typeof schema.type === "string" ? schema.type : "any";
|
|
103
|
+
};
|
|
104
|
+
const describeType = (schema, scope) => {
|
|
105
|
+
if (!isSchemaObject(schema)) return "any";
|
|
106
|
+
if (typeof schema.$ref === "string") {
|
|
107
|
+
const target = targetOf(schema.$ref, scope.root);
|
|
108
|
+
if (target === void 0) return "any";
|
|
109
|
+
return scope.reading.includes(schema.$ref) ? typeWord(target) : describeType(target, {
|
|
110
|
+
reading: [...scope.reading, schema.$ref],
|
|
111
|
+
root: scope.root
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
if (acceptsNothing(schema)) return "no value a JSON call can carry";
|
|
115
|
+
if (schema.const !== void 0) return JSON.stringify(schema.const);
|
|
116
|
+
if (Array.isArray(schema.enum) && schema.enum.length > 0) {
|
|
117
|
+
const values = schema.enum.slice(0, MAX_LISTED_ENUM_VALUES).map((value) => JSON.stringify(value));
|
|
118
|
+
const rest = schema.enum.length - values.length;
|
|
119
|
+
return `one of ${values.join(" | ")}${rest > 0 ? ` (+${rest} more)` : ""}`;
|
|
120
|
+
}
|
|
121
|
+
const branches = schema.anyOf ?? schema.oneOf;
|
|
122
|
+
if (Array.isArray(branches) && branches.length > 0) return branches.map((branch) => describeType(branch, scope)).join(" | ");
|
|
123
|
+
if (Array.isArray(schema.allOf) && schema.allOf.length > 0) return [...new Set(schema.allOf.map((part) => describeType(part, scope)))].join(" & ");
|
|
124
|
+
if (schema.type === "array") return Array.isArray(schema.prefixItems) ? `[${schema.prefixItems.map((item) => describeType(item, scope)).join(", ")}]` : `array of ${describeType(Array.isArray(schema.items) ? void 0 : schema.items, scope)}`;
|
|
125
|
+
if (schema.type === "object" && schema.properties === void 0 && isSchemaObject(schema.additionalProperties)) return `object of ${describeType(schema.additionalProperties, scope)}`;
|
|
126
|
+
return typeWord(schema);
|
|
127
|
+
};
|
|
128
|
+
const valueAt = (root, path) => {
|
|
129
|
+
let current = root;
|
|
130
|
+
try {
|
|
131
|
+
for (const key of path) {
|
|
132
|
+
if (current === null || typeof current !== "object") return;
|
|
133
|
+
current = current[key];
|
|
134
|
+
}
|
|
135
|
+
} catch {
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
return current;
|
|
139
|
+
};
|
|
140
|
+
const pathOf = (path) => path.length > 0 ? path.map((key) => String(key)).join(".") : "(root)";
|
|
141
|
+
const typeName = (value) => {
|
|
142
|
+
if (Array.isArray(value)) return "array";
|
|
143
|
+
return value === null ? "null" : typeof value;
|
|
144
|
+
};
|
|
145
|
+
const describeIssue = (issue, rawInput) => {
|
|
146
|
+
const path = pathOf(issue.path);
|
|
147
|
+
if (issue.code === "invalid_type") {
|
|
148
|
+
const received = valueAt(rawInput, issue.path);
|
|
149
|
+
return received === void 0 ? `${path} is required and was not supplied` : `${path} must be ${issue.expected}, not ${typeName(received)}`;
|
|
150
|
+
}
|
|
151
|
+
return `${path}: ${issue.message}`;
|
|
152
|
+
};
|
|
153
|
+
const describeParameters = (shape, root) => {
|
|
154
|
+
const properties = Object.entries(shape.properties ?? {});
|
|
155
|
+
if (properties.length === 0) return null;
|
|
156
|
+
const scope = {
|
|
157
|
+
reading: [ROOT_POINTER],
|
|
158
|
+
root
|
|
159
|
+
};
|
|
160
|
+
const required = new Set(Array.isArray(shape.required) ? shape.required : []);
|
|
161
|
+
const listed = properties.slice(0, MAX_LISTED_PARAMETERS);
|
|
162
|
+
const accepted = listed.map(([key, value]) => `${key} (${describeType(value, scope)}${required.has(key) ? ", required" : ", optional"})`).join(", ");
|
|
163
|
+
const omitted = properties.length - listed.length;
|
|
164
|
+
return `${accepted}${omitted > 0 ? `, and ${omitted} more` : ""}`;
|
|
165
|
+
};
|
|
166
|
+
const partsAsOneShape = (parts) => {
|
|
167
|
+
const properties = {};
|
|
168
|
+
const required = /* @__PURE__ */ new Set();
|
|
169
|
+
for (const shapes of parts) {
|
|
170
|
+
const [only] = shapes;
|
|
171
|
+
if (shapes.length !== 1 || only === void 0) return null;
|
|
172
|
+
Object.assign(properties, only.properties);
|
|
173
|
+
for (const name of Array.isArray(only.required) ? only.required : []) required.add(name);
|
|
174
|
+
}
|
|
175
|
+
return {
|
|
176
|
+
properties,
|
|
177
|
+
required: [...required],
|
|
178
|
+
type: "object"
|
|
179
|
+
};
|
|
180
|
+
};
|
|
181
|
+
const shapesOf = (schema, scope) => {
|
|
182
|
+
if (typeof schema.$ref === "string") {
|
|
183
|
+
const target = targetOf(schema.$ref, scope.root);
|
|
184
|
+
if (target === void 0) return [schema];
|
|
185
|
+
return scope.reading.includes(schema.$ref) ? [] : shapesOf(target, {
|
|
186
|
+
reading: [...scope.reading, schema.$ref],
|
|
187
|
+
root: scope.root
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
const branches = schema.oneOf ?? schema.anyOf;
|
|
191
|
+
if (Array.isArray(branches)) return branches.flatMap((branch) => isSchemaObject(branch) ? shapesOf(branch, scope) : []);
|
|
192
|
+
if (Array.isArray(schema.allOf) && schema.allOf.length > 0) return [partsAsOneShape(schema.allOf.map((part) => shapesOf(part, scope))) ?? schema];
|
|
193
|
+
return [schema];
|
|
194
|
+
};
|
|
195
|
+
const selectorOf = (shape, rawInput) => {
|
|
196
|
+
const pinned = Object.entries(shape.properties ?? {}).flatMap(([key, value]) => isSchemaObject(value) && value.const !== void 0 ? [{
|
|
197
|
+
key,
|
|
198
|
+
literal: value.const
|
|
199
|
+
}] : []);
|
|
200
|
+
if (pinned.length === 0 || pinned.some(({ key, literal }) => valueAt(rawInput, [key]) !== literal)) return null;
|
|
201
|
+
return pinned.map(({ key, literal }) => `${key} is ${JSON.stringify(literal)}`).join(" and ");
|
|
202
|
+
};
|
|
203
|
+
const describeAccepted = (schema, rawInput) => {
|
|
204
|
+
const shapes = shapesOf(schema, {
|
|
205
|
+
reading: [ROOT_POINTER],
|
|
206
|
+
root: schema
|
|
207
|
+
});
|
|
208
|
+
const parametersOf = (shape) => describeParameters(shape, schema);
|
|
209
|
+
const [only] = shapes;
|
|
210
|
+
if (shapes.length === 1 && only !== void 0) {
|
|
211
|
+
const parameters = parametersOf(only);
|
|
212
|
+
return parameters === null ? null : `Accepted parameters: ${parameters}.`;
|
|
213
|
+
}
|
|
214
|
+
if (shapes.every((shape) => parametersOf(shape) === null)) return null;
|
|
215
|
+
const selected = shapes.flatMap((shape) => {
|
|
216
|
+
const selector = selectorOf(shape, rawInput);
|
|
217
|
+
return selector === null ? [] : [{
|
|
218
|
+
selector,
|
|
219
|
+
shape
|
|
220
|
+
}];
|
|
221
|
+
});
|
|
222
|
+
const [chosen] = selected;
|
|
223
|
+
if (selected.length === 1 && chosen !== void 0) return `Accepted parameters when ${chosen.selector}: ${parametersOf(chosen.shape) ?? "none"}.`;
|
|
224
|
+
const listed = shapes.slice(0, MAX_LISTED_SHAPES).map((shape, index) => `[${index + 1}] ${parametersOf(shape) ?? "no parameters"}`).join("; ");
|
|
225
|
+
const omitted = shapes.length - Math.min(shapes.length, MAX_LISTED_SHAPES);
|
|
226
|
+
return `Accepted parameters, in one of these shapes: ${listed}${omitted > 0 ? `; and ${omitted} more` : ""}.`;
|
|
227
|
+
};
|
|
228
|
+
const describeRejection = (name, input, error, rawInput) => {
|
|
229
|
+
const problems = error.issues.map((issue) => describeIssue(issue, rawInput)).join("; ");
|
|
230
|
+
let schema;
|
|
231
|
+
try {
|
|
232
|
+
schema = renderInputSchema(input);
|
|
233
|
+
} catch {
|
|
234
|
+
return `invalid input for ${name}: ${problems}`;
|
|
235
|
+
}
|
|
236
|
+
const accepted = describeAccepted(schema, rawInput);
|
|
237
|
+
if (accepted === null) return `invalid input for ${name}: ${problems}. It takes no parameters.`;
|
|
238
|
+
return `invalid input for ${name}: ${problems}. ${accepted} Use exactly these names, and send values as their stated types: a number is 12000, not "12000".`;
|
|
239
|
+
};
|
|
240
|
+
const describeInvalidInput = (name, input, error, rawInput) => {
|
|
241
|
+
try {
|
|
242
|
+
return describeRejection(name, input, error, rawInput);
|
|
243
|
+
} catch {
|
|
244
|
+
return `invalid input for ${name}`;
|
|
245
|
+
}
|
|
246
|
+
};
|
|
247
|
+
const toolCapabilitySchema = zod.enum(["authenticated", "editor"]);
|
|
248
|
+
const confirmationToneSchema = zod.enum([
|
|
249
|
+
"affirmative",
|
|
250
|
+
"cautionary",
|
|
251
|
+
"destructive"
|
|
252
|
+
]);
|
|
253
|
+
const toolConfirmationSchema = zod.object({
|
|
254
|
+
acknowledgeLabel: zod.string().optional(),
|
|
255
|
+
confirmLabel: zod.string().optional(),
|
|
256
|
+
descriptionLabel: zod.string().optional(),
|
|
257
|
+
titleLabel: zod.string().optional(),
|
|
258
|
+
tone: confirmationToneSchema.optional()
|
|
259
|
+
});
|
|
260
|
+
const toolErrorCodeSchema = zod.enum({
|
|
261
|
+
canceled: "canceled",
|
|
262
|
+
"capability-denied": "capability-denied",
|
|
263
|
+
"collab-locked": "collab-locked",
|
|
264
|
+
"confirmation-denied": "confirmation-denied",
|
|
265
|
+
"confirmation-timeout": "confirmation-timeout",
|
|
266
|
+
conflict: "conflict",
|
|
267
|
+
"draft-open": "draft-open",
|
|
268
|
+
"edit-in-progress": "edit-in-progress",
|
|
269
|
+
forbidden: "forbidden",
|
|
270
|
+
internal: "internal",
|
|
271
|
+
"invalid-input": "invalid-input",
|
|
272
|
+
"limit-reached": "limit-reached",
|
|
273
|
+
"no-api": "no-api",
|
|
274
|
+
"no-map": "no-map",
|
|
275
|
+
"no-session": "no-session",
|
|
276
|
+
"not-found": "not-found",
|
|
277
|
+
"rate-limited": "rate-limited",
|
|
278
|
+
"split-on-end": "split-on-end",
|
|
279
|
+
"split-too-far": "split-too-far",
|
|
280
|
+
timeout: "timeout",
|
|
281
|
+
unavailable: "unavailable",
|
|
282
|
+
"unknown-tool": "unknown-tool",
|
|
283
|
+
"upgrade-required": "upgrade-required"
|
|
284
|
+
});
|
|
285
|
+
const resolveConfirmationValues = (tool, ctx, input) => {
|
|
286
|
+
if (!tool.confirmationValues) return;
|
|
287
|
+
try {
|
|
288
|
+
return tool.confirmationValues(ctx, input);
|
|
289
|
+
} catch {
|
|
290
|
+
return;
|
|
291
|
+
}
|
|
292
|
+
};
|
|
293
|
+
const askConfirmation = async (tool, ctx, input) => {
|
|
294
|
+
if (!ctx.confirm) return false;
|
|
295
|
+
try {
|
|
296
|
+
return await ctx.confirm({
|
|
297
|
+
acknowledge: tool.confirmation,
|
|
298
|
+
confirmLabel: tool.confirmation?.confirmLabel,
|
|
299
|
+
description: tool.description,
|
|
300
|
+
descriptionLabel: tool.confirmation?.descriptionLabel,
|
|
301
|
+
input,
|
|
302
|
+
name: tool.name,
|
|
303
|
+
titleLabel: tool.confirmation?.titleLabel,
|
|
304
|
+
tone: tool.confirmation?.tone,
|
|
305
|
+
values: resolveConfirmationValues(tool, ctx, input)
|
|
306
|
+
});
|
|
307
|
+
} catch {
|
|
308
|
+
return false;
|
|
309
|
+
}
|
|
310
|
+
};
|
|
311
|
+
const isToolFailure = (value) => typeof value === "object" && value !== null && "ok" in value && value.ok === false && "error" in value && typeof value.error === "string";
|
|
312
|
+
const refusalBeforeAsking = (tool, ctx, input, recognizers) => {
|
|
313
|
+
if (!tool.precondition) return null;
|
|
314
|
+
try {
|
|
315
|
+
const answered = tool.precondition(ctx, input);
|
|
316
|
+
if (answered === null || answered === void 0) return null;
|
|
317
|
+
if (isToolFailure(answered)) return answered;
|
|
318
|
+
} catch (err) {
|
|
319
|
+
return require_errors.failureFromThrown(err, recognizers);
|
|
320
|
+
}
|
|
321
|
+
return {
|
|
322
|
+
code: "internal",
|
|
323
|
+
error: `the precondition of ${tool.name} answered neither a refusal nor null`,
|
|
324
|
+
ok: false
|
|
325
|
+
};
|
|
326
|
+
};
|
|
327
|
+
const playbookDescriptions = (playbook) => new Map((playbook ?? []).map((entry) => [entry.id, entry.description]));
|
|
328
|
+
const playbookReadOnly = (playbook) => new Set((playbook ?? []).filter((entry) => entry.kind === "read").map((entry) => entry.id));
|
|
329
|
+
var ToolBus = class {
|
|
330
|
+
observers = /* @__PURE__ */ new Set();
|
|
331
|
+
tools = /* @__PURE__ */ new Map();
|
|
332
|
+
descriptions;
|
|
333
|
+
readOnly;
|
|
334
|
+
recognizers;
|
|
335
|
+
reserved;
|
|
336
|
+
dispatcher;
|
|
337
|
+
constructor(options = {}) {
|
|
338
|
+
this.descriptions = playbookDescriptions(options.playbook);
|
|
339
|
+
this.readOnly = playbookReadOnly(options.playbook);
|
|
340
|
+
this.recognizers = options.recognizers ?? [];
|
|
341
|
+
this.reserved = new Set(options.reserved ?? []);
|
|
342
|
+
this.dispatcher = {
|
|
343
|
+
dispatch: (ctx, name, rawInput) => this.dispatch(ctx, name, rawInput),
|
|
344
|
+
dispatchUnsafe: (ctx, name, rawInput) => this.dispatchUnsafe(ctx, name, rawInput)
|
|
345
|
+
};
|
|
346
|
+
}
|
|
347
|
+
register(tool) {
|
|
348
|
+
if (this.tools.has(tool.name)) {
|
|
349
|
+
const segment = tool.name.split(".")[0] ?? "";
|
|
350
|
+
throw new _mountaya_elements_errors.MountayaElementsError(this.reserved.has(segment) ? `tool already registered: ${tool.name}. Its "${segment}" segment is reserved on this bus, so unregister keeps it: hand the replacement to the handlers the bus is built with (overrideStudioHandler replaces one studio verb).` : `tool already registered: ${tool.name}. Take it off with unregister("${tool.name}"), then register the replacement.`);
|
|
351
|
+
}
|
|
352
|
+
if (tool.requiresConfirmation && tool.confirmation !== void 0) {
|
|
353
|
+
const parsed = toolConfirmationSchema.safeParse(tool.confirmation);
|
|
354
|
+
if (!parsed.success) throw new _mountaya_elements_errors.MountayaElementsError(`tool ${tool.name} carries an invalid confirmation policy: ${parsed.error.message}`);
|
|
355
|
+
}
|
|
356
|
+
this.tools.set(tool.name, tool);
|
|
357
|
+
}
|
|
358
|
+
registerAll(registry) {
|
|
359
|
+
for (const tool of Object.values(registry)) this.register(tool);
|
|
360
|
+
}
|
|
361
|
+
registered() {
|
|
362
|
+
return [...this.tools.values()];
|
|
363
|
+
}
|
|
364
|
+
unregister(name) {
|
|
365
|
+
if (this.reserved.has(name.split(".")[0] ?? "")) return false;
|
|
366
|
+
return this.tools.delete(name);
|
|
367
|
+
}
|
|
368
|
+
observe(observer) {
|
|
369
|
+
this.observers.add(observer);
|
|
370
|
+
return () => {
|
|
371
|
+
this.observers.delete(observer);
|
|
372
|
+
};
|
|
373
|
+
}
|
|
374
|
+
emit(event) {
|
|
375
|
+
require_listeners.notifyListeners(this.observers, event);
|
|
376
|
+
}
|
|
377
|
+
refuseInput(capability, name, start, error) {
|
|
378
|
+
this.emit({
|
|
379
|
+
capability,
|
|
380
|
+
errorClass: "invalid-input",
|
|
381
|
+
errorCode: "invalid-input",
|
|
382
|
+
errorMessage: error,
|
|
383
|
+
latencyMs: performance.now() - start,
|
|
384
|
+
name,
|
|
385
|
+
ok: false
|
|
386
|
+
});
|
|
387
|
+
return {
|
|
388
|
+
code: "invalid-input",
|
|
389
|
+
error,
|
|
390
|
+
ok: false
|
|
391
|
+
};
|
|
392
|
+
}
|
|
393
|
+
manifest(capabilities, surface) {
|
|
394
|
+
const entries = [];
|
|
395
|
+
for (const tool of this.tools.values()) {
|
|
396
|
+
if (!capabilities.has(tool.capability) || tool.agentHidden) continue;
|
|
397
|
+
if (surface !== void 0 && !surface.has(tool.name)) continue;
|
|
398
|
+
entries.push({
|
|
399
|
+
capability: tool.capability,
|
|
400
|
+
description: this.descriptions.get(tool.name) ?? tool.description,
|
|
401
|
+
inputSchema: renderInputSchema(tool.input),
|
|
402
|
+
name: tool.name,
|
|
403
|
+
readOnly: this.readOnly.has(tool.name),
|
|
404
|
+
requiresConfirmation: tool.requiresConfirmation ?? false
|
|
405
|
+
});
|
|
406
|
+
}
|
|
407
|
+
return entries;
|
|
408
|
+
}
|
|
409
|
+
async dispatchUnsafe(ctx, name, rawInput) {
|
|
410
|
+
const start = performance.now();
|
|
411
|
+
const tool = this.tools.get(name);
|
|
412
|
+
if (!tool) {
|
|
413
|
+
this.emit({
|
|
414
|
+
errorClass: "unknown-tool",
|
|
415
|
+
errorCode: "unknown-tool",
|
|
416
|
+
errorMessage: `unknown tool: ${name}`,
|
|
417
|
+
latencyMs: performance.now() - start,
|
|
418
|
+
name,
|
|
419
|
+
ok: false
|
|
420
|
+
});
|
|
421
|
+
return {
|
|
422
|
+
code: "unknown-tool",
|
|
423
|
+
error: `unknown tool: ${name}`,
|
|
424
|
+
ok: false
|
|
425
|
+
};
|
|
426
|
+
}
|
|
427
|
+
if (!ctx.capabilities.has(tool.capability)) {
|
|
428
|
+
this.emit({
|
|
429
|
+
capability: tool.capability,
|
|
430
|
+
errorClass: "capability-denied",
|
|
431
|
+
errorCode: "capability-denied",
|
|
432
|
+
errorMessage: `capability not granted: ${tool.capability}`,
|
|
433
|
+
latencyMs: performance.now() - start,
|
|
434
|
+
name,
|
|
435
|
+
ok: false
|
|
436
|
+
});
|
|
437
|
+
return {
|
|
438
|
+
code: "capability-denied",
|
|
439
|
+
error: `capability not granted: ${tool.capability}`,
|
|
440
|
+
ok: false
|
|
441
|
+
};
|
|
442
|
+
}
|
|
443
|
+
let parsed;
|
|
444
|
+
try {
|
|
445
|
+
parsed = tool.input.safeParse(rawInput);
|
|
446
|
+
} catch (err) {
|
|
447
|
+
return this.refuseInput(tool.capability, name, start, `invalid input for ${name}: ${require_errors.messageOf(err)}`);
|
|
448
|
+
}
|
|
449
|
+
if (!parsed.success) return this.refuseInput(tool.capability, name, start, describeInvalidInput(name, tool.input, parsed.error, rawInput));
|
|
450
|
+
const refused = refusalBeforeAsking(tool, ctx, parsed.data, this.recognizers);
|
|
451
|
+
if (refused !== null) {
|
|
452
|
+
this.emit({
|
|
453
|
+
capability: tool.capability,
|
|
454
|
+
errorClass: "handler-error",
|
|
455
|
+
errorCode: refused.code,
|
|
456
|
+
errorMessage: refused.error,
|
|
457
|
+
latencyMs: performance.now() - start,
|
|
458
|
+
name,
|
|
459
|
+
ok: false
|
|
460
|
+
});
|
|
461
|
+
return refused;
|
|
462
|
+
}
|
|
463
|
+
if (tool.requiresConfirmation && !await askConfirmation(tool, ctx, parsed.data)) {
|
|
464
|
+
this.emit({
|
|
465
|
+
capability: tool.capability,
|
|
466
|
+
errorClass: "confirmation-denied",
|
|
467
|
+
errorCode: "confirmation-denied",
|
|
468
|
+
errorMessage: `confirmation required, not granted: ${tool.name}`,
|
|
469
|
+
latencyMs: performance.now() - start,
|
|
470
|
+
name,
|
|
471
|
+
ok: false
|
|
472
|
+
});
|
|
473
|
+
return {
|
|
474
|
+
code: "confirmation-denied",
|
|
475
|
+
error: `confirmation required, not granted: ${tool.name}`,
|
|
476
|
+
ok: false
|
|
477
|
+
};
|
|
478
|
+
}
|
|
479
|
+
try {
|
|
480
|
+
const result = await tool.handler(ctx, parsed.data);
|
|
481
|
+
this.emit({
|
|
482
|
+
capability: tool.capability,
|
|
483
|
+
errorClass: result.ok ? void 0 : "handler-error",
|
|
484
|
+
errorCode: result.ok ? void 0 : result.code,
|
|
485
|
+
errorMessage: result.ok ? void 0 : result.error,
|
|
486
|
+
latencyMs: performance.now() - start,
|
|
487
|
+
name,
|
|
488
|
+
ok: result.ok
|
|
489
|
+
});
|
|
490
|
+
return result;
|
|
491
|
+
} catch (err) {
|
|
492
|
+
const failure = require_errors.failureFromThrown(err, this.recognizers);
|
|
493
|
+
this.emit({
|
|
494
|
+
capability: tool.capability,
|
|
495
|
+
errorClass: "handler-error",
|
|
496
|
+
errorCode: failure.code,
|
|
497
|
+
errorMessage: failure.error,
|
|
498
|
+
latencyMs: performance.now() - start,
|
|
499
|
+
name,
|
|
500
|
+
ok: false
|
|
501
|
+
});
|
|
502
|
+
return failure;
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
async dispatchFromModel(ctx, name, rawInput) {
|
|
506
|
+
const tool = this.tools.get(name);
|
|
507
|
+
if (tool?.agentHidden) {
|
|
508
|
+
const error = `tool not available to the agent: ${name}`;
|
|
509
|
+
this.emit({
|
|
510
|
+
capability: tool.capability,
|
|
511
|
+
errorClass: "agent-hidden",
|
|
512
|
+
errorCode: "forbidden",
|
|
513
|
+
errorMessage: error,
|
|
514
|
+
latencyMs: 0,
|
|
515
|
+
name,
|
|
516
|
+
ok: false
|
|
517
|
+
});
|
|
518
|
+
return {
|
|
519
|
+
code: "forbidden",
|
|
520
|
+
error,
|
|
521
|
+
ok: false
|
|
522
|
+
};
|
|
523
|
+
}
|
|
524
|
+
return this.dispatchUnsafe(ctx, name, rawInput);
|
|
525
|
+
}
|
|
526
|
+
dispatch(ctx, name, rawInput) {
|
|
527
|
+
return this.dispatchUnsafe(ctx, name, rawInput);
|
|
528
|
+
}
|
|
529
|
+
};
|
|
530
|
+
const isStudioToolName = (name) => Object.hasOwn(require_viewer.studioToolContracts, name);
|
|
531
|
+
const build = (builder, handlers) => {
|
|
532
|
+
const entries = Object.entries(handlers).filter(([, entry]) => entry !== void 0);
|
|
533
|
+
const unknown = entries.flatMap(([name]) => isStudioToolName(name) ? [] : [`"${name}"`]);
|
|
534
|
+
if (unknown.length > 0) throw new _mountaya_elements_errors.MountayaElementsError(`${builder}: no studio tool is named ${unknown.join(", ")}. A handler map is keyed by studio tool names: correct the key, or register a tool of your own with bus.register().`);
|
|
535
|
+
const registry = {};
|
|
536
|
+
for (const [name, entry] of entries) {
|
|
537
|
+
if (entry === void 0 || !isStudioToolName(name)) continue;
|
|
538
|
+
const definition = typeof entry === "function" ? { handler: entry } : entry;
|
|
539
|
+
registry[name] = {
|
|
540
|
+
...require_viewer.studioToolContracts[name],
|
|
541
|
+
...definition,
|
|
542
|
+
name
|
|
543
|
+
};
|
|
544
|
+
}
|
|
545
|
+
return registry;
|
|
546
|
+
};
|
|
547
|
+
const registerStudioTools = (bus, handlers) => {
|
|
548
|
+
const registry = build("registerStudioTools", handlers);
|
|
549
|
+
bus.registerAll(registry);
|
|
550
|
+
return registry;
|
|
551
|
+
};
|
|
552
|
+
const studioRegistry = () => (handlers) => build("studioRegistry", handlers);
|
|
553
|
+
const editorReservationInitialState = { editorReservation: null };
|
|
554
|
+
const createEditorReservationSlice = (set) => ({
|
|
555
|
+
releaseEditor: (mark) => set((state) => state.editorReservation === mark ? { editorReservation: null } : {}),
|
|
556
|
+
reserveEditor: (mark) => set({ editorReservation: mark })
|
|
557
|
+
});
|
|
558
|
+
const formsUnsavedInitialState = {
|
|
559
|
+
itineraryFormUnsaved: false,
|
|
560
|
+
waypointDetailsUnsaved: false
|
|
561
|
+
};
|
|
562
|
+
const memberOf = {
|
|
563
|
+
itinerary: "itineraryFormUnsaved",
|
|
564
|
+
waypointDetails: "waypointDetailsUnsaved"
|
|
565
|
+
};
|
|
566
|
+
const createFormsUnsavedSlice = (set) => ({ setFormUnsaved: (form, unsaved) => set((state) => state[memberOf[form]] === unsaved ? {} : { [memberOf[form]]: unsaved }) });
|
|
567
|
+
const embedInitialState = { embed: null };
|
|
568
|
+
const createEmbedSlice = (set) => ({ setEmbed: (embed) => set({ embed }) });
|
|
569
|
+
const selectEmbed = (state) => state.embed;
|
|
570
|
+
const embedContentInitialState = { embedContent: null };
|
|
571
|
+
const createEmbedContentSlice = (set) => ({ setEmbedContent: (embedContent) => set({ embedContent }) });
|
|
572
|
+
const selectEmbedContent = (state) => state.embedContent;
|
|
573
|
+
const draftSurfaceNames = Object.freeze({
|
|
574
|
+
import: "import",
|
|
575
|
+
suggest: "suggest-itineraries"
|
|
576
|
+
});
|
|
577
|
+
const showingDraftSurface = (state) => {
|
|
578
|
+
if (state.openContent === "import") return state.importSession === null ? null : "import";
|
|
579
|
+
if (state.openContent === "suggest") return state.suggestSession === null ? null : "suggest";
|
|
580
|
+
return null;
|
|
581
|
+
};
|
|
582
|
+
const showingDraftSession = (state) => {
|
|
583
|
+
const surface = showingDraftSurface(state);
|
|
584
|
+
if (surface === null) return null;
|
|
585
|
+
const session = surface === "import" ? state.importSession : state.suggestSession;
|
|
586
|
+
return session?.draft ? session : null;
|
|
587
|
+
};
|
|
588
|
+
const showingDraft = (state) => showingDraftSession(state)?.draft ?? null;
|
|
589
|
+
const draftSessionIdentity = (state, surface) => {
|
|
590
|
+
const session = surface === "import" ? state.importSession : state.suggestSession;
|
|
591
|
+
return session === null ? null : {
|
|
592
|
+
draftId: session.draftId,
|
|
593
|
+
sessionId: session.sessionId
|
|
594
|
+
};
|
|
595
|
+
};
|
|
596
|
+
const holdsDraftSession = (state, surface, sent) => {
|
|
597
|
+
const standing = draftSessionIdentity(state, surface);
|
|
598
|
+
return sent !== null && standing !== null && standing.sessionId === sent.sessionId && standing.draftId === sent.draftId;
|
|
599
|
+
};
|
|
600
|
+
const holdDuringDraftCommit = (ctx, surface, verb) => ctx.ui.getState().editorReservation?.session === surface ? {
|
|
601
|
+
code: "conflict",
|
|
602
|
+
error: `${verb}: the ${draftSurfaceNames[surface]} draft is being saved; send it again once its commit has settled`,
|
|
603
|
+
ok: false
|
|
604
|
+
} : null;
|
|
605
|
+
const holdDuringPreview = (ctx, surface, verb) => {
|
|
606
|
+
const status = surface === "import" ? ctx.ui.getState().importSession?.status : void 0;
|
|
607
|
+
return status?.kind === "settling" || status?.kind === "previewing" ? {
|
|
608
|
+
code: "conflict",
|
|
609
|
+
error: `${verb}: the ${draftSurfaceNames[surface]} draft is being previewed again for a changed option; send it again once the preview lands`,
|
|
610
|
+
ok: false
|
|
611
|
+
} : null;
|
|
612
|
+
};
|
|
613
|
+
const holdDraftWrite = (ctx, surface, verb) => holdDuringDraftCommit(ctx, surface, verb) ?? holdDuringPreview(ctx, surface, verb);
|
|
614
|
+
const holdShowingDraft = (ctx, verb) => {
|
|
615
|
+
const surface = showingDraftSurface(ctx.ui.getState());
|
|
616
|
+
return surface === null ? null : holdDraftWrite(ctx, surface, verb);
|
|
617
|
+
};
|
|
618
|
+
let minted = 0;
|
|
619
|
+
const mintSessionIdentity = () => {
|
|
620
|
+
minted += 1;
|
|
621
|
+
return minted;
|
|
622
|
+
};
|
|
623
|
+
const editedDraftIdentity = (session, draft) => {
|
|
624
|
+
if (draft === null) return null;
|
|
625
|
+
return session.draft !== null && session.draftId !== null ? session.draftId : mintSessionIdentity();
|
|
626
|
+
};
|
|
627
|
+
const importSessionInitialState = { importSession: null };
|
|
628
|
+
const createImportSessionSlice = (set) => ({
|
|
629
|
+
closeImport: () => set({ importSession: null }),
|
|
630
|
+
openImport: (provider) => set({ importSession: {
|
|
631
|
+
activityId: null,
|
|
632
|
+
collectionIds: [],
|
|
633
|
+
draft: null,
|
|
634
|
+
draftGranularity: null,
|
|
635
|
+
draftId: null,
|
|
636
|
+
file: null,
|
|
637
|
+
granularity: "auto",
|
|
638
|
+
isPrivate: true,
|
|
639
|
+
name: "",
|
|
640
|
+
organizationId: null,
|
|
641
|
+
preview: null,
|
|
642
|
+
provider,
|
|
643
|
+
sessionId: mintSessionIdentity(),
|
|
644
|
+
status: { kind: "idle" }
|
|
645
|
+
} }),
|
|
646
|
+
removeImportDraftSegment: (segmentId) => set((state) => {
|
|
647
|
+
const draft = state.importSession?.draft;
|
|
648
|
+
if (!state.importSession || !draft) return state;
|
|
649
|
+
return { importSession: {
|
|
650
|
+
...state.importSession,
|
|
651
|
+
draft: {
|
|
652
|
+
...draft,
|
|
653
|
+
segments: draft.segments.filter((segment) => segment.id !== segmentId)
|
|
654
|
+
}
|
|
655
|
+
} };
|
|
656
|
+
}),
|
|
657
|
+
setImportActivity: (activityId) => set((state) => state.importSession ? { importSession: {
|
|
658
|
+
...state.importSession,
|
|
659
|
+
activityId
|
|
660
|
+
} } : state),
|
|
661
|
+
setImportCollections: (collectionIds) => set((state) => state.importSession ? { importSession: {
|
|
662
|
+
...state.importSession,
|
|
663
|
+
collectionIds
|
|
664
|
+
} } : state),
|
|
665
|
+
setImportDraft: (draft) => set((state) => {
|
|
666
|
+
const session = state.importSession;
|
|
667
|
+
if (!session) return state;
|
|
668
|
+
return { importSession: {
|
|
669
|
+
...session,
|
|
670
|
+
draft,
|
|
671
|
+
draftGranularity: draft === null ? null : session.draftGranularity,
|
|
672
|
+
draftId: editedDraftIdentity(session, draft)
|
|
673
|
+
} };
|
|
674
|
+
}),
|
|
675
|
+
setImportDraftSegmentSpeed: (segmentId, speed) => set((state) => {
|
|
676
|
+
const draft = state.importSession?.draft;
|
|
677
|
+
if (!state.importSession || !draft) return state;
|
|
678
|
+
return { importSession: {
|
|
679
|
+
...state.importSession,
|
|
680
|
+
draft: {
|
|
681
|
+
...draft,
|
|
682
|
+
segments: draft.segments.map((segment) => segment.id === segmentId ? {
|
|
683
|
+
...segment,
|
|
684
|
+
speed
|
|
685
|
+
} : segment)
|
|
686
|
+
}
|
|
687
|
+
} };
|
|
688
|
+
}),
|
|
689
|
+
setImportFile: (file) => set((state) => state.importSession ? { importSession: {
|
|
690
|
+
...state.importSession,
|
|
691
|
+
file
|
|
692
|
+
} } : state),
|
|
693
|
+
setImportGranularity: (granularity) => set((state) => state.importSession ? { importSession: {
|
|
694
|
+
...state.importSession,
|
|
695
|
+
granularity
|
|
696
|
+
} } : state),
|
|
697
|
+
setImportName: (name) => set((state) => state.importSession ? { importSession: {
|
|
698
|
+
...state.importSession,
|
|
699
|
+
name
|
|
700
|
+
} } : state),
|
|
701
|
+
setImportOrganization: (organizationId) => set((state) => state.importSession ? { importSession: {
|
|
702
|
+
...state.importSession,
|
|
703
|
+
organizationId
|
|
704
|
+
} } : state),
|
|
705
|
+
setImportPreview: (preview) => set((state) => state.importSession ? { importSession: {
|
|
706
|
+
...state.importSession,
|
|
707
|
+
preview
|
|
708
|
+
} } : state),
|
|
709
|
+
setImportPrivate: (isPrivate) => set((state) => state.importSession ? { importSession: {
|
|
710
|
+
...state.importSession,
|
|
711
|
+
isPrivate
|
|
712
|
+
} } : state),
|
|
713
|
+
setImportProvider: (provider) => set((state) => state.importSession ? { importSession: {
|
|
714
|
+
...state.importSession,
|
|
715
|
+
provider
|
|
716
|
+
} } : state),
|
|
717
|
+
setImportStatus: (status) => set((state) => state.importSession ? { importSession: {
|
|
718
|
+
...state.importSession,
|
|
719
|
+
status
|
|
720
|
+
} } : state),
|
|
721
|
+
stageImportDraft: (draft, granularity) => set((state) => state.importSession ? { importSession: {
|
|
722
|
+
...state.importSession,
|
|
723
|
+
draft,
|
|
724
|
+
draftGranularity: granularity ?? null,
|
|
725
|
+
draftId: mintSessionIdentity()
|
|
726
|
+
} } : state)
|
|
727
|
+
});
|
|
728
|
+
zod.object({ itineraryId: zod.string() });
|
|
729
|
+
const itineraryDuplicateInitialState = { itineraryDuplicate: null };
|
|
730
|
+
const createItineraryDuplicateSlice = (set) => ({ setItineraryDuplicate: (itineraryDuplicate) => set({ itineraryDuplicate }) });
|
|
731
|
+
const suggestSessionInitialState = { suggestSession: null };
|
|
732
|
+
const createSuggestSessionSlice = (set) => ({
|
|
733
|
+
closeSuggest: () => set({ suggestSession: null }),
|
|
734
|
+
openSuggest: (options) => set({ suggestSession: {
|
|
735
|
+
activityId: null,
|
|
736
|
+
agentSelected: false,
|
|
737
|
+
ascentMeters: null,
|
|
738
|
+
candidates: [],
|
|
739
|
+
collectionIds: [],
|
|
740
|
+
distanceMeters: 1e4,
|
|
741
|
+
draft: null,
|
|
742
|
+
draftId: null,
|
|
743
|
+
end: null,
|
|
744
|
+
exhausted: false,
|
|
745
|
+
isPrivate: true,
|
|
746
|
+
name: "",
|
|
747
|
+
organizationId: null,
|
|
748
|
+
picking: options?.picking === void 0 ? "start" : options.picking,
|
|
749
|
+
routeType: "loop",
|
|
750
|
+
seenSeeds: [],
|
|
751
|
+
selectedSeed: null,
|
|
752
|
+
sessionId: mintSessionIdentity(),
|
|
753
|
+
speedKmh: null,
|
|
754
|
+
start: null,
|
|
755
|
+
status: { kind: "idle" },
|
|
756
|
+
targetSegmentId: null
|
|
757
|
+
} }),
|
|
758
|
+
selectSuggestionCandidate: (seed) => set((state) => state.suggestSession ? { suggestSession: {
|
|
759
|
+
...state.suggestSession,
|
|
760
|
+
selectedSeed: seed
|
|
761
|
+
} } : state),
|
|
762
|
+
setSuggestActivity: (activityId) => set((state) => state.suggestSession ? { suggestSession: {
|
|
763
|
+
...state.suggestSession,
|
|
764
|
+
activityId
|
|
765
|
+
} } : state),
|
|
766
|
+
setSuggestAgentSelected: (agentSelected) => set((state) => state.suggestSession ? { suggestSession: {
|
|
767
|
+
...state.suggestSession,
|
|
768
|
+
agentSelected
|
|
769
|
+
} } : state),
|
|
770
|
+
setSuggestAscent: (ascentMeters) => set((state) => state.suggestSession ? { suggestSession: {
|
|
771
|
+
...state.suggestSession,
|
|
772
|
+
ascentMeters
|
|
773
|
+
} } : state),
|
|
774
|
+
setSuggestCollections: (collectionIds) => set((state) => state.suggestSession ? { suggestSession: {
|
|
775
|
+
...state.suggestSession,
|
|
776
|
+
collectionIds
|
|
777
|
+
} } : state),
|
|
778
|
+
setSuggestDistance: (distanceMeters) => set((state) => state.suggestSession ? { suggestSession: {
|
|
779
|
+
...state.suggestSession,
|
|
780
|
+
distanceMeters
|
|
781
|
+
} } : state),
|
|
782
|
+
setSuggestDraft: (draft) => set((state) => {
|
|
783
|
+
const session = state.suggestSession;
|
|
784
|
+
if (!session) return state;
|
|
785
|
+
return { suggestSession: {
|
|
786
|
+
...session,
|
|
787
|
+
draft,
|
|
788
|
+
draftId: editedDraftIdentity(session, draft)
|
|
789
|
+
} };
|
|
790
|
+
}),
|
|
791
|
+
setSuggestEnd: (end) => set((state) => state.suggestSession ? { suggestSession: {
|
|
792
|
+
...state.suggestSession,
|
|
793
|
+
end
|
|
794
|
+
} } : state),
|
|
795
|
+
setSuggestionCandidates: (candidates, seenSeeds, exhausted = false) => set((state) => {
|
|
796
|
+
const session = state.suggestSession;
|
|
797
|
+
if (!session) return state;
|
|
798
|
+
const selectedSeed = session.selectedSeed !== null && candidates.some((candidate) => candidate.seed === session.selectedSeed) ? session.selectedSeed : null;
|
|
799
|
+
return { suggestSession: {
|
|
800
|
+
...session,
|
|
801
|
+
candidates,
|
|
802
|
+
exhausted,
|
|
803
|
+
seenSeeds,
|
|
804
|
+
selectedSeed
|
|
805
|
+
} };
|
|
806
|
+
}),
|
|
807
|
+
setSuggestionStatus: (status) => set((state) => state.suggestSession ? { suggestSession: {
|
|
808
|
+
...state.suggestSession,
|
|
809
|
+
status
|
|
810
|
+
} } : state),
|
|
811
|
+
setSuggestName: (name) => set((state) => state.suggestSession ? { suggestSession: {
|
|
812
|
+
...state.suggestSession,
|
|
813
|
+
name
|
|
814
|
+
} } : state),
|
|
815
|
+
setSuggestOrganization: (organizationId) => set((state) => state.suggestSession ? { suggestSession: {
|
|
816
|
+
...state.suggestSession,
|
|
817
|
+
organizationId
|
|
818
|
+
} } : state),
|
|
819
|
+
setSuggestPicking: (picking) => set((state) => state.suggestSession ? { suggestSession: {
|
|
820
|
+
...state.suggestSession,
|
|
821
|
+
picking
|
|
822
|
+
} } : state),
|
|
823
|
+
setSuggestPrivate: (isPrivate) => set((state) => state.suggestSession ? { suggestSession: {
|
|
824
|
+
...state.suggestSession,
|
|
825
|
+
isPrivate
|
|
826
|
+
} } : state),
|
|
827
|
+
setSuggestRouteType: (routeType) => set((state) => state.suggestSession ? { suggestSession: {
|
|
828
|
+
...state.suggestSession,
|
|
829
|
+
routeType
|
|
830
|
+
} } : state),
|
|
831
|
+
setSuggestSpeed: (speedKmh) => set((state) => state.suggestSession ? { suggestSession: {
|
|
832
|
+
...state.suggestSession,
|
|
833
|
+
speedKmh
|
|
834
|
+
} } : state),
|
|
835
|
+
setSuggestStart: (start) => set((state) => state.suggestSession ? { suggestSession: {
|
|
836
|
+
...state.suggestSession,
|
|
837
|
+
start
|
|
838
|
+
} } : state),
|
|
839
|
+
setSuggestTargetSegment: (targetSegmentId) => set((state) => state.suggestSession ? { suggestSession: {
|
|
840
|
+
...state.suggestSession,
|
|
841
|
+
targetSegmentId
|
|
842
|
+
} } : state),
|
|
843
|
+
stageSuggestDraft: (draft) => set((state) => state.suggestSession ? { suggestSession: {
|
|
844
|
+
...state.suggestSession,
|
|
845
|
+
draft,
|
|
846
|
+
draftId: mintSessionIdentity()
|
|
847
|
+
} } : state),
|
|
848
|
+
toggleSuggestionKeep: (seed) => set((state) => {
|
|
849
|
+
const session = state.suggestSession;
|
|
850
|
+
if (!session) return state;
|
|
851
|
+
const target = session.candidates.find((candidate) => candidate.seed === seed);
|
|
852
|
+
if (!target) return state;
|
|
853
|
+
const keptCount = session.candidates.filter((candidate) => candidate.kept).length;
|
|
854
|
+
if (!target.kept && keptCount >= 3) return state;
|
|
855
|
+
return { suggestSession: {
|
|
856
|
+
...session,
|
|
857
|
+
candidates: session.candidates.map((candidate) => candidate.seed === seed ? {
|
|
858
|
+
...candidate,
|
|
859
|
+
kept: !candidate.kept
|
|
860
|
+
} : candidate)
|
|
861
|
+
} };
|
|
862
|
+
})
|
|
863
|
+
});
|
|
864
|
+
const gatedBooleanRules = {
|
|
865
|
+
withOverlaysControl: "with_overlays_control",
|
|
866
|
+
withProfileAnalysis: "with_profile_analysis",
|
|
867
|
+
withProfileElevation: "with_profile_elevation"
|
|
868
|
+
};
|
|
869
|
+
const isGatedBooleanKey = (key) => Object.hasOwn(gatedBooleanRules, key);
|
|
870
|
+
const isFieldRestricted = (key, safetyRules) => {
|
|
871
|
+
if (!safetyRules || !isGatedBooleanKey(key)) return false;
|
|
872
|
+
return safetyRules[gatedBooleanRules[key]] === false;
|
|
873
|
+
};
|
|
874
|
+
const allowlistUnrestricted = (allowed) => allowed.length === 0 || allowed.includes("*");
|
|
875
|
+
const allowlistMode = (allowed, variant) => {
|
|
876
|
+
if (allowed.includes("*")) return "all";
|
|
877
|
+
if (allowed.length === 0) return variant === "cap" ? "none" : "all";
|
|
878
|
+
return "specific";
|
|
879
|
+
};
|
|
880
|
+
const allowlistForMode = (mode, variant, selection) => {
|
|
881
|
+
if (mode === "all") return variant === "cap" ? ["*"] : [];
|
|
882
|
+
return mode === "none" ? [] : [...selection];
|
|
883
|
+
};
|
|
884
|
+
const clampConfigToSafetyRules = (config, safetyRules) => {
|
|
885
|
+
if (!safetyRules) return config;
|
|
886
|
+
let next = config;
|
|
887
|
+
for (const key of Object.keys(gatedBooleanRules).filter(isGatedBooleanKey)) if (isFieldRestricted(key, safetyRules) && next[key]) next = {
|
|
888
|
+
...next,
|
|
889
|
+
[key]: false
|
|
890
|
+
};
|
|
891
|
+
return next;
|
|
892
|
+
};
|
|
893
|
+
const HILLSHADE_OVERLAY_SLUG = "hillshade";
|
|
894
|
+
const enrichmentOverlays = (layers) => layers.overlays.filter(_mountaya_elements_layers.isEnrichmentCategory).flatMap((category) => category.children);
|
|
895
|
+
const classicOverlays = (layers) => layers.overlays.filter((category) => !(0, _mountaya_elements_layers.isEnrichmentCategory)(category)).flatMap((category) => category.children);
|
|
896
|
+
const collectAttributions = (layers, activeOverlaySlug, activeEnrichments) => {
|
|
897
|
+
const overlays = { overlays: layers.overlays ?? [] };
|
|
898
|
+
const active = activeOverlaySlug === null ? null : (0, _mountaya_elements_layers.findOverlay)(overlays, activeOverlaySlug);
|
|
899
|
+
const enrichmentSources = activeEnrichments.flatMap((slug) => (0, _mountaya_elements_layers.findOverlay)(overlays, slug)?.sources ?? []);
|
|
900
|
+
const sources = [
|
|
901
|
+
...layers.itineraries?.sources ?? [],
|
|
902
|
+
...layers.zones?.sources ?? [],
|
|
903
|
+
...active?.sources ?? [],
|
|
904
|
+
...enrichmentSources
|
|
905
|
+
];
|
|
906
|
+
const seen = /* @__PURE__ */ new Set();
|
|
907
|
+
const attributions = [];
|
|
908
|
+
for (const source of sources) {
|
|
909
|
+
const attribution = source.attribution?.trim();
|
|
910
|
+
if (attribution !== void 0 && attribution !== "" && !seen.has(attribution)) {
|
|
911
|
+
seen.add(attribution);
|
|
912
|
+
attributions.push(attribution);
|
|
913
|
+
}
|
|
914
|
+
}
|
|
915
|
+
if (!seen.has(_mountaya_elements_style.BASEMAP_ATTRIBUTION)) attributions.push(_mountaya_elements_style.BASEMAP_ATTRIBUTION);
|
|
916
|
+
return attributions;
|
|
917
|
+
};
|
|
918
|
+
const filterTerrains = (terrains, allowed) => {
|
|
919
|
+
if (allowlistUnrestricted(allowed)) return [...terrains];
|
|
920
|
+
const allowedSlugs = new Set(allowed);
|
|
921
|
+
return terrains.filter((terrain) => allowedSlugs.has(terrain.slug));
|
|
922
|
+
};
|
|
923
|
+
const filterOverlayCategories = (categories, allowed, overlaysEntitled) => {
|
|
924
|
+
if (!overlaysEntitled) return [];
|
|
925
|
+
const unrestricted = allowlistUnrestricted(allowed);
|
|
926
|
+
const allowedSlugs = new Set(allowed);
|
|
927
|
+
return categories.map((category) => ({
|
|
928
|
+
...category,
|
|
929
|
+
children: category.children.filter((overlay) => unrestricted || allowedSlugs.has(overlay.slug))
|
|
930
|
+
})).filter((category) => category.children.length > 0);
|
|
931
|
+
};
|
|
932
|
+
const filterEnrichmentOverlays = (overlays, allowed, overlaysEntitled) => {
|
|
933
|
+
if (!overlaysEntitled) return [];
|
|
934
|
+
const unrestricted = allowlistUnrestricted(allowed);
|
|
935
|
+
const allowedSlugs = new Set(allowed);
|
|
936
|
+
return overlays.filter((overlay) => overlay.slug !== _mountaya_elements_layers.POIS_OVERLAY_SLUG && (unrestricted || allowedSlugs.has(overlay.slug)));
|
|
937
|
+
};
|
|
938
|
+
const findHillshadeOverlay = (layers) => (0, _mountaya_elements_layers.findOverlay)({ overlays: layers.overlays ?? [] }, HILLSHADE_OVERLAY_SLUG, "enrichment");
|
|
939
|
+
const toggleSlug = (slugs, slug, enabled) => {
|
|
940
|
+
if (slugs.includes(slug) === enabled) return slugs;
|
|
941
|
+
return enabled ? [...slugs, slug] : slugs.filter((active) => active !== slug);
|
|
942
|
+
};
|
|
943
|
+
const reconcilePoisEnrichment = (enrichments, groups) => {
|
|
944
|
+
const shouldHavePois = groups.length > 0;
|
|
945
|
+
return toggleSlug(enrichments, _mountaya_elements_layers.POIS_OVERLAY_SLUG, shouldHavePois);
|
|
946
|
+
};
|
|
947
|
+
const poiGroupsForSource = (groups, enabled) => {
|
|
948
|
+
if (groups.length > 0 === enabled) return groups;
|
|
949
|
+
return enabled ? [...require_viewer.DEFAULT_ENABLED_POI_GROUP_IDS] : [];
|
|
950
|
+
};
|
|
951
|
+
const knownPoiGroups = new Set(require_viewer.POI_GROUP_IDS);
|
|
952
|
+
const uniquePoiGroups = (groups) => {
|
|
953
|
+
const seen = /* @__PURE__ */ new Set();
|
|
954
|
+
const result = [];
|
|
955
|
+
for (const group of groups) if (knownPoiGroups.has(group) && !seen.has(group)) {
|
|
956
|
+
seen.add(group);
|
|
957
|
+
result.push(group);
|
|
958
|
+
}
|
|
959
|
+
return result;
|
|
960
|
+
};
|
|
961
|
+
const layersInitialState = {
|
|
962
|
+
activeEnrichments: [_mountaya_elements_layers.POIS_OVERLAY_SLUG],
|
|
963
|
+
activeOverlay: null,
|
|
964
|
+
activeOverlayCategorySlug: null,
|
|
965
|
+
activePoiGroups: [...require_viewer.DEFAULT_ENABLED_POI_GROUP_IDS],
|
|
966
|
+
overlayTimestamp: null,
|
|
967
|
+
poiFilterNoticeNonce: 0,
|
|
968
|
+
terrain: require_viewer.DEFAULT_TERRAIN,
|
|
969
|
+
terrainVariant: "light"
|
|
970
|
+
};
|
|
971
|
+
const createLayersSlice = (set, get) => ({
|
|
972
|
+
bumpPoiFilterNotice: () => set((state) => ({ poiFilterNoticeNonce: state.poiFilterNoticeNonce + 1 })),
|
|
973
|
+
setActiveOverlay: (activeOverlay) => set({ activeOverlay }),
|
|
974
|
+
setActiveOverlayCategorySlug: (activeOverlayCategorySlug) => set({ activeOverlayCategorySlug }),
|
|
975
|
+
setAllPoiGroups: (enabled) => {
|
|
976
|
+
get().setPoiGroups(enabled ? [...require_viewer.POI_GROUP_IDS] : []);
|
|
977
|
+
},
|
|
978
|
+
setEnrichment: (slug, enabled) => set((state) => {
|
|
979
|
+
if (slug !== _mountaya_elements_layers.POIS_OVERLAY_SLUG) return { activeEnrichments: toggleSlug(state.activeEnrichments, slug, enabled) };
|
|
980
|
+
const groups = poiGroupsForSource(state.activePoiGroups, enabled);
|
|
981
|
+
return {
|
|
982
|
+
activeEnrichments: reconcilePoisEnrichment(state.activeEnrichments, groups),
|
|
983
|
+
activePoiGroups: groups
|
|
984
|
+
};
|
|
985
|
+
}),
|
|
986
|
+
setOverlayTimestamp: (overlayTimestamp) => set({ overlayTimestamp }),
|
|
987
|
+
setPoiGroup: (group, enabled) => set((state) => {
|
|
988
|
+
if (!knownPoiGroups.has(group)) return {};
|
|
989
|
+
const groups = toggleSlug(state.activePoiGroups, group, enabled);
|
|
990
|
+
return {
|
|
991
|
+
activeEnrichments: reconcilePoisEnrichment(state.activeEnrichments, groups),
|
|
992
|
+
activePoiGroups: groups
|
|
993
|
+
};
|
|
994
|
+
}),
|
|
995
|
+
setPoiGroups: (groups) => set((state) => {
|
|
996
|
+
const next = uniquePoiGroups(groups);
|
|
997
|
+
return {
|
|
998
|
+
activeEnrichments: reconcilePoisEnrichment(state.activeEnrichments, next),
|
|
999
|
+
activePoiGroups: next
|
|
1000
|
+
};
|
|
1001
|
+
}),
|
|
1002
|
+
setTerrain: (terrain) => set({ terrain }),
|
|
1003
|
+
setTerrainVariant: (terrainVariant) => set({ terrainVariant })
|
|
1004
|
+
});
|
|
1005
|
+
const resolveWrite = (handed, state) => isWriteFunction(handed) ? handed(state) : handed;
|
|
1006
|
+
const isWriteFunction = (handed) => typeof handed === "function";
|
|
1007
|
+
const searchInitialState = {
|
|
1008
|
+
searchQuery: "",
|
|
1009
|
+
searchViewportScope: true
|
|
1010
|
+
};
|
|
1011
|
+
const createSearchSlice = (set) => ({
|
|
1012
|
+
setSearchQuery: (searchQuery) => set({ searchQuery }),
|
|
1013
|
+
setSearchViewportScope: (searchViewportScope) => set({ searchViewportScope })
|
|
1014
|
+
});
|
|
1015
|
+
const directionsTargetSchema = zod.object({
|
|
1016
|
+
itineraryId: zod.string(),
|
|
1017
|
+
segmentId: zod.string().nullable()
|
|
1018
|
+
});
|
|
1019
|
+
const directionsInitialState = { directionsTarget: null };
|
|
1020
|
+
const createDirectionsSlice = (set) => ({ setDirections: (directionsTarget) => set({ directionsTarget }) });
|
|
1021
|
+
const selectDirections = (state) => state.directionsTarget;
|
|
1022
|
+
const shareInitialState = { share: null };
|
|
1023
|
+
const createShareSlice = (set) => ({ setShare: (share) => set({ share }) });
|
|
1024
|
+
const selectShare = (state) => state.share;
|
|
1025
|
+
const waypointDetailsInitialState = { waypointDetailsDialog: null };
|
|
1026
|
+
const createWaypointDetailsSlice = (set) => ({ setWaypointDetailsDialog: (waypointDetailsDialog) => set({ waypointDetailsDialog }) });
|
|
1027
|
+
const selectWaypointDetails = (state) => state.waypointDetailsDialog;
|
|
1028
|
+
const createActiveDraftSlice = (_set, get) => ({
|
|
1029
|
+
removeActiveDraftSegment: (segmentId) => {
|
|
1030
|
+
const state = get();
|
|
1031
|
+
const session = showingDraftSession(state);
|
|
1032
|
+
if (session !== null && session === state.importSession) {
|
|
1033
|
+
state.removeImportDraftSegment(segmentId);
|
|
1034
|
+
return;
|
|
1035
|
+
}
|
|
1036
|
+
const draft = session?.draft;
|
|
1037
|
+
if (!draft) return;
|
|
1038
|
+
state.setSuggestDraft({
|
|
1039
|
+
...draft,
|
|
1040
|
+
segments: draft.segments.filter((segment) => segment.id !== segmentId)
|
|
1041
|
+
});
|
|
1042
|
+
},
|
|
1043
|
+
setActiveDraft: (draft) => {
|
|
1044
|
+
const state = get();
|
|
1045
|
+
const session = showingDraftSession(state);
|
|
1046
|
+
if (session === null) return;
|
|
1047
|
+
if (session === state.importSession) {
|
|
1048
|
+
state.setImportDraft(draft);
|
|
1049
|
+
return;
|
|
1050
|
+
}
|
|
1051
|
+
state.setSuggestDraft(draft);
|
|
1052
|
+
},
|
|
1053
|
+
setActiveDraftSegmentSpeed: (segmentId, speed) => {
|
|
1054
|
+
const state = get();
|
|
1055
|
+
const session = showingDraftSession(state);
|
|
1056
|
+
if (session !== null && session === state.importSession) {
|
|
1057
|
+
state.setImportDraftSegmentSpeed(segmentId, speed);
|
|
1058
|
+
return;
|
|
1059
|
+
}
|
|
1060
|
+
const draft = session?.draft;
|
|
1061
|
+
if (!draft) return;
|
|
1062
|
+
state.setSuggestDraft({
|
|
1063
|
+
...draft,
|
|
1064
|
+
segments: draft.segments.map((segment) => segment.id === segmentId ? {
|
|
1065
|
+
...segment,
|
|
1066
|
+
speed
|
|
1067
|
+
} : segment)
|
|
1068
|
+
});
|
|
1069
|
+
}
|
|
1070
|
+
});
|
|
1071
|
+
const initialState = {
|
|
1072
|
+
...require_viewer.chromeInitialState,
|
|
1073
|
+
...require_viewer.collabInitialState,
|
|
1074
|
+
...require_viewer.collectionsInitialState,
|
|
1075
|
+
...directionsInitialState,
|
|
1076
|
+
...editorReservationInitialState,
|
|
1077
|
+
...formsUnsavedInitialState,
|
|
1078
|
+
...embedContentInitialState,
|
|
1079
|
+
...embedInitialState,
|
|
1080
|
+
...importSessionInitialState,
|
|
1081
|
+
...itineraryDuplicateInitialState,
|
|
1082
|
+
...require_scope.itineraryInitialState,
|
|
1083
|
+
...layersInitialState,
|
|
1084
|
+
...require_viewer.roadAccessDialogInitialState,
|
|
1085
|
+
...searchInitialState,
|
|
1086
|
+
...require_scope.segmentEditInitialState,
|
|
1087
|
+
...require_viewer.segmentGroupEditInitialState,
|
|
1088
|
+
...require_viewer.segmentSplitInitialState,
|
|
1089
|
+
...shareInitialState,
|
|
1090
|
+
...suggestSessionInitialState,
|
|
1091
|
+
...require_viewer.videoExportInitialState,
|
|
1092
|
+
...waypointDetailsInitialState,
|
|
1093
|
+
...require_viewer.waypointEditInitialState,
|
|
1094
|
+
...require_viewer.zoneEditInitialState
|
|
1095
|
+
};
|
|
1096
|
+
const embedUiBaseline = {
|
|
1097
|
+
activeEnrichments: [],
|
|
1098
|
+
activePoiGroups: []
|
|
1099
|
+
};
|
|
1100
|
+
const createUiStore = (overrides) => (0, zustand_vanilla.createStore)(withUnchangedWritesDropped((set, get, store) => ({
|
|
1101
|
+
...initialState,
|
|
1102
|
+
...overrides,
|
|
1103
|
+
...createActiveDraftSlice(set, get, store),
|
|
1104
|
+
...require_viewer.createChromeSlice(set, get, store),
|
|
1105
|
+
...require_viewer.createCollabSlice(set, get, store),
|
|
1106
|
+
...require_viewer.createCollectionsSlice(set, get, store),
|
|
1107
|
+
...createDirectionsSlice(set, get, store),
|
|
1108
|
+
...createEditorReservationSlice(set, get, store),
|
|
1109
|
+
...createFormsUnsavedSlice(set, get, store),
|
|
1110
|
+
...createEmbedContentSlice(set, get, store),
|
|
1111
|
+
...createEmbedSlice(set, get, store),
|
|
1112
|
+
...createImportSessionSlice(set, get, store),
|
|
1113
|
+
...createItineraryDuplicateSlice(set, get, store),
|
|
1114
|
+
...require_scope.createItinerarySlice(set, get, store),
|
|
1115
|
+
...createLayersSlice(set, get, store),
|
|
1116
|
+
...require_viewer.createRoadAccessDialogSlice(set, get, store),
|
|
1117
|
+
...createSearchSlice(set, get, store),
|
|
1118
|
+
...require_scope.createSegmentEditSlice(set, get, store),
|
|
1119
|
+
...require_viewer.createSegmentGroupEditSlice(set, get, store),
|
|
1120
|
+
...require_viewer.createSegmentSplitSlice(set, get, store),
|
|
1121
|
+
...createShareSlice(set, get, store),
|
|
1122
|
+
...createSuggestSessionSlice(set, get, store),
|
|
1123
|
+
...require_viewer.createVideoExportSlice(set, get, store),
|
|
1124
|
+
...createWaypointDetailsSlice(set, get, store),
|
|
1125
|
+
...require_viewer.createWaypointEditSlice(set, get, store),
|
|
1126
|
+
...require_viewer.createZoneEditSlice(set, get, store)
|
|
1127
|
+
})));
|
|
1128
|
+
const withUnchangedWritesDropped = (creator) => (set, get, store) => {
|
|
1129
|
+
const dropping = (...write) => {
|
|
1130
|
+
if (write[1] === true) {
|
|
1131
|
+
set(write[0], true);
|
|
1132
|
+
return;
|
|
1133
|
+
}
|
|
1134
|
+
const [handed] = write;
|
|
1135
|
+
set((state) => {
|
|
1136
|
+
const patch = resolveWrite(handed, state);
|
|
1137
|
+
return changesNothing(patch, state) ? state : patch;
|
|
1138
|
+
});
|
|
1139
|
+
};
|
|
1140
|
+
store.setState = dropping;
|
|
1141
|
+
return creator(dropping, get, store);
|
|
1142
|
+
};
|
|
1143
|
+
const changesNothing = (patch, state) => {
|
|
1144
|
+
for (const key in patch) if (Object.hasOwn(patch, key) && !Object.is(patch[key], state[key])) return false;
|
|
1145
|
+
return true;
|
|
1146
|
+
};
|
|
1147
|
+
const selectProfilePaceKmh = (itineraryId) => (state) => {
|
|
1148
|
+
const override = state.profilePace;
|
|
1149
|
+
if (!override || !itineraryId || override.itineraryId !== itineraryId) return null;
|
|
1150
|
+
return override.speedKmh;
|
|
1151
|
+
};
|
|
1152
|
+
const selectProfileSheetSnap = (state) => state.profileSheetSnap;
|
|
1153
|
+
const selectSegmentViaPrompt = (state) => state.segmentViaPrompt;
|
|
1154
|
+
const selectActiveDraftSession = (state) => showingDraftSession(state);
|
|
1155
|
+
const selectActiveDraft = (state) => showingDraft(state);
|
|
1156
|
+
const selectBaseMapLocked = (state) => require_viewer.selectActiveEditEngine(state) !== null;
|
|
1157
|
+
const selectZoneEditDirty = (state) => require_shareLink.isZoneGeometryDirty(state.zoneEditSession);
|
|
1158
|
+
const selectZoneCreateSetup = (state) => state.openContent === "zone" && state.activeZone === null && state.zoneEditSession === null;
|
|
1159
|
+
const selectEditDirtyTick = (state) => state.editDirtyTick;
|
|
1160
|
+
const selectVideoExport = (state) => state.videoExport;
|
|
1161
|
+
const selectVideoExportPlan = (state) => state.videoExport?.plan ?? null;
|
|
1162
|
+
const selectVideoExportRoute = (state) => state.videoExport?.route ?? null;
|
|
1163
|
+
const selectVideoExportStatus = (state) => state.videoExport?.status ?? null;
|
|
1164
|
+
const selectImportSession = (state) => state.importSession;
|
|
1165
|
+
const selectSelectedSuggestionCandidate = (state) => {
|
|
1166
|
+
const session = state.suggestSession;
|
|
1167
|
+
if (!session || session.draft) return null;
|
|
1168
|
+
return require_viewer.selectedCandidate(session);
|
|
1169
|
+
};
|
|
1170
|
+
const selectAgentHandoffArmed = (state) => {
|
|
1171
|
+
const handoff = state.agentHandoff;
|
|
1172
|
+
if (!handoff) return false;
|
|
1173
|
+
const armed = require_viewer.agentHandoffTarget(state);
|
|
1174
|
+
return armed !== null && armed.kind === handoff.kind && armed.id === handoff.id;
|
|
1175
|
+
};
|
|
1176
|
+
const declaredBody = (value, fields) => {
|
|
1177
|
+
const body = {};
|
|
1178
|
+
for (const key of Object.keys(fields)) {
|
|
1179
|
+
const member = Reflect.get(value, key);
|
|
1180
|
+
if (Object.hasOwn(value, key) && member !== void 0) body[key] = member;
|
|
1181
|
+
}
|
|
1182
|
+
return body;
|
|
1183
|
+
};
|
|
1184
|
+
const CONFLICT = "CONFLICT";
|
|
1185
|
+
const ANSWER_UNAVAILABLE = "IDEMPOTENCY_ANSWER_UNAVAILABLE";
|
|
1186
|
+
const KEY_IN_USE = "IDEMPOTENCY_KEY_IN_USE";
|
|
1187
|
+
const PRECONDITION_FAILED_STATUS = 412;
|
|
1188
|
+
const REVISION_CONFLICT_NAME = "RevisionConflictError";
|
|
1189
|
+
var RevisionConflictError = class extends _mountaya_elements_errors.MountayaElementsError {
|
|
1190
|
+
name = REVISION_CONFLICT_NAME;
|
|
1191
|
+
};
|
|
1192
|
+
const SEGMENT_DELETE_NOT_EDGE_NAME = "SegmentDeleteNotEdgeError";
|
|
1193
|
+
var SegmentDeleteNotEdgeError = class extends _mountaya_elements_errors.MountayaElementsError {
|
|
1194
|
+
name = SEGMENT_DELETE_NOT_EDGE_NAME;
|
|
1195
|
+
detail;
|
|
1196
|
+
constructor(message, detail, options) {
|
|
1197
|
+
super(message, options);
|
|
1198
|
+
this.detail = detail;
|
|
1199
|
+
}
|
|
1200
|
+
};
|
|
1201
|
+
const errorName = (error) => {
|
|
1202
|
+
if (typeof error !== "object" || error === null || !("name" in error)) return;
|
|
1203
|
+
return typeof error.name === "string" ? error.name : void 0;
|
|
1204
|
+
};
|
|
1205
|
+
const isRevisionConflict = (error) => errorName(error) === REVISION_CONFLICT_NAME;
|
|
1206
|
+
const isSegmentDeleteNotEdge = (error) => errorName(error) === SEGMENT_DELETE_NOT_EDGE_NAME;
|
|
1207
|
+
const isFailureEntry = (value) => typeof value === "object" && value !== null && "message" in value && typeof value.message === "string";
|
|
1208
|
+
const apiFailure = (error) => {
|
|
1209
|
+
if (typeof error !== "object" || error === null || !("status" in error && "errors" in error)) return;
|
|
1210
|
+
if (typeof error.status !== "number" || !Array.isArray(error.errors)) return;
|
|
1211
|
+
return {
|
|
1212
|
+
entries: error.errors.filter(isFailureEntry),
|
|
1213
|
+
status: error.status
|
|
1214
|
+
};
|
|
1215
|
+
};
|
|
1216
|
+
const isAnswerUnavailable = (error) => {
|
|
1217
|
+
const failure = apiFailure(error);
|
|
1218
|
+
return failure?.status === 409 && failure.entries[0]?.extensions?.code === ANSWER_UNAVAILABLE;
|
|
1219
|
+
};
|
|
1220
|
+
const isKeyInUse = (error) => {
|
|
1221
|
+
const failure = apiFailure(error);
|
|
1222
|
+
return failure?.status === 409 && failure.entries[0]?.extensions?.code === KEY_IN_USE;
|
|
1223
|
+
};
|
|
1224
|
+
const madeAnswerOf = (error) => {
|
|
1225
|
+
if (!isAnswerUnavailable(error)) return;
|
|
1226
|
+
const answer = require_errors.memberOf(error, "answer");
|
|
1227
|
+
const etag = require_errors.memberOf(answer, "etag");
|
|
1228
|
+
const location = require_errors.memberOf(answer, "location");
|
|
1229
|
+
return {
|
|
1230
|
+
etag: typeof etag === "string" && etag !== "" ? etag : void 0,
|
|
1231
|
+
location: typeof location === "string" && location !== "" ? location : void 0
|
|
1232
|
+
};
|
|
1233
|
+
};
|
|
1234
|
+
const createdIdOf = (answer) => {
|
|
1235
|
+
if (answer.location === void 0) return;
|
|
1236
|
+
const [path = ""] = answer.location.split(/[?#]/, 1);
|
|
1237
|
+
const id = path.split("/").findLast((segment) => segment !== "");
|
|
1238
|
+
return id === void 0 ? void 0 : decodeURIComponent(id);
|
|
1239
|
+
};
|
|
1240
|
+
const reconcileMadeWrite = async (write, made) => {
|
|
1241
|
+
try {
|
|
1242
|
+
return await write();
|
|
1243
|
+
} catch (error) {
|
|
1244
|
+
const answer = madeAnswerOf(error);
|
|
1245
|
+
if (answer === void 0) throw error;
|
|
1246
|
+
return made(answer);
|
|
1247
|
+
}
|
|
1248
|
+
};
|
|
1249
|
+
const isChainShapeRefusal = (failure, error) => failure.status === 409 && failure.entries[0]?.extensions?.code === CONFLICT && require_errors.lockHolderOf(error) === void 0;
|
|
1250
|
+
const rethrowSegmentWriteError = (error, write) => {
|
|
1251
|
+
if (isAnswerUnavailable(error) || isKeyInUse(error)) throw error;
|
|
1252
|
+
const failure = apiFailure(error);
|
|
1253
|
+
if (failure !== void 0) {
|
|
1254
|
+
const message = error instanceof Error ? error.message : "";
|
|
1255
|
+
if (write === "delete" && isChainShapeRefusal(failure, error)) throw new SegmentDeleteNotEdgeError(message, failure.entries[0]?.message, { cause: error });
|
|
1256
|
+
if (failure.status === PRECONDITION_FAILED_STATUS || failure.status === 409 && require_errors.lockHolderOf(error) === void 0) throw new RevisionConflictError(message, { cause: error });
|
|
1257
|
+
}
|
|
1258
|
+
throw error;
|
|
1259
|
+
};
|
|
1260
|
+
const hasErrorCode = (error, code) => apiFailure(error)?.entries.some((entry) => entry.extensions?.code === code) ?? false;
|
|
1261
|
+
const isPreconditionFailed = (error) => apiFailure(error)?.status === PRECONDITION_FAILED_STATUS;
|
|
1262
|
+
const withSegmentAnalysis = (segment) => ({
|
|
1263
|
+
...segment,
|
|
1264
|
+
slope_info: segment.slope_info ?? [],
|
|
1265
|
+
steps: segment.steps ?? [],
|
|
1266
|
+
surface_info: segment.surface_info ?? [],
|
|
1267
|
+
trail_difficulty_info: segment.trail_difficulty_info ?? [],
|
|
1268
|
+
way_type_info: segment.way_type_info ?? []
|
|
1269
|
+
});
|
|
1270
|
+
const withItineraryAnalysis = (itinerary) => ({
|
|
1271
|
+
...itinerary,
|
|
1272
|
+
segments: itinerary.segments.map(withSegmentAnalysis)
|
|
1273
|
+
});
|
|
1274
|
+
const fetchItineraryRecord = async (client, itineraryId, surface) => {
|
|
1275
|
+
const body = await client.studio.itineraries.getItinerary({
|
|
1276
|
+
itinerary_id: itineraryId,
|
|
1277
|
+
query: surface === "published" ? { surface: "published" } : void 0
|
|
1278
|
+
});
|
|
1279
|
+
return withItineraryAnalysis(body.data);
|
|
1280
|
+
};
|
|
1281
|
+
const SPLIT_PICK_GESTURE = "split-pick";
|
|
1282
|
+
const selectEditorTakenBy = (state) => {
|
|
1283
|
+
const active = require_viewer.selectActiveEditEngine(state);
|
|
1284
|
+
if (active) return active.kind;
|
|
1285
|
+
if (state.segmentSplitPick !== null) return SPLIT_PICK_GESTURE;
|
|
1286
|
+
return state.editorReservation?.kind ?? null;
|
|
1287
|
+
};
|
|
1288
|
+
const samePoint = (a, b) => a === null || b === null ? a === b : a[0] === b[0] && a[1] === b[1];
|
|
1289
|
+
const isWaypointDraftDirty = (session) => {
|
|
1290
|
+
if (session === null) return false;
|
|
1291
|
+
const { draft, savedDraft } = session;
|
|
1292
|
+
if (savedDraft === null) return true;
|
|
1293
|
+
return draft.color !== savedDraft.color || draft.icon !== savedDraft.icon || draft.name !== savedDraft.name || !samePoint(draft.lngLat, savedDraft.lngLat) || draft.poiSeed?.sourceFeatureId !== savedDraft.poiSeed?.sourceFeatureId;
|
|
1294
|
+
};
|
|
1295
|
+
const isZoneWorkUnsaved = (state) => require_shareLink.isZoneGeometryDirty(state.zoneEditSession) || state.zoneFormUnsaved;
|
|
1296
|
+
const selectUnsavedWork = (state) => require_scope.isSegmentDraftDirty(state.segmentEditSession) || isWaypointDraftDirty(state.waypointEditSession) || isZoneWorkUnsaved(state) || state.itineraryFormUnsaved || state.waypointDetailsUnsaved || showingDraft(state) !== null;
|
|
1297
|
+
const lngLatOf = (position) => {
|
|
1298
|
+
const [lng, lat] = position ?? [];
|
|
1299
|
+
return lng !== void 0 && lat !== void 0 && Number.isFinite(lng) && Number.isFinite(lat) ? [lng, lat] : null;
|
|
1300
|
+
};
|
|
1301
|
+
const uuidPattern = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
1302
|
+
const hasUuidShape = (value) => uuidPattern.test(value);
|
|
1303
|
+
const indexById = (segments) => {
|
|
1304
|
+
const indices = /* @__PURE__ */ new Map();
|
|
1305
|
+
for (const [index, segment] of segments.entries()) indices.set(segment.id, index);
|
|
1306
|
+
return indices;
|
|
1307
|
+
};
|
|
1308
|
+
const runBoundsFrom = (indices, ids) => {
|
|
1309
|
+
const seen = /* @__PURE__ */ new Set();
|
|
1310
|
+
let first = Number.POSITIVE_INFINITY;
|
|
1311
|
+
let last = Number.NEGATIVE_INFINITY;
|
|
1312
|
+
for (const id of ids) {
|
|
1313
|
+
const index = indices.get(id);
|
|
1314
|
+
if (index === void 0 || seen.has(id)) return null;
|
|
1315
|
+
seen.add(id);
|
|
1316
|
+
first = Math.min(first, index);
|
|
1317
|
+
last = Math.max(last, index);
|
|
1318
|
+
}
|
|
1319
|
+
if (seen.size === 0) return null;
|
|
1320
|
+
return last - first + 1 === seen.size ? {
|
|
1321
|
+
first,
|
|
1322
|
+
last
|
|
1323
|
+
} : null;
|
|
1324
|
+
};
|
|
1325
|
+
const contiguousRunBounds = (segments, ids) => runBoundsFrom(indexById(segments), ids);
|
|
1326
|
+
const isContiguousRun = (segments, ids) => contiguousRunBounds(segments, ids) !== null;
|
|
1327
|
+
const toggleableSegmentIds = (segments, keptIds) => {
|
|
1328
|
+
const indices = indexById(segments);
|
|
1329
|
+
const keptList = [...keptIds];
|
|
1330
|
+
const kept = new Set(keptList);
|
|
1331
|
+
const toggleable = /* @__PURE__ */ new Set();
|
|
1332
|
+
if (kept.size === 0) {
|
|
1333
|
+
for (const segment of segments) toggleable.add(segment.id);
|
|
1334
|
+
return toggleable;
|
|
1335
|
+
}
|
|
1336
|
+
const bounds = runBoundsFrom(indices, keptList);
|
|
1337
|
+
if (bounds !== null) {
|
|
1338
|
+
const head = segments[bounds.first];
|
|
1339
|
+
const tail = segments[bounds.last];
|
|
1340
|
+
if (head && tail && bounds.last > bounds.first) {
|
|
1341
|
+
toggleable.add(head.id);
|
|
1342
|
+
toggleable.add(tail.id);
|
|
1343
|
+
}
|
|
1344
|
+
const above = bounds.first > 0 ? segments[bounds.first - 1] : void 0;
|
|
1345
|
+
const below = segments[bounds.last + 1];
|
|
1346
|
+
if (above) toggleable.add(above.id);
|
|
1347
|
+
if (below) toggleable.add(below.id);
|
|
1348
|
+
return toggleable;
|
|
1349
|
+
}
|
|
1350
|
+
for (const segment of segments) {
|
|
1351
|
+
const candidate = kept.has(segment.id) ? keptList.filter((id) => id !== segment.id) : [...keptList, segment.id];
|
|
1352
|
+
if (runBoundsFrom(indices, candidate) !== null) toggleable.add(segment.id);
|
|
1353
|
+
}
|
|
1354
|
+
return toggleable;
|
|
1355
|
+
};
|
|
1356
|
+
const mergedViaCount = (head, tail) => {
|
|
1357
|
+
const headVias = (0, _mountaya_elements_geo.extractVias)(head.geojson);
|
|
1358
|
+
const tailVias = (0, _mountaya_elements_geo.extractVias)(tail.geojson);
|
|
1359
|
+
const junction = headVias.at(-1);
|
|
1360
|
+
const opening = tailVias.at(0);
|
|
1361
|
+
if (junction === void 0 || opening === void 0) return headVias.length + tailVias.length;
|
|
1362
|
+
const [junctionLng, junctionLat] = junction;
|
|
1363
|
+
const [openingLng, openingLat] = opening;
|
|
1364
|
+
const shared = junctionLng === openingLng && junctionLat === openingLat;
|
|
1365
|
+
return headVias.length + tailVias.length - (shared ? 1 : 0);
|
|
1366
|
+
};
|
|
1367
|
+
const exceedsMergeViaCeiling = (head, tail) => head.mode === "directions" && mergedViaCount(head, tail) > _mountaya_elements_geo.DIRECTIONS_VIA_MAX;
|
|
1368
|
+
const splitPickVerdict = (geojson, lngLat, toleranceMeters) => {
|
|
1369
|
+
const projection = require_viewer.projectOnSegment(geojson, lngLat);
|
|
1370
|
+
if (!projection) return {
|
|
1371
|
+
code: "invalid-input",
|
|
1372
|
+
ok: false
|
|
1373
|
+
};
|
|
1374
|
+
if (!(projection.distanceMeters <= toleranceMeters)) return {
|
|
1375
|
+
code: "split-too-far",
|
|
1376
|
+
ok: false,
|
|
1377
|
+
projection
|
|
1378
|
+
};
|
|
1379
|
+
const { fraction } = projection;
|
|
1380
|
+
if (isSplitOnEnd(geojson, fraction)) return {
|
|
1381
|
+
code: "split-on-end",
|
|
1382
|
+
ok: false,
|
|
1383
|
+
projection
|
|
1384
|
+
};
|
|
1385
|
+
return {
|
|
1386
|
+
fraction,
|
|
1387
|
+
ok: true,
|
|
1388
|
+
projection
|
|
1389
|
+
};
|
|
1390
|
+
};
|
|
1391
|
+
const isSplitOnEnd = (geojson, fraction) => {
|
|
1392
|
+
const lengthMeters = require_viewer.segmentLengthMeters(geojson);
|
|
1393
|
+
const headMeters = lengthMeters * fraction;
|
|
1394
|
+
return fraction <= 0 || fraction >= 1 || headMeters < 10 || lengthMeters - headMeters < 10;
|
|
1395
|
+
};
|
|
1396
|
+
const resolveViewerUnits = (preferences) => ({
|
|
1397
|
+
language: preferences?.language || _mountaya_elements_profile.defaultUnits.language,
|
|
1398
|
+
length: preferences?.length ?? _mountaya_elements_profile.defaultUnits.length,
|
|
1399
|
+
pace: preferences?.pace ?? _mountaya_elements_profile.defaultUnits.pace,
|
|
1400
|
+
slope: preferences?.slope ?? _mountaya_elements_profile.defaultUnits.slope,
|
|
1401
|
+
temperature: preferences?.temperature ?? _mountaya_elements_profile.defaultUnits.temperature
|
|
1402
|
+
});
|
|
1403
|
+
const makeWaypointId = (ids = require_seams.studioSeamAbsences.ids) => ids.next();
|
|
1404
|
+
Object.defineProperty(exports, "HILLSHADE_OVERLAY_SLUG", {
|
|
1405
|
+
enumerable: true,
|
|
1406
|
+
get: function() {
|
|
1407
|
+
return HILLSHADE_OVERLAY_SLUG;
|
|
1408
|
+
}
|
|
1409
|
+
});
|
|
1410
|
+
Object.defineProperty(exports, "SPLIT_PICK_GESTURE", {
|
|
1411
|
+
enumerable: true,
|
|
1412
|
+
get: function() {
|
|
1413
|
+
return SPLIT_PICK_GESTURE;
|
|
1414
|
+
}
|
|
1415
|
+
});
|
|
1416
|
+
Object.defineProperty(exports, "SegmentDeleteNotEdgeError", {
|
|
1417
|
+
enumerable: true,
|
|
1418
|
+
get: function() {
|
|
1419
|
+
return SegmentDeleteNotEdgeError;
|
|
1420
|
+
}
|
|
1421
|
+
});
|
|
1422
|
+
Object.defineProperty(exports, "ToolBus", {
|
|
1423
|
+
enumerable: true,
|
|
1424
|
+
get: function() {
|
|
1425
|
+
return ToolBus;
|
|
1426
|
+
}
|
|
1427
|
+
});
|
|
1428
|
+
Object.defineProperty(exports, "allowlistForMode", {
|
|
1429
|
+
enumerable: true,
|
|
1430
|
+
get: function() {
|
|
1431
|
+
return allowlistForMode;
|
|
1432
|
+
}
|
|
1433
|
+
});
|
|
1434
|
+
Object.defineProperty(exports, "allowlistMode", {
|
|
1435
|
+
enumerable: true,
|
|
1436
|
+
get: function() {
|
|
1437
|
+
return allowlistMode;
|
|
1438
|
+
}
|
|
1439
|
+
});
|
|
1440
|
+
Object.defineProperty(exports, "allowlistUnrestricted", {
|
|
1441
|
+
enumerable: true,
|
|
1442
|
+
get: function() {
|
|
1443
|
+
return allowlistUnrestricted;
|
|
1444
|
+
}
|
|
1445
|
+
});
|
|
1446
|
+
Object.defineProperty(exports, "clampConfigToSafetyRules", {
|
|
1447
|
+
enumerable: true,
|
|
1448
|
+
get: function() {
|
|
1449
|
+
return clampConfigToSafetyRules;
|
|
1450
|
+
}
|
|
1451
|
+
});
|
|
1452
|
+
Object.defineProperty(exports, "classicOverlays", {
|
|
1453
|
+
enumerable: true,
|
|
1454
|
+
get: function() {
|
|
1455
|
+
return classicOverlays;
|
|
1456
|
+
}
|
|
1457
|
+
});
|
|
1458
|
+
Object.defineProperty(exports, "collectAttributions", {
|
|
1459
|
+
enumerable: true,
|
|
1460
|
+
get: function() {
|
|
1461
|
+
return collectAttributions;
|
|
1462
|
+
}
|
|
1463
|
+
});
|
|
1464
|
+
Object.defineProperty(exports, "confirmationToneSchema", {
|
|
1465
|
+
enumerable: true,
|
|
1466
|
+
get: function() {
|
|
1467
|
+
return confirmationToneSchema;
|
|
1468
|
+
}
|
|
1469
|
+
});
|
|
1470
|
+
Object.defineProperty(exports, "contiguousRunBounds", {
|
|
1471
|
+
enumerable: true,
|
|
1472
|
+
get: function() {
|
|
1473
|
+
return contiguousRunBounds;
|
|
1474
|
+
}
|
|
1475
|
+
});
|
|
1476
|
+
Object.defineProperty(exports, "createUiStore", {
|
|
1477
|
+
enumerable: true,
|
|
1478
|
+
get: function() {
|
|
1479
|
+
return createUiStore;
|
|
1480
|
+
}
|
|
1481
|
+
});
|
|
1482
|
+
Object.defineProperty(exports, "createdIdOf", {
|
|
1483
|
+
enumerable: true,
|
|
1484
|
+
get: function() {
|
|
1485
|
+
return createdIdOf;
|
|
1486
|
+
}
|
|
1487
|
+
});
|
|
1488
|
+
Object.defineProperty(exports, "declaredBody", {
|
|
1489
|
+
enumerable: true,
|
|
1490
|
+
get: function() {
|
|
1491
|
+
return declaredBody;
|
|
1492
|
+
}
|
|
1493
|
+
});
|
|
1494
|
+
Object.defineProperty(exports, "describeInvalidInput", {
|
|
1495
|
+
enumerable: true,
|
|
1496
|
+
get: function() {
|
|
1497
|
+
return describeInvalidInput;
|
|
1498
|
+
}
|
|
1499
|
+
});
|
|
1500
|
+
Object.defineProperty(exports, "directionsTargetSchema", {
|
|
1501
|
+
enumerable: true,
|
|
1502
|
+
get: function() {
|
|
1503
|
+
return directionsTargetSchema;
|
|
1504
|
+
}
|
|
1505
|
+
});
|
|
1506
|
+
Object.defineProperty(exports, "draftSessionIdentity", {
|
|
1507
|
+
enumerable: true,
|
|
1508
|
+
get: function() {
|
|
1509
|
+
return draftSessionIdentity;
|
|
1510
|
+
}
|
|
1511
|
+
});
|
|
1512
|
+
Object.defineProperty(exports, "draftSurfaceNames", {
|
|
1513
|
+
enumerable: true,
|
|
1514
|
+
get: function() {
|
|
1515
|
+
return draftSurfaceNames;
|
|
1516
|
+
}
|
|
1517
|
+
});
|
|
1518
|
+
Object.defineProperty(exports, "embedUiBaseline", {
|
|
1519
|
+
enumerable: true,
|
|
1520
|
+
get: function() {
|
|
1521
|
+
return embedUiBaseline;
|
|
1522
|
+
}
|
|
1523
|
+
});
|
|
1524
|
+
Object.defineProperty(exports, "enrichmentOverlays", {
|
|
1525
|
+
enumerable: true,
|
|
1526
|
+
get: function() {
|
|
1527
|
+
return enrichmentOverlays;
|
|
1528
|
+
}
|
|
1529
|
+
});
|
|
1530
|
+
Object.defineProperty(exports, "exceedsMergeViaCeiling", {
|
|
1531
|
+
enumerable: true,
|
|
1532
|
+
get: function() {
|
|
1533
|
+
return exceedsMergeViaCeiling;
|
|
1534
|
+
}
|
|
1535
|
+
});
|
|
1536
|
+
Object.defineProperty(exports, "fetchItineraryRecord", {
|
|
1537
|
+
enumerable: true,
|
|
1538
|
+
get: function() {
|
|
1539
|
+
return fetchItineraryRecord;
|
|
1540
|
+
}
|
|
1541
|
+
});
|
|
1542
|
+
Object.defineProperty(exports, "filterEnrichmentOverlays", {
|
|
1543
|
+
enumerable: true,
|
|
1544
|
+
get: function() {
|
|
1545
|
+
return filterEnrichmentOverlays;
|
|
1546
|
+
}
|
|
1547
|
+
});
|
|
1548
|
+
Object.defineProperty(exports, "filterOverlayCategories", {
|
|
1549
|
+
enumerable: true,
|
|
1550
|
+
get: function() {
|
|
1551
|
+
return filterOverlayCategories;
|
|
1552
|
+
}
|
|
1553
|
+
});
|
|
1554
|
+
Object.defineProperty(exports, "filterTerrains", {
|
|
1555
|
+
enumerable: true,
|
|
1556
|
+
get: function() {
|
|
1557
|
+
return filterTerrains;
|
|
1558
|
+
}
|
|
1559
|
+
});
|
|
1560
|
+
Object.defineProperty(exports, "findHillshadeOverlay", {
|
|
1561
|
+
enumerable: true,
|
|
1562
|
+
get: function() {
|
|
1563
|
+
return findHillshadeOverlay;
|
|
1564
|
+
}
|
|
1565
|
+
});
|
|
1566
|
+
Object.defineProperty(exports, "hasErrorCode", {
|
|
1567
|
+
enumerable: true,
|
|
1568
|
+
get: function() {
|
|
1569
|
+
return hasErrorCode;
|
|
1570
|
+
}
|
|
1571
|
+
});
|
|
1572
|
+
Object.defineProperty(exports, "hasUuidShape", {
|
|
1573
|
+
enumerable: true,
|
|
1574
|
+
get: function() {
|
|
1575
|
+
return hasUuidShape;
|
|
1576
|
+
}
|
|
1577
|
+
});
|
|
1578
|
+
Object.defineProperty(exports, "holdDraftWrite", {
|
|
1579
|
+
enumerable: true,
|
|
1580
|
+
get: function() {
|
|
1581
|
+
return holdDraftWrite;
|
|
1582
|
+
}
|
|
1583
|
+
});
|
|
1584
|
+
Object.defineProperty(exports, "holdDuringDraftCommit", {
|
|
1585
|
+
enumerable: true,
|
|
1586
|
+
get: function() {
|
|
1587
|
+
return holdDuringDraftCommit;
|
|
1588
|
+
}
|
|
1589
|
+
});
|
|
1590
|
+
Object.defineProperty(exports, "holdDuringPreview", {
|
|
1591
|
+
enumerable: true,
|
|
1592
|
+
get: function() {
|
|
1593
|
+
return holdDuringPreview;
|
|
1594
|
+
}
|
|
1595
|
+
});
|
|
1596
|
+
Object.defineProperty(exports, "holdShowingDraft", {
|
|
1597
|
+
enumerable: true,
|
|
1598
|
+
get: function() {
|
|
1599
|
+
return holdShowingDraft;
|
|
1600
|
+
}
|
|
1601
|
+
});
|
|
1602
|
+
Object.defineProperty(exports, "holdsDraftSession", {
|
|
1603
|
+
enumerable: true,
|
|
1604
|
+
get: function() {
|
|
1605
|
+
return holdsDraftSession;
|
|
1606
|
+
}
|
|
1607
|
+
});
|
|
1608
|
+
Object.defineProperty(exports, "isAnswerUnavailable", {
|
|
1609
|
+
enumerable: true,
|
|
1610
|
+
get: function() {
|
|
1611
|
+
return isAnswerUnavailable;
|
|
1612
|
+
}
|
|
1613
|
+
});
|
|
1614
|
+
Object.defineProperty(exports, "isContiguousRun", {
|
|
1615
|
+
enumerable: true,
|
|
1616
|
+
get: function() {
|
|
1617
|
+
return isContiguousRun;
|
|
1618
|
+
}
|
|
1619
|
+
});
|
|
1620
|
+
Object.defineProperty(exports, "isFieldRestricted", {
|
|
1621
|
+
enumerable: true,
|
|
1622
|
+
get: function() {
|
|
1623
|
+
return isFieldRestricted;
|
|
1624
|
+
}
|
|
1625
|
+
});
|
|
1626
|
+
Object.defineProperty(exports, "isKeyInUse", {
|
|
1627
|
+
enumerable: true,
|
|
1628
|
+
get: function() {
|
|
1629
|
+
return isKeyInUse;
|
|
1630
|
+
}
|
|
1631
|
+
});
|
|
1632
|
+
Object.defineProperty(exports, "isPreconditionFailed", {
|
|
1633
|
+
enumerable: true,
|
|
1634
|
+
get: function() {
|
|
1635
|
+
return isPreconditionFailed;
|
|
1636
|
+
}
|
|
1637
|
+
});
|
|
1638
|
+
Object.defineProperty(exports, "isRevisionConflict", {
|
|
1639
|
+
enumerable: true,
|
|
1640
|
+
get: function() {
|
|
1641
|
+
return isRevisionConflict;
|
|
1642
|
+
}
|
|
1643
|
+
});
|
|
1644
|
+
Object.defineProperty(exports, "isSegmentDeleteNotEdge", {
|
|
1645
|
+
enumerable: true,
|
|
1646
|
+
get: function() {
|
|
1647
|
+
return isSegmentDeleteNotEdge;
|
|
1648
|
+
}
|
|
1649
|
+
});
|
|
1650
|
+
Object.defineProperty(exports, "isSplitOnEnd", {
|
|
1651
|
+
enumerable: true,
|
|
1652
|
+
get: function() {
|
|
1653
|
+
return isSplitOnEnd;
|
|
1654
|
+
}
|
|
1655
|
+
});
|
|
1656
|
+
Object.defineProperty(exports, "isZoneWorkUnsaved", {
|
|
1657
|
+
enumerable: true,
|
|
1658
|
+
get: function() {
|
|
1659
|
+
return isZoneWorkUnsaved;
|
|
1660
|
+
}
|
|
1661
|
+
});
|
|
1662
|
+
Object.defineProperty(exports, "lngLatOf", {
|
|
1663
|
+
enumerable: true,
|
|
1664
|
+
get: function() {
|
|
1665
|
+
return lngLatOf;
|
|
1666
|
+
}
|
|
1667
|
+
});
|
|
1668
|
+
Object.defineProperty(exports, "makeWaypointId", {
|
|
1669
|
+
enumerable: true,
|
|
1670
|
+
get: function() {
|
|
1671
|
+
return makeWaypointId;
|
|
1672
|
+
}
|
|
1673
|
+
});
|
|
1674
|
+
Object.defineProperty(exports, "reconcileMadeWrite", {
|
|
1675
|
+
enumerable: true,
|
|
1676
|
+
get: function() {
|
|
1677
|
+
return reconcileMadeWrite;
|
|
1678
|
+
}
|
|
1679
|
+
});
|
|
1680
|
+
Object.defineProperty(exports, "registerStudioTools", {
|
|
1681
|
+
enumerable: true,
|
|
1682
|
+
get: function() {
|
|
1683
|
+
return registerStudioTools;
|
|
1684
|
+
}
|
|
1685
|
+
});
|
|
1686
|
+
Object.defineProperty(exports, "resolveViewerUnits", {
|
|
1687
|
+
enumerable: true,
|
|
1688
|
+
get: function() {
|
|
1689
|
+
return resolveViewerUnits;
|
|
1690
|
+
}
|
|
1691
|
+
});
|
|
1692
|
+
Object.defineProperty(exports, "rethrowSegmentWriteError", {
|
|
1693
|
+
enumerable: true,
|
|
1694
|
+
get: function() {
|
|
1695
|
+
return rethrowSegmentWriteError;
|
|
1696
|
+
}
|
|
1697
|
+
});
|
|
1698
|
+
Object.defineProperty(exports, "selectActiveDraft", {
|
|
1699
|
+
enumerable: true,
|
|
1700
|
+
get: function() {
|
|
1701
|
+
return selectActiveDraft;
|
|
1702
|
+
}
|
|
1703
|
+
});
|
|
1704
|
+
Object.defineProperty(exports, "selectActiveDraftSession", {
|
|
1705
|
+
enumerable: true,
|
|
1706
|
+
get: function() {
|
|
1707
|
+
return selectActiveDraftSession;
|
|
1708
|
+
}
|
|
1709
|
+
});
|
|
1710
|
+
Object.defineProperty(exports, "selectAgentHandoffArmed", {
|
|
1711
|
+
enumerable: true,
|
|
1712
|
+
get: function() {
|
|
1713
|
+
return selectAgentHandoffArmed;
|
|
1714
|
+
}
|
|
1715
|
+
});
|
|
1716
|
+
Object.defineProperty(exports, "selectBaseMapLocked", {
|
|
1717
|
+
enumerable: true,
|
|
1718
|
+
get: function() {
|
|
1719
|
+
return selectBaseMapLocked;
|
|
1720
|
+
}
|
|
1721
|
+
});
|
|
1722
|
+
Object.defineProperty(exports, "selectDirections", {
|
|
1723
|
+
enumerable: true,
|
|
1724
|
+
get: function() {
|
|
1725
|
+
return selectDirections;
|
|
1726
|
+
}
|
|
1727
|
+
});
|
|
1728
|
+
Object.defineProperty(exports, "selectEditDirtyTick", {
|
|
1729
|
+
enumerable: true,
|
|
1730
|
+
get: function() {
|
|
1731
|
+
return selectEditDirtyTick;
|
|
1732
|
+
}
|
|
1733
|
+
});
|
|
1734
|
+
Object.defineProperty(exports, "selectEditorTakenBy", {
|
|
1735
|
+
enumerable: true,
|
|
1736
|
+
get: function() {
|
|
1737
|
+
return selectEditorTakenBy;
|
|
1738
|
+
}
|
|
1739
|
+
});
|
|
1740
|
+
Object.defineProperty(exports, "selectEmbed", {
|
|
1741
|
+
enumerable: true,
|
|
1742
|
+
get: function() {
|
|
1743
|
+
return selectEmbed;
|
|
1744
|
+
}
|
|
1745
|
+
});
|
|
1746
|
+
Object.defineProperty(exports, "selectEmbedContent", {
|
|
1747
|
+
enumerable: true,
|
|
1748
|
+
get: function() {
|
|
1749
|
+
return selectEmbedContent;
|
|
1750
|
+
}
|
|
1751
|
+
});
|
|
1752
|
+
Object.defineProperty(exports, "selectImportSession", {
|
|
1753
|
+
enumerable: true,
|
|
1754
|
+
get: function() {
|
|
1755
|
+
return selectImportSession;
|
|
1756
|
+
}
|
|
1757
|
+
});
|
|
1758
|
+
Object.defineProperty(exports, "selectProfilePaceKmh", {
|
|
1759
|
+
enumerable: true,
|
|
1760
|
+
get: function() {
|
|
1761
|
+
return selectProfilePaceKmh;
|
|
1762
|
+
}
|
|
1763
|
+
});
|
|
1764
|
+
Object.defineProperty(exports, "selectProfileSheetSnap", {
|
|
1765
|
+
enumerable: true,
|
|
1766
|
+
get: function() {
|
|
1767
|
+
return selectProfileSheetSnap;
|
|
1768
|
+
}
|
|
1769
|
+
});
|
|
1770
|
+
Object.defineProperty(exports, "selectSegmentViaPrompt", {
|
|
1771
|
+
enumerable: true,
|
|
1772
|
+
get: function() {
|
|
1773
|
+
return selectSegmentViaPrompt;
|
|
1774
|
+
}
|
|
1775
|
+
});
|
|
1776
|
+
Object.defineProperty(exports, "selectSelectedSuggestionCandidate", {
|
|
1777
|
+
enumerable: true,
|
|
1778
|
+
get: function() {
|
|
1779
|
+
return selectSelectedSuggestionCandidate;
|
|
1780
|
+
}
|
|
1781
|
+
});
|
|
1782
|
+
Object.defineProperty(exports, "selectShare", {
|
|
1783
|
+
enumerable: true,
|
|
1784
|
+
get: function() {
|
|
1785
|
+
return selectShare;
|
|
1786
|
+
}
|
|
1787
|
+
});
|
|
1788
|
+
Object.defineProperty(exports, "selectUnsavedWork", {
|
|
1789
|
+
enumerable: true,
|
|
1790
|
+
get: function() {
|
|
1791
|
+
return selectUnsavedWork;
|
|
1792
|
+
}
|
|
1793
|
+
});
|
|
1794
|
+
Object.defineProperty(exports, "selectVideoExport", {
|
|
1795
|
+
enumerable: true,
|
|
1796
|
+
get: function() {
|
|
1797
|
+
return selectVideoExport;
|
|
1798
|
+
}
|
|
1799
|
+
});
|
|
1800
|
+
Object.defineProperty(exports, "selectVideoExportPlan", {
|
|
1801
|
+
enumerable: true,
|
|
1802
|
+
get: function() {
|
|
1803
|
+
return selectVideoExportPlan;
|
|
1804
|
+
}
|
|
1805
|
+
});
|
|
1806
|
+
Object.defineProperty(exports, "selectVideoExportRoute", {
|
|
1807
|
+
enumerable: true,
|
|
1808
|
+
get: function() {
|
|
1809
|
+
return selectVideoExportRoute;
|
|
1810
|
+
}
|
|
1811
|
+
});
|
|
1812
|
+
Object.defineProperty(exports, "selectVideoExportStatus", {
|
|
1813
|
+
enumerable: true,
|
|
1814
|
+
get: function() {
|
|
1815
|
+
return selectVideoExportStatus;
|
|
1816
|
+
}
|
|
1817
|
+
});
|
|
1818
|
+
Object.defineProperty(exports, "selectWaypointDetails", {
|
|
1819
|
+
enumerable: true,
|
|
1820
|
+
get: function() {
|
|
1821
|
+
return selectWaypointDetails;
|
|
1822
|
+
}
|
|
1823
|
+
});
|
|
1824
|
+
Object.defineProperty(exports, "selectZoneCreateSetup", {
|
|
1825
|
+
enumerable: true,
|
|
1826
|
+
get: function() {
|
|
1827
|
+
return selectZoneCreateSetup;
|
|
1828
|
+
}
|
|
1829
|
+
});
|
|
1830
|
+
Object.defineProperty(exports, "selectZoneEditDirty", {
|
|
1831
|
+
enumerable: true,
|
|
1832
|
+
get: function() {
|
|
1833
|
+
return selectZoneEditDirty;
|
|
1834
|
+
}
|
|
1835
|
+
});
|
|
1836
|
+
Object.defineProperty(exports, "showingDraft", {
|
|
1837
|
+
enumerable: true,
|
|
1838
|
+
get: function() {
|
|
1839
|
+
return showingDraft;
|
|
1840
|
+
}
|
|
1841
|
+
});
|
|
1842
|
+
Object.defineProperty(exports, "showingDraftSession", {
|
|
1843
|
+
enumerable: true,
|
|
1844
|
+
get: function() {
|
|
1845
|
+
return showingDraftSession;
|
|
1846
|
+
}
|
|
1847
|
+
});
|
|
1848
|
+
Object.defineProperty(exports, "showingDraftSurface", {
|
|
1849
|
+
enumerable: true,
|
|
1850
|
+
get: function() {
|
|
1851
|
+
return showingDraftSurface;
|
|
1852
|
+
}
|
|
1853
|
+
});
|
|
1854
|
+
Object.defineProperty(exports, "splitPickVerdict", {
|
|
1855
|
+
enumerable: true,
|
|
1856
|
+
get: function() {
|
|
1857
|
+
return splitPickVerdict;
|
|
1858
|
+
}
|
|
1859
|
+
});
|
|
1860
|
+
Object.defineProperty(exports, "studioRegistry", {
|
|
1861
|
+
enumerable: true,
|
|
1862
|
+
get: function() {
|
|
1863
|
+
return studioRegistry;
|
|
1864
|
+
}
|
|
1865
|
+
});
|
|
1866
|
+
Object.defineProperty(exports, "toggleableSegmentIds", {
|
|
1867
|
+
enumerable: true,
|
|
1868
|
+
get: function() {
|
|
1869
|
+
return toggleableSegmentIds;
|
|
1870
|
+
}
|
|
1871
|
+
});
|
|
1872
|
+
Object.defineProperty(exports, "toolCapabilitySchema", {
|
|
1873
|
+
enumerable: true,
|
|
1874
|
+
get: function() {
|
|
1875
|
+
return toolCapabilitySchema;
|
|
1876
|
+
}
|
|
1877
|
+
});
|
|
1878
|
+
Object.defineProperty(exports, "toolConfirmationSchema", {
|
|
1879
|
+
enumerable: true,
|
|
1880
|
+
get: function() {
|
|
1881
|
+
return toolConfirmationSchema;
|
|
1882
|
+
}
|
|
1883
|
+
});
|
|
1884
|
+
Object.defineProperty(exports, "toolErrorCodeSchema", {
|
|
1885
|
+
enumerable: true,
|
|
1886
|
+
get: function() {
|
|
1887
|
+
return toolErrorCodeSchema;
|
|
1888
|
+
}
|
|
1889
|
+
});
|
|
1890
|
+
Object.defineProperty(exports, "withItineraryAnalysis", {
|
|
1891
|
+
enumerable: true,
|
|
1892
|
+
get: function() {
|
|
1893
|
+
return withItineraryAnalysis;
|
|
1894
|
+
}
|
|
1895
|
+
});
|
|
1896
|
+
Object.defineProperty(exports, "withSegmentAnalysis", {
|
|
1897
|
+
enumerable: true,
|
|
1898
|
+
get: function() {
|
|
1899
|
+
return withSegmentAnalysis;
|
|
1900
|
+
}
|
|
1901
|
+
});
|
|
1902
|
+
|
|
1903
|
+
//# sourceMappingURL=chunk-DX37IPhV.cjs.map
|