@stacksjs/mobile 0.75.397 → 0.75.399
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/dist/index.d.ts +20 -4
- package/dist/index.js +2 -2
- package/dist/route.d.ts +2 -1
- package/dist/types.d.ts +16 -2
- package/package.json +4 -4
package/dist/index.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ import { NativeTab } from 'craft-native/mobile';
|
|
|
8
8
|
|
|
9
9
|
// From: src/index.ts
|
|
10
10
|
declare function locationRecordingOwnership(): boolean;
|
|
11
|
+
declare function locationRecordingPowerMode(): boolean;
|
|
11
12
|
declare function heartRateRecordingOwnership(): boolean;
|
|
12
13
|
declare function locationRecordingIntentIdentity(): boolean;
|
|
13
14
|
declare function heartRateRecordingIntentIdentity(): boolean;
|
|
@@ -598,6 +599,7 @@ declare interface RouteRecorder {
|
|
|
598
599
|
attach: (options: { expectedId: string, expectedHeartRateId?: string }) => Promise<LocationRecordingState | null>
|
|
599
600
|
pause: () => Promise<void>
|
|
600
601
|
resume: () => Promise<void>
|
|
602
|
+
setPowerMode: (powerMode: LocationPowerMode) => Promise<boolean>
|
|
601
603
|
stop: () => Promise<RouteFix[]>
|
|
602
604
|
refresh: () => Promise<RouteStats>
|
|
603
605
|
dispose: () => void
|
|
@@ -1398,6 +1400,7 @@ declare interface CraftMobileCapabilities {
|
|
|
1398
1400
|
backgroundLocation?: boolean
|
|
1399
1401
|
locationRecordingOwnership?: boolean
|
|
1400
1402
|
locationRecordingIntentIdentity?: boolean
|
|
1403
|
+
locationRecordingPowerMode?: boolean
|
|
1401
1404
|
heartRateRecordingIntentIdentity?: boolean
|
|
1402
1405
|
heartRateRecordingOwnership?: boolean
|
|
1403
1406
|
healthKit?: boolean
|
|
@@ -1552,6 +1555,8 @@ declare interface LocationRecordingState {
|
|
|
1552
1555
|
paused: boolean
|
|
1553
1556
|
startedAt: number | null
|
|
1554
1557
|
sampleCount?: number
|
|
1558
|
+
powerMode?: LocationPowerMode
|
|
1559
|
+
effectivePowerMode?: LocationEffectivePowerMode
|
|
1555
1560
|
}
|
|
1556
1561
|
/** An identity already registered durably by the caller before native start. */
|
|
1557
1562
|
declare interface RecordingStartOptions {
|
|
@@ -1646,9 +1651,15 @@ declare interface RecordingOwnershipOptions {
|
|
|
1646
1651
|
declare interface LocationRecordingReadOptions extends RecordingOwnershipOptions {
|
|
1647
1652
|
since?: number
|
|
1648
1653
|
}
|
|
1654
|
+
/** Change the power mode of the recording that is running, fenced to its ID. */
|
|
1655
|
+
declare interface LocationRecordingPowerModeOptions extends RecordingOwnershipOptions {
|
|
1656
|
+
powerMode: LocationPowerMode
|
|
1657
|
+
}
|
|
1649
1658
|
declare interface LocationApi {
|
|
1650
1659
|
supportsRecordingOwnership: () => boolean
|
|
1651
1660
|
supportsRecordingIntentIdentity: () => boolean
|
|
1661
|
+
supportsRecordingPowerMode: () => boolean
|
|
1662
|
+
setRecordingPowerMode: (options: LocationRecordingPowerModeOptions) => Promise<LocationRecordingState>
|
|
1652
1663
|
acknowledgeRecording: (options: RecordingOwnershipOptions) => Promise<boolean>
|
|
1653
1664
|
getCurrentPosition: (options?: LocationOptions) => Promise<Location>
|
|
1654
1665
|
watchPosition: (callback: (location: Location) => void, options?: LocationOptions) => number
|
|
@@ -2025,9 +2036,14 @@ type BiometricType = 'faceId' | 'touchId' | 'fingerprint' | 'face' | 'iris' | 'n
|
|
|
2025
2036
|
* 5 m apart instead of every second, and iOS relaxes to ten-metre accuracy
|
|
2026
2037
|
* while the pace holds steady. 5 m keeps fixes under ROUTE_GAP_S apart at any
|
|
2027
2038
|
* speed that counts as moving, so distance and moving time come out as at
|
|
2028
|
-
* full rate.
|
|
2029
|
-
|
|
2030
|
-
|
|
2039
|
+
* full rate. `'auto'` (Craft 0.0.403+, check `supportsRecordingPowerMode()`)
|
|
2040
|
+
* saves power only while the device wants it: Low Power Mode, Battery Saver, or
|
|
2041
|
+
* under 20% and not charging; read what it resolved to from
|
|
2042
|
+
* `effectivePowerMode` on the recording's state.
|
|
2043
|
+
*/
|
|
2044
|
+
type LocationPowerMode = 'default' | 'saver' | 'auto';
|
|
2045
|
+
/** What a recording is using right now; `'auto'` resolves to one of these. */
|
|
2046
|
+
type LocationEffectivePowerMode = 'default' | 'saver';
|
|
2031
2047
|
type AppState = 'active' | 'inactive' | 'background';
|
|
2032
2048
|
type HapticKind = 'impact' | 'notification' | 'selection';
|
|
2033
2049
|
/** Whether the person has let the app see their music. `unavailable` off a phone. */
|
|
@@ -2105,6 +2121,6 @@ declare interface VoiceRecorder {
|
|
|
2105
2121
|
}
|
|
2106
2122
|
type VoiceRecorderStatus = 'idle' | 'requesting' | 'recording' | 'ready' | 'error';
|
|
2107
2123
|
|
|
2108
|
-
export { normalizeDeepLinkURL, getNativeMobileBridge, isNativeMobile, whenNativeMobile, onMobileReady, withNativeFeedback, biometrics, camera, device, lifecycle, location, notifications, permissions, secureStorage, share, appReview, haptics, deepLinks, snapshots, keepAwake, brightness, music, heartRate, speech, network, pushNotifications, health, liveActivities, watchConnectivity, splash, mobile, NativeVoiceFile, VoiceRecorder, VoiceRecorderOptions, VoiceRecorderSnapshot, VoiceRecorderStatus, createVoiceRecorder, voiceRecordingFormData, craftHost, craftRoot, hasNativeMobileHost, bridgePending, whenBridgeReady, nativeFunctionNow, nativeFunction, callNative, afterBridge, subscribeWhenReady, onCraftEvent, BRIDGE_WAIT_MS, CraftHost, CallNativeOptions, observeLongPress, segmentAt, observeSegmentScrub, segmentForKey, focusSegment, installPressables, LongPressOptions, SegmentScrubOptions, keepBreadcrumb, crashReporting, CrashReportingOptions, currentAppearance, normalizeAppearance, onAppearance, onResume, onMemoryWarning, onSilentPush, onBackgroundRefresh, NativeAppearance, pageScrollTop, observePageScroll, pullDistance, observePullToRefresh, largeTitleMetrics, observeLargeTitle, resolveScrollHost, ScrollHost, PullToRefreshOptions, LargeTitleMetrics, LargeTitleOptions, canGoBack, goBack, enterNavTrail, backLabelFor, navTrail, previousScreenPath, goBackToTabRoot, trailEntryFor, deepLinkPath, followDeepLinks, HistoryHost, NavTrailEntry, TabRootHost, attachHeartRate, fixDistance, usableFixes, createRouteStats, routeStats, paceLabel, speedLabel, routeReadInterval, createRouteRecorder, HEART_RATE_MATCH_MS, ROUTE_GAP_S, ROUTE_FULL_READ_FIXES, ROUTE_FULL_READ_MAX_MS, RouteFix, RouteStats, RouteStatsOptions, RouteStatsAccumulator, RouteRecorderOptions, RouteRecorder, scheduledWorkoutsUnsupported, normalizeScheduledWorkout, scheduledWorkouts, AppleWorkoutStep, AppleIntervalBlock, AppleCustomWorkout, AppleWorkoutPlan, ScheduledWorkout, ScheduleWorkoutResult, ScheduledWorkoutsApi, ScheduledWorkoutsAuthorization, AppleWorkoutGoal, AppleWorkoutAlert, ScheduledWorkoutsMethod, startSessionClock, pauseSessionClock, resumeSessionClock, sessionClockElapsed, SessionClock, indoorVerdict, typedDistanceKm, INDOOR_CHECK_AFTER_S, IndoorFix, IndoorVerdict, toNativeRect, useActionSheet, confirmAction, showContextMenuFor, dialog, contextMenu, browser, symbols, statusBar, chrome, refresh, background, clipboard, db, files, shortcuts, widgets, orientation, auth, storeKit, DialogApi, ConfirmActionOptions, ContextMenuApi, BrowserOpenOptions, BrowserResult, BrowserApi, SymbolOptions, SymbolsApi, StatusBarApi, ChromeApi, RefreshApi, BackgroundApi, ClipboardApi, DatabaseExecuteResult, DatabaseApi, PickedFile, ScannedCode, FilesApi, HomeScreenShortcut, ShortcutsApi, WidgetsApi, OrientationApi, AppleSignInResult, AppleSignInOptions, AuthApi, StoreProduct, StoreTransaction, StoreKitApi, StatusBarStyle, OrientationLock, ActionSheetOptions, AlertOptions, ChoiceOptions, ConfirmOptions, ContextMenuItem, ContextMenuOptions, DialogAction, DialogActionStyle, NativeRect, isShown, observeNativeRefresh, NativeRefreshOptions, sheetStops, settleSheet, rubberBand, observeSheetDrag, liftToBody, presentPageAsCard, SHEET_FLICK_VELOCITY, SheetStop, SheetDragOptions, SheetDetent, SheetSettle, presentChoice, presentAlert, presentConfirm, presentActionSheet, placeMenu, presentContextMenu, applyAppearance, pageBackground, pageIsDark, installNativeChrome, NativeChromeOptions, readSpotlightKinds, spotlightKind, spotlightAction, spotlightSlot, spotlightActions, spotlightActivityTypes, spotlightTitle, placeSpotlightItem, removeSpotlightItem, spotlightRoute, readSpotlightEntries, spotlightBridge, createSpotlightIndex, onSpotlightTap, MAX_SPOTLIGHT_SLOTS_PER_KIND, SpotlightKind, SpotlightKindInput, SpotlightItem, SpotlightEntry, SpotlightKindsResult, SpotlightPlacement, SpotlightBridge, SpotlightIndexOptions, SpotlightIndex, readTabLinks, nativeTabs, routerHandlesTabs, handleTabReselect, coverTabBar, mirrorTabBar, tabBar, TAB_BAR_COVER_EVENT, TabBarApi, TabLink, TabReselectOptions, MirrorTabBarOptions, CraftMobileCapabilities, CraftMobileBridge, CraftReadyEvent, MobileApi, DeviceInfo, DeviceCapabilities, CameraOptions, PhotoResult, Location, LocationOptions, LocationRecordingState, RecordingStartOptions, LocationRecordingOptions, LocationRecordingResult, ShareOptions, NotificationOptions, DeviceApi, HapticsApi, PermissionsApi, CameraApi, BiometricsApi, StorageApi, CryptoApi, SecureStorageApi, RecordingOwnershipOptions, LocationRecordingReadOptions, LocationApi, ShareApi, LifecycleApi, NotificationsApi, KeepAwakeApi, BrightnessApi, SpeechOptions, SpeechApi, NowPlaying, MusicSkipOptions, HeartRateDevice, HeartRateRecordingState, HeartRateState, HeartRateReading, HeartRateSample, HeartRateRecordingApi, HeartRateApi, MusicApi, DeepLinksApi, SnapshotsApi, NetworkStatus, NetworkApi, AppReviewApi, PushNotificationsApi, HealthQuantitySample, HealthDataOptions, HealthDataResult, HealthWorkoutLocation, HealthWorkout, HealthWorkoutResult, HealthWorkoutQuery, HealthWorkoutSample, HealthDailyValue, HealthSampleQuery, HealthHeartRateQuery, HealthHeartRateSample, HealthSleepInterval, HealthMindfulSession, HealthMindfulSessionResult, HealthMindfulSessionQuery, HealthMindfulSample, HealthHeartRateUpdatesOptions, HealthAuthorizationOptions, HealthApi, LiveActivityState, LiveActivityOptions, LiveActivitiesApi, WatchConnectivityApi, HapticStyle, HapticNotificationType, PermissionType, PermissionStatus, BiometricType, LocationPowerMode, AppState, HapticKind, MusicAuthorization, MusicPlaybackState, MusicMethod, HeartRateAuthorization, BluetoothState, HeartRateConnection, HeartRateMethod, HealthDataType, HealthDailyType, HealthSampleType, HealthWorkoutType, HealthWorkoutActivity, HealthSleepStage, HealthReadMethod, storage, crypto };
|
|
2124
|
+
export { normalizeDeepLinkURL, getNativeMobileBridge, isNativeMobile, whenNativeMobile, onMobileReady, withNativeFeedback, biometrics, camera, device, lifecycle, location, notifications, permissions, secureStorage, share, appReview, haptics, deepLinks, snapshots, keepAwake, brightness, music, heartRate, speech, network, pushNotifications, health, liveActivities, watchConnectivity, splash, mobile, NativeVoiceFile, VoiceRecorder, VoiceRecorderOptions, VoiceRecorderSnapshot, VoiceRecorderStatus, createVoiceRecorder, voiceRecordingFormData, craftHost, craftRoot, hasNativeMobileHost, bridgePending, whenBridgeReady, nativeFunctionNow, nativeFunction, callNative, afterBridge, subscribeWhenReady, onCraftEvent, BRIDGE_WAIT_MS, CraftHost, CallNativeOptions, observeLongPress, segmentAt, observeSegmentScrub, segmentForKey, focusSegment, installPressables, LongPressOptions, SegmentScrubOptions, keepBreadcrumb, crashReporting, CrashReportingOptions, currentAppearance, normalizeAppearance, onAppearance, onResume, onMemoryWarning, onSilentPush, onBackgroundRefresh, NativeAppearance, pageScrollTop, observePageScroll, pullDistance, observePullToRefresh, largeTitleMetrics, observeLargeTitle, resolveScrollHost, ScrollHost, PullToRefreshOptions, LargeTitleMetrics, LargeTitleOptions, canGoBack, goBack, enterNavTrail, backLabelFor, navTrail, previousScreenPath, goBackToTabRoot, trailEntryFor, deepLinkPath, followDeepLinks, HistoryHost, NavTrailEntry, TabRootHost, attachHeartRate, fixDistance, usableFixes, createRouteStats, routeStats, paceLabel, speedLabel, routeReadInterval, createRouteRecorder, HEART_RATE_MATCH_MS, ROUTE_GAP_S, ROUTE_FULL_READ_FIXES, ROUTE_FULL_READ_MAX_MS, RouteFix, RouteStats, RouteStatsOptions, RouteStatsAccumulator, RouteRecorderOptions, RouteRecorder, scheduledWorkoutsUnsupported, normalizeScheduledWorkout, scheduledWorkouts, AppleWorkoutStep, AppleIntervalBlock, AppleCustomWorkout, AppleWorkoutPlan, ScheduledWorkout, ScheduleWorkoutResult, ScheduledWorkoutsApi, ScheduledWorkoutsAuthorization, AppleWorkoutGoal, AppleWorkoutAlert, ScheduledWorkoutsMethod, startSessionClock, pauseSessionClock, resumeSessionClock, sessionClockElapsed, SessionClock, indoorVerdict, typedDistanceKm, INDOOR_CHECK_AFTER_S, IndoorFix, IndoorVerdict, toNativeRect, useActionSheet, confirmAction, showContextMenuFor, dialog, contextMenu, browser, symbols, statusBar, chrome, refresh, background, clipboard, db, files, shortcuts, widgets, orientation, auth, storeKit, DialogApi, ConfirmActionOptions, ContextMenuApi, BrowserOpenOptions, BrowserResult, BrowserApi, SymbolOptions, SymbolsApi, StatusBarApi, ChromeApi, RefreshApi, BackgroundApi, ClipboardApi, DatabaseExecuteResult, DatabaseApi, PickedFile, ScannedCode, FilesApi, HomeScreenShortcut, ShortcutsApi, WidgetsApi, OrientationApi, AppleSignInResult, AppleSignInOptions, AuthApi, StoreProduct, StoreTransaction, StoreKitApi, StatusBarStyle, OrientationLock, ActionSheetOptions, AlertOptions, ChoiceOptions, ConfirmOptions, ContextMenuItem, ContextMenuOptions, DialogAction, DialogActionStyle, NativeRect, isShown, observeNativeRefresh, NativeRefreshOptions, sheetStops, settleSheet, rubberBand, observeSheetDrag, liftToBody, presentPageAsCard, SHEET_FLICK_VELOCITY, SheetStop, SheetDragOptions, SheetDetent, SheetSettle, presentChoice, presentAlert, presentConfirm, presentActionSheet, placeMenu, presentContextMenu, applyAppearance, pageBackground, pageIsDark, installNativeChrome, NativeChromeOptions, readSpotlightKinds, spotlightKind, spotlightAction, spotlightSlot, spotlightActions, spotlightActivityTypes, spotlightTitle, placeSpotlightItem, removeSpotlightItem, spotlightRoute, readSpotlightEntries, spotlightBridge, createSpotlightIndex, onSpotlightTap, MAX_SPOTLIGHT_SLOTS_PER_KIND, SpotlightKind, SpotlightKindInput, SpotlightItem, SpotlightEntry, SpotlightKindsResult, SpotlightPlacement, SpotlightBridge, SpotlightIndexOptions, SpotlightIndex, readTabLinks, nativeTabs, routerHandlesTabs, handleTabReselect, coverTabBar, mirrorTabBar, tabBar, TAB_BAR_COVER_EVENT, TabBarApi, TabLink, TabReselectOptions, MirrorTabBarOptions, CraftMobileCapabilities, CraftMobileBridge, CraftReadyEvent, MobileApi, DeviceInfo, DeviceCapabilities, CameraOptions, PhotoResult, Location, LocationOptions, LocationRecordingState, RecordingStartOptions, LocationRecordingOptions, LocationRecordingResult, ShareOptions, NotificationOptions, DeviceApi, HapticsApi, PermissionsApi, CameraApi, BiometricsApi, StorageApi, CryptoApi, SecureStorageApi, RecordingOwnershipOptions, LocationRecordingReadOptions, LocationRecordingPowerModeOptions, LocationApi, ShareApi, LifecycleApi, NotificationsApi, KeepAwakeApi, BrightnessApi, SpeechOptions, SpeechApi, NowPlaying, MusicSkipOptions, HeartRateDevice, HeartRateRecordingState, HeartRateState, HeartRateReading, HeartRateSample, HeartRateRecordingApi, HeartRateApi, MusicApi, DeepLinksApi, SnapshotsApi, NetworkStatus, NetworkApi, AppReviewApi, PushNotificationsApi, HealthQuantitySample, HealthDataOptions, HealthDataResult, HealthWorkoutLocation, HealthWorkout, HealthWorkoutResult, HealthWorkoutQuery, HealthWorkoutSample, HealthDailyValue, HealthSampleQuery, HealthHeartRateQuery, HealthHeartRateSample, HealthSleepInterval, HealthMindfulSession, HealthMindfulSessionResult, HealthMindfulSessionQuery, HealthMindfulSample, HealthHeartRateUpdatesOptions, HealthAuthorizationOptions, HealthApi, LiveActivityState, LiveActivityOptions, LiveActivitiesApi, WatchConnectivityApi, HapticStyle, HapticNotificationType, PermissionType, PermissionStatus, BiometricType, LocationPowerMode, LocationEffectivePowerMode, AppState, HapticKind, MusicAuthorization, MusicPlaybackState, MusicMethod, HeartRateAuthorization, BluetoothState, HeartRateConnection, HeartRateMethod, HealthDataType, HealthDailyType, HealthSampleType, HealthWorkoutType, HealthWorkoutActivity, HealthSleepStage, HealthReadMethod, storage, crypto };
|
|
2109
2125
|
export { NativeTab } from 'craft-native/mobile';
|
|
2110
2126
|
export { NativeTabBarOptions } from 'craft-native/mobile';
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{appReview as
|
|
1
|
+
import{appReview as lr,biometrics as We,brightness as xe,camera as Ae,deepLinks as Bt,device as Z,haptics as ke,health as ue,heartRate as T,keepAwake as Ft,lifecycle as cr,liveActivities as $e,location as D,music as j,network as Ut,notifications as de,permissions as pe,pushNotifications as Ke,secureStorage as Ee,share as Wt,speech as je,snapshots as Te,splash as ur,watchConnectivity as fe}from"craft-native/mobile";var Dr=2500;function E(){if(typeof window>"u")return;return window}function Q(){let e=E()?.craft;return e&&typeof e==="object"?e:void 0}function Gt(){return typeof navigator>"u"?"":navigator.userAgent||""}function re(){let e=E();if(!e)return!1;if(e.CraftAndroid)return!0;let t=Q()?.platform;if(t==="ios"||t==="android")return!0;return Boolean(e.webkit?.messageHandlers?.craft)&&/iPhone|iPad|iPod/.test(Gt())}function ge(){let e=E();if(!e||e.craft)return!1;return re()||Boolean(e.webkit?.messageHandlers?.craft)}function ee(e=15000){let t=E();if(t?.craft)return Promise.resolve(!0);if(!t||!ge())return Promise.resolve(!1);return new Promise((n)=>{let r=()=>{clearTimeout(o),t.removeEventListener("craftReady",r),n(Boolean(t.craft))},o=setTimeout(r,e);t.addEventListener("craftReady",r)})}function Yt(e,t){if(!e)return null;let n=t.split("."),r=e;for(let i of n.slice(0,-1))if(r=r?.[i],!r||typeof r!=="object"&&typeof r!=="function")return null;let o=r?.[n[n.length-1]];return typeof o==="function"?o.bind(r):null}function M(e){return Yt(Q(),e)}async function Xt(e,t=2500){let n=M(e);if(n||!ge())return n;return await ee(t),M(e)}async function w(e,t,n,r={}){let o=await Xt(e,r.timeoutMs);if(!o)return n();try{return await o(...t)}catch(i){if(r.fallbackOnError)return n();throw i}}async function d(e,t=2500){if(ge())await ee(t);return e()}function J(e,t=2500){let n,r=!1;if(!ge())n=e();else ee(t).then(()=>{if(!r)n=e()});return()=>{if(r=!0,typeof n==="function")n()}}function W(e,t){let n=E();if(!n)return()=>{};let r=(o)=>t(o.detail??{});return n.addEventListener(e,r),()=>n.removeEventListener(e,r)}var qe="native-dialog-styles",Qt=`
|
|
2
2
|
.native-dialog { position: fixed; inset: 0; z-index: 2147483000; font-size: var(--native-font-size, 17px); font-family: var(--native-font-family, -apple-system, system-ui, sans-serif); -webkit-tap-highlight-color: transparent; }
|
|
3
3
|
.native-dialog-backdrop { position: absolute; inset: 0; background: rgb(0 0 0 / 0.3); opacity: 0; transition: opacity 220ms ease; }
|
|
4
4
|
.native-dialog--menu .native-dialog-backdrop { background: rgb(0 0 0 / 0.12); -webkit-backdrop-filter: blur(14px) saturate(140%); backdrop-filter: blur(14px) saturate(140%); }
|
|
@@ -52,4 +52,4 @@ import{appReview as sr,biometrics as We,brightness as Re,camera as Ae,deepLinks
|
|
|
52
52
|
.native-dialog-group, .native-menu { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--native-dialog-solid, rgb(242 242 247)); }
|
|
53
53
|
.dark .native-dialog-group, .dark .native-menu { background: var(--native-dialog-solid-dark, rgb(44 44 46)); }
|
|
54
54
|
}
|
|
55
|
-
`;function Ge(){return T()?.document}function Qt(e){if(e.getElementById(qe))return;let t=e.createElement("style");t.id=qe,t.textContent=Xt,(e.head??e.documentElement).appendChild(t)}var Jt=0;function N(e,t,n,r){let o=e.createElement(t);if(o.className=n,r!==void 0)o.textContent=r;return o}function Ve(){return T()?.stx?.overlays}var Zt=0;function Ye(e,t,n,r){Qt(e);let o=T(),i=`native-dialog-layer-${++Zt}`,a=N(e,"div",`native-dialog native-dialog--${t}`);return a.setAttribute("data-native-dialog",t),a.appendChild(N(e,"div","native-dialog-backdrop")),new Promise((s)=>{let l=!1,f=(c)=>{if(l)return;l=!0,a.classList.remove("is-open"),Ve()?.close(i),setTimeout(()=>a.remove(),260),s(c)},u=n({root:a,settle:f});a.appendChild(u),e.body.appendChild(a),Ve()?.open(i,{panel:u,root:a,onEscape:()=>f(r())});let m=o;(typeof m?.requestAnimationFrame==="function"?(c)=>m.requestAnimationFrame(()=>m.requestAnimationFrame(c)):(c)=>setTimeout(c,16))(()=>{if(!l)a.classList.add("is-open")})})}function Pe(e){let t=Ge();if(!t?.body)return Promise.resolve(null);let n=`native-dialog-${++Jt}`,r=e.actions.find((a)=>a.style==="cancel"),o=e.variant==="sheet"?e.actions.filter((a)=>a.style!=="cancel"):e.actions,i=e.variant==="sheet"?r??{id:"__cancel",title:e.cancelLabel||"Cancel",style:"cancel"}:void 0;return Ye(t,e.variant,({root:a,settle:s})=>{let l=(c)=>c.style==="cancel"?null:c.id,f=N(t,"div","native-dialog-panel");f.setAttribute("role","alertdialog"),f.setAttribute("aria-modal","true"),f.tabIndex=-1;let u=N(t,"div","native-dialog-group");if(e.title||e.message){let c=N(t,"div","native-dialog-header");if(e.title){let p=N(t,"p","native-dialog-title",e.title);p.id=`${n}-title`,c.appendChild(p),f.setAttribute("aria-labelledby",p.id)}if(e.message){let p=N(t,"p","native-dialog-message",e.message);p.id=`${n}-message`,c.appendChild(p),f.setAttribute("aria-describedby",p.id)}u.appendChild(c)}let m=N(t,"div","native-dialog-actions");if(e.variant==="alert"&&o.length===2)m.classList.add("is-row");for(let c of o){let p=N(t,"button",`native-dialog-action${c.style==="destructive"?" is-destructive":""}${c.style==="cancel"?" is-cancel":""}`,c.title);p.type="button",p.setAttribute("data-action-id",c.id),p.addEventListener("click",()=>s(l(c))),m.appendChild(p)}if(u.appendChild(m),f.appendChild(u),i){let c=N(t,"div","native-dialog-group"),p=N(t,"button","native-dialog-action is-cancel",i.title);p.type="button",p.setAttribute("data-action-id",i.id),p.addEventListener("click",()=>s(null)),c.appendChild(p),f.appendChild(c)}let h=a.querySelector(".native-dialog-backdrop");if(e.variant==="sheet")h?.addEventListener("click",()=>s(null));return f},()=>{if(e.variant==="sheet")return null;if(r)return null;return o.length===1?o[0].id:null})}async function Xe(e){await Pe({variant:"alert",title:e.title,message:e.message,actions:[{id:"ok",title:e.okLabel||"OK"}]})}async function Qe(e){return await Pe({variant:"alert",title:e.title,message:e.message,actions:[{id:"cancel",title:e.cancelLabel||"Cancel",style:"cancel"},{id:"confirm",title:e.confirmLabel||"OK",style:e.destructive?"destructive":"default"}]})==="confirm"}function Je(e){return Pe({variant:"sheet",title:e.title,message:e.message,actions:e.actions,cancelLabel:e.cancelLabel})}function en(e,t,n){let i=Math.max(12,Math.min(e.x,n.width-t.width-12)),a=e.y+e.height+8,s=a+t.height<=n.height-12,l=e.y-8-t.height,f=s||l<12?Math.max(12,Math.min(a,n.height-t.height-12)):l,u=e.x+e.width/2>n.width/2?"right":"left";return{top:f,left:i,origin:`${s||l<12?"top":"bottom"} ${u}`}}function Ze(e){let t=Ge();if(!t?.body)return Promise.resolve(null);let n=T();return Ye(t,"menu",({root:r,settle:o})=>{let i=N(t,"div","native-menu native-dialog-panel");if(i.setAttribute("role","menu"),e.title)i.appendChild(N(t,"p","native-menu-title",e.title)),i.setAttribute("aria-label",e.title);for(let a of e.items){let s=N(t,"button",`native-menu-item${a.destructive?" is-destructive":""}`);if(s.type="button",s.setAttribute("role","menuitem"),s.setAttribute("data-action-id",a.id),a.disabled)s.disabled=!0;if(s.appendChild(N(t,"span","native-menu-label",a.title)),a.icon){let l=N(t,"i",`native-menu-icon ${a.icon}`);l.setAttribute("aria-hidden","true"),s.appendChild(l)}s.addEventListener("click",()=>o(a.id)),i.appendChild(s)}return r.querySelector(".native-dialog-backdrop")?.addEventListener("click",()=>o(null)),queueMicrotask(()=>{let a=i.getBoundingClientRect?.(),s=en(e.anchor,{width:a?.width||248,height:a?.height||e.items.length*44},{width:n?.innerWidth||390,height:n?.innerHeight||844});i.style.top=`${s.top}px`,i.style.left=`${s.left}px`,i.style.setProperty("--native-menu-origin",s.origin)}),i},()=>null)}var rt=()=>!0,D=()=>!1,K=()=>null;function et(){return T()?.navigator??(typeof navigator>"u"?void 0:navigator)}function Ne(e){return{x:Math.round(e.x??e.left??0),y:Math.round(e.y??e.top??0),width:Math.round(e.width),height:Math.round(e.height)}}var oe={alert:(e)=>y("dialog.alert",[e],()=>Xe(e),{fallbackOnError:!0}).then(()=>{}),confirm:(e)=>y("dialog.confirm",[e],()=>Qe(e),{fallbackOnError:!0}).then(Boolean),actionSheet:async(e)=>{let t={...e,anchor:e.anchor?Ne(e.anchor):void 0},n=await y("dialog.actionSheet",[t],()=>Je(e),{fallbackOnError:!0});if(typeof n!=="string")return null;return e.actions.find((r)=>r.id===n)?.style==="cancel"?null:n}};function Ur(){return(e)=>oe.actionSheet(e)}async function Wr(e){if((e.style??(e.destructive?"sheet":"alert"))==="alert")return oe.confirm(e);return await oe.actionSheet({title:e.title,message:e.message,anchor:e.anchor,actions:[{id:"confirm",title:e.confirmLabel||"OK",style:e.destructive?"destructive":"default"},{id:"cancel",title:e.cancelLabel||"Cancel",style:"cancel"}]})==="confirm"}var He={show:async(e)=>{let t={title:e.title,anchor:Ne(e.anchor),items:e.items.map(({id:r,title:o,symbol:i,destructive:a,disabled:s})=>({id:r,title:o,symbol:i,destructive:a,disabled:s}))},n=await y("contextMenu.show",[t],()=>Ze(e),{fallbackOnError:!0});return typeof n==="string"?n:null}};function $r(e,t){return He.show({...t,anchor:Ne(e.getBoundingClientRect())})}function tn(e,t){let n=T();if(!n)return{cancelled:!0};if(typeof n.craft?.openURL==="function")return Promise.resolve(n.craft.openURL(e)).catch(()=>{}),{cancelled:!1};if(t.mode==="auth")return n.location?.assign(e),{cancelled:!1};if(!(typeof n.open==="function"?n.open(e,"_blank","noopener"):null))n.location?.assign(e);return{cancelled:!1}}var ot={open:async(e,t={})=>{let n=await y("browser.open",[e,t],()=>tn(e,t),{fallbackOnError:!0});if(!n||typeof n!=="object")return{cancelled:!1};let{url:r,cancelled:o}=n;return typeof r==="string"?{url:r,cancelled:Boolean(o)}:{cancelled:Boolean(o)}}},Le=new Map,Me=new Map;function tt(e,t){return`${e}|${t.pointSize??""}|${t.weight??""}|${t.color??""}|${t.scale??""}`}var it={isAvailable:()=>L("symbols.image")!==null,image:(e,t={})=>{let n=tt(e,t),r=Le.get(n);if(r)return r;let o=y("symbols.image",[e,t],K).then((i)=>typeof i==="string"&&i.startsWith("data:")?i:null,K).then((i)=>(Me.set(n,i),i));return Le.set(n,o),o},cached:(e,t={})=>Me.get(tt(e,t)),clearCache:()=>{Le.clear(),Me.clear()}},he={setStyle:(e)=>y("statusBar.setStyle",[e],D,{fallbackOnError:!0}).then((t)=>t!==!1)},ie={setUnderPageColor:(e)=>y("chrome.setUnderPageColor",[e],D,{fallbackOnError:!0}).then((t)=>t!==!1),setKeyboardAccessory:(e)=>y("chrome.setKeyboardAccessory",[e],D,{fallbackOnError:!0}).then((t)=>t!==!1)},V={isAvailable:()=>L("refresh.enable")!==null,enable:(e)=>y("refresh.enable",[e??{}],D,{fallbackOnError:!0}).then((t)=>t!==!1),disable:()=>y("refresh.disable",[],D,{fallbackOnError:!0}).then((e)=>e!==!1),end:()=>y("refresh.end",[],D,{fallbackOnError:!0}).then((e)=>e!==!1),onRefresh:(e)=>W("craftRefresh",()=>e())},ae={complete:(e)=>y("background.complete",[e],D,{fallbackOnError:!0}).then((t)=>t!==!1)},at={write:(e)=>y("clipboard.write",[e],async()=>{let t=et()?.clipboard;if(!t?.writeText)return!1;return t.writeText(e).then(rt,D)},{fallbackOnError:!0}).then((t)=>t!==!1),read:()=>y("clipboard.read",[],async()=>{let e=et()?.clipboard;if(!e?.readText)return null;return e.readText().catch(K)},{fallbackOnError:!0}).then((e)=>typeof e==="string"?e:null)},st={isAvailable:()=>L("db.query")!==null,query:(e,t=[])=>y("db.query",[e,t],K).then((n)=>Array.isArray(n)?n:null),execute:(e,t=[])=>y("db.execute",[e,t],K).then((n)=>{if(!n||typeof n!=="object")return null;let{rowsAffected:r,lastInsertId:o}=n;return{rowsAffected:Number(r)||0,lastInsertId:Number(o)||0}})};function Ce(e,t){let n=T()?.document;if(!n?.body)return null;let r=n.createElement("a");return r.href=e,r.download=t,r.rel="noopener",r.style.display="none",n.body.appendChild(r),r.click(),r.remove(),t}function nn(e){let t=T()?.document;if(!t?.body)return Promise.resolve(null);return new Promise((n)=>{let r=t.createElement("input");if(r.type="file",r.style.display="none",e.length)r.accept=e.map((i)=>i.includes("/")||i.startsWith(".")?i:`.${i}`).join(",");let o=(i)=>{r.remove(),n(i)};r.addEventListener("cancel",()=>o(null)),r.addEventListener("change",()=>{let i=r.files?.[0];if(!i)return o(null);let a=new FileReader;a.onload=()=>o({name:i.name,mimeType:i.type||void 0,data:typeof a.result==="string"?a.result:void 0}),a.onerror=()=>o({name:i.name,mimeType:i.type||void 0}),a.readAsDataURL(i)}),t.body.appendChild(r),r.click()})}var lt={openPDF:(e,t=0)=>y("openPDF",[e,t],()=>{let n=T();return Boolean(n?.open?.(e,"_blank","noopener"))}).then((n)=>n!==!1),takeScreenshot:()=>y("takeScreenshot",[],K,{fallbackOnError:!0}).then((e)=>typeof e==="string"?e:null),scanQRCode:()=>y("scanQRCode",[],K).then((e)=>{if(!e||typeof e!=="object")return null;let{type:t,data:n}=e;return typeof n==="string"?{type:String(t??""),data:n}:null},K),pickFile:(e=[])=>y("pickFile",[e],()=>nn(e)).then((t)=>{if(!t||typeof t!=="object")return null;let n=t;if(typeof n.name!=="string")return null;return{name:n.name,path:typeof n.path==="string"?n.path:void 0,data:typeof n.data==="string"?n.data:void 0,mimeType:typeof n.mimeType==="string"?n.mimeType:void 0}},K),saveFile:(e,t,n)=>y("saveFile",[e,t,n],()=>{if(e.startsWith("data:"))return Ce(e,t);let r=new Blob([e],{type:n||"text/plain"}),o=URL.createObjectURL(r),i=Ce(o,t);return setTimeout(()=>URL.revokeObjectURL(o),1000),i}).then((r)=>typeof r==="string"?r:null),downloadFile:(e,t)=>y("downloadFile",[e,t],()=>Ce(e,t)).then((n)=>typeof n==="string"?n:null)},ct={set:(e)=>y("shortcuts.set",[e.map(({symbol:t,...n})=>t?{...n,iconName:t}:n)],D).then((t)=>t!==!1),clear:()=>y("shortcuts.clear",[],D).then((e)=>e!==!1),onShortcut:(e)=>W("craftShortcut",(t)=>{if(typeof t.type==="string")e(t.type)})},ut={update:(e)=>y("widget.update",[e],D).then((t)=>t!==!1),reload:()=>y("widget.reload",[],D).then((e)=>e!==!1)},rn={portrait:"portrait-primary",portraitUpsideDown:"portrait-secondary",landscape:"landscape",landscapeLeft:"landscape-primary",landscapeRight:"landscape-secondary"};function nt(){return T()?.screen?.orientation}var dt={lock:(e)=>y("lockOrientation",[e],()=>{let t=nt();return t?.lock?t.lock(rn[e]).then(rt,D):!1}).then((t)=>t!==!1),unlock:()=>y("unlockOrientation",[],()=>(nt()?.unlock?.(),!0)).then((e)=>e!==!1)},pt={signInWithApple:(e={})=>y("signInWithApple",e.nonce?[{nonce:e.nonce}]:[],K).then((t)=>{if(!t||typeof t!=="object"||typeof t.userId!=="string")return null;return t})},ft={isAvailable:()=>L("iap.purchase")!==null,products:(e)=>y("iap.getProducts",[e],()=>[]).then((t)=>Array.isArray(t)?t:[]),purchase:(e)=>y("iap.purchase",[e],K).then((t)=>t&&typeof t==="object"?t:null,(t)=>{if(/cancel/i.test(String(t?.message??t)))return null;throw t}),restore:()=>y("iap.restore",[],()=>[]).then((e)=>Array.isArray(e)?e:[])};import{storage as z}from"craft-native/mobile";function mt(){return Q()?.capabilities?.storageCompareAndSet===!0&&z.supportsCompareAndSet?.()===!0}function gt(){return Q()?.capabilities?.storageSetIfAbsent===!0&&z.supportsSetIfAbsent?.()===!0}var ht={supportsCompareAndSet:mt,supportsSetIfAbsent:gt,get:(e)=>d(()=>z.get(e)),set:(e,t)=>d(()=>z.set(e,t)),remove:(e)=>d(()=>z.remove(e)),clear:()=>d(()=>z.clear()),keys:()=>d(()=>z.keys()),setIfAbsent:(e,t)=>d(()=>{if(!gt())throw Object.assign(Error("This host or adapter cannot create storage atomically"),{code:"STORAGE_SET_IF_ABSENT_UNSUPPORTED"});return z.setIfAbsent(e,t)}),compareAndSet:(e,t,n)=>d(()=>{if(!mt())throw Object.assign(Error("This host or adapter cannot compare storage atomically"),{code:"STORAGE_COMPARE_AND_SET_UNSUPPORTED"});return z.compareAndSet(e,t,n)})};import{crypto as on}from"craft-native/mobile";var bt={randomUUID:()=>d(()=>on.randomUUID())};var an=["authorized","denied","notDetermined","restricted","unsupported"];function be(){let e=Q(),t=e?.scheduledWorkouts;if(!t||typeof t!=="object"||e?.capabilities?.scheduledWorkouts!==!0)return;return t}function sn(){return Object.assign(Error("unsupported"),{code:"UNSUPPORTED"})}function vt(e){return an.includes(e)?e:"unsupported"}function ln(e){if(!e||typeof e!=="object")return null;let t=e;if(typeof t.id!=="string"||!t.id||typeof t.date!=="string"||!/^\d{4}-\d{2}-\d{2}$/.test(t.date))return null;let n={id:t.id.toLowerCase(),date:t.date,complete:t.complete===!0};if(typeof t.hour==="number"&&Number.isFinite(t.hour))n.hour=t.hour;if(typeof t.minute==="number"&&Number.isFinite(t.minute))n.minute=t.minute;return n}function te(e,t,...n){return d(async()=>{let r=be();if(typeof r?.[e]!=="function")throw sn();return t(await r[e](...n))})}var yt={isAvailable:()=>typeof be()?.isSupported==="function",supports:(e)=>typeof be()?.[e]==="function",isSupported:()=>d(async()=>{let e=be();if(typeof e?.isSupported!=="function")return!1;try{return await e.isSupported()===!0}catch{return!1}}),authorization:()=>te("authorization",vt),requestAuthorization:()=>te("requestAuthorization",vt),list:()=>te("list",(e)=>Array.isArray(e)?e.map(ln).filter((t)=>t!==null):[]),schedule:(e)=>{if(!e||typeof e!=="object"||typeof e.id!=="string")return Promise.reject(Object.assign(Error("schedule needs a plan with an id"),{code:"INVALID_ARGUMENT"}));return te("schedule",(t)=>{let n=t&&typeof t==="object"?t:{},r={id:(typeof n.id==="string"?n.id:e.id).toLowerCase()};if(Array.isArray(n.droppedAlerts)&&n.droppedAlerts.length)r.droppedAlerts=n.droppedAlerts.filter((o)=>typeof o==="string");return r},e)},remove:(e)=>te("remove",(t)=>t===!0,e),removeAll:()=>te("removeAll",(e)=>typeof e==="number"&&Number.isFinite(e)?e:0)};function Zr(e,t){let n=t.delay??500,r=t.tolerance??10,o=null,i=null,a=!1,s=()=>{if(o)clearTimeout(o);if(o=null,i&&!a)t.onPressEnd?.();i=null},l=(h)=>{let c=h;if(c.button!==void 0&&c.button!==0)return;a=!1,i={x:c.clientX,y:c.clientY},t.onPressStart?.(),o=setTimeout(()=>{if(o=null,!i)return;a=!0,t.onLongPress({...i}),i=null},n)},f=(h)=>{if(!i)return;let c=h;if(Math.hypot(c.clientX-i.x,c.clientY-i.y)>r)s()},u=(h)=>{if(!a)return;a=!1,h.preventDefault(),h.stopPropagation()},m=(h)=>h.preventDefault();return e.addEventListener("pointerdown",l),e.addEventListener("pointermove",f),e.addEventListener("pointerup",s),e.addEventListener("pointercancel",s),e.addEventListener("pointerleave",s),e.addEventListener("click",u,!0),e.addEventListener("contextmenu",m),()=>{s(),e.removeEventListener("pointerdown",l),e.removeEventListener("pointermove",f),e.removeEventListener("pointerup",s),e.removeEventListener("pointercancel",s),e.removeEventListener("pointerleave",s),e.removeEventListener("click",u,!0),e.removeEventListener("contextmenu",m)}}function cn(e,t,n){if(n<=1||t.width<=0)return 0;let r=Math.floor((e-t.left)/t.width*n);return Math.max(0,Math.min(n-1,r))}function eo(e,t){let n=null,r=null,o=!1,i=0,a=(c)=>{let p=e.getBoundingClientRect();return cn(c,{left:p.left+2,width:p.width-4},t.count())},s=(c)=>{let p=c;if(p.button!==void 0&&p.button!==0)return;let g=a(p.clientX);if(g!==t.selected())return;n=g,i=g,o=!1,r=p.pointerId;try{e.setPointerCapture?.(p.pointerId)}catch{}t.onPress?.(!0)},l=(c)=>{if(n===null)return;let p=a(c.clientX);if(p===i)return;o=!0,i=p,t.onScrub(p)},f=(c)=>{if(n===null)return;if(r!==null)try{e.releasePointerCapture?.(r)}catch{}if(t.onPress?.(!1),c&&o)t.onCommit(i);else if(o)t.onScrub(n);n=null,r=null},u=(c)=>{if(!o)return;o=!1,c.preventDefault(),c.stopPropagation()},m=()=>f(!0),h=()=>f(!1);return e.addEventListener("pointerdown",s),e.addEventListener("pointermove",l),e.addEventListener("pointerup",m),e.addEventListener("pointercancel",h),e.addEventListener("click",u,!0),()=>{e.removeEventListener("pointerdown",s),e.removeEventListener("pointermove",l),e.removeEventListener("pointerup",m),e.removeEventListener("pointercancel",h),e.removeEventListener("click",u,!0)}}function to(e,t,n){if(n<=0)return null;switch(e){case"ArrowRight":case"ArrowDown":return(t+1)%n;case"ArrowLeft":case"ArrowUp":return(t-1+n)%n;case"Home":return 0;case"End":return n-1;default:return null}}function no(e,t){e.querySelectorAll('[role="tab"]')[t]?.focus()}function ro(e){let t=(n)=>{if(!n.target?.closest?.("[data-native-pressable]"))return;let o=L("haptics.prepare");if(o)Promise.resolve().then(()=>o("impact")).catch(()=>{})};return e.addEventListener("touchstart",t,{passive:!0,capture:!0}),()=>e.removeEventListener("touchstart",t,{capture:!0})}import{BugHQClient as un}from"@bughq/sdk";import{crashReporter as ne}from"craft-native/mobile";var _=null;function dn(e){if(e.type!=="http")return!0;let t=e.data??{},n=typeof t.status==="number"?t.status:0;return t.error===!0||n>=400||n===0}function St(){return ne.isAvailable()}function pn(e){return async(t)=>{if(!St())return!e;return ne.capture(t)}}var lo={start(e={}){if(_)return _;let t=re()||St();if(!t&&!e.key&&!e.dsn)return null;let n=e.beforeBreadcrumb;return _=new un({framework:"stacks-mobile",sdkName:"bughq.stacks.mobile",autoInstrument:{navigation:!0,fetch:!0,xhr:!0},...e,heartbeat:t?!1:e.heartbeat,transport:t?pn(Boolean(e.key||e.dsn)):void 0,beforeBreadcrumb(r){if(!dn(r))return null;let o=n?n(r):r;if(o===null)return null;let i=o||r;if(t)ne.addBreadcrumb(i);return i}}),_},async setUser(e){let t=e===null||e===void 0||e===""?null:String(e);_?.setUser(t===null?null:{id:t}),await ne.setUser(t)},capture(e,t){_?.captureException(e,t)},addBreadcrumb(e){if(_)_.addBreadcrumb(e);else ne.addBreadcrumb(e)},async flush(){await Promise.all([_?.flush(),ne.flush()])},client(){return _},stop(){_?.close(),_=null}};function De(e){let t=T();try{return Boolean(t?.matchMedia?.(e).matches)}catch{return!1}}function wt(e){return e!==null&&e!==void 0&&e!=="false"&&e!=="0"}function xt(){let e=T()?.document?.documentElement,t=Number.parseFloat(e?.style?.getPropertyValue("--craft-font-scale")||"");return{fontScale:Number.isFinite(t)&&t>0?t:1,reduceMotion:wt(e?.getAttribute("data-craft-reduce-motion"))||De("(prefers-reduced-motion: reduce)"),reduceTransparency:wt(e?.getAttribute("data-craft-reduce-transparency"))||De("(prefers-reduced-transparency: reduce)"),colorScheme:e?.classList?.contains("dark")||De("(prefers-color-scheme: dark)")?"dark":"light"}}function fn(e){let t=xt(),n=Number(e?.fontScale);return{contentSizeCategory:typeof e?.contentSizeCategory==="string"?e.contentSizeCategory:void 0,fontScale:Number.isFinite(n)&&n>0?n:t.fontScale,reduceMotion:typeof e?.reduceMotion==="boolean"?e.reduceMotion:t.reduceMotion,reduceTransparency:typeof e?.reduceTransparency==="boolean"?e.reduceTransparency:t.reduceTransparency,colorScheme:e?.colorScheme==="dark"||e?.colorScheme==="light"?e.colorScheme:t.colorScheme}}function Rt(e,t={}){if(t.immediate!==!1)e(xt());return W("craftAppearance",(n)=>e(fn(n)))}function fo(e){return W("craftResume",(t)=>e({backgroundedMs:Number(t.backgroundedMs)||0}))}function mo(e){return W("craftMemoryWarning",()=>e())}function At(e){return(t)=>{Promise.resolve().then(()=>e(t)).then(()=>ae.complete(!0),()=>ae.complete(!1))}}function go(e){let t=At(e);return W("craftSilentPush",(n)=>t(n.payload??{}))}function ho(e){let t=At(()=>e());return W("craftBackgroundRefresh",()=>t(void 0))}import{haptics as mn}from"craft-native/mobile";function _e(){if(typeof window>"u")return;return window}function se(e=_e()){if(!e)return 0;if(typeof e.scrollY==="number")return e.scrollY;if(typeof e.scrollTop==="number")return e.scrollTop;return e.document?.scrollingElement?.scrollTop??0}function gn(e,t=_e()){if(!t)return()=>{};let n=!1,r=typeof requestAnimationFrame==="function"?requestAnimationFrame:(i)=>setTimeout(i,16),o=()=>{if(n)return;n=!0,r(()=>{n=!1,e(se(t))})};return e(se(t)),t.addEventListener("scroll",o,{passive:!0}),()=>t.removeEventListener("scroll",o)}function hn(e,t){let n=Math.max(0,-e),r=e<=0?Math.max(0,t)*0.5:0;return Math.round(Math.max(n,r))}function yo(e){let t=e.host??_e();if(!t)return()=>{};let n=e.threshold??72,r=null,o=!1,i=!1,a=typeof requestAnimationFrame==="function"?requestAnimationFrame:(g)=>setTimeout(g,16),s=null,l=(g)=>{s=null,e.onPull?.(g,o,{bounce:Math.min(g,Math.max(0,-se(t)))})},f=(g)=>{let S=s!==null;if(s=g,S)return;a(()=>{if(s!==null)l(s)})},u=(g)=>{let S=g.touches?.[0];return S?S.clientY:null},m=(g)=>{if(i||se(t)>0)return;r=u(g),o=!1},h=(g)=>{if(r===null)return;let S=u(g);if(S===null)return;let b=hn(se(t),S-r);if(!o&&b>=n)o=!0,Promise.resolve(mn.impact("medium")).catch(()=>{});else if(o&&b<n*0.8)o=!1;f(b)},c=async()=>{if(r===null)return;if(r=null,!o){l(0);return}o=!1,i=!0,l(n);try{await e.onRefresh()}finally{i=!1,l(0)}},p=()=>{if(r===null)return;r=null,o=!1,l(0)};return t.addEventListener("touchstart",m,{passive:!0}),t.addEventListener("touchmove",h,{passive:!0}),t.addEventListener("touchend",c),t.addEventListener("touchcancel",p),()=>{s=null,t.removeEventListener("touchstart",m),t.removeEventListener("touchmove",h),t.removeEventListener("touchend",c),t.removeEventListener("touchcancel",p)}}function bn(e,t=52){let n=Math.max(1,t),r=Math.min(1,Math.max(0,e/n)),o=e<0?1+Math.min(0.1,-e/600):1;return{progress:Math.round(r*1000)/1000,stretch:Math.round(o*1000)/1000}}function So(e,t={}){let n="",r=()=>t.title?.offsetHeight||t.height||52;return gn((o)=>{let i=bn(o,r()),a=`${i.progress}|${i.stretch}`;if(a===n)return;n=a,e.style.setProperty("--native-nav-progress",String(i.progress)),e.style.setProperty("--native-nav-stretch",String(i.stretch)),t.onChange?.(i)},t.host)}function wo(e){if(!e||typeof window>"u")return;let t=window.document?.querySelector(e);return t?t:void 0}function Et(){if(typeof window>"u")return;return window}var kt="__stxPushed",vn="__stxScroll";function yn(e=Et()){let t=e?.history?.state;if(t===null||t===void 0)return!1;if(typeof t!=="object")return!0;let n=t;if(kt in n)return n[kt]===!0;return!(vn in n)}function Ro(e=Et()){if(!yn(e))return!1;return e.history.back(),!0}function Ao(e,t,n=50){let r=e[e.length-1];if(e.length>=2&&e[e.length-2].path===t)e.pop();else if(!r||r.path!==t)e.push({path:t,title:""});if(e.length>n)e.splice(0,e.length-n);return{current:e[e.length-1],previous:e[e.length-2]??null}}function ko(e,t,n=12){let r=e?.title.trim()??"";return r&&r.length<=n?r:t}function To(){if(typeof window>"u")return[];let e=window;return e.__stacksNavTrail??=[]}function Sn(e){try{let t=new URL(e,"http://local");return`${t.pathname}${t.search}`}catch{return e}}function Eo(){if(typeof window>"u")return;let e=window.stxRouter;if(typeof e?.screens!=="function")return;let t=e.screens(),n=t.find((o)=>o.active);if(!n)return;let r=t.filter((o)=>o.tab===n.tab&&o.depth<n.depth);if(!r.length)return null;return Sn(r.reduce((o,i)=>i.depth>o.depth?i:o).url)}function Oo(e=typeof window>"u"?void 0:window){let t=e?.stxRouter;if(typeof t?.screens!=="function"||typeof e?.history?.go!=="function")return!1;let n=t.screens(),r=n.find((a)=>a.active);if(!r)return!1;let o=n.filter((a)=>a.tab===r.tab&&a.depth<r.depth);if(!o.length)return!1;let i=o.reduce((a,s)=>s.depth<a.depth?s:a);return e.history.go(i.depth-r.depth),!0}function Io(e,t){for(let n=e.length-1;n>=0;n--)if(e[n].path===t)return e[n];return null}function wn(e,t=xn()){let n;try{n=new URL(e)}catch{return null}let r=`${n.search}${n.hash}`;if(n.protocol==="http:"||n.protocol==="https:"){if(!t||n.origin!==t)return null;return`${n.pathname||"/"}${r}`}return`${`/${[n.host,n.pathname.replace(/^\/+/,"")].filter(Boolean).join("/")}`}${r}`}function xn(){if(typeof window>"u")return;return window.location?.origin}var Tt="stacks-mobile-deep-link";function Po(e,t){let n=(r)=>{let o=wn(r);if(o)e(o)};return t.getInitialURL().then((r)=>{if(!r)return;try{if(sessionStorage.getItem(Tt)===r)return;sessionStorage.setItem(Tt,r)}catch{}n(r)}).catch(()=>{}),t.onLink((r,o)=>{if(o?.initial)return;n(r)})}var Mo=5000;function Rn(e,t,n=5000){let r=t.filter((o)=>Number.isFinite(o.timestamp)&&Number.isFinite(o.bpm)&&o.bpm>0).slice().sort((o,i)=>o.timestamp-i.timestamp);if(!r.length)return e.slice();return e.map((o)=>{let i=0,a=r.length;while(i<a){let u=i+a>>1;if(r[u].timestamp<o.timestamp)i=u+1;else a=u}let s=r[i],l=r[i-1],f=!s?l:!l?s:o.timestamp-l.timestamp<=s.timestamp-o.timestamp?l:s;if(!f||Math.abs(f.timestamp-o.timestamp)>n)return o;return{...o,heartRate:Math.round(f.bpm)}})}var An=6371008.8,Be={distanceM:0,movingS:0,paceSPerKm:null,averagePaceSPerKm:null,speedMps:null,accuracyM:null,fixes:0},kn=30,Tn=kn;function En(e,t){let n=Math.PI/180,r=(t.latitude-e.latitude)*n,o=(t.longitude-e.longitude)*n,i=Math.sin(r/2)**2+Math.cos(e.latitude*n)*Math.cos(t.latitude*n)*Math.sin(o/2)**2;return 2*An*Math.asin(Math.min(1,Math.sqrt(i)))}function Co(e,t=25){let n=new Set;return e.filter((r)=>Number.isFinite(r.latitude)&&Number.isFinite(r.longitude)&&Number.isFinite(r.timestamp)&&Math.abs(r.latitude)<=90&&Math.abs(r.longitude)<=180&&Number.isFinite(r.accuracy)&&r.accuracy>=0&&r.accuracy<=t).sort((r,o)=>r.timestamp-o.timestamp).filter((r)=>{if(n.has(r.timestamp))return!1;return n.add(r.timestamp),!0})}function On(e,t){return Number.isFinite(e.latitude)&&Number.isFinite(e.longitude)&&Number.isFinite(e.timestamp)&&Math.abs(e.latitude)<=90&&Math.abs(e.longitude)<=180&&Number.isFinite(e.accuracy)&&e.accuracy>=0&&e.accuracy<=t}function ve(e={}){let t=e.maxAccuracyM??25,n=(e.paceWindowS??30)*1000,r=[],o=0,i=0,a=null,s=0,l=null,f=null,u={...Be};function m(c){let p=r[r.length-1],g=a?(c.timestamp-a.timestamp)/1000:0;if(a=c,s++,!p){r.push({fix:c,cumM:0});return}if(g>Tn){r.push({fix:c,cumM:o});return}let S=(c.timestamp-p.fix.timestamp)/1000,b=En(p.fix,c),I=Math.min(10,Math.max(3,p.fix.accuracy,c.accuracy));if(b<I)return;if(o+=b,S>0&&b/S>=0.5)i+=S;r.push({fix:c,cumM:o})}function h(){let c=r[r.length-1];if(c){let S=c.fix.timestamp-n,b=0;while(b<r.length-1&&r[b].fix.timestamp<S)b++;if(b)r=r.slice(b)}let p=null,g=null;if(c&&a.timestamp-c.fix.timestamp<=n){let S=r[0],b=c.cumM-S.cumM,I=(c.fix.timestamp-S.fix.timestamp)/1000;if(b>=20&&I>0)g=b/I,p=I/(b/1000)}return{distanceM:o,movingS:i,paceSPerKm:p,averagePaceSPerKm:o>=50&&i>0?i/(o/1000):null,speedMps:g,accuracyM:a?a.accuracy:f,fixes:s}}return{get stats(){return u},get latestTimestamp(){return l},add(c){if(c.length){let p=c[c.length-1];if(!a)f=p.accuracy??null;let g=a?a.timestamp:-1/0,S=c.filter((b)=>On(b,t)&&b.timestamp>g).sort((b,I)=>b.timestamp-I.timestamp);for(let b of S){if(a&&b.timestamp<=a.timestamp)continue;m(b)}for(let b of c)if(Number.isFinite(b.timestamp)&&(l===null||b.timestamp>l))l=b.timestamp}return u=h(),u}}}function In(e,t={}){return ve(t).add(e)}function No(e){if(e==null||e<=0||!Number.isFinite(e)||e>3600)return"–";let t=Math.round(e);return`${Math.floor(t/60)}:${String(t%60).padStart(2,"0")}`}function Ho(e){return e!=null&&e>0&&Number.isFinite(e)?(e*3.6).toFixed(1):"–"}var Ot=3600,Pn=30000;function Ln(e,t,n){if(!n||t<=Ot)return e;return Math.max(e,Math.min(Pn,Math.round(e*t/Ot)))}function Do(e){let t=e.location,n=e.intervalMs??3000,r=Be,o=ve(e),i=!1,a=null,s=0,l=e.heartRate,f=!1,u=null,m=[],h=()=>typeof document<"u"&&document.visibilityState==="hidden",c=0,p=null,g=Promise.resolve(),S=null,b=!1,I=null;function O(){if(b)throw Object.assign(Error("The recording screen is no longer active"),{code:"RECORDING_CONFLICT"});if(t.supportsRecordingOwnership?.()!==!0)throw Object.assign(Error("This host cannot protect native recording ownership"),{code:"RECORDING_OWNERSHIP_UNSUPPORTED"})}function w(){if(O(),!I)throw Object.assign(Error("A saved recording ID is required"),{code:"RECORDING_CONFLICT"});return I}function x(v){let A=g.then(v);return g=A.then(()=>{},()=>{}),A}function k(){if(p)return p;let v=c,A=I,P=(async()=>{if(O(),!A)throw Object.assign(Error("A saved recording ID is required"),{code:"RECORDING_CONFLICT"});let M=o,C=M.latestTimestamp,U=await t.readRecording(C===null?{expectedId:A}:{expectedId:A,since:C});if(v!==c||b||M!==o)return M.add(U);if(C!==null&&U.length&&U[0].timestamp<=C)i=!0;return r=M.add(U),e.onUpdate?.(r),r})().finally(()=>{if(p===P)p=null});return p=P,P}function R(){if(H(),b)return;let v=s,A=()=>{a=setTimeout(()=>{if(a=null,b||v!==s)return;(h()?Promise.resolve():k().then(()=>{},()=>{})).then(()=>{if(!b&&v===s)A()})},Ln(n,r.fixes,i))};A()}function H(){if(s++,a)clearTimeout(a);a=null}function q(v,A,P,M=ve(e)){if(H(),c++,p=null,o=M,i=!1,I=v,u=A,f=A!==null,m=[],r=P,!b)e.onUpdate?.(r)}async function me(v){if(!l||!f||!u||b||l.supportsRecordingOwnership?.()!==!0)return;await v(l,u).catch(()=>{})}return{get stats(){return r},get recordingId(){return I},get heartRateRecordingId(){return u},get heartRate(){return m},start(v){return S=null,x(async()=>{if(O(),v&&t.supportsRecordingIntentIdentity?.()!==!0)throw Object.assign(Error("This host cannot start a registered route identity"),{code:"RECORDING_INTENT_IDENTITY_UNSUPPORTED"});if(v&&(typeof v.recordingId!=="string"||!v.recordingId.trim()))throw Object.assign(Error("A registered recording ID is required"),{code:"INVALID_ARGUMENT"});let A=typeof e.locationOptions==="function"?e.locationOptions():e.locationOptions,P=await t.startRecording({enableHighAccuracy:!0,...A,...v?{recordingId:v.recordingId}:{}});if(!P?.active||typeof P.id!=="string"||!P.id.trim())throw Object.assign(Error("The native recording did not provide an ID"),{code:"RECORDING_CONFLICT"});if(v&&P.id!==v.recordingId)throw Object.assign(Error("The native route did not start with its registered ID"),{code:"RECORDING_CONFLICT"});let M=null;if(!b&&l?.isAvailable()&&l.supportsRecordingOwnership?.()===!0&&(!v||v.heartRateRecordingId&&l.supportsRecordingIntentIdentity?.()===!0))try{let C=await l.startRecording(v?{recordingId:v.heartRateRecordingId}:void 0);if(v&&C.id!==v.heartRateRecordingId)throw Object.assign(Error("The native heart rate did not start with its registered ID"),{code:"RECORDING_CONFLICT"});if(C.active&&typeof C.id==="string"&&C.id.trim())M=C.id}catch{}return q(P.id,M,{...Be}),R(),r})},attach(v){return S=null,x(async()=>{if(typeof v?.expectedId!=="string"||!v.expectedId.trim())throw Object.assign(Error("A saved recording ID is required"),{code:"RECORDING_CONFLICT"});O();let A=await t.getRecordingState({expectedId:v.expectedId});if(O(),!A?.id)return null;if(A.id!==v.expectedId)throw Object.assign(Error("The recording belongs to another session"),{code:"RECORDING_CONFLICT"});let P=null;if(v.expectedHeartRateId!==void 0){let U=v.expectedHeartRateId;if(typeof U!=="string"||!U.trim())throw Object.assign(Error("A saved heart-rate recording ID is required"),{code:"RECORDING_CONFLICT"});if(!l?.isAvailable()||l.supportsRecordingOwnership?.()!==!0)throw Object.assign(Error("This host cannot protect heart-rate recording ownership"),{code:"RECORDING_OWNERSHIP_UNSUPPORTED"});let qt=await l.getRecordingState({expectedId:U});if(O(),qt.id!==U)throw Object.assign(Error("The heart-rate recording belongs to another session"),{code:"RECORDING_CONFLICT"});await l.readRecording({expectedId:U,since:Date.now()}),O(),P=U}let M=await t.readRecording({expectedId:v.expectedId});O();let C=ve(e);if(q(v.expectedId,P,C.add(M),C),A.active&&!A.paused)R();return A})},pause(){return x(async()=>{await t.pauseRecording({expectedId:w()}),await me((v,A)=>v.pauseRecording({expectedId:A})),H(),await k().catch(()=>{})})},resume(){return x(async()=>{await t.resumeRecording({expectedId:w()}),await me((v,A)=>v.resumeRecording({expectedId:A})),R()})},stop(){if(S)return S;let v=x(async()=>{H(),c++;let A=w(),P=await t.stopRecording({expectedId:A});if(P.id!==A)throw Object.assign(Error("The native recording identity changed"),{code:"RECORDING_CONFLICT"});let M=P?.locations??[];if(!b&&l&&f&&u&&l.supportsRecordingOwnership?.()===!0){let C=await l.stopRecording({expectedId:u}).catch(()=>null);f=!1,m=C?.id===u?C.samples:[],M=Rn(M,m)}if(r=In(M,e),!b)e.onUpdate?.(r);return M}).catch((A)=>{if(S===v)S=null;throw A});return S=v,v},dispose(){b=!0,c++,p=null,H()},refresh:k}}function Bo(e){return{startedAt:Number.isFinite(e)?e:null,pausedAt:null,pausedMs:0}}function Fo(e,t){return e.startedAt===null||e.pausedAt!==null||!Number.isFinite(t)?e:{...e,pausedAt:Math.max(e.startedAt,t)}}function Uo(e,t){return e.pausedAt===null||!Number.isFinite(t)?e:{...e,pausedAt:null,pausedMs:e.pausedMs+Math.max(0,t-e.pausedAt)}}function Wo(e,t){if(e.startedAt===null)return 0;let n=((e.pausedAt??t)-e.startedAt-e.pausedMs)/1000;return Number.isFinite(n)?Math.max(0,n):0}var Ko=150;function Mn(e,t){let n=Math.PI/180,r=(t.latitude-e.latitude)*n,o=(t.longitude-e.longitude)*n,i=Math.sin(r/2)**2+Math.cos(e.latitude*n)*Math.cos(t.latitude*n)*Math.sin(o/2)**2;return 12742017.6*Math.asin(Math.min(1,Math.sqrt(i)))}function ye(e,t){let n=[...e].sort((r,o)=>r-o);return n[Math.min(n.length-1,Math.floor(t*n.length))]}function jo(e,t){let n=(e||[]).filter((a)=>Number.isFinite(a?.latitude)&&Number.isFinite(a?.longitude)&&Math.abs(a.latitude)<=90&&Math.abs(a.longitude)<=180),r=n.filter((a)=>a.accuracy!=null).map((a)=>Number(a.accuracy)).filter((a)=>Number.isFinite(a)&&a>=0),o=r.length?ye(r,0.5):Number.POSITIVE_INFINITY,i=0;if(n.length){let a={latitude:ye(n.map((s)=>s.latitude),0.5),longitude:ye(n.map((s)=>s.longitude),0.5)};i=ye(n.map((s)=>Mn(a,s)),0.8)}if(n.length>=10&&i>150&&o<=15)return"outside";if(t<150)return"unsure";if(n.length<3||o>30||i<25)return"indoors";if(i<50&&o>10)return"indoors";return"unsure"}function zo(e,t={}){let r=String(e||"").trim().toLowerCase().replace(",",".").match(/^(\d+(?:\.\d*)?|\.\d+)\s*(km|k|m|mi)?$/);if(!r)return null;let o=Number(r[1]),i=r[2]||t.defaultUnit||(o>100?"m":"km"),a=i==="m"?o/1000:i==="mi"?o*1.609344:o;return Number.isFinite(a)&&a>=0&&a<=2000?Math.round(a*1000)/1000:null}var xe=new Set,It=!1,Se=null;function Cn(e){return e.isConnected&&e.getClientRects().length>0}function Pt(){return[...xe].find((e)=>Cn(e.element))}function we(){let e=Pt(),t=Boolean(e);if(t===It)return;if(It=t,t)V.enable(e?.tintColor?{tintColor:e.tintColor}:{});else V.disable()}function Nn(){let e=Pt();if(!e){V.end();return}Promise.resolve().then(()=>e.run()).catch(()=>{}).finally(()=>V.end())}function Go(e,t){let n={element:e,tintColor:t.tintColor,run:t.onRefresh};xe.add(n);let r=e.ownerDocument?.defaultView;if(!Se){let o=V.onRefresh(Nn),i=()=>we();r?.addEventListener("stx:load",i),Se=()=>{o(),r?.removeEventListener("stx:load",i)}}return we(),r?.requestAnimationFrame?.(()=>we()),()=>{if(xe.delete(n),xe.size===0)Se?.(),Se=null;we()}}var Xo=0.5;function Hn(e,t,n){let r=[];if(n.includes("large")||n.length===0)r.push({name:"large",y:0});if(n.includes("medium"))r.push({name:"medium",y:Math.max(0,Math.round(e-t*0.5))});return r.push({name:"dismiss",y:Math.max(1,e)}),r.sort((o,i)=>o.y-i.y)}function Dn(e){let{y:t,velocity:n,stops:r}=e,o=r.filter((s)=>s.name!=="dismiss"),i=r.find((s)=>s.name==="dismiss");if(o.length===0)return"dismiss";if(n>0.5)return(r.filter((l)=>l.y>t+1)[0]??i).name;if(n<-0.5){let s=o.filter((l)=>l.y<t-1);return(s[s.length-1]??o[0]).name}let a=o[o.length-1];if(t>a.y+(i.y-a.y)*0.5)return"dismiss";return o.reduce((s,l)=>Math.abs(l.y-t)<Math.abs(s.y-t)?l:s).name}function _n(e,t=400){if(e<=0)return 0;return e*t*0.55/(t+e*0.55)}function Qo(e){let{panel:t}=e,n=null,r=[],o=0,i=()=>e.viewport?.()??t.ownerDocument?.defaultView?.innerHeight??800,a=()=>Hn(t.offsetHeight||t.getBoundingClientRect().height,i(),e.detents()),s=(u)=>{let m=u;if(m.button!==void 0&&m.button!==0)return;if(m.target?.closest?.("button, a, input, select, textarea, [role=button]"))return;let h=a().find((c)=>c.name===e.detent())?.y??0;n={y:m.clientY,base:h,pointerId:m.pointerId},o=h,r=[{y:h,t:m.timeStamp}],t.classList.add("is-dragging");try{u.currentTarget?.setPointerCapture?.(m.pointerId)}catch{}},l=(u)=>{if(!n)return;let m=u,h=n.base+m.clientY-n.y;o=h<0?-_n(-h):h,r.push({y:o,t:m.timeStamp});while(r.length>2&&m.timeStamp-r[0].t>100)r.shift();t.style.transform=`translateY(${o}px)`;let c=t.offsetHeight||1;t.parentElement?.style.setProperty("--native-sheet-presence",String(Math.max(0,Math.min(1,1-o/c))))},f=(u)=>{if(!n)return;let m=u;n=null;let h=r[0],c=Math.max(1,m.timeStamp-h.t),p=(o-h.y)/c;t.classList.remove("is-dragging"),t.style.transform="",t.parentElement?.style.removeProperty("--native-sheet-presence"),e.onSettle(Dn({y:o,velocity:p,stops:a()}))};for(let u of e.handles)u.addEventListener("pointerdown",s),u.addEventListener("pointermove",l),u.addEventListener("pointerup",f),u.addEventListener("pointercancel",f);return()=>{for(let u of e.handles)u.removeEventListener("pointerdown",s),u.removeEventListener("pointermove",l),u.removeEventListener("pointerup",f),u.removeEventListener("pointercancel",f)}}function Jo(e){let t=e.ownerDocument;if(e.parentElement===t.body)return()=>{};let n=t.createComment("native-sheet");return e.parentNode?.insertBefore(n,e),t.body.appendChild(e),()=>{if(n.parentNode)n.parentNode.insertBefore(e,n);else e.remove();n.remove()}}var Fe=new WeakMap;function Zo(e,t){let n=e.documentElement,r=Fe.get(e)??0;if(!t){let a=Math.max(0,r-1);if(Fe.set(e,a),a===0)n.removeAttribute("data-native-sheet-card");return}if(Fe.set(e,r+1),r>0)return;let o=e.defaultView,i=(o?.scrollY??0)+(o?.innerHeight??800)/2;n.style.setProperty("--native-sheet-card-origin",`${Math.round(i)}px`),n.setAttribute("data-native-sheet-card","")}function Bn(e,t){e.style.setProperty("--native-font-scale",String(t.fontScale)),e.toggleAttribute("data-native-reduce-motion",t.reduceMotion),e.toggleAttribute("data-native-reduce-transparency",t.reduceTransparency)}function Fn(e){let t=e.replace(/\s+/g,"").toLowerCase();return!t||t==="transparent"||/^rgba\(\d+,\d+,\d+,0(\.0+)?\)$/.test(t)||/\/0(\.0+)?\)$/.test(t)}function Un(e){let t=e.defaultView;if(!t?.getComputedStyle)return null;for(let n of[e.body,e.documentElement]){if(!n)continue;let r=t.getComputedStyle(n).backgroundColor;if(r&&!Fn(r))return r}return null}function Wn(e){if(e.documentElement.classList.contains("dark"))return!0;if(e.documentElement.classList.contains("light"))return!1;return Boolean(e.defaultView?.matchMedia?.("(prefers-color-scheme: dark)").matches)}function ri(e,t={}){let n=t.root??e.documentElement;ie.setKeyboardAccessory(t.keyboardAccessory===!0);let r="",o="",i=()=>{let u=Un(e);if(u&&u!==r)r=u,ie.setUnderPageColor(u);let m=Wn(e)?"light":"dark";if(m!==o)o=m,he.setStyle(m)},a=Rt((u)=>{Bn(n,u),i()}),s=e.defaultView,l=typeof s?.MutationObserver==="function"?new s.MutationObserver(i):null;l?.observe(e.documentElement,{attributes:!0,attributeFilter:["class","style","data-theme"]});let f=s?.matchMedia?.("(prefers-color-scheme: dark)");return f?.addEventListener?.("change",i),s?.addEventListener("stx:load",i),i(),()=>{a(),l?.disconnect(),f?.removeEventListener?.("change",i),s?.removeEventListener("stx:load",i)}}var ii=64;var $n=/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/,Kn=/^(?:0|[1-9]\d*)$/;function Mt(e){let t=[],n=[],r=e&&typeof e==="object"&&!Array.isArray(e)?e:{};for(let[o,i]of Object.entries(r)){let a=i&&typeof i==="object"?i:null;if(!a){n.push(`spotlight kind "${o}" is not an object`);continue}let{slots:s,route:l}=a,f=typeof a.noun==="string"&&a.noun.trim()?a.noun.trim():"Item";if(!$n.test(o)||o.includes("-slot-")){n.push(`spotlight kind "${o}" is not a usable name: lowercase letters, digits and single dashes, and never "-slot-"`);continue}if(typeof s!=="number"||!Number.isInteger(s)||s<=0||s>64){n.push(`spotlight kind "${o}" needs slots between 1 and 64, not ${String(s)}`);continue}if(typeof l!=="string"||!l.startsWith("/")||!l.includes(":id")){n.push(`spotlight kind "${o}" needs a route starting with "/" and carrying ":id", not ${String(l)}`);continue}t.push({name:o,slots:s,route:l,noun:f})}return{kinds:t,problems:n}}function ce(e,t){return e.find((n)=>n.name===t)??null}function le(e,t,n){let r=ce(e,t);if(!r||!Number.isInteger(n)||n<0||n>=r.slots)return null;return`${t}-slot-${n}`}function jn(e,t){if(typeof t!=="string")return null;let n=t.lastIndexOf("-slot-");if(n<=0)return null;let r=t.slice(0,n),o=t.slice(n+6);if(!Kn.test(o))return null;let i=Number(o);return le(e,r,i)===t?{kind:r,slot:i}:null}function Ct(e){return e.flatMap((t)=>Array.from({length:t.slots},(n,r)=>`${t.name}-slot-${r}`))}function ai(e,t){let n=e&&typeof e==="object"?e:{};if(n.enabled===!1)return[];let o=[...(Array.isArray(n.activityTypes)?n.activityTypes.filter((i)=>typeof i==="string"&&i.trim().length>0):[]).map((i)=>i.trim()),...Ct(Mt(n.kinds).kinds)];return[...new Set(o)].map((i)=>`${t}.${i}`)}function Nt(e,t,n){let r=typeof n.name==="string"?n.name.replace(/\s+/g," ").trim():"";if(!r)return`${ce(e,t)?.noun??"Item"} #${n.id}`;return r.length>120?`${r.slice(0,119).trimEnd()}…`:r}function zn(e,t,n,r,o=Date.now()){let i=ce(e,n);if(!i||!Number.isInteger(r.id)||r.id<=0)return null;let a=t.filter((p)=>p.kind===n),s=Nt(e,n,r),l=a.find((p)=>p.itemId===r.id)??null,f=l?null:Yn(a,i.slots),u=l||f!==null?null:Xn(a),m=l?.slot??f??u?.slot;if(m===void 0||m===null)return null;let h={kind:n,slot:m,itemId:r.id,title:s,donatedAt:o},c=t.filter((p)=>p.kind!==n||p.slot!==m&&p.itemId!==r.id);return{entries:Ht(e,[...c,h]),entry:h,evicted:u,changed:!l||l.title!==s}}function qn(e,t,n){let r=e.find((o)=>o.kind===t&&o.itemId===n)??null;return{entries:r?e.filter((o)=>o!==r):[...e],removed:r}}function Vn(e,t,n){let r=jn(e,n);if(!r)return null;let o=t.find((a)=>a.kind===r.kind&&a.slot===r.slot),i=ce(e,r.kind)?.route;return o&&i?i.replace(":id",String(o.itemId)):null}function Gn(e,t){if(!Array.isArray(t))return[];let n=new Map,r=new Set;for(let o of t){if(!o||typeof o!=="object")continue;let i=o,{kind:a,slot:s,itemId:l,title:f,donatedAt:u}=i;if(typeof a!=="string"||typeof s!=="number"||le(e,a,s)===null)continue;if(typeof l!=="number"||!Number.isInteger(l)||l<=0)continue;let m=`${a}-slot-${s}`,h=`${a}#${l}`;if(n.has(m)||r.has(h))continue;n.set(m,{kind:a,slot:s,itemId:l,title:typeof f==="string"&&f.trim()?f:Nt(e,a,{id:l}),donatedAt:typeof u==="number"&&Number.isFinite(u)&&u>0?u:0}),r.add(h)}return Ht(e,[...n.values()])}function Ht(e,t){let n=new Map(e.map((r,o)=>[r.name,o]));return[...t].sort((r,o)=>(n.get(r.kind)??0)-(n.get(o.kind)??0)||r.slot-o.slot)}function Yn(e,t){let n=new Set(e.map((r)=>r.slot));for(let r=0;r<t;r++)if(!n.has(r))return r;return null}function Xn(e){return e.reduce((t,n)=>!t||n.donatedAt<t.donatedAt?n:t,null)}function Qn(){let e=globalThis.craft;return e&&typeof e==="object"?e.siri:void 0}var Jn="stacks_spotlight_index",Zn=3000;function si(e){let t=e.onProblem??((w)=>console.warn(`[spotlight] ${w}`)),n=Array.isArray(e.kinds)?{kinds:[...e.kinds],problems:[]}:Mt(e.kinds);for(let w of n.problems)t(w);let r=e.enabled===!1?[]:n.kinds,o=e.storageKey??Jn,i=e.legacyStorageKeys??[],a=e.timeoutMs??Zn,s=e.now??(()=>Date.now()),l=e.bridge??Qn,f=null;function u(){try{return typeof localStorage>"u"?null:localStorage}catch{return null}}function m(){if(f)return f;f=[];let w=u();if(!w)return f;try{let x=[o,...i].map((k)=>w.getItem(k)).find((k)=>k);f=x?Gn(r,JSON.parse(x)):[]}catch{f=[]}return f}function h(w){f=w;let x=u();if(!x)return;try{x.setItem(o,JSON.stringify(w));for(let k of i)x.removeItem(k)}catch{}}async function c(w){if(!w)return null;let x;try{return await Promise.race([w,new Promise((k)=>{x=setTimeout(()=>k(null),a)})])}catch{return null}finally{if(x!==void 0)clearTimeout(x)}}let p=Promise.resolve();function g(w){let x=p.then(w,w);return p=x.catch(()=>{return}),x}async function S(w,x){let k=l()?.register;if(!k||r.length===0)return!1;return g(async()=>{let R=zn(r,m(),w,x,s()),H=R&&le(r,w,R.entry.slot);if(!R||!H)return!1;if(!R.changed)return h(R.entries),!0;let q=await c(k(R.entry.title,H))!==null;if(q)h(R.entries);return q})}async function b(w,x){let k=l()?.remove;if(!k)return!1;return g(async()=>{let{entries:R,removed:H}=qn(m(),w,x);if(!H)return!1;let q=le(r,w,H.slot),me=q?await c(k(q))!==null:!1;return h(R),me})}async function I(w,x){let k=ce(r,w)?.slots;if(!k||!l()?.register)return 0;let R=0;for(let H of[...x].slice(0,k).reverse())if(await S(w,H))R++;return R}async function O(){let w=l()?.remove;if(!w)return h([]),0;return g(async()=>{let x=0;for(let k of m()){let R=le(r,k.kind,k.slot);if(R&&await c(w(R))!==null)x++}return h([]),x})}return{kinds:r,index:S,sync:I,remove:b,clear:O,routeFor:(w)=>Vn(r,m(),w),entries:()=>m(),activityTypes:(w)=>Ct(r).map((x)=>`${w}.${x}`),reset:()=>{f=null}}}var Lt=["craftShortcut","craftSiriShortcut"];function li(e,t){let n=(r)=>{let o=r.detail,i=typeof o==="string"?o:o&&typeof o==="object"?o.action??o.type:null,a=typeof i==="string"?e.routeFor(i):null;if(a)t(a)};if(typeof globalThis.addEventListener!=="function")return()=>{};for(let r of Lt)globalThis.addEventListener(r,n);return()=>{for(let r of Lt)globalThis.removeEventListener(r,n)}}import{tabBar as er}from"craft-native/mobile";var tr=er;function nr(e){return Array.from(e.querySelectorAll("a[data-native-tab]")).map((t)=>({id:t.getAttribute("href")||"",title:t.getAttribute("data-native-tab")||t.getAttribute("aria-label")||"",symbol:t.getAttribute("data-native-tab-symbol")||"circle",badge:(t.querySelector(".native-tab-badge")?.textContent||"").trim(),current:t.hasAttribute("data-stx-nav-current")||t.classList.contains("is-active")})).filter((t)=>t.id&&t.title)}function rr(e){return{tabs:e.map(({id:n,title:r,symbol:o,badge:i})=>i?{id:n,title:r,symbol:o,badge:i}:{id:n,title:r,symbol:o}),selected:e.find((n)=>n.current)?.id}}function _t(){if(typeof window>"u")return;let e=window.stxRouter;return e&&typeof e==="object"?e:void 0}function or(){return typeof _t()?.selectTab==="function"}function di(e,t={}){let n=(r)=>{if(or()||r.defaultPrevented)return;let o=r.target?.closest?.("a[data-native-tab]");if(!o||!e.contains(o))return;if(!o.hasAttribute("data-stx-nav-current")&&!o.classList.contains("is-active")&&o.getAttribute("aria-current")!=="page")return;r.preventDefault();let i=e.ownerDocument.defaultView;if(t.scrollToTop)t.scrollToTop();else i?.scrollTo?.({top:0,behavior:i.matchMedia?.("(prefers-reduced-motion: reduce)").matches?"auto":"smooth"});i?.dispatchEvent(new CustomEvent("stx:tabreselect",{detail:{href:o.getAttribute("href")||""}}))};return e.addEventListener("click",n),()=>e.removeEventListener("click",n)}function Dt(e){let t=e.trim();return/^#[0-9a-f]{6}$/i.test(t)?t:void 0}var Ue="stacks:tab-bar-cover";function pi(e,t){if(t)e.setAttribute("data-native-covers-tab-bar","");else e.removeAttribute("data-native-covers-tab-bar");e.ownerDocument?.defaultView?.dispatchEvent(new Event(Ue))}function fi(e,t={}){let n=t.api??tr;if(!n.isAvailable())return null;let r=t.hidden??(()=>Boolean(e.ownerDocument?.querySelector("[data-native-hide-tab-bar], [data-native-covers-tab-bar]"))),o=typeof getComputedStyle==="function"?getComputedStyle(e):null,i=Dt(o?.getPropertyValue("--native-tab-active")||""),a=Dt(o?.getPropertyValue("--native-tab-active-dark")||""),s="",l=()=>{if(r()){if(s!=="hidden")n.hide();s="hidden";return}let{tabs:h,selected:c}=rr(nr(e)),p=JSON.stringify({tabs:h,selected:c});if(p===s)return;let g=s&&s!=="hidden"?JSON.parse(s):null;if(g&&c&&JSON.stringify(g.tabs)===JSON.stringify(h))n.select(c);else n.set(h,{selected:c,tint:i,tintDark:a});s=p},f=typeof MutationObserver==="function"?new MutationObserver(l):null;f?.observe(e,{attributes:!0,attributeFilter:["data-stx-nav-current","class"],childList:!0,subtree:!0,characterData:!0});let u=n.onSelect((h)=>{let c=_t();if(c?.selectTab){c.selectTab(h);return}Array.from(e.querySelectorAll("a[data-native-tab]")).find((g)=>g.getAttribute("href")===h)?.click()}),m=()=>l();if(typeof window<"u")window.addEventListener("stx:load",m),window.addEventListener("stx:screen-shown",m),window.addEventListener(Ue,m);return l(),()=>{if(f?.disconnect(),u(),typeof window<"u")window.removeEventListener("stx:load",m),window.removeEventListener("stx:screen-shown",m),window.removeEventListener(Ue,m);n.hide()}}function ir(e={}){let t=e.maxSeconds??300,n=e.maxBytes??12582912;if(![t,n].every((g)=>Number.isSafeInteger(g)&&g>0)||t>300)throw TypeError("Invalid voice recording limits");let r={status:"idle",audio:null,error:null},o=new Set,i={},a=null,s=null,l=null,f,u=(g)=>{r=g;for(let S of o)S({...g})},m=()=>{clearTimeout(f),l?.getTracks().forEach((g)=>g.stop()),l=null};function h(){if(i={},a){let S=a;a=null,Promise.resolve(L("audioRecording.cancel")?.(S)).catch(()=>{})}let g=s;if(s=null,g&&g.state!=="inactive")g.stop();m(),u({status:"idle",audio:null,error:null})}async function c(){h();let g=i;u({status:"requesting",audio:null,error:null});try{let S=L("audioRecording.start");if(S){let R=globalThis.crypto.randomUUID();if(a=R,await S(R,{maxSeconds:t}),i!==g)return;f=setTimeout(()=>{if(i===g)p()},t*1000-250),u({status:"recording",audio:null,error:null});return}if(typeof navigator>"u"||!navigator.mediaDevices?.getUserMedia||typeof MediaRecorder>"u")throw Error("Microphone recording is unavailable. Upload an audio recording instead.");let b=await navigator.mediaDevices.getUserMedia({audio:{channelCount:1},video:!1});if(i!==g){b.getTracks().forEach((R)=>R.stop());return}l=b;let I=["audio/webm;codecs=opus","audio/mp4","audio/webm"].find((R)=>MediaRecorder.isTypeSupported(R)),O=new MediaRecorder(b,{...I?{mimeType:I}:{},audioBitsPerSecond:32000});s=O;let w=[],x=0,k=!1;O.ondataavailable=(R)=>{if(i!==g||!R.data.size)return;if(x+=R.data.size,x>n){if(k=!0,w.length=0,O.state!=="inactive")O.stop();m();return}if(!k)w.push(R.data)},O.onerror=()=>{if(i!==g)return;h(),u({status:"error",audio:null,error:"Recording failed. Please try again."})},O.onstop=()=>{if(i!==g)return;s=null,m();let R=new Blob(w,{type:O.mimeType||I||"audio/webm"});u(k||!R.size?{status:"error",audio:null,error:k?"The recording exceeds the upload limit.":"The recording was empty."}:{status:"ready",audio:R,error:null})},O.start(1000),f=setTimeout(()=>{if(i===g&&O.state!=="inactive")O.stop()},t*1000-250),u({status:"recording",audio:null,error:null})}catch(S){if(i!==g)return;h(),u({status:"error",audio:null,error:S instanceof Error?S.message:"Microphone permission was refused."})}}async function p(){if(!a){if(s&&s.state!=="inactive")s.stop();return}let g=i,S=a;clearTimeout(f);try{let b=await L("audioRecording.stop")?.(S);if(i!==g)return;if(!b?.path||!b.size||b.size>n||!Number.isFinite(b.durationSeconds)||b.durationSeconds<=0||b.durationSeconds>t+1)throw Error("The recording is empty or exceeds its limits.");u({status:"ready",audio:b,error:null})}catch(b){if(i!==g)return;h(),u({status:"error",audio:null,error:b instanceof Error?b.message:"Recording failed."})}}return{start:c,cancel:h,dispose(){h(),o.clear()},stop:p,supported:()=>Boolean(L("audioRecording.start"))||typeof navigator<"u"&&Boolean(navigator.mediaDevices?.getUserMedia)&&typeof MediaRecorder<"u",snapshot:()=>({...r}),subscribe(g){return o.add(g),g({...r}),()=>{o.delete(g)}}}}function ar(e,t={},n="audio"){if(!n||Object.hasOwn(t,n))throw TypeError("Use a distinct recording field name");let r=new FormData;if(typeof Blob<"u"&&e instanceof Blob)r.append(n,e,"feedback");else{if(!e||!("path"in e)||typeof e.path!=="string"||!e.path||!L("audioRecording.stop"))throw TypeError("A native recording requires its native upload host");Reflect.apply(r.append,r,[n,e]);let o=r.get(n);if(!o||typeof o!=="object"||!("path"in o)||o.path!==e.path)throw TypeError("The upload host did not preserve the native recording file")}for(let[o,i]of Object.entries(t)){if(typeof i!=="string")throw TypeError("Upload fields must be strings");r.append(o,i)}return r}var ur={isAvailable:()=>d(()=>We.isAvailable()),getBiometricType:()=>d(()=>We.getBiometricType()),authenticate:(e)=>d(()=>We.authenticate(e))},dr={takePicture:(e)=>d(()=>Ae.takePicture(e)),pickImage:()=>d(()=>Ae.pickImage()),pickMultiple:(e)=>d(()=>Ae.pickMultiple(e)),isAvailable:()=>d(()=>Ae.isAvailable())},pr={getInfo:()=>d(()=>Z.getInfo()),getCapabilities:()=>d(()=>Z.getCapabilities()),isMobile:()=>Z.isMobile(),isIOS:()=>Z.isIOS(),isAndroid:()=>Z.isAndroid(),getLocale:()=>Z.getLocale(),getTimezone:()=>Z.getTimezone()},fr=lr;function G(){return X()?.capabilities.locationRecordingOwnership===!0&&B.supportsRecordingOwnership?.()===!0}function Y(){return X()?.capabilities.heartRateRecordingOwnership===!0&&E.supportsRecordingOwnership?.()===!0}function $t(){return G()&&X()?.capabilities.locationRecordingIntentIdentity===!0&&B.supportsRecordingIntentIdentity?.()===!0}function Kt(){return Y()&&X()?.capabilities.heartRateRecordingIntentIdentity===!0&&E.supportsRecordingIntentIdentity?.()===!0}function zt(e,t,n){return d(async()=>{let r=e&&Object.hasOwn(e,"recordingId");if(r){if(!t())throw Object.assign(Error("This host or adapter cannot start a registered recording identity"),{code:"RECORDING_INTENT_IDENTITY_UNSUPPORTED"});if(typeof e.recordingId!=="string"||!e.recordingId.trim())throw Object.assign(Error("A registered recording ID is required"),{code:"INVALID_ARGUMENT"})}let o=await n();if(r&&o.id!==e.recordingId)throw Object.assign(Error("The native recording identity changed at start"),{code:"RECORDING_CONFLICT"});return o})}function F(e,t,n){return d(()=>{if(e&&Object.hasOwn(e,"expectedId")){if(!t())throw Object.assign(Error("This host or adapter cannot protect recording ownership"),{code:"RECORDING_OWNERSHIP_UNSUPPORTED"});if(typeof e.expectedId!=="string"||!e.expectedId.trim())throw Object.assign(Error("A saved recording ID is required"),{code:"RECORDING_CONFLICT"})}return n()})}var mr={supportsRecordingOwnership:G,supportsRecordingIntentIdentity:$t,acknowledgeRecording:(e)=>F({expectedId:e?.expectedId},G,()=>B.acknowledgeRecording(e)),getCurrentPosition:(e)=>d(()=>B.getCurrentPosition(e)),watchPosition:(e,t)=>B.watchPosition(e,t),clearWatch:(e)=>B.clearWatch(e),startRecording:(e)=>zt(e,$t,()=>B.startRecording(e)),pauseRecording:(e)=>F(e,G,()=>B.pauseRecording(e)),resumeRecording:(e)=>F(e,G,()=>B.resumeRecording(e)),stopRecording:(e)=>F(e,G,()=>B.stopRecording(e)),getRecordingState:(e)=>F(e,G,()=>B.getRecordingState(e)),readRecording:(e)=>F(e,G,()=>B.readRecording(e))},gr={show:(e)=>d(()=>de.show(e)),schedule:(e)=>d(()=>de.schedule(e)),cancel:(e)=>d(()=>de.cancel(e)),cancelAll:()=>d(()=>de.cancelAll()),setBadge:(e)=>d(()=>de.setBadge(e))},hr={check:(e)=>d(()=>pe.check(e)),request:(e)=>d(()=>pe.request(e)),checkMultiple:(e)=>d(()=>pe.checkMultiple(e)),requestMultiple:(e)=>d(()=>pe.requestMultiple(e)),openSettings:()=>d(()=>pe.openSettings())},br={set:(e,t)=>d(()=>Te.set(e,t)),get:(e)=>d(()=>Te.get(e)),delete:(e)=>d(()=>Te.delete(e)),clear:()=>d(()=>Te.clear())},vr={share:(e)=>d(()=>Wt.share(e)),isAvailable:()=>Wt.isAvailable()},yr={request:()=>d(()=>sr.request())},Oe={impact:(e)=>Promise.resolve().then(()=>ke.impact(e)).catch(()=>{}),notification:(e)=>Promise.resolve().then(()=>ke.notification(e)).catch(()=>{}),selection:()=>Promise.resolve().then(()=>ke.selection()).catch(()=>{}),vibrate:(e)=>Promise.resolve().then(()=>ke.vibrate(e)).catch(()=>{}),prepare:(e)=>{let t=L("haptics.prepare");return t?Promise.resolve().then(()=>t(e)).then(()=>{},()=>{}):Promise.resolve()}};function jt(e){if(typeof e==="string")return e.trim()||null;if(!e||typeof e!=="object")return null;let t=e.url;return typeof t==="string"&&t.trim()?t:null}var Sr={async getInitialURL(){if(!await ee())return null;return jt(await Bt.getInitialURL?.())},onLink(e){let t=null,n=!1,r=()=>{if(n)return;t=Bt.onLink?.((o,i)=>{let a=jt(o);if(a)e(a,{initial:i?.initial===!0})})??null};if(Ie()?.craft)r();else ee().then(r);return()=>{n=!0,t?.()}}},Ri={isAvailable:()=>Ee.isAvailable(),set:(e,t)=>Ee.set(e,t),remove:(e)=>Ee.remove(e),clear:()=>Ee.clear()},wr={enable:()=>d(()=>Ft.enable()),disable:()=>d(()=>Ft.disable())},xr={isAvailable:()=>Re.isAvailable(),get:()=>d(()=>Re.get()),set:(e)=>d(()=>Re.set(e)),restore:()=>d(()=>Re.restore())},Rr={isAvailable:()=>j.isAvailable(),supports:(e)=>j.supports(e),getAuthorizationStatus:()=>d(()=>j.getAuthorizationStatus()),requestAuthorization:()=>d(()=>j.requestAuthorization()),getNowPlaying:()=>d(()=>j.getNowPlaying()),play:()=>d(()=>j.play()),pause:()=>d(()=>j.pause()),togglePlayPause:()=>d(()=>j.togglePlayPause()),skipToNext:()=>d(()=>j.skipToNext()),skipToPrevious:(e)=>d(()=>j.skipToPrevious(e)),onChange:(e)=>J(()=>j.onChange(e))},Ar={supportsRecordingOwnership:Y,supportsRecordingIntentIdentity:Kt,acknowledgeRecording:(e)=>F({expectedId:e?.expectedId},Y,()=>E.acknowledgeRecording(e)),isAvailable:()=>E.isAvailable(),supports:(e)=>E.supports(e),getState:()=>d(()=>E.getState()),requestAuthorization:()=>d(()=>E.requestAuthorization()),scan:(e)=>d(()=>E.scan(e)),stopScan:()=>d(()=>E.stopScan()),getDevices:()=>d(()=>E.getDevices()),connect:(e)=>d(()=>E.connect(e)),reconnect:()=>d(()=>E.reconnect()),disconnect:(e)=>d(()=>E.disconnect(e)),startRecording:(e)=>zt(e,Kt,()=>E.startRecording(e)),pauseRecording:(e)=>F(e,Y,()=>E.pauseRecording(e)),resumeRecording:(e)=>F(e,Y,()=>E.resumeRecording(e)),stopRecording:(e)=>F(e,Y,()=>E.stopRecording(e)),getRecordingState:(e)=>F(e,Y,()=>E.getRecordingState(e)),readRecording:(e)=>F(e,Y,()=>E.readRecording(e)),onReading:(e)=>J(()=>E.onReading(e)),onDevice:(e)=>J(()=>E.onDevice(e)),onState:(e)=>J(()=>E.onState(e))},kr={isAvailable:()=>je.isAvailable(),speak:(e,t)=>d(()=>je.speak(e,t)),stop:()=>d(()=>je.stop())},Tr={getStatus:()=>d(()=>Ut.getStatus()),onChange:(e)=>J(()=>Ut.onChange(e))},Er={register:()=>d(()=>Ke.register()),onToken:(e)=>Ke.onToken(e),onNotification:(e)=>J(()=>Ke.onNotification(e))},Or={requestAuthorization:(e,t)=>d(()=>ue.requestAuthorization(e,t)),getData:(e,t)=>d(()=>ue.getData(e,t)),saveWorkout:(e)=>d(()=>ue.saveWorkout(e)),getWorkouts:(e)=>d(()=>ue.getWorkouts(e)),getDailyStatistics:(e,t)=>d(()=>ue.getDailyStatistics(e,t)),getHeartRateSamples:(e)=>y("health.getHeartRateSamples",[e??{}],()=>[]).then((t)=>Array.isArray(t)?t:[]),getSamples:(e,t)=>y("health.getSamples",[e,t??{}],()=>[]).then((n)=>Array.isArray(n)?n:[]),getSleepIntervals:(e)=>y("health.getSleepIntervals",[e??{}],()=>[]).then((t)=>Array.isArray(t)?t:[]),saveMindfulSession:(e)=>y("health.saveMindfulSession",[e],()=>null).then((t)=>t??null),getMindfulSessions:(e)=>y("health.getMindfulSessions",[e??{}],()=>[]).then((t)=>Array.isArray(t)?t:[]),startHeartRateUpdates:(e)=>y("health.startHeartRateUpdates",[e??{}],()=>!1).then((t)=>t!==!1),stopHeartRateUpdates:()=>y("health.stopHeartRateUpdates",[],()=>!0).then(()=>!0),onHeartRate:(e)=>W("craftHealthHeartRate",(t)=>{if(Array.isArray(t.samples)&&t.samples.length)e(t.samples)}),supports:(e)=>L(`health.${e}`)!==null},Ir={start:(e)=>d(()=>$e.start(e)),update:(e)=>d(()=>$e.update(e)),end:()=>d(()=>$e.end())},Pr={send:(e)=>d(()=>fe.send(e)),updateContext:(e)=>d(()=>fe.updateContext(e)),isReachable:()=>d(()=>fe.isReachable()),onMessage:(e)=>fe.onMessage(e),onReachabilityChange:(e)=>fe.onReachabilityChange(e)},Ai=cr;function Ie(){return T()}function X(){let e=Ie()?.craft;if(!e||typeof e!=="object")return null;if(!("platform"in e)||e.platform!=="ios"&&e.platform!=="android")return null;let t="capabilities"in e?e.capabilities:void 0,n=t&&typeof t==="object"&&!Array.isArray(t)?Object.fromEntries(Object.entries(t).filter(([,r])=>typeof r==="boolean")):{};return{platform:e.platform,capabilities:n}}function ze(){return X()!==null}function Lr(e=2000){if(ze()||re())return Promise.resolve(!0);let t=Ie();if(!t||!(t.craft||t.webkit?.messageHandlers?.craft))return Promise.resolve(!1);return new Promise((n)=>{let r=()=>{clearTimeout(o),t.removeEventListener("craftReady",r),n(ze())},o=setTimeout(r,e);t.addEventListener("craftReady",r,{once:!0})})}function Mr(e){let t=Ie();if(!t)return()=>{};if(X()){let r=!1;return queueMicrotask(()=>{if(!r)e(new Event("craftReady"))}),()=>{r=!0}}let n=(r)=>{if(!X())return;t.removeEventListener("craftReady",n),e(r)};return t.addEventListener("craftReady",n),()=>t.removeEventListener("craftReady",n)}async function Cr(e){await Oe.impact("light");try{let t=await e();return await Oe.notification("success"),t}catch(t){throw await Oe.notification("error"),t}}var ki={get nativeBridge(){return X()},biometrics:ur,camera:dr,device:pr,haptics:Oe,lifecycle:fr,location:mr,notifications:gr,permissions:hr,secureStorage:br,storage:ht,crypto:bt,share:vr,appReview:yr,deepLinks:Sr,keepAwake:wr,brightness:xr,music:Rr,heartRate:Ar,scheduledWorkouts:yt,speech:kr,network:Tr,pushNotifications:Er,health:Or,liveActivities:Ir,watchConnectivity:Pr,dialog:oe,contextMenu:He,browser:ot,symbols:it,statusBar:he,chrome:ie,refresh:V,background:ae,clipboard:at,db:st,files:lt,shortcuts:ct,widgets:ut,orientation:dt,auth:pt,storeKit:ft,isNativeMobile:ze,whenNative:Lr,onReady:Mr,withFeedback:Cr};export{Nr as BRIDGE_WAIT_MS,Mo as HEART_RATE_MATCH_MS,Ko as INDOOR_CHECK_AFTER_S,ii as MAX_SPOTLIGHT_SLOTS_PER_KIND,Ot as ROUTE_FULL_READ_FIXES,Pn as ROUTE_FULL_READ_MAX_MS,kn as ROUTE_GAP_S,Xo as SHEET_FLICK_VELOCITY,Ue as TAB_BAR_COVER_EVENT,d as afterBridge,yr as appReview,Bn as applyAppearance,Rn as attachHeartRate,pt as auth,ko as backLabelFor,ae as background,ur as biometrics,ge as bridgePending,xr as brightness,ot as browser,y as callNative,dr as camera,yn as canGoBack,ie as chrome,at as clipboard,Wr as confirmAction,He as contextMenu,pi as coverTabBar,T as craftHost,Q as craftRoot,lo as crashReporting,Do as createRouteRecorder,ve as createRouteStats,si as createSpotlightIndex,ir as createVoiceRecorder,bt as crypto,xt as currentAppearance,st as db,wn as deepLinkPath,Sr as deepLinks,pr as device,oe as dialog,Ao as enterNavTrail,lt as files,En as fixDistance,no as focusSegment,Po as followDeepLinks,X as getNativeMobileBridge,Ro as goBack,Oo as goBackToTabRoot,di as handleTabReselect,Oe as haptics,re as hasNativeMobileHost,Or as health,Ar as heartRate,jo as indoorVerdict,ri as installNativeChrome,ro as installPressables,ze as isNativeMobile,Cn as isShown,wr as keepAwake,dn as keepBreadcrumb,bn as largeTitleMetrics,fr as lifecycle,Jo as liftToBody,Ir as liveActivities,mr as location,fi as mirrorTabBar,ki as mobile,Rr as music,Yt as nativeFunction,L as nativeFunctionNow,rr as nativeTabs,To as navTrail,Tr as network,fn as normalizeAppearance,jt as normalizeDeepLinkURL,ln as normalizeScheduledWorkout,gr as notifications,So as observeLargeTitle,Zr as observeLongPress,Go as observeNativeRefresh,gn as observePageScroll,yo as observePullToRefresh,eo as observeSegmentScrub,Qo as observeSheetDrag,Rt as onAppearance,ho as onBackgroundRefresh,W as onCraftEvent,mo as onMemoryWarning,Mr as onMobileReady,fo as onResume,go as onSilentPush,li as onSpotlightTap,dt as orientation,No as paceLabel,Un as pageBackground,Wn as pageIsDark,se as pageScrollTop,Fo as pauseSessionClock,hr as permissions,en as placeMenu,zn as placeSpotlightItem,Je as presentActionSheet,Xe as presentAlert,Pe as presentChoice,Qe as presentConfirm,Ze as presentContextMenu,Zo as presentPageAsCard,Eo as previousScreenPath,hn as pullDistance,Er as pushNotifications,Gn as readSpotlightEntries,Mt as readSpotlightKinds,nr as readTabLinks,V as refresh,qn as removeSpotlightItem,wo as resolveScrollHost,Uo as resumeSessionClock,Ln as routeReadInterval,In as routeStats,or as routerHandlesTabs,_n as rubberBand,yt as scheduledWorkouts,sn as scheduledWorkoutsUnsupported,br as secureStorage,cn as segmentAt,to as segmentForKey,Wo as sessionClockElapsed,Dn as settleSheet,vr as share,Hn as sheetStops,ct as shortcuts,$r as showContextMenuFor,Ri as snapshots,kr as speech,Ho as speedLabel,Ai as splash,le as spotlightAction,Ct as spotlightActions,ai as spotlightActivityTypes,Qn as spotlightBridge,ce as spotlightKind,Vn as spotlightRoute,jn as spotlightSlot,Nt as spotlightTitle,Bo as startSessionClock,he as statusBar,ht as storage,ft as storeKit,J as subscribeWhenReady,it as symbols,tr as tabBar,Ne as toNativeRect,Io as trailEntryFor,zo as typedDistanceKm,Co as usableFixes,Ur as useActionSheet,ar as voiceRecordingFormData,Pr as watchConnectivity,ee as whenBridgeReady,Lr as whenNativeMobile,ut as widgets,Cr as withNativeFeedback};
|
|
55
|
+
`;function Ge(){return E()?.document}function Jt(e){if(e.getElementById(qe))return;let t=e.createElement("style");t.id=qe,t.textContent=Qt,(e.head??e.documentElement).appendChild(t)}var Zt=0;function N(e,t,n,r){let o=e.createElement(t);if(o.className=n,r!==void 0)o.textContent=r;return o}function Ve(){return E()?.stx?.overlays}var en=0;function Ye(e,t,n,r){Jt(e);let o=E(),i=`native-dialog-layer-${++en}`,a=N(e,"div",`native-dialog native-dialog--${t}`);return a.setAttribute("data-native-dialog",t),a.appendChild(N(e,"div","native-dialog-backdrop")),new Promise((s)=>{let l=!1,f=(c)=>{if(l)return;l=!0,a.classList.remove("is-open"),Ve()?.close(i),setTimeout(()=>a.remove(),260),s(c)},u=n({root:a,settle:f});a.appendChild(u),e.body.appendChild(a),Ve()?.open(i,{panel:u,root:a,onEscape:()=>f(r())});let m=o;(typeof m?.requestAnimationFrame==="function"?(c)=>m.requestAnimationFrame(()=>m.requestAnimationFrame(c)):(c)=>setTimeout(c,16))(()=>{if(!l)a.classList.add("is-open")})})}function Ie(e){let t=Ge();if(!t?.body)return Promise.resolve(null);let n=`native-dialog-${++Zt}`,r=e.actions.find((a)=>a.style==="cancel"),o=e.variant==="sheet"?e.actions.filter((a)=>a.style!=="cancel"):e.actions,i=e.variant==="sheet"?r??{id:"__cancel",title:e.cancelLabel||"Cancel",style:"cancel"}:void 0;return Ye(t,e.variant,({root:a,settle:s})=>{let l=(c)=>c.style==="cancel"?null:c.id,f=N(t,"div","native-dialog-panel");f.setAttribute("role","alertdialog"),f.setAttribute("aria-modal","true"),f.tabIndex=-1;let u=N(t,"div","native-dialog-group");if(e.title||e.message){let c=N(t,"div","native-dialog-header");if(e.title){let p=N(t,"p","native-dialog-title",e.title);p.id=`${n}-title`,c.appendChild(p),f.setAttribute("aria-labelledby",p.id)}if(e.message){let p=N(t,"p","native-dialog-message",e.message);p.id=`${n}-message`,c.appendChild(p),f.setAttribute("aria-describedby",p.id)}u.appendChild(c)}let m=N(t,"div","native-dialog-actions");if(e.variant==="alert"&&o.length===2)m.classList.add("is-row");for(let c of o){let p=N(t,"button",`native-dialog-action${c.style==="destructive"?" is-destructive":""}${c.style==="cancel"?" is-cancel":""}`,c.title);p.type="button",p.setAttribute("data-action-id",c.id),p.addEventListener("click",()=>s(l(c))),m.appendChild(p)}if(u.appendChild(m),f.appendChild(u),i){let c=N(t,"div","native-dialog-group"),p=N(t,"button","native-dialog-action is-cancel",i.title);p.type="button",p.setAttribute("data-action-id",i.id),p.addEventListener("click",()=>s(null)),c.appendChild(p),f.appendChild(c)}let b=a.querySelector(".native-dialog-backdrop");if(e.variant==="sheet")b?.addEventListener("click",()=>s(null));return f},()=>{if(e.variant==="sheet")return null;if(r)return null;return o.length===1?o[0].id:null})}async function Xe(e){await Ie({variant:"alert",title:e.title,message:e.message,actions:[{id:"ok",title:e.okLabel||"OK"}]})}async function Qe(e){return await Ie({variant:"alert",title:e.title,message:e.message,actions:[{id:"cancel",title:e.cancelLabel||"Cancel",style:"cancel"},{id:"confirm",title:e.confirmLabel||"OK",style:e.destructive?"destructive":"default"}]})==="confirm"}function Je(e){return Ie({variant:"sheet",title:e.title,message:e.message,actions:e.actions,cancelLabel:e.cancelLabel})}function tn(e,t,n){let i=Math.max(12,Math.min(e.x,n.width-t.width-12)),a=e.y+e.height+8,s=a+t.height<=n.height-12,l=e.y-8-t.height,f=s||l<12?Math.max(12,Math.min(a,n.height-t.height-12)):l,u=e.x+e.width/2>n.width/2?"right":"left";return{top:f,left:i,origin:`${s||l<12?"top":"bottom"} ${u}`}}function Ze(e){let t=Ge();if(!t?.body)return Promise.resolve(null);let n=E();return Ye(t,"menu",({root:r,settle:o})=>{let i=N(t,"div","native-menu native-dialog-panel");if(i.setAttribute("role","menu"),e.title)i.appendChild(N(t,"p","native-menu-title",e.title)),i.setAttribute("aria-label",e.title);for(let a of e.items){let s=N(t,"button",`native-menu-item${a.destructive?" is-destructive":""}`);if(s.type="button",s.setAttribute("role","menuitem"),s.setAttribute("data-action-id",a.id),a.disabled)s.disabled=!0;if(s.appendChild(N(t,"span","native-menu-label",a.title)),a.icon){let l=N(t,"i",`native-menu-icon ${a.icon}`);l.setAttribute("aria-hidden","true"),s.appendChild(l)}s.addEventListener("click",()=>o(a.id)),i.appendChild(s)}return r.querySelector(".native-dialog-backdrop")?.addEventListener("click",()=>o(null)),queueMicrotask(()=>{let a=i.getBoundingClientRect?.(),s=tn(e.anchor,{width:a?.width||248,height:a?.height||e.items.length*44},{width:n?.innerWidth||390,height:n?.innerHeight||844});i.style.top=`${s.top}px`,i.style.left=`${s.left}px`,i.style.setProperty("--native-menu-origin",s.origin)}),i},()=>null)}var rt=()=>!0,_=()=>!1,K=()=>null;function et(){return E()?.navigator??(typeof navigator>"u"?void 0:navigator)}function Ne(e){return{x:Math.round(e.x??e.left??0),y:Math.round(e.y??e.top??0),width:Math.round(e.width),height:Math.round(e.height)}}var oe={alert:(e)=>w("dialog.alert",[e],()=>Xe(e),{fallbackOnError:!0}).then(()=>{}),confirm:(e)=>w("dialog.confirm",[e],()=>Qe(e),{fallbackOnError:!0}).then(Boolean),actionSheet:async(e)=>{let t={...e,anchor:e.anchor?Ne(e.anchor):void 0},n=await w("dialog.actionSheet",[t],()=>Je(e),{fallbackOnError:!0});if(typeof n!=="string")return null;return e.actions.find((r)=>r.id===n)?.style==="cancel"?null:n}};function Wr(){return(e)=>oe.actionSheet(e)}async function $r(e){if((e.style??(e.destructive?"sheet":"alert"))==="alert")return oe.confirm(e);return await oe.actionSheet({title:e.title,message:e.message,anchor:e.anchor,actions:[{id:"confirm",title:e.confirmLabel||"OK",style:e.destructive?"destructive":"default"},{id:"cancel",title:e.cancelLabel||"Cancel",style:"cancel"}]})==="confirm"}var De={show:async(e)=>{let t={title:e.title,anchor:Ne(e.anchor),items:e.items.map(({id:r,title:o,symbol:i,destructive:a,disabled:s})=>({id:r,title:o,symbol:i,destructive:a,disabled:s}))},n=await w("contextMenu.show",[t],()=>Ze(e),{fallbackOnError:!0});return typeof n==="string"?n:null}};function Kr(e,t){return De.show({...t,anchor:Ne(e.getBoundingClientRect())})}function nn(e,t){let n=E();if(!n)return{cancelled:!0};if(typeof n.craft?.openURL==="function")return Promise.resolve(n.craft.openURL(e)).catch(()=>{}),{cancelled:!1};if(t.mode==="auth")return n.location?.assign(e),{cancelled:!1};if(!(typeof n.open==="function"?n.open(e,"_blank","noopener"):null))n.location?.assign(e);return{cancelled:!1}}var ot={open:async(e,t={})=>{let n=await w("browser.open",[e,t],()=>nn(e,t),{fallbackOnError:!0});if(!n||typeof n!=="object")return{cancelled:!1};let{url:r,cancelled:o}=n;return typeof r==="string"?{url:r,cancelled:Boolean(o)}:{cancelled:Boolean(o)}}},Me=new Map,Le=new Map;function tt(e,t){return`${e}|${t.pointSize??""}|${t.weight??""}|${t.color??""}|${t.scale??""}`}var it={isAvailable:()=>M("symbols.image")!==null,image:(e,t={})=>{let n=tt(e,t),r=Me.get(n);if(r)return r;let o=w("symbols.image",[e,t],K).then((i)=>typeof i==="string"&&i.startsWith("data:")?i:null,K).then((i)=>(Le.set(n,i),i));return Me.set(n,o),o},cached:(e,t={})=>Le.get(tt(e,t)),clearCache:()=>{Me.clear(),Le.clear()}},he={setStyle:(e)=>w("statusBar.setStyle",[e],_,{fallbackOnError:!0}).then((t)=>t!==!1)},ie={setUnderPageColor:(e)=>w("chrome.setUnderPageColor",[e],_,{fallbackOnError:!0}).then((t)=>t!==!1),setKeyboardAccessory:(e)=>w("chrome.setKeyboardAccessory",[e],_,{fallbackOnError:!0}).then((t)=>t!==!1)},Y={isAvailable:()=>M("refresh.enable")!==null,enable:(e)=>w("refresh.enable",[e??{}],_,{fallbackOnError:!0}).then((t)=>t!==!1),disable:()=>w("refresh.disable",[],_,{fallbackOnError:!0}).then((e)=>e!==!1),end:()=>w("refresh.end",[],_,{fallbackOnError:!0}).then((e)=>e!==!1),onRefresh:(e)=>W("craftRefresh",()=>e())},ae={complete:(e)=>w("background.complete",[e],_,{fallbackOnError:!0}).then((t)=>t!==!1)},at={write:(e)=>w("clipboard.write",[e],async()=>{let t=et()?.clipboard;if(!t?.writeText)return!1;return t.writeText(e).then(rt,_)},{fallbackOnError:!0}).then((t)=>t!==!1),read:()=>w("clipboard.read",[],async()=>{let e=et()?.clipboard;if(!e?.readText)return null;return e.readText().catch(K)},{fallbackOnError:!0}).then((e)=>typeof e==="string"?e:null)},st={isAvailable:()=>M("db.query")!==null,query:(e,t=[])=>w("db.query",[e,t],K).then((n)=>Array.isArray(n)?n:null),execute:(e,t=[])=>w("db.execute",[e,t],K).then((n)=>{if(!n||typeof n!=="object")return null;let{rowsAffected:r,lastInsertId:o}=n;return{rowsAffected:Number(r)||0,lastInsertId:Number(o)||0}})};function Ce(e,t){let n=E()?.document;if(!n?.body)return null;let r=n.createElement("a");return r.href=e,r.download=t,r.rel="noopener",r.style.display="none",n.body.appendChild(r),r.click(),r.remove(),t}function rn(e){let t=E()?.document;if(!t?.body)return Promise.resolve(null);return new Promise((n)=>{let r=t.createElement("input");if(r.type="file",r.style.display="none",e.length)r.accept=e.map((i)=>i.includes("/")||i.startsWith(".")?i:`.${i}`).join(",");let o=(i)=>{r.remove(),n(i)};r.addEventListener("cancel",()=>o(null)),r.addEventListener("change",()=>{let i=r.files?.[0];if(!i)return o(null);let a=new FileReader;a.onload=()=>o({name:i.name,mimeType:i.type||void 0,data:typeof a.result==="string"?a.result:void 0}),a.onerror=()=>o({name:i.name,mimeType:i.type||void 0}),a.readAsDataURL(i)}),t.body.appendChild(r),r.click()})}var lt={openPDF:(e,t=0)=>w("openPDF",[e,t],()=>{let n=E();return Boolean(n?.open?.(e,"_blank","noopener"))}).then((n)=>n!==!1),takeScreenshot:()=>w("takeScreenshot",[],K,{fallbackOnError:!0}).then((e)=>typeof e==="string"?e:null),scanQRCode:()=>w("scanQRCode",[],K).then((e)=>{if(!e||typeof e!=="object")return null;let{type:t,data:n}=e;return typeof n==="string"?{type:String(t??""),data:n}:null},K),pickFile:(e=[])=>w("pickFile",[e],()=>rn(e)).then((t)=>{if(!t||typeof t!=="object")return null;let n=t;if(typeof n.name!=="string")return null;return{name:n.name,path:typeof n.path==="string"?n.path:void 0,data:typeof n.data==="string"?n.data:void 0,mimeType:typeof n.mimeType==="string"?n.mimeType:void 0}},K),saveFile:(e,t,n)=>w("saveFile",[e,t,n],()=>{if(e.startsWith("data:"))return Ce(e,t);let r=new Blob([e],{type:n||"text/plain"}),o=URL.createObjectURL(r),i=Ce(o,t);return setTimeout(()=>URL.revokeObjectURL(o),1000),i}).then((r)=>typeof r==="string"?r:null),downloadFile:(e,t)=>w("downloadFile",[e,t],()=>Ce(e,t)).then((n)=>typeof n==="string"?n:null)},ct={set:(e)=>w("shortcuts.set",[e.map(({symbol:t,...n})=>t?{...n,iconName:t}:n)],_).then((t)=>t!==!1),clear:()=>w("shortcuts.clear",[],_).then((e)=>e!==!1),onShortcut:(e)=>W("craftShortcut",(t)=>{if(typeof t.type==="string")e(t.type)})},ut={update:(e)=>w("widget.update",[e],_).then((t)=>t!==!1),reload:()=>w("widget.reload",[],_).then((e)=>e!==!1)},on={portrait:"portrait-primary",portraitUpsideDown:"portrait-secondary",landscape:"landscape",landscapeLeft:"landscape-primary",landscapeRight:"landscape-secondary"};function nt(){return E()?.screen?.orientation}var dt={lock:(e)=>w("lockOrientation",[e],()=>{let t=nt();return t?.lock?t.lock(on[e]).then(rt,_):!1}).then((t)=>t!==!1),unlock:()=>w("unlockOrientation",[],()=>(nt()?.unlock?.(),!0)).then((e)=>e!==!1)},pt={signInWithApple:(e={})=>w("signInWithApple",e.nonce?[{nonce:e.nonce}]:[],K).then((t)=>{if(!t||typeof t!=="object"||typeof t.userId!=="string")return null;return t})},ft={isAvailable:()=>M("iap.purchase")!==null,products:(e)=>w("iap.getProducts",[e],()=>[]).then((t)=>Array.isArray(t)?t:[]),purchase:(e)=>w("iap.purchase",[e],K).then((t)=>t&&typeof t==="object"?t:null,(t)=>{if(/cancel/i.test(String(t?.message??t)))return null;throw t}),restore:()=>w("iap.restore",[],()=>[]).then((e)=>Array.isArray(e)?e:[])};import{storage as q}from"craft-native/mobile";function mt(){return Q()?.capabilities?.storageCompareAndSet===!0&&q.supportsCompareAndSet?.()===!0}function gt(){return Q()?.capabilities?.storageSetIfAbsent===!0&&q.supportsSetIfAbsent?.()===!0}var ht={supportsCompareAndSet:mt,supportsSetIfAbsent:gt,get:(e)=>d(()=>q.get(e)),set:(e,t)=>d(()=>q.set(e,t)),remove:(e)=>d(()=>q.remove(e)),clear:()=>d(()=>q.clear()),keys:()=>d(()=>q.keys()),setIfAbsent:(e,t)=>d(()=>{if(!gt())throw Object.assign(Error("This host or adapter cannot create storage atomically"),{code:"STORAGE_SET_IF_ABSENT_UNSUPPORTED"});return q.setIfAbsent(e,t)}),compareAndSet:(e,t,n)=>d(()=>{if(!mt())throw Object.assign(Error("This host or adapter cannot compare storage atomically"),{code:"STORAGE_COMPARE_AND_SET_UNSUPPORTED"});return q.compareAndSet(e,t,n)})};import{crypto as an}from"craft-native/mobile";var bt={randomUUID:()=>d(()=>an.randomUUID())};var sn=["authorized","denied","notDetermined","restricted","unsupported"];function be(){let e=Q(),t=e?.scheduledWorkouts;if(!t||typeof t!=="object"||e?.capabilities?.scheduledWorkouts!==!0)return;return t}function ln(){return Object.assign(Error("unsupported"),{code:"UNSUPPORTED"})}function vt(e){return sn.includes(e)?e:"unsupported"}function cn(e){if(!e||typeof e!=="object")return null;let t=e;if(typeof t.id!=="string"||!t.id||typeof t.date!=="string"||!/^\d{4}-\d{2}-\d{2}$/.test(t.date))return null;let n={id:t.id.toLowerCase(),date:t.date,complete:t.complete===!0};if(typeof t.hour==="number"&&Number.isFinite(t.hour))n.hour=t.hour;if(typeof t.minute==="number"&&Number.isFinite(t.minute))n.minute=t.minute;return n}function te(e,t,...n){return d(async()=>{let r=be();if(typeof r?.[e]!=="function")throw ln();return t(await r[e](...n))})}var yt={isAvailable:()=>typeof be()?.isSupported==="function",supports:(e)=>typeof be()?.[e]==="function",isSupported:()=>d(async()=>{let e=be();if(typeof e?.isSupported!=="function")return!1;try{return await e.isSupported()===!0}catch{return!1}}),authorization:()=>te("authorization",vt),requestAuthorization:()=>te("requestAuthorization",vt),list:()=>te("list",(e)=>Array.isArray(e)?e.map(cn).filter((t)=>t!==null):[]),schedule:(e)=>{if(!e||typeof e!=="object"||typeof e.id!=="string")return Promise.reject(Object.assign(Error("schedule needs a plan with an id"),{code:"INVALID_ARGUMENT"}));return te("schedule",(t)=>{let n=t&&typeof t==="object"?t:{},r={id:(typeof n.id==="string"?n.id:e.id).toLowerCase()};if(Array.isArray(n.droppedAlerts)&&n.droppedAlerts.length)r.droppedAlerts=n.droppedAlerts.filter((o)=>typeof o==="string");return r},e)},remove:(e)=>te("remove",(t)=>t===!0,e),removeAll:()=>te("removeAll",(e)=>typeof e==="number"&&Number.isFinite(e)?e:0)};function eo(e,t){let n=t.delay??500,r=t.tolerance??10,o=null,i=null,a=!1,s=()=>{if(o)clearTimeout(o);if(o=null,i&&!a)t.onPressEnd?.();i=null},l=(b)=>{let c=b;if(c.button!==void 0&&c.button!==0)return;a=!1,i={x:c.clientX,y:c.clientY},t.onPressStart?.(),o=setTimeout(()=>{if(o=null,!i)return;a=!0,t.onLongPress({...i}),i=null},n)},f=(b)=>{if(!i)return;let c=b;if(Math.hypot(c.clientX-i.x,c.clientY-i.y)>r)s()},u=(b)=>{if(!a)return;a=!1,b.preventDefault(),b.stopPropagation()},m=(b)=>b.preventDefault();return e.addEventListener("pointerdown",l),e.addEventListener("pointermove",f),e.addEventListener("pointerup",s),e.addEventListener("pointercancel",s),e.addEventListener("pointerleave",s),e.addEventListener("click",u,!0),e.addEventListener("contextmenu",m),()=>{s(),e.removeEventListener("pointerdown",l),e.removeEventListener("pointermove",f),e.removeEventListener("pointerup",s),e.removeEventListener("pointercancel",s),e.removeEventListener("pointerleave",s),e.removeEventListener("click",u,!0),e.removeEventListener("contextmenu",m)}}function un(e,t,n){if(n<=1||t.width<=0)return 0;let r=Math.floor((e-t.left)/t.width*n);return Math.max(0,Math.min(n-1,r))}function to(e,t){let n=null,r=null,o=!1,i=0,a=(c)=>{let p=e.getBoundingClientRect();return un(c,{left:p.left+2,width:p.width-4},t.count())},s=(c)=>{let p=c;if(p.button!==void 0&&p.button!==0)return;let g=a(p.clientX);if(g!==t.selected())return;n=g,i=g,o=!1,r=p.pointerId;try{e.setPointerCapture?.(p.pointerId)}catch{}t.onPress?.(!0)},l=(c)=>{if(n===null)return;let p=a(c.clientX);if(p===i)return;o=!0,i=p,t.onScrub(p)},f=(c)=>{if(n===null)return;if(r!==null)try{e.releasePointerCapture?.(r)}catch{}if(t.onPress?.(!1),c&&o)t.onCommit(i);else if(o)t.onScrub(n);n=null,r=null},u=(c)=>{if(!o)return;o=!1,c.preventDefault(),c.stopPropagation()},m=()=>f(!0),b=()=>f(!1);return e.addEventListener("pointerdown",s),e.addEventListener("pointermove",l),e.addEventListener("pointerup",m),e.addEventListener("pointercancel",b),e.addEventListener("click",u,!0),()=>{e.removeEventListener("pointerdown",s),e.removeEventListener("pointermove",l),e.removeEventListener("pointerup",m),e.removeEventListener("pointercancel",b),e.removeEventListener("click",u,!0)}}function no(e,t,n){if(n<=0)return null;switch(e){case"ArrowRight":case"ArrowDown":return(t+1)%n;case"ArrowLeft":case"ArrowUp":return(t-1+n)%n;case"Home":return 0;case"End":return n-1;default:return null}}function ro(e,t){e.querySelectorAll('[role="tab"]')[t]?.focus()}function oo(e){let t=(n)=>{if(!n.target?.closest?.("[data-native-pressable]"))return;let o=M("haptics.prepare");if(o)Promise.resolve().then(()=>o("impact")).catch(()=>{})};return e.addEventListener("touchstart",t,{passive:!0,capture:!0}),()=>e.removeEventListener("touchstart",t,{capture:!0})}import{BugHQClient as dn}from"@bughq/sdk";import{crashReporter as ne}from"craft-native/mobile";var F=null;function pn(e){if(e.type!=="http")return!0;let t=e.data??{},n=typeof t.status==="number"?t.status:0;return t.error===!0||n>=400||n===0}function wt(){return ne.isAvailable()}function fn(e){return async(t)=>{if(!wt())return!e;return ne.capture(t)}}var co={start(e={}){if(F)return F;let t=re()||wt();if(!t&&!e.key&&!e.dsn)return null;let n=e.beforeBreadcrumb;return F=new dn({framework:"stacks-mobile",sdkName:"bughq.stacks.mobile",autoInstrument:{navigation:!0,fetch:!0,xhr:!0},...e,heartbeat:t?!1:e.heartbeat,transport:t?fn(Boolean(e.key||e.dsn)):void 0,beforeBreadcrumb(r){if(!pn(r))return null;let o=n?n(r):r;if(o===null)return null;let i=o||r;if(t)ne.addBreadcrumb(i);return i}}),F},async setUser(e){let t=e===null||e===void 0||e===""?null:String(e);F?.setUser(t===null?null:{id:t}),await ne.setUser(t)},capture(e,t){F?.captureException(e,t)},addBreadcrumb(e){if(F)F.addBreadcrumb(e);else ne.addBreadcrumb(e)},async flush(){await Promise.all([F?.flush(),ne.flush()])},client(){return F},stop(){F?.close(),F=null}};function He(e){let t=E();try{return Boolean(t?.matchMedia?.(e).matches)}catch{return!1}}function St(e){return e!==null&&e!==void 0&&e!=="false"&&e!=="0"}function Rt(){let e=E()?.document?.documentElement,t=Number.parseFloat(e?.style?.getPropertyValue("--craft-font-scale")||"");return{fontScale:Number.isFinite(t)&&t>0?t:1,reduceMotion:St(e?.getAttribute("data-craft-reduce-motion"))||He("(prefers-reduced-motion: reduce)"),reduceTransparency:St(e?.getAttribute("data-craft-reduce-transparency"))||He("(prefers-reduced-transparency: reduce)"),colorScheme:e?.classList?.contains("dark")||He("(prefers-color-scheme: dark)")?"dark":"light"}}function mn(e){let t=Rt(),n=Number(e?.fontScale);return{contentSizeCategory:typeof e?.contentSizeCategory==="string"?e.contentSizeCategory:void 0,fontScale:Number.isFinite(n)&&n>0?n:t.fontScale,reduceMotion:typeof e?.reduceMotion==="boolean"?e.reduceMotion:t.reduceMotion,reduceTransparency:typeof e?.reduceTransparency==="boolean"?e.reduceTransparency:t.reduceTransparency,colorScheme:e?.colorScheme==="dark"||e?.colorScheme==="light"?e.colorScheme:t.colorScheme}}function xt(e,t={}){if(t.immediate!==!1)e(Rt());return W("craftAppearance",(n)=>e(mn(n)))}function mo(e){return W("craftResume",(t)=>e({backgroundedMs:Number(t.backgroundedMs)||0}))}function go(e){return W("craftMemoryWarning",()=>e())}function At(e){return(t)=>{Promise.resolve().then(()=>e(t)).then(()=>ae.complete(!0),()=>ae.complete(!1))}}function ho(e){let t=At(e);return W("craftSilentPush",(n)=>t(n.payload??{}))}function bo(e){let t=At(()=>e());return W("craftBackgroundRefresh",()=>t(void 0))}import{haptics as gn}from"craft-native/mobile";function _e(){if(typeof window>"u")return;return window}function se(e=_e()){if(!e)return 0;if(typeof e.scrollY==="number")return e.scrollY;if(typeof e.scrollTop==="number")return e.scrollTop;return e.document?.scrollingElement?.scrollTop??0}function hn(e,t=_e()){if(!t)return()=>{};let n=!1,r=typeof requestAnimationFrame==="function"?requestAnimationFrame:(i)=>setTimeout(i,16),o=()=>{if(n)return;n=!0,r(()=>{n=!1,e(se(t))})};return e(se(t)),t.addEventListener("scroll",o,{passive:!0}),()=>t.removeEventListener("scroll",o)}function bn(e,t){let n=Math.max(0,-e),r=e<=0?Math.max(0,t)*0.5:0;return Math.round(Math.max(n,r))}function wo(e){let t=e.host??_e();if(!t)return()=>{};let n=e.threshold??72,r=null,o=!1,i=!1,a=typeof requestAnimationFrame==="function"?requestAnimationFrame:(g)=>setTimeout(g,16),s=null,l=(g)=>{s=null,e.onPull?.(g,o,{bounce:Math.min(g,Math.max(0,-se(t)))})},f=(g)=>{let y=s!==null;if(s=g,y)return;a(()=>{if(s!==null)l(s)})},u=(g)=>{let y=g.touches?.[0];return y?y.clientY:null},m=(g)=>{if(i||se(t)>0)return;r=u(g),o=!1},b=(g)=>{if(r===null)return;let y=u(g);if(y===null)return;let h=bn(se(t),y-r);if(!o&&h>=n)o=!0,Promise.resolve(gn.impact("medium")).catch(()=>{});else if(o&&h<n*0.8)o=!1;f(h)},c=async()=>{if(r===null)return;if(r=null,!o){l(0);return}o=!1,i=!0,l(n);try{await e.onRefresh()}finally{i=!1,l(0)}},p=()=>{if(r===null)return;r=null,o=!1,l(0)};return t.addEventListener("touchstart",m,{passive:!0}),t.addEventListener("touchmove",b,{passive:!0}),t.addEventListener("touchend",c),t.addEventListener("touchcancel",p),()=>{s=null,t.removeEventListener("touchstart",m),t.removeEventListener("touchmove",b),t.removeEventListener("touchend",c),t.removeEventListener("touchcancel",p)}}function vn(e,t=52){let n=Math.max(1,t),r=Math.min(1,Math.max(0,e/n)),o=e<0?1+Math.min(0.1,-e/600):1;return{progress:Math.round(r*1000)/1000,stretch:Math.round(o*1000)/1000}}function So(e,t={}){let n="",r=()=>t.title?.offsetHeight||t.height||52;return hn((o)=>{let i=vn(o,r()),a=`${i.progress}|${i.stretch}`;if(a===n)return;n=a,e.style.setProperty("--native-nav-progress",String(i.progress)),e.style.setProperty("--native-nav-stretch",String(i.stretch)),t.onChange?.(i)},t.host)}function Ro(e){if(!e||typeof window>"u")return;let t=window.document?.querySelector(e);return t?t:void 0}function Tt(){if(typeof window>"u")return;return window}var kt="__stxPushed",yn="__stxScroll";function wn(e=Tt()){let t=e?.history?.state;if(t===null||t===void 0)return!1;if(typeof t!=="object")return!0;let n=t;if(kt in n)return n[kt]===!0;return!(yn in n)}function Ao(e=Tt()){if(!wn(e))return!1;return e.history.back(),!0}function ko(e,t,n=50){let r=e[e.length-1];if(e.length>=2&&e[e.length-2].path===t)e.pop();else if(!r||r.path!==t)e.push({path:t,title:""});if(e.length>n)e.splice(0,e.length-n);return{current:e[e.length-1],previous:e[e.length-2]??null}}function Eo(e,t,n=12){let r=e?.title.trim()??"";return r&&r.length<=n?r:t}function To(){if(typeof window>"u")return[];let e=window;return e.__stacksNavTrail??=[]}function Sn(e){try{let t=new URL(e,"http://local");return`${t.pathname}${t.search}`}catch{return e}}function Oo(){if(typeof window>"u")return;let e=window.stxRouter;if(typeof e?.screens!=="function")return;let t=e.screens(),n=t.find((o)=>o.active);if(!n)return;let r=t.filter((o)=>o.tab===n.tab&&o.depth<n.depth);if(!r.length)return null;return Sn(r.reduce((o,i)=>i.depth>o.depth?i:o).url)}function Po(e=typeof window>"u"?void 0:window){let t=e?.stxRouter;if(typeof t?.screens!=="function"||typeof e?.history?.go!=="function")return!1;let n=t.screens(),r=n.find((a)=>a.active);if(!r)return!1;let o=n.filter((a)=>a.tab===r.tab&&a.depth<r.depth);if(!o.length)return!1;let i=o.reduce((a,s)=>s.depth<a.depth?s:a);return e.history.go(i.depth-r.depth),!0}function Io(e,t){for(let n=e.length-1;n>=0;n--)if(e[n].path===t)return e[n];return null}function Rn(e,t=xn()){let n;try{n=new URL(e)}catch{return null}let r=`${n.search}${n.hash}`;if(n.protocol==="http:"||n.protocol==="https:"){if(!t||n.origin!==t)return null;return`${n.pathname||"/"}${r}`}return`${`/${[n.host,n.pathname.replace(/^\/+/,"")].filter(Boolean).join("/")}`}${r}`}function xn(){if(typeof window>"u")return;return window.location?.origin}var Et="stacks-mobile-deep-link";function Mo(e,t){let n=(r)=>{let o=Rn(r);if(o)e(o)};return t.getInitialURL().then((r)=>{if(!r)return;try{if(sessionStorage.getItem(Et)===r)return;sessionStorage.setItem(Et,r)}catch{}n(r)}).catch(()=>{}),t.onLink((r,o)=>{if(o?.initial)return;n(r)})}var Co=5000;function An(e,t,n=5000){let r=t.filter((o)=>Number.isFinite(o.timestamp)&&Number.isFinite(o.bpm)&&o.bpm>0).slice().sort((o,i)=>o.timestamp-i.timestamp);if(!r.length)return e.slice();return e.map((o)=>{let i=0,a=r.length;while(i<a){let u=i+a>>1;if(r[u].timestamp<o.timestamp)i=u+1;else a=u}let s=r[i],l=r[i-1],f=!s?l:!l?s:o.timestamp-l.timestamp<=s.timestamp-o.timestamp?l:s;if(!f||Math.abs(f.timestamp-o.timestamp)>n)return o;return{...o,heartRate:Math.round(f.bpm)}})}var kn=6371008.8,Be={distanceM:0,movingS:0,paceSPerKm:null,averagePaceSPerKm:null,speedMps:null,accuracyM:null,fixes:0},En=30,Tn=En;function On(e,t){let n=Math.PI/180,r=(t.latitude-e.latitude)*n,o=(t.longitude-e.longitude)*n,i=Math.sin(r/2)**2+Math.cos(e.latitude*n)*Math.cos(t.latitude*n)*Math.sin(o/2)**2;return 2*kn*Math.asin(Math.min(1,Math.sqrt(i)))}function No(e,t=25){let n=new Set;return e.filter((r)=>Number.isFinite(r.latitude)&&Number.isFinite(r.longitude)&&Number.isFinite(r.timestamp)&&Math.abs(r.latitude)<=90&&Math.abs(r.longitude)<=180&&Number.isFinite(r.accuracy)&&r.accuracy>=0&&r.accuracy<=t).sort((r,o)=>r.timestamp-o.timestamp).filter((r)=>{if(n.has(r.timestamp))return!1;return n.add(r.timestamp),!0})}function Pn(e,t){return Number.isFinite(e.latitude)&&Number.isFinite(e.longitude)&&Number.isFinite(e.timestamp)&&Math.abs(e.latitude)<=90&&Math.abs(e.longitude)<=180&&Number.isFinite(e.accuracy)&&e.accuracy>=0&&e.accuracy<=t}function ve(e={}){let t=e.maxAccuracyM??25,n=(e.paceWindowS??30)*1000,r=[],o=0,i=0,a=null,s=0,l=null,f=null,u={...Be};function m(c){let p=r[r.length-1],g=a?(c.timestamp-a.timestamp)/1000:0;if(a=c,s++,!p){r.push({fix:c,cumM:0});return}if(g>Tn){r.push({fix:c,cumM:o});return}let y=(c.timestamp-p.fix.timestamp)/1000,h=On(p.fix,c),O=Math.min(10,Math.max(3,p.fix.accuracy,c.accuracy));if(h<O)return;if(o+=h,y>0&&h/y>=0.5)i+=y;r.push({fix:c,cumM:o})}function b(){let c=r[r.length-1];if(c){let y=c.fix.timestamp-n,h=0;while(h<r.length-1&&r[h].fix.timestamp<y)h++;if(h)r=r.slice(h)}let p=null,g=null;if(c&&a.timestamp-c.fix.timestamp<=n){let y=r[0],h=c.cumM-y.cumM,O=(c.fix.timestamp-y.fix.timestamp)/1000;if(h>=20&&O>0)g=h/O,p=O/(h/1000)}return{distanceM:o,movingS:i,paceSPerKm:p,averagePaceSPerKm:o>=50&&i>0?i/(o/1000):null,speedMps:g,accuracyM:a?a.accuracy:f,fixes:s}}return{get stats(){return u},get latestTimestamp(){return l},add(c){if(c.length){let p=c[c.length-1];if(!a)f=p.accuracy??null;let g=a?a.timestamp:-1/0,y=c.filter((h)=>Pn(h,t)&&h.timestamp>g).sort((h,O)=>h.timestamp-O.timestamp);for(let h of y){if(a&&h.timestamp<=a.timestamp)continue;m(h)}for(let h of c)if(Number.isFinite(h.timestamp)&&(l===null||h.timestamp>l))l=h.timestamp}return u=b(),u}}}function In(e,t={}){return ve(t).add(e)}function Do(e){if(e==null||e<=0||!Number.isFinite(e)||e>3600)return"–";let t=Math.round(e);return`${Math.floor(t/60)}:${String(t%60).padStart(2,"0")}`}function Ho(e){return e!=null&&e>0&&Number.isFinite(e)?(e*3.6).toFixed(1):"–"}var Ot=3600,Mn=30000;function Ln(e,t,n){if(!n||t<=Ot)return e;return Math.max(e,Math.min(Mn,Math.round(e*t/Ot)))}function _o(e){let t=e.location,n=e.intervalMs??3000,r=Be,o=ve(e),i=!1,a=null,s=0,l=e.heartRate,f=!1,u=null,m=[],b=()=>typeof document<"u"&&document.visibilityState==="hidden",c=0,p=null,g=Promise.resolve(),y=null,h=!1,O=null;function P(){if(h)throw Object.assign(Error("The recording screen is no longer active"),{code:"RECORDING_CONFLICT"});if(t.supportsRecordingOwnership?.()!==!0)throw Object.assign(Error("This host cannot protect native recording ownership"),{code:"RECORDING_OWNERSHIP_UNSUPPORTED"})}function S(){if(P(),!O)throw Object.assign(Error("A saved recording ID is required"),{code:"RECORDING_CONFLICT"});return O}function R(v){let A=g.then(v);return g=A.then(()=>{},()=>{}),A}function k(){if(p)return p;let v=c,A=O,I=(async()=>{if(P(),!A)throw Object.assign(Error("A saved recording ID is required"),{code:"RECORDING_CONFLICT"});let L=o,C=L.latestTimestamp,U=await t.readRecording(C===null?{expectedId:A}:{expectedId:A,since:C});if(v!==c||h||L!==o)return L.add(U);if(C!==null&&U.length&&U[0].timestamp<=C)i=!0;return r=L.add(U),e.onUpdate?.(r),r})().finally(()=>{if(p===I)p=null});return p=I,I}function x(){if(H(),h)return;let v=s,A=()=>{a=setTimeout(()=>{if(a=null,h||v!==s)return;(b()?Promise.resolve():k().then(()=>{},()=>{})).then(()=>{if(!h&&v===s)A()})},Ln(n,r.fixes,i))};A()}function H(){if(s++,a)clearTimeout(a);a=null}function G(v,A,I,L=ve(e)){if(H(),c++,p=null,o=L,i=!1,O=v,u=A,f=A!==null,m=[],r=I,!h)e.onUpdate?.(r)}async function me(v){if(!l||!f||!u||h||l.supportsRecordingOwnership?.()!==!0)return;await v(l,u).catch(()=>{})}return{get stats(){return r},get recordingId(){return O},get heartRateRecordingId(){return u},get heartRate(){return m},start(v){return y=null,R(async()=>{if(P(),v&&t.supportsRecordingIntentIdentity?.()!==!0)throw Object.assign(Error("This host cannot start a registered route identity"),{code:"RECORDING_INTENT_IDENTITY_UNSUPPORTED"});if(v&&(typeof v.recordingId!=="string"||!v.recordingId.trim()))throw Object.assign(Error("A registered recording ID is required"),{code:"INVALID_ARGUMENT"});let A=typeof e.locationOptions==="function"?e.locationOptions():e.locationOptions,I=await t.startRecording({enableHighAccuracy:!0,...A,...v?{recordingId:v.recordingId}:{}});if(!I?.active||typeof I.id!=="string"||!I.id.trim())throw Object.assign(Error("The native recording did not provide an ID"),{code:"RECORDING_CONFLICT"});if(v&&I.id!==v.recordingId)throw Object.assign(Error("The native route did not start with its registered ID"),{code:"RECORDING_CONFLICT"});let L=null;if(!h&&l?.isAvailable()&&l.supportsRecordingOwnership?.()===!0&&(!v||v.heartRateRecordingId&&l.supportsRecordingIntentIdentity?.()===!0))try{let C=await l.startRecording(v?{recordingId:v.heartRateRecordingId}:void 0);if(v&&C.id!==v.heartRateRecordingId)throw Object.assign(Error("The native heart rate did not start with its registered ID"),{code:"RECORDING_CONFLICT"});if(C.active&&typeof C.id==="string"&&C.id.trim())L=C.id}catch{}return G(I.id,L,{...Be}),x(),r})},attach(v){return y=null,R(async()=>{if(typeof v?.expectedId!=="string"||!v.expectedId.trim())throw Object.assign(Error("A saved recording ID is required"),{code:"RECORDING_CONFLICT"});P();let A=await t.getRecordingState({expectedId:v.expectedId});if(P(),!A?.id)return null;if(A.id!==v.expectedId)throw Object.assign(Error("The recording belongs to another session"),{code:"RECORDING_CONFLICT"});let I=null;if(v.expectedHeartRateId!==void 0){let U=v.expectedHeartRateId;if(typeof U!=="string"||!U.trim())throw Object.assign(Error("A saved heart-rate recording ID is required"),{code:"RECORDING_CONFLICT"});if(!l?.isAvailable()||l.supportsRecordingOwnership?.()!==!0)throw Object.assign(Error("This host cannot protect heart-rate recording ownership"),{code:"RECORDING_OWNERSHIP_UNSUPPORTED"});let Vt=await l.getRecordingState({expectedId:U});if(P(),Vt.id!==U)throw Object.assign(Error("The heart-rate recording belongs to another session"),{code:"RECORDING_CONFLICT"});await l.readRecording({expectedId:U,since:Date.now()}),P(),I=U}let L=await t.readRecording({expectedId:v.expectedId});P();let C=ve(e);if(G(v.expectedId,I,C.add(L),C),A.active&&!A.paused)x();return A})},pause(){return R(async()=>{await t.pauseRecording({expectedId:S()}),await me((v,A)=>v.pauseRecording({expectedId:A})),H(),await k().catch(()=>{})})},resume(){return R(async()=>{await t.resumeRecording({expectedId:S()}),await me((v,A)=>v.resumeRecording({expectedId:A})),x()})},setPowerMode(v){return R(async()=>{if(h||y||!O||t.supportsRecordingPowerMode?.()!==!0)return!1;try{return await t.setRecordingPowerMode({expectedId:O,powerMode:v}),!0}catch(A){let I=A?.code;if(I==="NO_ACTIVE_RECORDING"||I==="RECORDING_POWER_MODE_UNSUPPORTED")return!1;throw A}})},stop(){if(y)return y;let v=R(async()=>{H(),c++;let A=S(),I=await t.stopRecording({expectedId:A});if(I.id!==A)throw Object.assign(Error("The native recording identity changed"),{code:"RECORDING_CONFLICT"});let L=I?.locations??[];if(!h&&l&&f&&u&&l.supportsRecordingOwnership?.()===!0){let C=await l.stopRecording({expectedId:u}).catch(()=>null);f=!1,m=C?.id===u?C.samples:[],L=An(L,m)}if(r=In(L,e),!h)e.onUpdate?.(r);return L}).catch((A)=>{if(y===v)y=null;throw A});return y=v,v},dispose(){h=!0,c++,p=null,H()},refresh:k}}function Fo(e){return{startedAt:Number.isFinite(e)?e:null,pausedAt:null,pausedMs:0}}function Uo(e,t){return e.startedAt===null||e.pausedAt!==null||!Number.isFinite(t)?e:{...e,pausedAt:Math.max(e.startedAt,t)}}function Wo(e,t){return e.pausedAt===null||!Number.isFinite(t)?e:{...e,pausedAt:null,pausedMs:e.pausedMs+Math.max(0,t-e.pausedAt)}}function $o(e,t){if(e.startedAt===null)return 0;let n=((e.pausedAt??t)-e.startedAt-e.pausedMs)/1000;return Number.isFinite(n)?Math.max(0,n):0}var jo=150;function Cn(e,t){let n=Math.PI/180,r=(t.latitude-e.latitude)*n,o=(t.longitude-e.longitude)*n,i=Math.sin(r/2)**2+Math.cos(e.latitude*n)*Math.cos(t.latitude*n)*Math.sin(o/2)**2;return 12742017.6*Math.asin(Math.min(1,Math.sqrt(i)))}function ye(e,t){let n=[...e].sort((r,o)=>r-o);return n[Math.min(n.length-1,Math.floor(t*n.length))]}function zo(e,t){let n=(e||[]).filter((a)=>Number.isFinite(a?.latitude)&&Number.isFinite(a?.longitude)&&Math.abs(a.latitude)<=90&&Math.abs(a.longitude)<=180),r=n.filter((a)=>a.accuracy!=null).map((a)=>Number(a.accuracy)).filter((a)=>Number.isFinite(a)&&a>=0),o=r.length?ye(r,0.5):Number.POSITIVE_INFINITY,i=0;if(n.length){let a={latitude:ye(n.map((s)=>s.latitude),0.5),longitude:ye(n.map((s)=>s.longitude),0.5)};i=ye(n.map((s)=>Cn(a,s)),0.8)}if(n.length>=10&&i>150&&o<=15)return"outside";if(t<150)return"unsure";if(n.length<3||o>30||i<25)return"indoors";if(i<50&&o>10)return"indoors";return"unsure"}function qo(e,t={}){let r=String(e||"").trim().toLowerCase().replace(",",".").match(/^(\d+(?:\.\d*)?|\.\d+)\s*(km|k|m|mi)?$/);if(!r)return null;let o=Number(r[1]),i=r[2]||t.defaultUnit||(o>100?"m":"km"),a=i==="m"?o/1000:i==="mi"?o*1.609344:o;return Number.isFinite(a)&&a>=0&&a<=2000?Math.round(a*1000)/1000:null}var Re=new Set,Pt=!1,we=null;function Nn(e){return e.isConnected&&e.getClientRects().length>0}function It(){return[...Re].find((e)=>Nn(e.element))}function Se(){let e=It(),t=Boolean(e);if(t===Pt)return;if(Pt=t,t)Y.enable(e?.tintColor?{tintColor:e.tintColor}:{});else Y.disable()}function Dn(){let e=It();if(!e){Y.end();return}Promise.resolve().then(()=>e.run()).catch(()=>{}).finally(()=>Y.end())}function Yo(e,t){let n={element:e,tintColor:t.tintColor,run:t.onRefresh};Re.add(n);let r=e.ownerDocument?.defaultView;if(!we){let o=Y.onRefresh(Dn),i=()=>Se();r?.addEventListener("stx:load",i),we=()=>{o(),r?.removeEventListener("stx:load",i)}}return Se(),r?.requestAnimationFrame?.(()=>Se()),()=>{if(Re.delete(n),Re.size===0)we?.(),we=null;Se()}}var Qo=0.5;function Hn(e,t,n){let r=[];if(n.includes("large")||n.length===0)r.push({name:"large",y:0});if(n.includes("medium"))r.push({name:"medium",y:Math.max(0,Math.round(e-t*0.5))});return r.push({name:"dismiss",y:Math.max(1,e)}),r.sort((o,i)=>o.y-i.y)}function _n(e){let{y:t,velocity:n,stops:r}=e,o=r.filter((s)=>s.name!=="dismiss"),i=r.find((s)=>s.name==="dismiss");if(o.length===0)return"dismiss";if(n>0.5)return(r.filter((l)=>l.y>t+1)[0]??i).name;if(n<-0.5){let s=o.filter((l)=>l.y<t-1);return(s[s.length-1]??o[0]).name}let a=o[o.length-1];if(t>a.y+(i.y-a.y)*0.5)return"dismiss";return o.reduce((s,l)=>Math.abs(l.y-t)<Math.abs(s.y-t)?l:s).name}function Bn(e,t=400){if(e<=0)return 0;return e*t*0.55/(t+e*0.55)}function Jo(e){let{panel:t}=e,n=null,r=[],o=0,i=()=>e.viewport?.()??t.ownerDocument?.defaultView?.innerHeight??800,a=()=>Hn(t.offsetHeight||t.getBoundingClientRect().height,i(),e.detents()),s=(u)=>{let m=u;if(m.button!==void 0&&m.button!==0)return;if(m.target?.closest?.("button, a, input, select, textarea, [role=button]"))return;let b=a().find((c)=>c.name===e.detent())?.y??0;n={y:m.clientY,base:b,pointerId:m.pointerId},o=b,r=[{y:b,t:m.timeStamp}],t.classList.add("is-dragging");try{u.currentTarget?.setPointerCapture?.(m.pointerId)}catch{}},l=(u)=>{if(!n)return;let m=u,b=n.base+m.clientY-n.y;o=b<0?-Bn(-b):b,r.push({y:o,t:m.timeStamp});while(r.length>2&&m.timeStamp-r[0].t>100)r.shift();t.style.transform=`translateY(${o}px)`;let c=t.offsetHeight||1;t.parentElement?.style.setProperty("--native-sheet-presence",String(Math.max(0,Math.min(1,1-o/c))))},f=(u)=>{if(!n)return;let m=u;n=null;let b=r[0],c=Math.max(1,m.timeStamp-b.t),p=(o-b.y)/c;t.classList.remove("is-dragging"),t.style.transform="",t.parentElement?.style.removeProperty("--native-sheet-presence"),e.onSettle(_n({y:o,velocity:p,stops:a()}))};for(let u of e.handles)u.addEventListener("pointerdown",s),u.addEventListener("pointermove",l),u.addEventListener("pointerup",f),u.addEventListener("pointercancel",f);return()=>{for(let u of e.handles)u.removeEventListener("pointerdown",s),u.removeEventListener("pointermove",l),u.removeEventListener("pointerup",f),u.removeEventListener("pointercancel",f)}}function Zo(e){let t=e.ownerDocument;if(e.parentElement===t.body)return()=>{};let n=t.createComment("native-sheet");return e.parentNode?.insertBefore(n,e),t.body.appendChild(e),()=>{if(n.parentNode)n.parentNode.insertBefore(e,n);else e.remove();n.remove()}}var Fe=new WeakMap;function ei(e,t){let n=e.documentElement,r=Fe.get(e)??0;if(!t){let a=Math.max(0,r-1);if(Fe.set(e,a),a===0)n.removeAttribute("data-native-sheet-card");return}if(Fe.set(e,r+1),r>0)return;let o=e.defaultView,i=(o?.scrollY??0)+(o?.innerHeight??800)/2;n.style.setProperty("--native-sheet-card-origin",`${Math.round(i)}px`),n.setAttribute("data-native-sheet-card","")}function Fn(e,t){e.style.setProperty("--native-font-scale",String(t.fontScale)),e.toggleAttribute("data-native-reduce-motion",t.reduceMotion),e.toggleAttribute("data-native-reduce-transparency",t.reduceTransparency)}function Un(e){let t=e.replace(/\s+/g,"").toLowerCase();return!t||t==="transparent"||/^rgba\(\d+,\d+,\d+,0(\.0+)?\)$/.test(t)||/\/0(\.0+)?\)$/.test(t)}function Wn(e){let t=e.defaultView;if(!t?.getComputedStyle)return null;for(let n of[e.body,e.documentElement]){if(!n)continue;let r=t.getComputedStyle(n).backgroundColor;if(r&&!Un(r))return r}return null}function $n(e){if(e.documentElement.classList.contains("dark"))return!0;if(e.documentElement.classList.contains("light"))return!1;return Boolean(e.defaultView?.matchMedia?.("(prefers-color-scheme: dark)").matches)}function oi(e,t={}){let n=t.root??e.documentElement;ie.setKeyboardAccessory(t.keyboardAccessory===!0);let r="",o="",i=()=>{let u=Wn(e);if(u&&u!==r)r=u,ie.setUnderPageColor(u);let m=$n(e)?"light":"dark";if(m!==o)o=m,he.setStyle(m)},a=xt((u)=>{Fn(n,u),i()}),s=e.defaultView,l=typeof s?.MutationObserver==="function"?new s.MutationObserver(i):null;l?.observe(e.documentElement,{attributes:!0,attributeFilter:["class","style","data-theme"]});let f=s?.matchMedia?.("(prefers-color-scheme: dark)");return f?.addEventListener?.("change",i),s?.addEventListener("stx:load",i),i(),()=>{a(),l?.disconnect(),f?.removeEventListener?.("change",i),s?.removeEventListener("stx:load",i)}}var ai=64;var Kn=/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/,jn=/^(?:0|[1-9]\d*)$/;function Lt(e){let t=[],n=[],r=e&&typeof e==="object"&&!Array.isArray(e)?e:{};for(let[o,i]of Object.entries(r)){let a=i&&typeof i==="object"?i:null;if(!a){n.push(`spotlight kind "${o}" is not an object`);continue}let{slots:s,route:l}=a,f=typeof a.noun==="string"&&a.noun.trim()?a.noun.trim():"Item";if(!Kn.test(o)||o.includes("-slot-")){n.push(`spotlight kind "${o}" is not a usable name: lowercase letters, digits and single dashes, and never "-slot-"`);continue}if(typeof s!=="number"||!Number.isInteger(s)||s<=0||s>64){n.push(`spotlight kind "${o}" needs slots between 1 and 64, not ${String(s)}`);continue}if(typeof l!=="string"||!l.startsWith("/")||!l.includes(":id")){n.push(`spotlight kind "${o}" needs a route starting with "/" and carrying ":id", not ${String(l)}`);continue}t.push({name:o,slots:s,route:l,noun:f})}return{kinds:t,problems:n}}function ce(e,t){return e.find((n)=>n.name===t)??null}function le(e,t,n){let r=ce(e,t);if(!r||!Number.isInteger(n)||n<0||n>=r.slots)return null;return`${t}-slot-${n}`}function zn(e,t){if(typeof t!=="string")return null;let n=t.lastIndexOf("-slot-");if(n<=0)return null;let r=t.slice(0,n),o=t.slice(n+6);if(!jn.test(o))return null;let i=Number(o);return le(e,r,i)===t?{kind:r,slot:i}:null}function Ct(e){return e.flatMap((t)=>Array.from({length:t.slots},(n,r)=>`${t.name}-slot-${r}`))}function si(e,t){let n=e&&typeof e==="object"?e:{};if(n.enabled===!1)return[];let o=[...(Array.isArray(n.activityTypes)?n.activityTypes.filter((i)=>typeof i==="string"&&i.trim().length>0):[]).map((i)=>i.trim()),...Ct(Lt(n.kinds).kinds)];return[...new Set(o)].map((i)=>`${t}.${i}`)}function Nt(e,t,n){let r=typeof n.name==="string"?n.name.replace(/\s+/g," ").trim():"";if(!r)return`${ce(e,t)?.noun??"Item"} #${n.id}`;return r.length>120?`${r.slice(0,119).trimEnd()}…`:r}function qn(e,t,n,r,o=Date.now()){let i=ce(e,n);if(!i||!Number.isInteger(r.id)||r.id<=0)return null;let a=t.filter((p)=>p.kind===n),s=Nt(e,n,r),l=a.find((p)=>p.itemId===r.id)??null,f=l?null:Xn(a,i.slots),u=l||f!==null?null:Qn(a),m=l?.slot??f??u?.slot;if(m===void 0||m===null)return null;let b={kind:n,slot:m,itemId:r.id,title:s,donatedAt:o},c=t.filter((p)=>p.kind!==n||p.slot!==m&&p.itemId!==r.id);return{entries:Dt(e,[...c,b]),entry:b,evicted:u,changed:!l||l.title!==s}}function Vn(e,t,n){let r=e.find((o)=>o.kind===t&&o.itemId===n)??null;return{entries:r?e.filter((o)=>o!==r):[...e],removed:r}}function Gn(e,t,n){let r=zn(e,n);if(!r)return null;let o=t.find((a)=>a.kind===r.kind&&a.slot===r.slot),i=ce(e,r.kind)?.route;return o&&i?i.replace(":id",String(o.itemId)):null}function Yn(e,t){if(!Array.isArray(t))return[];let n=new Map,r=new Set;for(let o of t){if(!o||typeof o!=="object")continue;let i=o,{kind:a,slot:s,itemId:l,title:f,donatedAt:u}=i;if(typeof a!=="string"||typeof s!=="number"||le(e,a,s)===null)continue;if(typeof l!=="number"||!Number.isInteger(l)||l<=0)continue;let m=`${a}-slot-${s}`,b=`${a}#${l}`;if(n.has(m)||r.has(b))continue;n.set(m,{kind:a,slot:s,itemId:l,title:typeof f==="string"&&f.trim()?f:Nt(e,a,{id:l}),donatedAt:typeof u==="number"&&Number.isFinite(u)&&u>0?u:0}),r.add(b)}return Dt(e,[...n.values()])}function Dt(e,t){let n=new Map(e.map((r,o)=>[r.name,o]));return[...t].sort((r,o)=>(n.get(r.kind)??0)-(n.get(o.kind)??0)||r.slot-o.slot)}function Xn(e,t){let n=new Set(e.map((r)=>r.slot));for(let r=0;r<t;r++)if(!n.has(r))return r;return null}function Qn(e){return e.reduce((t,n)=>!t||n.donatedAt<t.donatedAt?n:t,null)}function Jn(){let e=globalThis.craft;return e&&typeof e==="object"?e.siri:void 0}var Zn="stacks_spotlight_index",er=3000;function li(e){let t=e.onProblem??((S)=>console.warn(`[spotlight] ${S}`)),n=Array.isArray(e.kinds)?{kinds:[...e.kinds],problems:[]}:Lt(e.kinds);for(let S of n.problems)t(S);let r=e.enabled===!1?[]:n.kinds,o=e.storageKey??Zn,i=e.legacyStorageKeys??[],a=e.timeoutMs??er,s=e.now??(()=>Date.now()),l=e.bridge??Jn,f=null;function u(){try{return typeof localStorage>"u"?null:localStorage}catch{return null}}function m(){if(f)return f;f=[];let S=u();if(!S)return f;try{let R=[o,...i].map((k)=>S.getItem(k)).find((k)=>k);f=R?Yn(r,JSON.parse(R)):[]}catch{f=[]}return f}function b(S){f=S;let R=u();if(!R)return;try{R.setItem(o,JSON.stringify(S));for(let k of i)R.removeItem(k)}catch{}}async function c(S){if(!S)return null;let R;try{return await Promise.race([S,new Promise((k)=>{R=setTimeout(()=>k(null),a)})])}catch{return null}finally{if(R!==void 0)clearTimeout(R)}}let p=Promise.resolve();function g(S){let R=p.then(S,S);return p=R.catch(()=>{return}),R}async function y(S,R){let k=l()?.register;if(!k||r.length===0)return!1;return g(async()=>{let x=qn(r,m(),S,R,s()),H=x&&le(r,S,x.entry.slot);if(!x||!H)return!1;if(!x.changed)return b(x.entries),!0;let G=await c(k(x.entry.title,H))!==null;if(G)b(x.entries);return G})}async function h(S,R){let k=l()?.remove;if(!k)return!1;return g(async()=>{let{entries:x,removed:H}=Vn(m(),S,R);if(!H)return!1;let G=le(r,S,H.slot),me=G?await c(k(G))!==null:!1;return b(x),me})}async function O(S,R){let k=ce(r,S)?.slots;if(!k||!l()?.register)return 0;let x=0;for(let H of[...R].slice(0,k).reverse())if(await y(S,H))x++;return x}async function P(){let S=l()?.remove;if(!S)return b([]),0;return g(async()=>{let R=0;for(let k of m()){let x=le(r,k.kind,k.slot);if(x&&await c(S(x))!==null)R++}return b([]),R})}return{kinds:r,index:y,sync:O,remove:h,clear:P,routeFor:(S)=>Gn(r,m(),S),entries:()=>m(),activityTypes:(S)=>Ct(r).map((R)=>`${S}.${R}`),reset:()=>{f=null}}}var Mt=["craftShortcut","craftSiriShortcut"];function ci(e,t){let n=(r)=>{let o=r.detail,i=typeof o==="string"?o:o&&typeof o==="object"?o.action??o.type:null,a=typeof i==="string"?e.routeFor(i):null;if(a)t(a)};if(typeof globalThis.addEventListener!=="function")return()=>{};for(let r of Mt)globalThis.addEventListener(r,n);return()=>{for(let r of Mt)globalThis.removeEventListener(r,n)}}import{tabBar as tr}from"craft-native/mobile";var nr=tr;function rr(e){return Array.from(e.querySelectorAll("a[data-native-tab]")).map((t)=>({id:t.getAttribute("href")||"",title:t.getAttribute("data-native-tab")||t.getAttribute("aria-label")||"",symbol:t.getAttribute("data-native-tab-symbol")||"circle",badge:(t.querySelector(".native-tab-badge")?.textContent||"").trim(),current:t.hasAttribute("data-stx-nav-current")||t.classList.contains("is-active")})).filter((t)=>t.id&&t.title)}function or(e){return{tabs:e.map(({id:n,title:r,symbol:o,badge:i})=>i?{id:n,title:r,symbol:o,badge:i}:{id:n,title:r,symbol:o}),selected:e.find((n)=>n.current)?.id}}function _t(){if(typeof window>"u")return;let e=window.stxRouter;return e&&typeof e==="object"?e:void 0}function ir(){return typeof _t()?.selectTab==="function"}function pi(e,t={}){let n=(r)=>{if(ir()||r.defaultPrevented)return;let o=r.target?.closest?.("a[data-native-tab]");if(!o||!e.contains(o))return;if(!o.hasAttribute("data-stx-nav-current")&&!o.classList.contains("is-active")&&o.getAttribute("aria-current")!=="page")return;r.preventDefault();let i=e.ownerDocument.defaultView;if(t.scrollToTop)t.scrollToTop();else i?.scrollTo?.({top:0,behavior:i.matchMedia?.("(prefers-reduced-motion: reduce)").matches?"auto":"smooth"});i?.dispatchEvent(new CustomEvent("stx:tabreselect",{detail:{href:o.getAttribute("href")||""}}))};return e.addEventListener("click",n),()=>e.removeEventListener("click",n)}function Ht(e){let t=e.trim();return/^#[0-9a-f]{6}$/i.test(t)?t:void 0}var Ue="stacks:tab-bar-cover";function fi(e,t){if(t)e.setAttribute("data-native-covers-tab-bar","");else e.removeAttribute("data-native-covers-tab-bar");e.ownerDocument?.defaultView?.dispatchEvent(new Event(Ue))}function mi(e,t={}){let n=t.api??nr;if(!n.isAvailable())return null;let r=t.hidden??(()=>Boolean(e.ownerDocument?.querySelector("[data-native-hide-tab-bar], [data-native-covers-tab-bar]"))),o=typeof getComputedStyle==="function"?getComputedStyle(e):null,i=Ht(o?.getPropertyValue("--native-tab-active")||""),a=Ht(o?.getPropertyValue("--native-tab-active-dark")||""),s="",l=()=>{if(r()){if(s!=="hidden")n.hide();s="hidden";return}let{tabs:b,selected:c}=or(rr(e)),p=JSON.stringify({tabs:b,selected:c});if(p===s)return;let g=s&&s!=="hidden"?JSON.parse(s):null;if(g&&c&&JSON.stringify(g.tabs)===JSON.stringify(b))n.select(c);else n.set(b,{selected:c,tint:i,tintDark:a});s=p},f=typeof MutationObserver==="function"?new MutationObserver(l):null;f?.observe(e,{attributes:!0,attributeFilter:["data-stx-nav-current","class"],childList:!0,subtree:!0,characterData:!0});let u=n.onSelect((b)=>{let c=_t();if(c?.selectTab){c.selectTab(b);return}Array.from(e.querySelectorAll("a[data-native-tab]")).find((g)=>g.getAttribute("href")===b)?.click()}),m=()=>l();if(typeof window<"u")window.addEventListener("stx:load",m),window.addEventListener("stx:screen-shown",m),window.addEventListener(Ue,m);return l(),()=>{if(f?.disconnect(),u(),typeof window<"u")window.removeEventListener("stx:load",m),window.removeEventListener("stx:screen-shown",m),window.removeEventListener(Ue,m);n.hide()}}function ar(e={}){let t=e.maxSeconds??300,n=e.maxBytes??12582912;if(![t,n].every((g)=>Number.isSafeInteger(g)&&g>0)||t>300)throw TypeError("Invalid voice recording limits");let r={status:"idle",audio:null,error:null},o=new Set,i={},a=null,s=null,l=null,f,u=(g)=>{r=g;for(let y of o)y({...g})},m=()=>{clearTimeout(f),l?.getTracks().forEach((g)=>g.stop()),l=null};function b(){if(i={},a){let y=a;a=null,Promise.resolve(M("audioRecording.cancel")?.(y)).catch(()=>{})}let g=s;if(s=null,g&&g.state!=="inactive")g.stop();m(),u({status:"idle",audio:null,error:null})}async function c(){b();let g=i;u({status:"requesting",audio:null,error:null});try{let y=M("audioRecording.start");if(y){let x=globalThis.crypto.randomUUID();if(a=x,await y(x,{maxSeconds:t}),i!==g)return;f=setTimeout(()=>{if(i===g)p()},t*1000-250),u({status:"recording",audio:null,error:null});return}if(typeof navigator>"u"||!navigator.mediaDevices?.getUserMedia||typeof MediaRecorder>"u")throw Error("Microphone recording is unavailable. Upload an audio recording instead.");let h=await navigator.mediaDevices.getUserMedia({audio:{channelCount:1},video:!1});if(i!==g){h.getTracks().forEach((x)=>x.stop());return}l=h;let O=["audio/webm;codecs=opus","audio/mp4","audio/webm"].find((x)=>MediaRecorder.isTypeSupported(x)),P=new MediaRecorder(h,{...O?{mimeType:O}:{},audioBitsPerSecond:32000});s=P;let S=[],R=0,k=!1;P.ondataavailable=(x)=>{if(i!==g||!x.data.size)return;if(R+=x.data.size,R>n){if(k=!0,S.length=0,P.state!=="inactive")P.stop();m();return}if(!k)S.push(x.data)},P.onerror=()=>{if(i!==g)return;b(),u({status:"error",audio:null,error:"Recording failed. Please try again."})},P.onstop=()=>{if(i!==g)return;s=null,m();let x=new Blob(S,{type:P.mimeType||O||"audio/webm"});u(k||!x.size?{status:"error",audio:null,error:k?"The recording exceeds the upload limit.":"The recording was empty."}:{status:"ready",audio:x,error:null})},P.start(1000),f=setTimeout(()=>{if(i===g&&P.state!=="inactive")P.stop()},t*1000-250),u({status:"recording",audio:null,error:null})}catch(y){if(i!==g)return;b(),u({status:"error",audio:null,error:y instanceof Error?y.message:"Microphone permission was refused."})}}async function p(){if(!a){if(s&&s.state!=="inactive")s.stop();return}let g=i,y=a;clearTimeout(f);try{let h=await M("audioRecording.stop")?.(y);if(i!==g)return;if(!h?.path||!h.size||h.size>n||!Number.isFinite(h.durationSeconds)||h.durationSeconds<=0||h.durationSeconds>t+1)throw Error("The recording is empty or exceeds its limits.");u({status:"ready",audio:h,error:null})}catch(h){if(i!==g)return;b(),u({status:"error",audio:null,error:h instanceof Error?h.message:"Recording failed."})}}return{start:c,cancel:b,dispose(){b(),o.clear()},stop:p,supported:()=>Boolean(M("audioRecording.start"))||typeof navigator<"u"&&Boolean(navigator.mediaDevices?.getUserMedia)&&typeof MediaRecorder<"u",snapshot:()=>({...r}),subscribe(g){return o.add(g),g({...r}),()=>{o.delete(g)}}}}function sr(e,t={},n="audio"){if(!n||Object.hasOwn(t,n))throw TypeError("Use a distinct recording field name");let r=new FormData;if(typeof Blob<"u"&&e instanceof Blob)r.append(n,e,"feedback");else{if(!e||!("path"in e)||typeof e.path!=="string"||!e.path||!M("audioRecording.stop"))throw TypeError("A native recording requires its native upload host");Reflect.apply(r.append,r,[n,e]);let o=r.get(n);if(!o||typeof o!=="object"||!("path"in o)||o.path!==e.path)throw TypeError("The upload host did not preserve the native recording file")}for(let[o,i]of Object.entries(t)){if(typeof i!=="string")throw TypeError("Upload fields must be strings");r.append(o,i)}return r}var dr={isAvailable:()=>d(()=>We.isAvailable()),getBiometricType:()=>d(()=>We.getBiometricType()),authenticate:(e)=>d(()=>We.authenticate(e))},pr={takePicture:(e)=>d(()=>Ae.takePicture(e)),pickImage:()=>d(()=>Ae.pickImage()),pickMultiple:(e)=>d(()=>Ae.pickMultiple(e)),isAvailable:()=>d(()=>Ae.isAvailable())},fr={getInfo:()=>d(()=>Z.getInfo()),getCapabilities:()=>d(()=>Z.getCapabilities()),isMobile:()=>Z.isMobile(),isIOS:()=>Z.isIOS(),isAndroid:()=>Z.isAndroid(),getLocale:()=>Z.getLocale(),getTimezone:()=>Z.getTimezone()},mr=cr;function z(){return V()?.capabilities.locationRecordingOwnership===!0&&D.supportsRecordingOwnership?.()===!0}function $t(){return z()&&V()?.capabilities.locationRecordingPowerMode===!0&&D.supportsRecordingPowerMode?.()===!0}function X(){return V()?.capabilities.heartRateRecordingOwnership===!0&&T.supportsRecordingOwnership?.()===!0}function Kt(){return z()&&V()?.capabilities.locationRecordingIntentIdentity===!0&&D.supportsRecordingIntentIdentity?.()===!0}function jt(){return X()&&V()?.capabilities.heartRateRecordingIntentIdentity===!0&&T.supportsRecordingIntentIdentity?.()===!0}function qt(e,t,n){return d(async()=>{let r=e&&Object.hasOwn(e,"recordingId");if(r){if(!t())throw Object.assign(Error("This host or adapter cannot start a registered recording identity"),{code:"RECORDING_INTENT_IDENTITY_UNSUPPORTED"});if(typeof e.recordingId!=="string"||!e.recordingId.trim())throw Object.assign(Error("A registered recording ID is required"),{code:"INVALID_ARGUMENT"})}let o=await n();if(r&&o.id!==e.recordingId)throw Object.assign(Error("The native recording identity changed at start"),{code:"RECORDING_CONFLICT"});return o})}function B(e,t,n){return d(()=>{if(e&&Object.hasOwn(e,"expectedId")){if(!t())throw Object.assign(Error("This host or adapter cannot protect recording ownership"),{code:"RECORDING_OWNERSHIP_UNSUPPORTED"});if(typeof e.expectedId!=="string"||!e.expectedId.trim())throw Object.assign(Error("A saved recording ID is required"),{code:"RECORDING_CONFLICT"})}return n()})}var gr={supportsRecordingOwnership:z,supportsRecordingIntentIdentity:Kt,supportsRecordingPowerMode:$t,setRecordingPowerMode:(e)=>d(()=>{if(!$t())throw Object.assign(Error("This host cannot change the recording power mode"),{code:"RECORDING_POWER_MODE_UNSUPPORTED"});return B(e,z,()=>D.setRecordingPowerMode(e))}),acknowledgeRecording:(e)=>B({expectedId:e?.expectedId},z,()=>D.acknowledgeRecording(e)),getCurrentPosition:(e)=>d(()=>D.getCurrentPosition(e)),watchPosition:(e,t)=>D.watchPosition(e,t),clearWatch:(e)=>D.clearWatch(e),startRecording:(e)=>qt(e,Kt,()=>D.startRecording(e)),pauseRecording:(e)=>B(e,z,()=>D.pauseRecording(e)),resumeRecording:(e)=>B(e,z,()=>D.resumeRecording(e)),stopRecording:(e)=>B(e,z,()=>D.stopRecording(e)),getRecordingState:(e)=>B(e,z,()=>D.getRecordingState(e)),readRecording:(e)=>B(e,z,()=>D.readRecording(e))},hr={show:(e)=>d(()=>de.show(e)),schedule:(e)=>d(()=>de.schedule(e)),cancel:(e)=>d(()=>de.cancel(e)),cancelAll:()=>d(()=>de.cancelAll()),setBadge:(e)=>d(()=>de.setBadge(e))},br={check:(e)=>d(()=>pe.check(e)),request:(e)=>d(()=>pe.request(e)),checkMultiple:(e)=>d(()=>pe.checkMultiple(e)),requestMultiple:(e)=>d(()=>pe.requestMultiple(e)),openSettings:()=>d(()=>pe.openSettings())},vr={set:(e,t)=>d(()=>Ee.set(e,t)),get:(e)=>d(()=>Ee.get(e)),delete:(e)=>d(()=>Ee.delete(e)),clear:()=>d(()=>Ee.clear())},yr={share:(e)=>d(()=>Wt.share(e)),isAvailable:()=>Wt.isAvailable()},wr={request:()=>d(()=>lr.request())},Oe={impact:(e)=>Promise.resolve().then(()=>ke.impact(e)).catch(()=>{}),notification:(e)=>Promise.resolve().then(()=>ke.notification(e)).catch(()=>{}),selection:()=>Promise.resolve().then(()=>ke.selection()).catch(()=>{}),vibrate:(e)=>Promise.resolve().then(()=>ke.vibrate(e)).catch(()=>{}),prepare:(e)=>{let t=M("haptics.prepare");return t?Promise.resolve().then(()=>t(e)).then(()=>{},()=>{}):Promise.resolve()}};function zt(e){if(typeof e==="string")return e.trim()||null;if(!e||typeof e!=="object")return null;let t=e.url;return typeof t==="string"&&t.trim()?t:null}var Sr={async getInitialURL(){if(!await ee())return null;return zt(await Bt.getInitialURL?.())},onLink(e){let t=null,n=!1,r=()=>{if(n)return;t=Bt.onLink?.((o,i)=>{let a=zt(o);if(a)e(a,{initial:i?.initial===!0})})??null};if(Pe()?.craft)r();else ee().then(r);return()=>{n=!0,t?.()}}},Ai={isAvailable:()=>Te.isAvailable(),set:(e,t)=>Te.set(e,t),remove:(e)=>Te.remove(e),clear:()=>Te.clear()},Rr={enable:()=>d(()=>Ft.enable()),disable:()=>d(()=>Ft.disable())},xr={isAvailable:()=>xe.isAvailable(),get:()=>d(()=>xe.get()),set:(e)=>d(()=>xe.set(e)),restore:()=>d(()=>xe.restore())},Ar={isAvailable:()=>j.isAvailable(),supports:(e)=>j.supports(e),getAuthorizationStatus:()=>d(()=>j.getAuthorizationStatus()),requestAuthorization:()=>d(()=>j.requestAuthorization()),getNowPlaying:()=>d(()=>j.getNowPlaying()),play:()=>d(()=>j.play()),pause:()=>d(()=>j.pause()),togglePlayPause:()=>d(()=>j.togglePlayPause()),skipToNext:()=>d(()=>j.skipToNext()),skipToPrevious:(e)=>d(()=>j.skipToPrevious(e)),onChange:(e)=>J(()=>j.onChange(e))},kr={supportsRecordingOwnership:X,supportsRecordingIntentIdentity:jt,acknowledgeRecording:(e)=>B({expectedId:e?.expectedId},X,()=>T.acknowledgeRecording(e)),isAvailable:()=>T.isAvailable(),supports:(e)=>T.supports(e),getState:()=>d(()=>T.getState()),requestAuthorization:()=>d(()=>T.requestAuthorization()),scan:(e)=>d(()=>T.scan(e)),stopScan:()=>d(()=>T.stopScan()),getDevices:()=>d(()=>T.getDevices()),connect:(e)=>d(()=>T.connect(e)),reconnect:()=>d(()=>T.reconnect()),disconnect:(e)=>d(()=>T.disconnect(e)),startRecording:(e)=>qt(e,jt,()=>T.startRecording(e)),pauseRecording:(e)=>B(e,X,()=>T.pauseRecording(e)),resumeRecording:(e)=>B(e,X,()=>T.resumeRecording(e)),stopRecording:(e)=>B(e,X,()=>T.stopRecording(e)),getRecordingState:(e)=>B(e,X,()=>T.getRecordingState(e)),readRecording:(e)=>B(e,X,()=>T.readRecording(e)),onReading:(e)=>J(()=>T.onReading(e)),onDevice:(e)=>J(()=>T.onDevice(e)),onState:(e)=>J(()=>T.onState(e))},Er={isAvailable:()=>je.isAvailable(),speak:(e,t)=>d(()=>je.speak(e,t)),stop:()=>d(()=>je.stop())},Tr={getStatus:()=>d(()=>Ut.getStatus()),onChange:(e)=>J(()=>Ut.onChange(e))},Or={register:()=>d(()=>Ke.register()),onToken:(e)=>Ke.onToken(e),onNotification:(e)=>J(()=>Ke.onNotification(e))},Pr={requestAuthorization:(e,t)=>d(()=>ue.requestAuthorization(e,t)),getData:(e,t)=>d(()=>ue.getData(e,t)),saveWorkout:(e)=>d(()=>ue.saveWorkout(e)),getWorkouts:(e)=>d(()=>ue.getWorkouts(e)),getDailyStatistics:(e,t)=>d(()=>ue.getDailyStatistics(e,t)),getHeartRateSamples:(e)=>w("health.getHeartRateSamples",[e??{}],()=>[]).then((t)=>Array.isArray(t)?t:[]),getSamples:(e,t)=>w("health.getSamples",[e,t??{}],()=>[]).then((n)=>Array.isArray(n)?n:[]),getSleepIntervals:(e)=>w("health.getSleepIntervals",[e??{}],()=>[]).then((t)=>Array.isArray(t)?t:[]),saveMindfulSession:(e)=>w("health.saveMindfulSession",[e],()=>null).then((t)=>t??null),getMindfulSessions:(e)=>w("health.getMindfulSessions",[e??{}],()=>[]).then((t)=>Array.isArray(t)?t:[]),startHeartRateUpdates:(e)=>w("health.startHeartRateUpdates",[e??{}],()=>!1).then((t)=>t!==!1),stopHeartRateUpdates:()=>w("health.stopHeartRateUpdates",[],()=>!0).then(()=>!0),onHeartRate:(e)=>W("craftHealthHeartRate",(t)=>{if(Array.isArray(t.samples)&&t.samples.length)e(t.samples)}),supports:(e)=>M(`health.${e}`)!==null},Ir={start:(e)=>d(()=>$e.start(e)),update:(e)=>d(()=>$e.update(e)),end:()=>d(()=>$e.end())},Mr={send:(e)=>d(()=>fe.send(e)),updateContext:(e)=>d(()=>fe.updateContext(e)),isReachable:()=>d(()=>fe.isReachable()),onMessage:(e)=>fe.onMessage(e),onReachabilityChange:(e)=>fe.onReachabilityChange(e)},ki=ur;function Pe(){return E()}function V(){let e=Pe()?.craft;if(!e||typeof e!=="object")return null;if(!("platform"in e)||e.platform!=="ios"&&e.platform!=="android")return null;let t="capabilities"in e?e.capabilities:void 0,n=t&&typeof t==="object"&&!Array.isArray(t)?Object.fromEntries(Object.entries(t).filter(([,r])=>typeof r==="boolean")):{};return{platform:e.platform,capabilities:n}}function ze(){return V()!==null}function Lr(e=2000){if(ze()||re())return Promise.resolve(!0);let t=Pe();if(!t||!(t.craft||t.webkit?.messageHandlers?.craft))return Promise.resolve(!1);return new Promise((n)=>{let r=()=>{clearTimeout(o),t.removeEventListener("craftReady",r),n(ze())},o=setTimeout(r,e);t.addEventListener("craftReady",r,{once:!0})})}function Cr(e){let t=Pe();if(!t)return()=>{};if(V()){let r=!1;return queueMicrotask(()=>{if(!r)e(new Event("craftReady"))}),()=>{r=!0}}let n=(r)=>{if(!V())return;t.removeEventListener("craftReady",n),e(r)};return t.addEventListener("craftReady",n),()=>t.removeEventListener("craftReady",n)}async function Nr(e){await Oe.impact("light");try{let t=await e();return await Oe.notification("success"),t}catch(t){throw await Oe.notification("error"),t}}var Ei={get nativeBridge(){return V()},biometrics:dr,camera:pr,device:fr,haptics:Oe,lifecycle:mr,location:gr,notifications:hr,permissions:br,secureStorage:vr,storage:ht,crypto:bt,share:yr,appReview:wr,deepLinks:Sr,keepAwake:Rr,brightness:xr,music:Ar,heartRate:kr,scheduledWorkouts:yt,speech:Er,network:Tr,pushNotifications:Or,health:Pr,liveActivities:Ir,watchConnectivity:Mr,dialog:oe,contextMenu:De,browser:ot,symbols:it,statusBar:he,chrome:ie,refresh:Y,background:ae,clipboard:at,db:st,files:lt,shortcuts:ct,widgets:ut,orientation:dt,auth:pt,storeKit:ft,isNativeMobile:ze,whenNative:Lr,onReady:Cr,withFeedback:Nr};export{Dr as BRIDGE_WAIT_MS,Co as HEART_RATE_MATCH_MS,jo as INDOOR_CHECK_AFTER_S,ai as MAX_SPOTLIGHT_SLOTS_PER_KIND,Ot as ROUTE_FULL_READ_FIXES,Mn as ROUTE_FULL_READ_MAX_MS,En as ROUTE_GAP_S,Qo as SHEET_FLICK_VELOCITY,Ue as TAB_BAR_COVER_EVENT,d as afterBridge,wr as appReview,Fn as applyAppearance,An as attachHeartRate,pt as auth,Eo as backLabelFor,ae as background,dr as biometrics,ge as bridgePending,xr as brightness,ot as browser,w as callNative,pr as camera,wn as canGoBack,ie as chrome,at as clipboard,$r as confirmAction,De as contextMenu,fi as coverTabBar,E as craftHost,Q as craftRoot,co as crashReporting,_o as createRouteRecorder,ve as createRouteStats,li as createSpotlightIndex,ar as createVoiceRecorder,bt as crypto,Rt as currentAppearance,st as db,Rn as deepLinkPath,Sr as deepLinks,fr as device,oe as dialog,ko as enterNavTrail,lt as files,On as fixDistance,ro as focusSegment,Mo as followDeepLinks,V as getNativeMobileBridge,Ao as goBack,Po as goBackToTabRoot,pi as handleTabReselect,Oe as haptics,re as hasNativeMobileHost,Pr as health,kr as heartRate,zo as indoorVerdict,oi as installNativeChrome,oo as installPressables,ze as isNativeMobile,Nn as isShown,Rr as keepAwake,pn as keepBreadcrumb,vn as largeTitleMetrics,mr as lifecycle,Zo as liftToBody,Ir as liveActivities,gr as location,mi as mirrorTabBar,Ei as mobile,Ar as music,Xt as nativeFunction,M as nativeFunctionNow,or as nativeTabs,To as navTrail,Tr as network,mn as normalizeAppearance,zt as normalizeDeepLinkURL,cn as normalizeScheduledWorkout,hr as notifications,So as observeLargeTitle,eo as observeLongPress,Yo as observeNativeRefresh,hn as observePageScroll,wo as observePullToRefresh,to as observeSegmentScrub,Jo as observeSheetDrag,xt as onAppearance,bo as onBackgroundRefresh,W as onCraftEvent,go as onMemoryWarning,Cr as onMobileReady,mo as onResume,ho as onSilentPush,ci as onSpotlightTap,dt as orientation,Do as paceLabel,Wn as pageBackground,$n as pageIsDark,se as pageScrollTop,Uo as pauseSessionClock,br as permissions,tn as placeMenu,qn as placeSpotlightItem,Je as presentActionSheet,Xe as presentAlert,Ie as presentChoice,Qe as presentConfirm,Ze as presentContextMenu,ei as presentPageAsCard,Oo as previousScreenPath,bn as pullDistance,Or as pushNotifications,Yn as readSpotlightEntries,Lt as readSpotlightKinds,rr as readTabLinks,Y as refresh,Vn as removeSpotlightItem,Ro as resolveScrollHost,Wo as resumeSessionClock,Ln as routeReadInterval,In as routeStats,ir as routerHandlesTabs,Bn as rubberBand,yt as scheduledWorkouts,ln as scheduledWorkoutsUnsupported,vr as secureStorage,un as segmentAt,no as segmentForKey,$o as sessionClockElapsed,_n as settleSheet,yr as share,Hn as sheetStops,ct as shortcuts,Kr as showContextMenuFor,Ai as snapshots,Er as speech,Ho as speedLabel,ki as splash,le as spotlightAction,Ct as spotlightActions,si as spotlightActivityTypes,Jn as spotlightBridge,ce as spotlightKind,Gn as spotlightRoute,zn as spotlightSlot,Nt as spotlightTitle,Fo as startSessionClock,he as statusBar,ht as storage,ft as storeKit,J as subscribeWhenReady,it as symbols,nr as tabBar,Ne as toNativeRect,Io as trailEntryFor,qo as typedDistanceKm,No as usableFixes,Wr as useActionSheet,sr as voiceRecordingFormData,Mr as watchConnectivity,ee as whenBridgeReady,Lr as whenNativeMobile,ut as widgets,Nr as withNativeFeedback};
|
package/dist/route.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { HeartRateRecordingApi, HeartRateSample, Location, LocationApi, LocationRecordingOptions, LocationRecordingState } from './types';
|
|
1
|
+
import type { HeartRateRecordingApi, HeartRateSample, Location, LocationApi, LocationPowerMode, LocationRecordingOptions, LocationRecordingState } from './types';
|
|
2
2
|
/**
|
|
3
3
|
* The fixes with the heart rate of the reading nearest each one, when there
|
|
4
4
|
* is one within `maxGapMs`: a strap reads about once a second, a phone fixes
|
|
@@ -93,6 +93,7 @@ export declare interface RouteRecorder {
|
|
|
93
93
|
attach: (options: { expectedId: string, expectedHeartRateId?: string }) => Promise<LocationRecordingState | null>
|
|
94
94
|
pause: () => Promise<void>
|
|
95
95
|
resume: () => Promise<void>
|
|
96
|
+
setPowerMode: (powerMode: LocationPowerMode) => Promise<boolean>
|
|
96
97
|
stop: () => Promise<RouteFix[]>
|
|
97
98
|
refresh: () => Promise<RouteStats>
|
|
98
99
|
dispose: () => void
|
package/dist/types.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ export declare interface CraftMobileCapabilities {
|
|
|
14
14
|
backgroundLocation?: boolean
|
|
15
15
|
locationRecordingOwnership?: boolean
|
|
16
16
|
locationRecordingIntentIdentity?: boolean
|
|
17
|
+
locationRecordingPowerMode?: boolean
|
|
17
18
|
heartRateRecordingIntentIdentity?: boolean
|
|
18
19
|
heartRateRecordingOwnership?: boolean
|
|
19
20
|
healthKit?: boolean
|
|
@@ -168,6 +169,8 @@ export declare interface LocationRecordingState {
|
|
|
168
169
|
paused: boolean
|
|
169
170
|
startedAt: number | null
|
|
170
171
|
sampleCount?: number
|
|
172
|
+
powerMode?: LocationPowerMode
|
|
173
|
+
effectivePowerMode?: LocationEffectivePowerMode
|
|
171
174
|
}
|
|
172
175
|
/** An identity already registered durably by the caller before native start. */
|
|
173
176
|
export declare interface RecordingStartOptions {
|
|
@@ -262,9 +265,15 @@ export declare interface RecordingOwnershipOptions {
|
|
|
262
265
|
export declare interface LocationRecordingReadOptions extends RecordingOwnershipOptions {
|
|
263
266
|
since?: number
|
|
264
267
|
}
|
|
268
|
+
/** Change the power mode of the recording that is running, fenced to its ID. */
|
|
269
|
+
export declare interface LocationRecordingPowerModeOptions extends RecordingOwnershipOptions {
|
|
270
|
+
powerMode: LocationPowerMode
|
|
271
|
+
}
|
|
265
272
|
export declare interface LocationApi {
|
|
266
273
|
supportsRecordingOwnership: () => boolean
|
|
267
274
|
supportsRecordingIntentIdentity: () => boolean
|
|
275
|
+
supportsRecordingPowerMode: () => boolean
|
|
276
|
+
setRecordingPowerMode: (options: LocationRecordingPowerModeOptions) => Promise<LocationRecordingState>
|
|
268
277
|
acknowledgeRecording: (options: RecordingOwnershipOptions) => Promise<boolean>
|
|
269
278
|
getCurrentPosition: (options?: LocationOptions) => Promise<Location>
|
|
270
279
|
watchPosition: (callback: (location: Location) => void, options?: LocationOptions) => number
|
|
@@ -641,9 +650,14 @@ export type BiometricType = 'faceId' | 'touchId' | 'fingerprint' | 'face' | 'iri
|
|
|
641
650
|
* 5 m apart instead of every second, and iOS relaxes to ten-metre accuracy
|
|
642
651
|
* while the pace holds steady. 5 m keeps fixes under ROUTE_GAP_S apart at any
|
|
643
652
|
* speed that counts as moving, so distance and moving time come out as at
|
|
644
|
-
* full rate.
|
|
653
|
+
* full rate. `'auto'` (Craft 0.0.403+, check `supportsRecordingPowerMode()`)
|
|
654
|
+
* saves power only while the device wants it: Low Power Mode, Battery Saver, or
|
|
655
|
+
* under 20% and not charging; read what it resolved to from
|
|
656
|
+
* `effectivePowerMode` on the recording's state.
|
|
645
657
|
*/
|
|
646
|
-
export type LocationPowerMode = 'default' | 'saver';
|
|
658
|
+
export type LocationPowerMode = 'default' | 'saver' | 'auto';
|
|
659
|
+
/** What a recording is using right now; `'auto'` resolves to one of these. */
|
|
660
|
+
export type LocationEffectivePowerMode = 'default' | 'saver';
|
|
647
661
|
export type AppState = 'active' | 'inactive' | 'background';
|
|
648
662
|
export type HapticKind = 'impact' | 'notification' | 'selection';
|
|
649
663
|
/** Whether the person has let the app see their music. `unavailable` off a phone. */
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@stacksjs/mobile",
|
|
3
3
|
"type": "module",
|
|
4
4
|
"sideEffects": false,
|
|
5
|
-
"version": "0.75.
|
|
5
|
+
"version": "0.75.399",
|
|
6
6
|
"description": "Craft-powered native mobile runtime for Stacks and STX applications",
|
|
7
7
|
"author": "Chris Breuer",
|
|
8
8
|
"license": "MIT",
|
|
@@ -39,11 +39,11 @@
|
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"@bughq/sdk": "^0.3.0",
|
|
42
|
-
"@stacksjs/types": "0.75.
|
|
43
|
-
"craft-native": ">=0.0.
|
|
42
|
+
"@stacksjs/types": "0.75.399",
|
|
43
|
+
"craft-native": ">=0.0.403"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@stacksjs/build": "0.75.
|
|
46
|
+
"@stacksjs/build": "0.75.399",
|
|
47
47
|
"better-dx": "^0.2.24"
|
|
48
48
|
}
|
|
49
49
|
}
|