@tamagui/adapt 2.7.7 → 3.0.0-beta.643.1

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.
@@ -1 +1 @@
1
- {"version":3,"names":["isAndroid","isIos","isTouchable","isWeb","useIsomorphicLayoutEffect","createStyledContext","useMedia","withStaticProperties","getPortal","PortalHost","PortalItem","StackZIndexContext","React","createContext","useContext","useId","useMemo","Fragment","jsx","createAdaptChildrenStore","children","listeners","Set","set","c","l","get","subscribe","callback","add","delete","AdaptChildrenStoreContext","AdaptContext","Contents","scopeName","portalName","platform","setPlatform","x","when","setWhen","LastAdaptContextScope","ProvideAdaptContext","context","scope","lastScope","Provider","value","useAdaptContext","adaptScope","useStyledContext","AdaptPortals","Map","AdaptParent","portal","id","childrenStoreRef","useRef","current","isTeleport","FinalContents","has","element","name","forwardProps","useState","AdaptContents","rest","Error","process","env","NODE_ENV","createElement","key","shouldForwardSpace","Adapt","Adapt2","props","enabled","useAdaptIsActiveGiven","output","Component","AdaptPortalContents","isActive","useAdaptIsActive","childrenStore","state","type","AdaptPortalTeleport","store","passThrough","hostName","media"],"sources":["Adapt.mjs"],"sourcesContent":["import { isAndroid, isIos, isTouchable, isWeb, useIsomorphicLayoutEffect } from \"@tamagui/constants\";\nimport { createStyledContext, useMedia } from \"@tamagui/core\";\nimport { withStaticProperties } from \"@tamagui/helpers\";\nimport { getPortal } from \"@tamagui/native\";\nimport { PortalHost, PortalItem } from \"@tamagui/portal\";\nimport { StackZIndexContext } from \"@tamagui/z-index-stack\";\nimport React, { createContext, useContext, useId, useMemo } from \"react\";\nimport { Fragment, jsx } from \"react/jsx-runtime\";\n\nfunction createAdaptChildrenStore() {\n\tlet children = null;\n\tconst listeners = /* @__PURE__ */ new Set();\n\treturn {\n\t\tset(c) {\n\t\t\tchildren = c;\n\t\t\tfor (const l of listeners) l();\n\t\t},\n\t\tget: () => children,\n\t\tsubscribe(callback) {\n\t\t\tlisteners.add(callback);\n\t\t\treturn () => listeners.delete(callback);\n\t\t}\n\t};\n}\nconst AdaptChildrenStoreContext = createContext(null);\nconst AdaptContext = createStyledContext({\n\tContents: null,\n\tscopeName: \"\",\n\tportalName: \"\",\n\tplatform: null,\n\tsetPlatform: (x) => {},\n\twhen: null,\n\tsetWhen: () => {}\n});\nconst LastAdaptContextScope = createContext(\"\");\nconst ProvideAdaptContext = ({ children, ...context }) => {\n\tconst scope = context.scopeName || \"\";\n\tconst lastScope = useContext(LastAdaptContextScope);\n\treturn /* @__PURE__ */ jsx(LastAdaptContextScope.Provider, {\n\t\tvalue: lastScope || context.lastScope || \"\",\n\t\tchildren: /* @__PURE__ */ jsx(AdaptContext.Provider, {\n\t\t\tscope,\n\t\t\tlastScope: lastScope || context.lastScope,\n\t\t\t...context,\n\t\t\tchildren\n\t\t})\n\t});\n};\nconst useAdaptContext = (scope) => {\n\tconst lastScope = useContext(LastAdaptContextScope);\n\tconst adaptScope = scope ?? lastScope;\n\treturn AdaptContext.useStyledContext(adaptScope);\n};\nconst AdaptPortals = /* @__PURE__ */ new Map();\nconst AdaptParent = ({ children, Contents, scope, portal }) => {\n\tconst id = useId();\n\tconst portalName = `AdaptPortal${scope}${id}`;\n\tconst childrenStoreRef = React.useRef(null);\n\tif (!childrenStoreRef.current) childrenStoreRef.current = createAdaptChildrenStore();\n\tconst isTeleport = false;\n\tconst FinalContents = useMemo(() => {\n\t\tif (Contents) return Contents;\n\t\tif (AdaptPortals.has(portalName)) return AdaptPortals.get(portalName);\n\t\tconst element = () => {\n\t\t\treturn /* @__PURE__ */ jsx(PortalHost, {\n\t\t\t\tname: portalName,\n\t\t\t\tforwardProps: typeof portal === \"boolean\" ? void 0 : portal?.forwardProps\n\t\t\t}, id);\n\t\t};\n\t\tAdaptPortals.set(portalName, element);\n\t\treturn element;\n\t}, [\n\t\tportalName,\n\t\tContents,\n\t\tisTeleport\n\t]);\n\tuseIsomorphicLayoutEffect(() => {\n\t\tAdaptPortals.set(portalName, FinalContents);\n\t\treturn () => {\n\t\t\tAdaptPortals.delete(portalName);\n\t\t};\n\t}, [portalName, isTeleport]);\n\tconst [when, setWhen] = React.useState(null);\n\tconst [platform, setPlatform] = React.useState(null);\n\treturn /* @__PURE__ */ jsx(AdaptChildrenStoreContext.Provider, {\n\t\tvalue: childrenStoreRef.current,\n\t\tchildren: /* @__PURE__ */ jsx(LastAdaptContextScope.Provider, {\n\t\t\tvalue: scope,\n\t\t\tchildren: /* @__PURE__ */ jsx(ProvideAdaptContext, {\n\t\t\t\tContents: FinalContents,\n\t\t\t\twhen,\n\t\t\t\tplatform,\n\t\t\t\tsetPlatform,\n\t\t\t\tsetWhen,\n\t\t\t\tportalName,\n\t\t\t\tscopeName: scope,\n\t\t\t\tchildren\n\t\t\t})\n\t\t})\n\t});\n};\nconst AdaptContents = ({ scope, ...rest }) => {\n\tconst context = useAdaptContext(scope);\n\tif (!context?.Contents) throw new Error(process.env.NODE_ENV === \"production\" ? `tamagui.dev/docs/intro/errors#warning-002` : `You're rendering a Tamagui <Adapt /> component without nesting it inside a parent that is able to adapt.`);\n\treturn React.createElement(context.Contents, {\n\t\t...rest,\n\t\tkey: `stable`\n\t});\n};\nAdaptContents.shouldForwardSpace = true;\nconst Adapt = withStaticProperties(function Adapt2(props) {\n\tconst { platform, when, children, scope } = props;\n\tconst context = useAdaptContext(scope);\n\tconst enabled = useAdaptIsActiveGiven(props);\n\tuseIsomorphicLayoutEffect(() => {\n\t\tcontext?.setWhen?.(when || enabled);\n\t\tcontext?.setPlatform?.(platform || null);\n\t}, [\n\t\twhen,\n\t\tplatform,\n\t\tenabled,\n\t\tcontext.setWhen,\n\t\tcontext.setPlatform\n\t]);\n\tuseIsomorphicLayoutEffect(() => {\n\t\treturn () => {\n\t\t\tcontext?.setWhen?.(null);\n\t\t\tcontext?.setPlatform?.(null);\n\t\t};\n\t}, []);\n\tlet output;\n\tif (typeof children === \"function\") {\n\t\tconst Component = context?.Contents;\n\t\toutput = children(Component ? /* @__PURE__ */ jsx(Component, {}) : null);\n\t} else output = children;\n\treturn /* @__PURE__ */ jsx(StackZIndexContext, { children: !enabled ? null : output });\n}, { Contents: AdaptContents });\nconst AdaptPortalContents = (props) => {\n\tconst isActive = useAdaptIsActive(props.scope);\n\tconst { portalName } = useAdaptContext(props.scope);\n\tconst childrenStore = useContext(AdaptChildrenStoreContext);\n\tif (!isWeb && getPortal().state.type === \"teleport\" && childrenStore) return /* @__PURE__ */ jsx(AdaptPortalTeleport, {\n\t\tisActive,\n\t\tstore: childrenStore,\n\t\tchildren: props.children\n\t});\n\treturn /* @__PURE__ */ jsx(PortalItem, {\n\t\tpassThrough: !isActive,\n\t\thostName: portalName,\n\t\tchildren: props.children\n\t});\n};\nfunction AdaptPortalTeleport({ isActive, store, children }) {\n\tuseIsomorphicLayoutEffect(() => {\n\t\tif (isActive) store.set(children);\n\t\telse store.set(null);\n\t});\n\tuseIsomorphicLayoutEffect(() => {\n\t\treturn () => store.set(null);\n\t}, [store]);\n\treturn isActive ? null : /* @__PURE__ */ jsx(Fragment, { children });\n}\nconst useAdaptIsActiveGiven = ({ when, platform }) => {\n\tconst media = useMedia();\n\tif (when == null && platform == null) return false;\n\tif (when === true) return true;\n\tlet enabled = false;\n\tif (platform === \"touch\") enabled = isTouchable;\n\telse if (platform === \"native\") enabled = !isWeb;\n\telse if (platform === \"web\") enabled = isWeb;\n\telse if (platform === \"ios\") enabled = isIos;\n\telse if (platform === \"android\") enabled = isAndroid;\n\tif (platform && enabled == false) return false;\n\tif (when && typeof when === \"string\") enabled = media[when];\n\treturn enabled;\n};\nconst useAdaptIsActive = (scope) => {\n\treturn useAdaptIsActiveGiven(useAdaptContext(scope));\n};\n\nexport { Adapt, AdaptContents, AdaptContext, AdaptParent, AdaptPortalContents, ProvideAdaptContext, useAdaptContext, useAdaptIsActive };"],"mappings":"AAAA,SAASA,SAAS,EAAEC,KAAK,EAAEC,WAAW,EAAEC,KAAK,EAAEC,yBAAyB,QAAQ,oBAAoB;AACpG,SAASC,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f,CAAC;AACD,MAAMM,gBAAgB,GAAIxC,KAAK,IAAK;EACnC,OAAOmC,qBAAqB,CAAC/B,eAAe,CAACJ,KAAK,CAAC,CAAC;AACrD,CAAC;AAED,SAAS+B,KAAK,EAAET,aAAa,EAAElC,YAAY,EAAEqB,WAAW,EAAE6B,mBAAmB,EAAExC,mBAAmB,EAAEM,eAAe,EAAEoC,gBAAgB","ignoreList":[]}
1
+ {"version":3,"file":"Adapt.js","names":[],"sources":["esm/Adapt.js"],"sourcesContent":["import {\n isAndroid,\n isIos,\n isTouchable,\n isWeb,\n useIsomorphicLayoutEffect\n} from \"@tamagui/constants\";\nimport { createStyledContext, useMedia } from \"@tamagui/core\";\nimport { withStaticProperties } from \"@tamagui/helpers\";\nimport { StackZIndexContext } from \"@tamagui/z-index-stack\";\nimport React, { createContext, useContext, useId } from \"react\";\nimport { Fragment, jsx } from \"react/jsx-runtime\";\nfunction createAdaptSlotStore() {\n const listeners = /* @__PURE__ */ new Set();\n const store = {\n element: null,\n version: 0,\n publish(element) {\n store.element = element;\n },\n clear() {\n store.element = null;\n },\n notify() {\n store.version += 1;\n for (const listener of listeners) {\n listener();\n }\n },\n getSnapshot() {\n return store.version;\n },\n subscribe(callback) {\n listeners.add(callback);\n return () => {\n listeners.delete(callback);\n };\n }\n };\n return store;\n}\nconst adaptContextKeys = [\n \"Contents\",\n \"scopeName\",\n \"portalName\",\n \"platform\",\n \"setPlatform\",\n \"when\",\n \"setWhen\",\n \"active\",\n \"rawActive\",\n \"setRawActive\",\n \"slot\",\n \"handoff\",\n \"targetFullyHidden\",\n \"registerTarget\",\n \"unregisterTarget\",\n \"registerContents\",\n \"unregisterContents\",\n \"registerRenderCallback\",\n \"unregisterRenderCallback\"\n];\nconst AdaptContext = createStyledContext(\n {\n Contents: null,\n scopeName: \"\",\n portalName: \"\",\n platform: null,\n setPlatform: (x) => {\n },\n when: null,\n setWhen: () => {\n },\n active: false,\n rawActive: false,\n setRawActive: () => {\n },\n slot: null,\n handoff: {\n hidden: true,\n onTransition: () => {\n }\n },\n targetFullyHidden: true,\n registerTarget: () => {\n },\n unregisterTarget: () => {\n },\n registerContents: () => {\n },\n unregisterContents: () => {\n },\n registerRenderCallback: () => {\n },\n unregisterRenderCallback: () => {\n }\n },\n {\n keys: adaptContextKeys\n }\n);\nconst AdaptCapabilitiesContext = createContext({});\nconst LastAdaptContextScope = createContext(\"\");\nconst ProvideAdaptContext = ({\n children,\n ...context\n}) => {\n const scope = context.scopeName || \"\";\n const lastScope = useContext(LastAdaptContextScope);\n return /* @__PURE__ */ jsx(LastAdaptContextScope.Provider, { value: lastScope || context.lastScope || \"\", children: /* @__PURE__ */ jsx(\n AdaptContext.Provider,\n {\n scope,\n lastScope: lastScope || context.lastScope,\n ...context,\n children\n }\n ) });\n};\nconst useAdaptContext = (scope) => {\n const lastScope = useContext(LastAdaptContextScope);\n const adaptScope = scope ?? lastScope;\n return AdaptContext.useStyledContext(adaptScope);\n};\nconst AdaptParent = ({\n children,\n Contents,\n scope,\n open,\n onOpenChange,\n state\n}) => {\n const id = useId();\n const portalName = `AdaptPortal${scope}${id}`;\n const slotRef = React.useRef(null);\n if (!slotRef.current) {\n slotRef.current = createAdaptSlotStore();\n }\n const [when, setWhen] = React.useState(null);\n const [platform, setPlatform] = React.useState(null);\n const [rawActive, setRawActive] = React.useState(false);\n const [exiting, setExiting] = React.useState(false);\n const [present, setPresent] = React.useState(false);\n const [targetFullyHidden, setTargetFullyHidden] = React.useState(!open);\n const targetCountRef = React.useRef(0);\n const contentsCountRef = React.useRef(0);\n const renderCallbackCountRef = React.useRef(0);\n const rawActiveRef = React.useRef(false);\n const openRef = React.useRef(open);\n const wasTargetHiddenRef = React.useRef(!rawActive);\n const hasHadActiveTargetRef = React.useRef(false);\n const shouldStartExit = !rawActive && present && Boolean(open);\n const active = rawActive || exiting || shouldStartExit;\n const targetHidden = !rawActive;\n const skipNextAnimation = Boolean(\n rawActive && wasTargetHiddenRef.current && hasHadActiveTargetRef.current && open\n );\n rawActiveRef.current = rawActive;\n openRef.current = open;\n if (rawActive) {\n hasHadActiveTargetRef.current = true;\n }\n wasTargetHiddenRef.current = targetHidden;\n const releasePresenceLatch = React.useCallback(() => {\n setExiting(false);\n if (!rawActiveRef.current) {\n setPresent(false);\n }\n }, []);\n useIsomorphicLayoutEffect(() => {\n if (shouldStartExit) {\n setExiting(true);\n }\n }, [shouldStartExit]);\n useIsomorphicLayoutEffect(() => {\n if (open && rawActive) {\n setTargetFullyHidden(false);\n return;\n }\n if (!open && !active) {\n setTargetFullyHidden(true);\n }\n }, [active, open, rawActive]);\n useIsomorphicLayoutEffect(() => {\n if (rawActive) {\n setPresent(true);\n } else if (!active) {\n setPresent(false);\n }\n if (rawActive && exiting) {\n setExiting(false);\n }\n }, [active, exiting, rawActive]);\n const handoff = React.useMemo(\n () => ({\n hidden: targetHidden,\n skipNextAnimation,\n onTransition(e) {\n if (e.phase !== \"end\" || e.finished === false) return;\n if (e.cause !== \"close\") {\n setTargetFullyHidden(false);\n return;\n }\n if (openRef.current && rawActiveRef.current) {\n setTargetFullyHidden(false);\n return;\n }\n setTargetFullyHidden(true);\n releasePresenceLatch();\n }\n }),\n [releasePresenceLatch, skipNextAnimation, targetHidden]\n );\n const registerTarget = React.useCallback(() => {\n targetCountRef.current += 1;\n if (process.env.NODE_ENV === \"development\" && targetCountRef.current > 1) {\n console.error(\n `Adapt expected exactly one target in scope \"${scope}\", but ${targetCountRef.current} targets registered.`\n );\n }\n }, [scope]);\n const unregisterTarget = React.useCallback(() => {\n targetCountRef.current = Math.max(0, targetCountRef.current - 1);\n }, []);\n const registerContents = React.useCallback(() => {\n contentsCountRef.current += 1;\n }, []);\n const unregisterContents = React.useCallback(() => {\n contentsCountRef.current = Math.max(0, contentsCountRef.current - 1);\n }, []);\n const registerRenderCallback = React.useCallback(() => {\n renderCallbackCountRef.current += 1;\n }, []);\n const unregisterRenderCallback = React.useCallback(() => {\n renderCallbackCountRef.current = Math.max(0, renderCallbackCountRef.current - 1);\n }, []);\n React.useEffect(() => {\n if (process.env.NODE_ENV !== \"development\") return;\n if (!active) return;\n const timer = setTimeout(() => {\n if (rawActiveRef.current && targetCountRef.current === 0 && contentsCountRef.current === 0 && renderCallbackCountRef.current === 0) {\n console.error(\n `Adapt is active in scope \"${scope}\" but no target registered with useAdaptTarget(), Adapt.Contents marker, or render callback consumed it.`\n );\n }\n });\n return () => clearTimeout(timer);\n }, [active, scope]);\n const FinalContents = Contents || AdaptSlotContents;\n return /* @__PURE__ */ jsx(LastAdaptContextScope.Provider, { value: scope, children: /* @__PURE__ */ jsx(\n ProvideAdaptContext,\n {\n Contents: FinalContents,\n when,\n platform,\n setPlatform,\n setWhen,\n active,\n rawActive,\n setRawActive,\n portalName,\n scopeName: scope,\n slot: slotRef.current,\n open,\n onOpenChange,\n state,\n handoff,\n targetFullyHidden,\n registerTarget,\n unregisterTarget,\n registerContents,\n unregisterContents,\n registerRenderCallback,\n unregisterRenderCallback,\n children\n }\n ) });\n};\nconst AdaptContents = ({ scope, ...rest }) => {\n const context = useAdaptContext(scope);\n if (!context?.Contents) {\n throw new Error(\n process.env.NODE_ENV === \"production\" ? `tamagui.dev/docs/intro/errors#warning-002` : `You're rendering a Tamagui <Adapt /> component without nesting it inside a parent that is able to adapt.`\n );\n }\n useIsomorphicLayoutEffect(() => {\n if (!context.active) return;\n context.registerContents();\n return () => {\n context.unregisterContents();\n };\n }, [context.active, context.registerContents, context.unregisterContents]);\n return React.createElement(context.Contents, { ...rest, scope, key: `stable` });\n};\nAdaptContents.shouldForwardSpace = true;\nconst Adapt = withStaticProperties(\n function Adapt2(props) {\n const { platform, when, children, scope } = props;\n const context = useAdaptContext(scope);\n const rawEnabled = useAdaptIsActiveGiven(props);\n const enabled = rawEnabled || context.active;\n const isRenderCallback = typeof children === \"function\";\n useIsomorphicLayoutEffect(() => {\n context?.setWhen?.(when || rawEnabled);\n context?.setPlatform?.(platform || null);\n context?.setRawActive?.(rawEnabled);\n }, [\n when,\n platform,\n rawEnabled,\n context.setWhen,\n context.setPlatform,\n context.setRawActive\n ]);\n useIsomorphicLayoutEffect(() => {\n if (!enabled || !isRenderCallback) return;\n context.registerRenderCallback();\n return () => {\n context.unregisterRenderCallback();\n };\n }, [\n enabled,\n isRenderCallback,\n context.registerRenderCallback,\n context.unregisterRenderCallback\n ]);\n useIsomorphicLayoutEffect(() => {\n return () => {\n context?.setWhen?.(null);\n context?.setPlatform?.(null);\n context?.setRawActive?.(false);\n };\n }, []);\n let output;\n if (isRenderCallback) {\n const Component = context?.Contents;\n output = children(Component ? /* @__PURE__ */ jsx(Component, {}) : null, getAdaptRenderState(context));\n } else {\n output = children;\n }\n return /* @__PURE__ */ jsx(StackZIndexContext, { children: !enabled ? null : output });\n },\n {\n Contents: AdaptContents\n }\n);\nconst AdaptPortalContents = (props) => {\n const isActive = useAdaptIsActive(props.scope);\n const { slot } = useAdaptContext(props.scope);\n return /* @__PURE__ */ jsx(AdaptSlotPublisher, { isActive, slot, children: props.children });\n};\nfunction AdaptSlotContents({ scope }) {\n const { slot } = useAdaptContext(scope);\n React.useSyncExternalStore(\n slot?.subscribe ?? emptySubscribe,\n slot?.getSnapshot ?? emptySnapshot,\n slot?.getSnapshot ?? emptySnapshot\n );\n return /* @__PURE__ */ jsx(Fragment, { children: slot?.element ?? null });\n}\nfunction AdaptSlotPublisher({\n isActive,\n slot,\n children\n}) {\n const publishedRef = React.useRef(false);\n useIsomorphicLayoutEffect(() => {\n if (!slot) return;\n if (isActive) {\n slot.publish(children);\n publishedRef.current = true;\n } else {\n slot.clear();\n publishedRef.current = false;\n }\n slot.notify();\n });\n useIsomorphicLayoutEffect(() => {\n return () => {\n if (publishedRef.current) {\n slot?.clear();\n slot?.notify();\n publishedRef.current = false;\n }\n };\n }, [slot]);\n return isActive ? null : /* @__PURE__ */ jsx(Fragment, { children });\n}\nconst emptySubscribe = () => () => {\n};\nconst emptySnapshot = () => 0;\nconst useAdaptIsActiveGiven = ({\n when,\n platform\n}) => {\n const media = useMedia();\n if (when == null && platform == null) {\n return false;\n }\n if (when === true) {\n return true;\n }\n let enabled = false;\n if (platform === \"touch\") enabled = isTouchable;\n else if (platform === \"native\") enabled = !isWeb;\n else if (platform === \"web\") enabled = isWeb;\n else if (platform === \"ios\") enabled = isIos;\n else if (platform === \"android\") enabled = isAndroid;\n if (platform && enabled == false) {\n return false;\n }\n if (when && typeof when === \"string\") {\n enabled = media[when];\n }\n return enabled;\n};\nconst useAdaptIsActive = (scope) => {\n const props = useAdaptContext(scope);\n const isActiveGiven = useAdaptIsActiveGiven(props);\n return props.active || isActiveGiven;\n};\nfunction useAdaptTarget(scope) {\n const context = useAdaptContext(scope);\n useIsomorphicLayoutEffect(() => {\n if (!context.active) return;\n context.registerTarget();\n return () => {\n context.unregisterTarget();\n };\n }, [context.active, context.registerTarget, context.unregisterTarget]);\n if (!context.active) {\n return null;\n }\n return {\n open: context.open,\n onOpenChange: context.onOpenChange,\n handoff: context.handoff,\n state: context.state\n };\n}\nconst AdaptCapabilities = ({\n children,\n scroll,\n overlay,\n dismiss\n}) => {\n const parent = useContext(AdaptCapabilitiesContext);\n const value = React.useMemo(\n () => ({\n scroll: scroll ?? parent.scroll,\n overlay: overlay ?? parent.overlay,\n dismiss: dismiss ?? parent.dismiss\n }),\n [dismiss, overlay, parent.dismiss, parent.overlay, parent.scroll, scroll]\n );\n return /* @__PURE__ */ jsx(AdaptCapabilitiesContext.Provider, { value, children });\n};\nconst useAdaptedCapabilities = () => {\n return useContext(AdaptCapabilitiesContext);\n};\nfunction getAdaptRenderState(context) {\n return {\n active: context.active,\n open: context.open,\n onOpenChange: context.onOpenChange,\n state: context.state,\n handoff: context.handoff\n };\n}\nexport {\n Adapt,\n AdaptCapabilities,\n AdaptContents,\n AdaptContext,\n AdaptParent,\n AdaptPortalContents,\n ProvideAdaptContext,\n useAdaptContext,\n useAdaptIsActive,\n useAdaptTarget,\n useAdaptedCapabilities\n};\n//# sourceMappingURL=Adapt.js.map\n"],"mappings":";;;;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