@mappedin/react-sdk 6.0.1-beta.9 → 6.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -5
- package/THIRD_PARTY_LICENSES.txt +8938 -21631
- package/lib/esm/index.d.ts +316 -25300
- package/lib/esm/index.js +727 -1
- package/lib/esm/index.js.map +7 -0
- package/package.json +18 -18
- package/lib/esm/GLTFExporter-DDZP3YM5.js +0 -1
- package/lib/esm/GLTFLoader-54EWX6DJ.js +0 -1
- package/lib/esm/browser-UXFEBJ7R.js +0 -1
- package/lib/esm/chunk-A35HKGOE.js +0 -1
- package/lib/esm/chunk-FE5S74VA.js +0 -1
- package/lib/esm/chunk-N3QTXFSC.js +0 -1
- package/lib/esm/chunk-NTOUDKDJ.js +0 -1
- package/lib/esm/chunk-SHB4JBRW.js +0 -1
- package/lib/esm/chunk-WVWEOR6I.js +0 -1
- package/lib/esm/index.css +0 -1
- package/lib/esm/inspector-7OFL6D2O.js +0 -1
- package/lib/esm/inspector-OZDC5DPH.css +0 -1
- package/lib/esm/internal-BMRBMNE6.js +0 -1
- package/lib/esm/outdoor-context-v4-M3BL3WQZ.js +0 -1
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["<define:process>", "../../../../node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/index.js", "../../src/index.tsx", "../../src/MapDataProvider.tsx", "../../src/hooks/useMapData.tsx", "../../../packages/common/Mappedin.Logger.ts", "../../src/hooks/useMemoDeep.tsx", "../../src/hooks/useMapDataEvent.tsx", "../../src/MapView.tsx", "../../src/hooks/useMapViewEvent.tsx", "../../src/errors.ts", "../../src/hooks/useMapViewExtension.tsx", "../../src/Path.tsx", "../../src/hooks/useUpdateEffect.ts", "../../src/Navigation.tsx", "../../src/Shape.tsx", "../../src/Model.tsx", "../../src/hooks/useMap.tsx", "../../src/Marker.tsx", "../../../packages/common/random-id.ts", "../../src/Label.tsx"],
|
|
4
|
+
"sourcesContent": ["{\"env\":{\"npm_package_version\":\"6.1.0\"}}", "'use strict';\n\n// do not edit .js files directly - edit src/index.jst\n\n\n\nmodule.exports = function equal(a, b) {\n if (a === b) return true;\n\n if (a && b && typeof a == 'object' && typeof b == 'object') {\n if (a.constructor !== b.constructor) return false;\n\n var length, i, keys;\n if (Array.isArray(a)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (!equal(a[i], b[i])) return false;\n return true;\n }\n\n\n\n if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;\n if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();\n if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();\n\n keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length) return false;\n\n for (i = length; i-- !== 0;)\n if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;\n\n for (i = length; i-- !== 0;) {\n var key = keys[i];\n\n if (!equal(a[key], b[key])) return false;\n }\n\n return true;\n }\n\n // true if both NaN, false otherwise\n return a!==a && b!==b;\n};\n", "/**\n * @module @mappedin/react-sdk\n */\n// MapData\nexport { MapDataProvider } from './MapDataProvider';\nexport type { MapDataProviderProps } from './MapDataProvider';\nexport { useMapData } from './hooks/useMapData';\nexport { useMapDataEvent } from './hooks/useMapDataEvent';\n\n// MapView\nexport { MapView } from './MapView';\nexport type { MapViewProps } from './MapView';\nexport { useMapViewEvent } from './hooks/useMapViewEvent';\nexport { useMapViewExtension } from './hooks/useMapViewExtension';\nexport { Path } from './Path';\nexport type { PathProps } from './Path';\nexport { Navigation } from './Navigation';\nexport type { NavigationProps } from './Navigation';\nexport { Shape } from './Shape';\nexport type { ShapeProps } from './Shape';\nexport { Model } from './Model';\nexport type { ModelProps } from './Model';\nexport { useMap } from './hooks/useMap';\nexport { Marker, AnimatedMarker } from './Marker';\nexport type { MarkerProps } from './Marker';\nexport { Label } from './Label';\nexport type { LabelProps } from './Label';\n\n// Re-export React types for docs\nimport type * as React from 'react';\nexport type { React };\n", "import type { MapData, TGetMapDataOptions } from '@mappedin/mappedin-js';\nimport type { PropsWithChildren } from 'react';\nimport React, { createContext, useCallback, useMemo, useRef } from 'react';\n\nexport type CachedMapDataEntry = {\n\tmapData: MapData;\n\toptions: TGetMapDataOptions;\n};\n\nexport type MapDataContextType = {\n\tgetCache: () => CachedMapDataEntry | undefined;\n\tsetCache: (entry: CachedMapDataEntry) => void;\n};\n\nexport const MapDataContext = createContext<MapDataContextType>({\n\tgetCache: () => undefined,\n\tsetCache: () => {},\n});\n\nexport type MapDataProviderProps = {\n\tmapData: MapData;\n};\n\nexport function MapDataProvider({ mapData, children }: PropsWithChildren<MapDataProviderProps>) {\n\tconst cachedEntryRef = useRef<CachedMapDataEntry | undefined>(\n\t\tmapData ? { mapData, options: {} as TGetMapDataOptions } : undefined,\n\t);\n\n\tconst getCache = useCallback(() => cachedEntryRef.current, []);\n\tconst setCache = useCallback((entry: CachedMapDataEntry) => {\n\t\tcachedEntryRef.current = entry;\n\t}, []);\n\n\tconst contextValue = useMemo(\n\t\t() => ({\n\t\t\tgetCache,\n\t\t\tsetCache,\n\t\t}),\n\t\t[getCache, setCache],\n\t);\n\n\treturn <MapDataContext.Provider value={contextValue}>{children}</MapDataContext.Provider>;\n}\n", "import { useCallback, useContext, useEffect, useRef, useState } from 'react';\nimport type { MapData, TGetMapDataOptions } from '@mappedin/mappedin-js';\nimport { getMapData } from '@mappedin/mappedin-js';\nimport equal from 'fast-deep-equal';\nimport Logger from '@packages/internal/common/Mappedin.Logger';\nimport { MapDataContext } from '../MapDataProvider';\nimport { useMemoDeep } from './useMemoDeep';\n\n/**\n * Hook to get the MapData and handle loading and error states.\n *\n * If used outside of a {@link MapDataProvider} or {@link MapView} component, options are required to fetch the MapData.\n * If used within a {@link MapDataProvider} or {@link MapView} component, options are optional and will use the MapData from the context if available.\n *\n * @category Hooks\n *\n * @example\n * ```tsx\n * const { mapData, isLoading, error } = useMapData(options);\n * ```\n */\nexport function useMapData(options?: TGetMapDataOptions): {\n\tmapData?: MapData;\n\tisLoading: boolean;\n\terror?: Error;\n} {\n\tconst { getCache, setCache } = useContext(MapDataContext);\n\tconst [mapData, setMapData] = useState<MapData | undefined>(undefined);\n\tconst [isLoading, setIsLoading] = useState(true);\n\tconst [error, setError] = useState<Error | undefined>(undefined);\n\tconst fetchIdRef = useRef(0);\n\n\tconst memoizedOptions: TGetMapDataOptions | undefined = useMemoDeep(\n\t\t() => options && { ...options, analytics: { context: 'reactsdk', ...options?.analytics } },\n\t\t[options],\n\t);\n\n\tconst fetchMapData = useCallback((options: TGetMapDataOptions) => {\n\t\tconst fetchId = ++fetchIdRef.current;\n\t\tsetIsLoading(true);\n\t\tsetError(undefined);\n\n\t\t// TODO: use abortcontroller signal to cancel the fetch outright\n\t\tgetMapData(options)\n\t\t\t.then(fetchedMapData => {\n\t\t\t\tif (fetchIdRef.current === fetchId) {\n\t\t\t\t\tsetMapData(fetchedMapData);\n\t\t\t\t}\n\t\t\t})\n\t\t\t.catch(err => {\n\t\t\t\tif (fetchIdRef.current === fetchId) {\n\t\t\t\t\tLogger.error('Failed to fetch MapData', err);\n\t\t\t\t\tsetError(err);\n\t\t\t\t}\n\t\t\t})\n\t\t\t.finally(() => {\n\t\t\t\tif (fetchIdRef.current === fetchId) setIsLoading(false);\n\t\t\t});\n\t}, []);\n\n\tuseEffect(() => {\n\t\t// If this is used within a context, we can try to get the mapData from context first\n\t\tconst cachedEntry = getCache?.();\n\t\tif (cachedEntry != null) {\n\t\t\tif (\n\t\t\t\t// No options provided, use cached data\n\t\t\t\tmemoizedOptions == null ||\n\t\t\t\t// Options provided and matches cached data\n\t\t\t\t(cachedEntry.mapData.mapId === memoizedOptions.mapId && equal(cachedEntry.options, memoizedOptions))\n\t\t\t) {\n\t\t\t\tsetMapData(cachedEntry.mapData);\n\t\t\t\tsetIsLoading(false);\n\t\t\t\tsetError(undefined);\n\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tif (!memoizedOptions) {\n\t\t\tsetError(new Error('useMapData requires options if not use within a MapDataProvider or MapView component.'));\n\t\t\treturn;\n\t\t}\n\t\t// If all else fails, fetch new data\n\t\tfetchMapData(memoizedOptions);\n\t}, [fetchMapData, getCache, memoizedOptions]);\n\n\tuseEffect(() => {\n\t\tconst cachedEntry = getCache?.();\n\t\tif (mapData != null && (cachedEntry == null || cachedEntry.mapData.mapId === mapData.mapId)) {\n\t\t\t// Only overwrite the context cache with new data if the mapData has the same mapId\n\t\t\t// In this case, we likely refetched due to an option change\n\t\t\tsetCache?.({ mapData, options: memoizedOptions || ({} as TGetMapDataOptions) });\n\t\t}\n\t}, [mapData, memoizedOptions, getCache, setCache]);\n\n\treturn { mapData, isLoading, error };\n}\n", "/* eslint-disable no-console*/\nexport const MI_DEBUG_KEY = 'mi-debug';\nexport const MI_ERROR_LABEL = '[MappedinJS]';\n\nexport enum E_SDK_LOG_LEVEL {\n\tLOG,\n\tWARN,\n\tERROR,\n\tSILENT,\n}\n\nexport function createLogger(name = '', { prefix = MI_ERROR_LABEL } = {}) {\n\tconst label = `${prefix}${name ? `-${name}` : ''}`;\n\n\tconst rnDebug = (type: 'log' | 'warn' | 'error', args: any[]) => {\n\t\tif (typeof window !== 'undefined' && (window as any).rnDebug) {\n\t\t\tconst processed = args.map(arg => {\n\t\t\t\tif (arg instanceof Error && arg.stack) {\n\t\t\t\t\treturn `${arg.message}\\n${arg.stack}`;\n\t\t\t\t}\n\n\t\t\t\treturn arg;\n\t\t\t});\n\t\t\t(window as any).rnDebug(`${name} ${type}: ${processed.join(' ')}`);\n\t\t}\n\t};\n\n\treturn {\n\t\tlogState: process.env.NODE_ENV === 'test' ? E_SDK_LOG_LEVEL.SILENT : E_SDK_LOG_LEVEL.LOG,\n\n\t\tlog(...args: any[]) {\n\t\t\tif (this.logState <= E_SDK_LOG_LEVEL.LOG) {\n\t\t\t\tconsole.log(label, ...args);\n\t\t\t\trnDebug('log', args);\n\t\t\t}\n\t\t},\n\n\t\twarn(...args: any[]) {\n\t\t\tif (this.logState <= E_SDK_LOG_LEVEL.WARN) {\n\t\t\t\tconsole.warn(label, ...args);\n\t\t\t\trnDebug('warn', args);\n\t\t\t}\n\t\t},\n\n\t\terror(...args: any[]) {\n\t\t\tif (this.logState <= E_SDK_LOG_LEVEL.ERROR) {\n\t\t\t\tconsole.error(label, ...args);\n\n\t\t\t\trnDebug('error', args);\n\t\t\t}\n\t\t},\n\n\t\t// It's a bit tricky to prepend [MappedinJs] to assert and time because of how the output is structured in the console, so it is left out for simplicity\n\t\tassert(...args: any[]) {\n\t\t\tconsole.assert(...args);\n\t\t},\n\n\t\ttime(label: string) {\n\t\t\tconsole.time(label);\n\t\t},\n\n\t\ttimeEnd(label: string) {\n\t\t\tconsole.timeEnd(label);\n\t\t},\n\t\tsetLevel(level: E_SDK_LOG_LEVEL) {\n\t\t\tif (E_SDK_LOG_LEVEL.LOG <= level && level <= E_SDK_LOG_LEVEL.SILENT) {\n\t\t\t\tthis.logState = level;\n\t\t\t}\n\t\t},\n\t};\n}\n\nconst Logger = createLogger();\nexport function setLoggerLevel(level: E_SDK_LOG_LEVEL) {\n\tif (E_SDK_LOG_LEVEL.LOG <= level && level <= E_SDK_LOG_LEVEL.SILENT) {\n\t\tLogger.logState = level;\n\t}\n}\n\nexport default Logger;\n", "import { useRef, type DependencyList } from 'react';\nimport equal from 'fast-deep-equal';\n\n/**\n * Deep comparison memoization hook similar to useMemo but with deep equality check\n * @param factory Function that returns the value to memoize\n * @param deps Dependency list to deeply compare for changes\n * @returns Memoized value that only changes when dependencies deeply change\n * @internal\n */\nexport function useMemoDeep<T>(factory: () => T, deps: DependencyList): T {\n\tconst valueRef = useRef<T>();\n\tconst depsRef = useRef<DependencyList>();\n\n\tif (!equal(deps, depsRef.current)) {\n\t\tvalueRef.current = factory();\n\t\tdepsRef.current = deps;\n\t}\n\n\treturn valueRef.current!;\n}\n", "import { useCallback, useContext, useEffect } from 'react';\nimport type { TMapDataEvents } from '@mappedin/mappedin-js';\nimport { MapDataContext } from '../MapDataProvider';\n\n/**\n * Hook to subscribe to an event on the MapData.\n *\n * Must be used within a {@link MapDataProvider} or {@link MapView} component.\n * @throws If used outside of a {@link MapDataProvider} or {@link MapView} component.\n *\n * @param event - The event to listen for.\n * @param callback - The callback to call when the event is triggered.\n *\n * @category Hooks\n *\n * @example\n * ```tsx\n * useMapDataEvent('language-change', event => {\n * console.log(`Map language changed to ${event.name} (${event.code})`);\n * });\n * ```\n */\nexport function useMapDataEvent<T extends keyof TMapDataEvents>(\n\tevent: T,\n\tcallback: (\n\t\tpayload: TMapDataEvents[T] extends {\n\t\t\tdata: null;\n\t\t}\n\t\t\t? TMapDataEvents[T]['data']\n\t\t\t: TMapDataEvents[T],\n\t) => void,\n) {\n\tconst { getCache: getCachedMapData } = useContext(MapDataContext);\n\tconst handleCallback = useCallback(payload => callback(payload), [callback]);\n\n\tuseEffect(() => {\n\t\tconst mapData = getCachedMapData?.()?.mapData;\n\t\tif (mapData == null) {\n\t\t\tthrow new Error('useMapDataEvent must be used within a MapDataProvider or MapView component.');\n\t\t}\n\n\t\tmapData.on(event, handleCallback);\n\n\t\treturn () => {\n\t\t\tif (mapData == null) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tmapData.off(event, handleCallback);\n\t\t};\n\t}, [getCachedMapData, event, handleCallback]);\n}\n", "import type { ReactNode } from 'react';\nimport React, {\n\tuseCallback,\n\tuseEffect,\n\tuseMemo,\n\tuseRef,\n\tuseState,\n\tforwardRef,\n\tuseImperativeHandle,\n\tcreateContext,\n} from 'react';\nimport { useMemoDeep } from './hooks/useMemoDeep';\nimport { show3dMap } from '@mappedin/mappedin-js';\nimport type { MapView as MapViewJS, MapData, TShow3DMapOptions } from '@mappedin/mappedin-js';\nimport Logger from '@packages/internal/common/Mappedin.Logger';\nimport { MapDataProvider } from './MapDataProvider';\nimport type { ExtensionRegistry, MapViewExtensionName } from '@packages/internal/common/extensions';\n\ntype MapViewContextType = {\n\tmapView?: MapViewJS;\n\textensions: ExtensionRegistry;\n};\n\nexport const MapViewContext = createContext<MapViewContextType>({\n\tmapView: undefined,\n\textensions: {},\n});\n\nconst DEFAULT_STYLE: React.CSSProperties = {\n\twidth: '100%',\n\theight: '100%',\n\tposition: 'relative',\n};\n\n/**\n * TypeScript can't seem to handle these parameters when wrapped in forwardRef, but it's unlikely\n * that we'll ever add more parameters to show3dMap.\n */\n// type ParamsArray = Parameters<typeof show3dMap>;\n// type StreamAgentParameterNames = ['el', 'mapData', 'options'];\n\n/**\n * @interface\n */\nexport type MapViewProps = {\n\tmapData: MapData;\n\toptions?: TShow3DMapOptions;\n\t/**\n\t * The fallback content to render while the map is loading.\n\t */\n\tfallback?: ReactNode;\n};\n/**\n * MapView component.\n *\n * The root component which renders the map and provides context to the hooks and child components.\n *\n * @category Components\n *\n * @example\n * ```tsx\n * const { mapData } = useMapData({ key: '...', secret: '...', mapId: '...' });\n * return (\n * <MapView mapData={mapData}>\n * <Marker target={...} />\n * </MapView>\n * )\n * ```\n */\nexport const MapView = forwardRef<\n\tMapViewJS | undefined,\n\tMapViewProps & Omit<React.ComponentPropsWithoutRef<'div'>, keyof MapViewProps>\n>((props, ref) => {\n\tconst { mapData, options, style, fallback, children, ...rest } = props;\n\n\t// Persistent reference across renders\n\tconst thisRef = useRef<{\n\t\tmapView?: MapViewJS;\n\t\textensions: ExtensionRegistry;\n\t}>({\n\t\textensions: {}, // store the extensions in the ref so we don't re-render children when they change\n\t}).current;\n\tconst [isLoading, setIsLoading] = useState(true);\n\tconst [isMounted, setIsMounted] = useState(false);\n\tconst mapEl = useRef<HTMLDivElement>(null);\n\n\tconst memoizedMapData = useMemo(() => mapData, [mapData]);\n\tconst memoizedOptions = useMemoDeep(() => options, [options]);\n\n\t// Expose the mapView instance via ref\n\tuseImperativeHandle(ref, () => thisRef.mapView);\n\n\tconst contextValue: MapViewContextType = useMemo(() => {\n\t\treturn {\n\t\t\tmapView: thisRef.mapView,\n\t\t\textensions: thisRef.extensions,\n\t\t} satisfies MapViewContextType;\n\t}, [memoizedMapData, thisRef.mapView, thisRef.extensions]);\n\n\tconst cleanUpExtensions = useCallback((extensions: ExtensionRegistry) => {\n\t\ttry {\n\t\t\tconst extensionNames = Object.keys(extensions) as MapViewExtensionName[];\n\t\t\tfor (const extensionName of extensionNames) {\n\t\t\t\tconst extensionEntry = extensions[extensionName];\n\t\t\t\tif (extensionEntry) {\n\t\t\t\t\textensionEntry.onDeregister(extensionEntry.instance);\n\n\t\t\t\t\tdelete extensions[extensionName];\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tLogger.error('Failed to clean up extensions', error);\n\t\t}\n\n\t\treturn {};\n\t}, []);\n\n\tconst destroyMapView = useCallback((mapView?: MapViewJS) => {\n\t\tconst mapViewToDestroy = mapView || thisRef.mapView;\n\n\t\ttry {\n\t\t\tmapViewToDestroy?.destroy?.();\n\t\t} catch (error) {\n\t\t\tLogger.error('Failed to destroy MapView', error);\n\t\t}\n\n\t\t// Only clear ref and state if destroying the current instance\n\t\tif (!mapView) {\n\t\t\tthisRef.extensions = cleanUpExtensions(thisRef.extensions);\n\t\t\tthisRef.mapView = undefined;\n\t\t\tsetIsMounted(false);\n\t\t}\n\t}, []);\n\n\tuseEffect(() => {\n\t\tif (!memoizedMapData || !mapEl.current) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Clean up any existing MapView first\n\t\tdestroyMapView();\n\n\t\tlet cancelled = false;\n\t\tsetIsLoading(true);\n\t\tshow3dMap(mapEl.current, memoizedMapData, memoizedOptions)\n\t\t\t.then(mapView => {\n\t\t\t\tif (!cancelled) {\n\t\t\t\t\t// Just in case extensions were left over from a previous render\n\t\t\t\t\tthisRef.mapView = mapView;\n\t\t\t\t\tsetIsMounted(true);\n\t\t\t\t} else {\n\t\t\t\t\t// Component was unmounted during creation, destroy immediately\n\t\t\t\t\tdestroyMapView(mapView);\n\t\t\t\t}\n\t\t\t})\n\t\t\t.catch(err => {\n\t\t\t\tLogger.error('Failed to render MapView', err);\n\t\t\t})\n\t\t\t.finally(() => {\n\t\t\t\tif (!cancelled) {\n\t\t\t\t\tsetIsLoading(false);\n\t\t\t\t}\n\t\t\t});\n\n\t\treturn () => {\n\t\t\tcancelled = true;\n\t\t\t// Destroy the mapView if has already been mounted\n\t\t\tif (thisRef.mapView) {\n\t\t\t\tdestroyMapView();\n\t\t\t}\n\t\t};\n\t}, [memoizedMapData, memoizedOptions, destroyMapView]);\n\n\treturn (\n\t\t<MapDataProvider mapData={memoizedMapData}>\n\t\t\t<MapViewContext.Provider value={contextValue}>\n\t\t\t\t<div data-testid=\"mappedin-map\" ref={mapEl} style={{ ...DEFAULT_STYLE, ...style }} {...rest} />\n\t\t\t\t{isLoading ? <>{fallback}</> : isMounted ? children : null}\n\t\t\t</MapViewContext.Provider>\n\t\t</MapDataProvider>\n\t);\n});\n", "import { useCallback, useContext, useEffect } from 'react';\nimport { MapViewNullError } from '../errors';\nimport type { TEvents } from '@mappedin/mappedin-js';\nimport { MapViewContext } from '../MapView';\n\n/**\n * Hook to subscribe to an event on the {@link MapView}.\n *\n * Must be used within a {@link MapView} component.\n * @throws If used outside of a {@link MapView} component.\n *\n * @param event - The event to listen for.\n * @param callback - The callback to call when the event is triggered.\n *\n * @category Hooks\n *\n * @example\n * ```tsx\n * useMapViewEvent('click', event => {\n * const { coordinate } = event;\n * const { latitude, longitude } = coordinate;\n * console.log(`Map was clicked at ${latitude}, ${longitude}`);\n * });\n * ```\n */\nexport function useMapViewEvent<T extends keyof TEvents>(\n\tevent: T,\n\tcallback: (\n\t\tpayload: TEvents[T] extends {\n\t\t\tdata: null;\n\t\t}\n\t\t\t? TEvents[T]['data']\n\t\t\t: TEvents[T],\n\t) => void,\n) {\n\tconst { mapView } = useContext(MapViewContext);\n\n\tconst handleCallback = useCallback(payload => callback(payload), [callback]);\n\n\tuseEffect(() => {\n\t\tif (mapView == null) {\n\t\t\tthrow new MapViewNullError('useMapViewEvent');\n\t\t}\n\n\t\tmapView.on(event, handleCallback);\n\n\t\treturn () => {\n\t\t\tif (mapView == null) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tmapView.off(event, handleCallback);\n\t\t};\n\t}, [mapView, event, callback]);\n}\n", "export class MapViewNullError extends Error {\n\tconstructor(name: string) {\n\t\tsuper(`${name} must be used within a MapView component.`);\n\t}\n}\n", "import type { MapViewExtension, MapViewExtensionName } from '@packages/internal/common/extensions';\nimport { MapViewContext } from '../MapView';\nimport { useCallback, useContext } from 'react';\n\ntype MapViewExtensionOptions<T extends MapViewExtension<unknown>> = {\n\t/**\n\t * Callback to be fired when the extension is registered.\n\t * This will not be called on subsequent calls to register until the extension is deregistered again.\n\t **/\n\tonRegister: () => T;\n\t/**\n\t * Callback to be fired when the extension is deregistered.\n\t * This will not be called if the extension is not registered.\n\t **/\n\tonDeregister: (extension: T) => void;\n};\n\ntype MapViewExtensionResult<T extends MapViewExtension<unknown>> = {\n\t/**\n\t * Register the extension or return the existing instance if it is already registered.\n\t */\n\tregister: () => T;\n\t/**\n\t * Deregister the extension.\n\t */\n\tderegister: () => void;\n};\n\n/**\n * @internal\n * Register an extension to the mapView context.\n * @param name - The name of the extension.\n * @returns An object with a register and deregister function.\n */\nexport function useMapViewExtension<T extends MapViewExtension<unknown> = MapViewExtension<unknown>>(\n\tname: MapViewExtensionName,\n\toptions: MapViewExtensionOptions<T>,\n): MapViewExtensionResult<T> {\n\tconst { extensions } = useContext(MapViewContext);\n\n\tif (!options?.onRegister || !options?.onDeregister) {\n\t\tthrow new Error('onRegister and onDeregister are required');\n\t}\n\n\tconst register = useCallback((): T => {\n\t\tconst existingEntry = extensions[name];\n\t\tlet instance = existingEntry?.instance;\n\n\t\tif (!instance) {\n\t\t\tinstance = options.onRegister();\n\t\t\textensions[name] = {\n\t\t\t\tinstance,\n\t\t\t\tonDeregister: options.onDeregister as (extension: MapViewExtension<unknown>) => void,\n\t\t\t};\n\t\t}\n\n\t\treturn instance as T;\n\t}, [extensions, name, options.onRegister]);\n\n\tconst deregister = useCallback(() => {\n\t\tconst extensionEntry = extensions[name];\n\t\tif (extensionEntry) {\n\t\t\textensionEntry.onDeregister(extensionEntry.instance as T);\n\t\t\tdelete extensions[name];\n\t\t}\n\t}, [extensions, name, options.onDeregister]);\n\n\treturn {\n\t\tregister,\n\t\tderegister,\n\t};\n}\n", "import { useContext, useEffect, useRef, forwardRef, useImperativeHandle, useState } from 'react';\nimport type { TupleToObjectWithPropNames } from './type-utils';\nimport { MapViewNullError } from './errors';\nimport { useMemoDeep } from './hooks/useMemoDeep';\nimport { useUpdateEffect } from './hooks/useUpdateEffect';\nimport type { MapView, Path as PathJS } from '@mappedin/mappedin-js';\nimport { MapViewContext } from './MapView';\n\ntype ParamsArray = Parameters<MapView['Paths']['add']>;\n\ntype StreamAgentParameterNames = ['coordinate', 'options'];\n\n/**\n * @interface\n */\nexport type PathProps = TupleToObjectWithPropNames<ParamsArray, StreamAgentParameterNames> & {\n\tonDrawComplete?: () => void;\n};\n\n/**\n * Path component.\n *\n * A Path indicates a route on the map.\n *\n * @category Components\n *\n * @example\n * ```tsx\n * const space1 = mapData.getByType('space')[0];\n * const space2 = mapData.getByType('space')[1];\n * const directions = mapView.getDirections(space1, space2);\n *\n * return directions ? <Path coordinate={directions.coordinates} options={{ color: 'blue' }} /> : null;\n * ```\n */\nexport const Path = forwardRef<PathJS | undefined, PathProps>((props, ref) => {\n\tconst { mapView } = useContext(MapViewContext);\n\tconst pathRef = useRef<PathJS>();\n\tconst memoizedOptions = useMemoDeep(() => props.options, [props.options]);\n\tconst [pathReady, setPathReady] = useState(false);\n\n\t// Expose the path instance via ref\n\tuseImperativeHandle(ref, () => pathRef.current, [pathReady]);\n\n\tuseEffect(() => {\n\t\tif (mapView == null) {\n\t\t\tthrow new MapViewNullError('Path');\n\t\t}\n\n\t\tconst path = mapView.Paths.add(props.coordinate, memoizedOptions);\n\t\tpath.animation.then(() => {\n\t\t\t// TODO: this fires when the path is destroyed before the animation is complete\n\t\t\t// our animation should have a reject/resolve to handle this, or implement the CancelablePromise from animateState\n\t\t\tprops.onDrawComplete?.();\n\t\t});\n\n\t\tpathRef.current = path;\n\t\tsetPathReady(true);\n\t\treturn () => {\n\t\t\tif (pathRef.current) {\n\t\t\t\tmapView.Paths.remove(pathRef.current);\n\t\t\t}\n\t\t\tsetPathReady(false);\n\t\t};\n\t}, [mapView, props.coordinate]);\n\n\t// Update options when they change (skip initial render)\n\tuseUpdateEffect(() => {\n\t\tif (pathRef.current && memoizedOptions) {\n\t\t\tmapView?.updateState(pathRef.current, memoizedOptions);\n\t\t}\n\t}, [memoizedOptions]);\n\n\treturn null;\n});\n", "import { useEffect, useRef } from 'react';\n\n/**\n * A custom hook that behaves like useEffect but skips the initial render.\n * This is useful for update effects that should only run when dependencies change,\n * not on the initial mount.\n *\n * @param effect - The effect function to run\n * @param deps - The dependency array\n * @internal\n */\nexport function useUpdateEffect(effect: React.EffectCallback, deps: React.DependencyList): void {\n\tconst isInitialRender = useRef(true);\n\n\tuseEffect(() => {\n\t\tif (isInitialRender.current) {\n\t\t\tisInitialRender.current = false;\n\t\t\treturn;\n\t\t}\n\n\t\treturn effect();\n\t}, deps);\n}\n", "import { useContext, useEffect } from 'react';\nimport type { TupleToObjectWithPropNames } from './type-utils';\nimport { MapViewNullError } from './errors';\nimport type { MapView } from '@mappedin/mappedin-js';\nimport { useMemoDeep } from './hooks/useMemoDeep';\nimport { MapViewContext } from './MapView';\n\ntype ParamsArray = Parameters<MapView['Navigation']['draw']>;\n\ntype StreamAgentParameterNames = ['directions', 'options'];\n\n/**\n * @interface\n */\nexport type NavigationProps = TupleToObjectWithPropNames<ParamsArray, StreamAgentParameterNames> & {\n\tonDrawComplete?: () => void;\n};\n\n/**\n * Navigation component.\n *\n * Navigation draws a route on the map with pre-defined Markers for connections and the start and end points.\n *\n * @category Components\n *\n * @example\n * ```tsx\n * const space1 = mapData.getByType('space')[0];\n * const space2 = mapData.getByType('space')[1];\n * const directions = mapView.getDirections(space1, space2);\n *\n * return directions ? <Navigation directions={directions} /> : null;\n * ```\n */\nexport function Navigation(props: NavigationProps) {\n\tconst { mapView } = useContext(MapViewContext);\n\tconst memoizedOptions = useMemoDeep(() => props.options, [props.options]);\n\n\tuseEffect(() => {\n\t\tif (mapView == null) {\n\t\t\tthrow new MapViewNullError('Navigation');\n\t\t}\n\n\t\tmapView.Navigation.draw(props.directions, memoizedOptions).then(() => {\n\t\t\tprops.onDrawComplete?.();\n\t\t});\n\n\t\treturn () => {\n\t\t\tmapView.Navigation.clear();\n\t\t};\n\t}, [mapView, props.directions, memoizedOptions]);\n\n\treturn null;\n}\n", "import { useContext, useEffect, useRef, forwardRef, useImperativeHandle, useState } from 'react';\nimport type { TupleToObjectWithPropNames } from './type-utils';\nimport { useMemoDeep } from './hooks/useMemoDeep';\nimport { useUpdateEffect } from './hooks/useUpdateEffect';\nimport type { MapView, Shape as ShapeJS } from '@mappedin/mappedin-js';\nimport { MapViewContext } from './MapView';\n\ntype ParamsArray = Parameters<MapView['Shapes']['add']>;\n\ntype StreamAgentParameterNames = ['geometry', 'style', 'floor'];\n\n/**\n * @interface\n */\nexport type ShapeProps = TupleToObjectWithPropNames<ParamsArray, StreamAgentParameterNames>;\n\n/**\n * Shape component.\n *\n * A Shape is a custom geometry on the map created from a GeoJSON feature collection.\n *\n * @category Components\n *\n * @example\n * ```tsx\n * <Shape geometry={geojson} style={{ color: 'blue', height: 2 }} />\n * ```\n */\nexport const Shape = forwardRef<ShapeJS | undefined, ShapeProps>((props, ref) => {\n\tconst { mapView } = useContext(MapViewContext);\n\tconst shapeRef = useRef<ShapeJS>();\n\tconst memoizedStyle = useMemoDeep(() => props.style, [props.style]);\n\tconst [shapeReady, setShapeReady] = useState(false);\n\n\t// Expose the shape instance via ref\n\tuseImperativeHandle(ref, () => shapeRef.current, [shapeReady]);\n\n\tuseEffect(() => {\n\t\tif (mapView == null) {\n\t\t\tthrow new Error('MapView not initialized');\n\t\t}\n\t\tshapeRef.current = mapView.Shapes.add(props.geometry, props.style, props.floor);\n\t\tsetShapeReady(true);\n\n\t\treturn () => {\n\t\t\tif (mapView == null || shapeRef.current == null) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tmapView.Shapes.remove(shapeRef.current);\n\t\t\tsetShapeReady(false);\n\t\t};\n\t}, [mapView, props.geometry, props.style, props.floor]);\n\n\t// Update style when it changes (skip initial render)\n\tuseUpdateEffect(() => {\n\t\tif (shapeRef.current && memoizedStyle) {\n\t\t\tmapView?.updateState(shapeRef.current, memoizedStyle);\n\t\t}\n\t}, [memoizedStyle]);\n\n\treturn null;\n});\n", "import { useContext, useEffect, useRef, forwardRef, useImperativeHandle, useState } from 'react';\nimport type { TupleToObjectWithPropNames } from './type-utils';\nimport { MapViewNullError } from './errors';\nimport { useMemoDeep } from './hooks/useMemoDeep';\nimport { useUpdateEffect } from './hooks/useUpdateEffect';\nimport type { MapView, Model as ModelJS } from '@mappedin/mappedin-js';\nimport { MapViewContext } from './MapView';\n\ntype ParamsArray = Parameters<MapView['Models']['add']>;\n\ntype StreamAgentParameterNames = ['coordinate', 'url', 'options'];\n\n/**\n * @interface\n */\nexport type ModelProps = TupleToObjectWithPropNames<ParamsArray, StreamAgentParameterNames>;\n\n/**\n * Model component.\n *\n * A Model is a 3D model in GLTF or GLB format anchored to a Coordinate on the map.\n *\n * @category Components\n *\n * @example\n * ```tsx\n * <Model\n * coordinate={coordinate}\n * url={'/path/to/model.glb'}\n * options={{\n * scale: [0.01, 0.01, 0.01],\n * rotation: [90, 0, 0],\n * opacity: 0.5,\n * }}\n * />\n * ```\n */\nexport const Model = forwardRef<ModelJS | undefined, ModelProps>((props, ref) => {\n\tconst { mapView } = useContext(MapViewContext);\n\tconst modelRef = useRef<ModelJS>();\n\tconst memoizedOptions = useMemoDeep(() => props.options, [props.options]);\n\tconst [modelReady, setModelReady] = useState(false);\n\n\t// Expose the model instance via ref\n\tuseImperativeHandle(ref, () => modelRef.current, [modelReady]);\n\n\tuseEffect(() => {\n\t\tif (mapView == null) {\n\t\t\tthrow new MapViewNullError('Model');\n\t\t}\n\t\tmodelRef.current = mapView.Models.add(props.coordinate, props.url, memoizedOptions);\n\t\tsetModelReady(true);\n\t\treturn () => {\n\t\t\tif (mapView == null || modelRef.current == null) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tmapView.Models.remove(modelRef.current);\n\t\t\tsetModelReady(false);\n\t\t};\n\t}, [mapView, props.url]);\n\n\t// Update coordinate and options when they change (skip initial render)\n\tuseUpdateEffect(() => {\n\t\tif (modelRef.current) {\n\t\t\tmapView?.updateState(modelRef.current, {\n\t\t\t\tposition: props.coordinate,\n\t\t\t\t...memoizedOptions,\n\t\t\t});\n\t\t}\n\t}, [props.coordinate, memoizedOptions]);\n\n\treturn null;\n});\n", "import { useContext } from 'react';\nimport { MapViewNullError } from '../errors';\nimport type { MapData, MapView } from '@mappedin/mappedin-js';\nimport { MapViewContext } from '../MapView';\nimport { MapDataContext } from '../MapDataProvider';\n/**\n * Hook to get the MapData and MapView from the current MapView context.\n *\n * Must be used within a {@link MapView} component.\n * @throws If used outside of a {@link MapView} component.\n *\n * @category Hooks\n *\n * @example\n * ```tsx\n * const { mapData, mapView } = useMap();\n * ```\n */\nexport function useMap(): {\n\tmapData: MapData;\n\tmapView: MapView;\n} {\n\tconst { mapView } = useContext(MapViewContext);\n\tconst { getCache: getCachedMapData } = useContext(MapDataContext);\n\n\tif (!mapView) {\n\t\tthrow new MapViewNullError('useMap');\n\t}\n\n\treturn { mapData: getCachedMapData?.()?.mapData || mapView.getMapData(), mapView };\n}\n", "import type { PropsWithChildren } from 'react';\nimport React, {\n\tuseCallback,\n\tuseContext,\n\tuseEffect,\n\tuseMemo,\n\tuseRef,\n\tforwardRef,\n\tuseImperativeHandle,\n\tuseState,\n} from 'react';\nimport { createPortal } from 'react-dom';\nimport { MapViewNullError } from './errors';\nimport type { TupleToObjectWithPropNames } from './type-utils';\nimport { randomId } from '@packages/internal/common/random-id';\nimport { useMemoDeep } from './hooks/useMemoDeep';\nimport { useUpdateEffect } from './hooks/useUpdateEffect';\nimport type { MapView, TAnimationOptions, Marker as MarkerJS } from '@mappedin/mappedin-js';\nimport { MapViewContext } from './MapView';\n\ntype ParamsArray = Parameters<MapView['Markers']['add']>;\n\ntype StreamAgentParameterNames = ['target', 'contentHtml', 'options'];\n\n/**\n * @interface\n */\nexport type MarkerProps = Omit<TupleToObjectWithPropNames<ParamsArray, StreamAgentParameterNames>, 'contentHtml'>;\n\n/**\n * Marker component.\n *\n * A Marker is a 2D component anchored to a position on the map.\n * To animate the Marker when its target changes, see {@link AnimatedMarker}.\n *\n * @example\n * ```tsx\n * <Marker target={mapData.getByType('space')[0]}>\n * <div>Hello, world!</div>\n * </Marker>\n * ```\n *\n * @category Components\n */\nexport const Marker = forwardRef<MarkerJS | undefined, PropsWithChildren<MarkerProps>>((props, ref) => {\n\tconst { mapView } = useContext(MapViewContext);\n\tconst markerRef = useRef<MarkerJS>();\n\tconst [markerReady, setMarkerReady] = useState(false);\n\tconst memoizedOptions = useMemoDeep(() => props.options, [props.options]);\n\n\t// Expose the marker instance via ref\n\tuseImperativeHandle(ref, () => markerRef.current, [markerReady]);\n\n\tuseEffect(() => {\n\t\tif (mapView == null) {\n\t\t\tthrow new MapViewNullError('Marker');\n\t\t}\n\t\tmarkerRef.current = mapView.Markers.add(props.target, '', memoizedOptions);\n\t\tsetMarkerReady(true);\n\n\t\treturn () => {\n\t\t\tif (mapView == null || markerRef.current == null) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tmapView.Markers.remove(markerRef.current);\n\t\t\tsetMarkerReady(false);\n\t\t};\n\t}, [mapView, props.target]);\n\n\t// Update options when they change (skip initial render)\n\tuseUpdateEffect(() => {\n\t\tif (markerRef.current && memoizedOptions) {\n\t\t\tmapView?.updateState(markerRef.current, memoizedOptions);\n\t\t}\n\t}, [memoizedOptions]);\n\n\tif (mapView == null || markerRef.current == null) {\n\t\treturn null;\n\t}\n\n\treturn createPortal(props.children, markerRef.current.contentEl, markerRef.current.id);\n});\n\n/**\n * AnimatedMarker component.\n * @experimental\n *\n * A {@link Marker} component that animates between positions when its target changes.\n *\n * @example\n * ```tsx\n * <AnimatedMarker target={mapData.getByType('space')[0]} duration={1000}>\n * <div>Hello, world!</div>\n * </AnimatedMarker>\n * ```\n *\n * @category Components\n */\nexport const AnimatedMarker = forwardRef<MarkerJS | undefined, PropsWithChildren<MarkerProps & TAnimationOptions>>(\n\t(props, ref) => {\n\t\tconst { mapView } = useContext(MapViewContext);\n\t\tconst keyRef = useRef<string>(randomId());\n\t\tconst markerRef = useRef<MarkerJS>();\n\t\tconst [markerReady, setMarkerReady] = useState(false);\n\n\t\t// Store the initial target to avoid re-creating the marker\n\t\tconst initialTarget = useRef(props.target);\n\n\t\t// Forward the ref and also keep a local reference for animations\n\t\tuseImperativeHandle(ref, () => markerRef.current, [markerReady]);\n\n\t\t// Callback ref to track when the marker becomes available\n\t\tconst handleMarkerRef = useCallback((marker: MarkerJS | null) => {\n\t\t\tmarkerRef.current = marker || undefined;\n\t\t\tsetMarkerReady(!!marker);\n\t\t}, []);\n\n\t\tuseEffect(() => {\n\t\t\tif (mapView == null) {\n\t\t\t\tthrow new MapViewNullError('Marker');\n\t\t\t}\n\t\t\tif (markerRef.current && markerRef.current.target !== props.target) {\n\t\t\t\tconst { duration = 300, easing = 'linear' } = props;\n\t\t\t\tmapView.Markers.animateTo(markerRef.current, props.target, { duration, easing });\n\t\t\t}\n\n\t\t\treturn () => {\n\t\t\t\tsetMarkerReady(false);\n\t\t\t};\n\t\t}, [mapView, props.target]);\n\n\t\tconst propsWithoutAnimation = useMemo(\n\t\t\t() => ({ ...props, duration: undefined, easing: undefined }),\n\t\t\t[props.duration, props.easing],\n\t\t);\n\n\t\treturn (\n\t\t\t<Marker {...propsWithoutAnimation} key={keyRef.current} target={initialTarget.current} ref={handleMarkerRef} />\n\t\t);\n\t},\n);\n", "const SLICE_POSITIONS = [0, 4, 6, 8, 10] as const;\n\n/**\n * Returns a UUIDv4-like ID without relying on a CSPRNG as we don't need it for these purposes.\n * @hidden\n */\nexport const randomId = () => {\n\tconst array: number[] = new Array(16).fill(0);\n\tlet seed = Math.random() * 0x100000000;\n\n\tfor (let i = 0; i < array.length; i++) {\n\t\tif (i > 0 && (i & 0x03) === 0) {\n\t\t\tseed = Math.random() * 0x100000000;\n\t\t}\n\t\tarray[i] = (seed >>> ((i & 0x03) << 3)) & 0xff;\n\t}\n\tconst hexArray = array.map(n => n.toString(16).padStart(2, '0'));\n\t// UUID's 3rd segment must start with a 4\n\n\thexArray[6] = '4' + hexArray[6][1];\n\t// UUID's 4th segment (for variant 1) must be an 8, 9, a or b\n\t// (due to needing the leading 2 bits in binary to be 10).\n\thexArray[8] = ['8', '9', 'a', 'b'].includes(hexArray[7][0]) ? hexArray[7] : 'a' + hexArray[7][1];\n\n\treturn SLICE_POSITIONS.map((v, i) =>\n\t\thexArray.slice(v, i === SLICE_POSITIONS.length - 1 ? undefined : SLICE_POSITIONS[i + 1]).join(''),\n\t).join('-');\n};\n\nexport function cyrb53(str: string, seed = 0): number {\n\tlet h1 = 0xdeadbeef ^ seed;\n\tlet h2 = 0x41c6ce57 ^ seed;\n\tfor (let i = 0, ch; i < str.length; i++) {\n\t\tch = str.charCodeAt(i);\n\t\th1 = Math.imul(h1 ^ ch, 2654435761);\n\t\th2 = Math.imul(h2 ^ ch, 1597334677);\n\t}\n\n\th1 = Math.imul(h1 ^ (h1 >>> 16), 2246822507) ^ Math.imul(h2 ^ (h2 >>> 13), 3266489909);\n\th2 = Math.imul(h2 ^ (h2 >>> 16), 2246822507) ^ Math.imul(h1 ^ (h1 >>> 13), 3266489909);\n\n\treturn 4294967296 * (2097151 & h2) + (h1 >>> 0);\n}\n\nlet counter = 0;\nexport function shortId() {\n\t// Hybrid ID generation: timestamp base36 + counter\n\tconst base = Date.now().toString(36);\n\treturn `${base}${(++counter).toString(36)}`;\n}\n", "import { forwardRef, useContext, useEffect, useImperativeHandle, useRef, useState } from 'react';\nimport { MapViewNullError } from './errors';\nimport type { TupleToObjectWithPropNames } from './type-utils';\nimport { useMemoDeep } from './hooks/useMemoDeep';\nimport { useUpdateEffect } from './hooks/useUpdateEffect';\nimport type { MapView, Label as LabelJS } from '@mappedin/mappedin-js';\nimport { MapViewContext } from './MapView';\n\ntype ParamsArray = Parameters<MapView['Labels']['add']>;\n\ntype StreamAgentParameterNames = ['target', 'text', 'options'];\n\n/**\n * @interface\n */\nexport type LabelProps = TupleToObjectWithPropNames<ParamsArray, StreamAgentParameterNames>;\n\n/**\n * Label component.\n *\n * A Label is a 2D text label anchored to a position on the map.\n *\n * @category Components\n *\n * @example\n * ```tsx\n * <Label target={mapData.getByType('space')[0]} text={\"Hello, world!\"} />\n * ```\n */\nexport const Label = forwardRef<LabelJS | undefined, LabelProps>((props, ref) => {\n\tconst { mapView } = useContext(MapViewContext);\n\tconst labelRef = useRef<LabelJS>();\n\tconst [isLabelReady, setIsLabelReady] = useState(false);\n\tconst memoizedOptions = useMemoDeep(() => props.options, [props.options]);\n\n\t// Expose the label instance via ref\n\tuseImperativeHandle(ref, () => labelRef.current, [isLabelReady]);\n\n\t// Only create/destroy label when target changes\n\tuseEffect(() => {\n\t\tif (mapView == null) {\n\t\t\tthrow new MapViewNullError('Label');\n\t\t}\n\t\tlabelRef.current = mapView.Labels.add(props.target, props.text, memoizedOptions);\n\t\tsetIsLabelReady(true);\n\n\t\treturn () => {\n\t\t\tif (mapView == null || labelRef.current == null) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tmapView.Labels.remove(labelRef.current);\n\t\t\tsetIsLabelReady(false);\n\t\t};\n\t}, [mapView, props.target]); // Only depend on mapView and target\n\n\t// Update text and options when they change (skip initial render)\n\tuseUpdateEffect(() => {\n\t\tif (labelRef.current) {\n\t\t\tmapView?.updateState(labelRef.current, {\n\t\t\t\ttext: props.text,\n\t\t\t\t...memoizedOptions,\n\t\t\t});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AqB,UAAAC,UAAQ,YAAAC,iBAAgB;AA6BlF,IAAM,QAAQC,YAA4C,CAAC,OAAO,QAAQ;AAChF,QAAM,EAAE,QAAQ,IAAIC,aAAW,cAAc;AAC7C,QAAM,WAAWC,SAAgB;AACjC,QAAM,CAAC,cAAc,eAAe,IAAIC,UAAS,KAAK;AACtD,QAAM,kBAAkB,YAAY,MAAM,MAAM,SAAS,CAAC,MAAM,OAAO,CAAC;AAGxE,EAAAC,qBAAoB,KAAK,MAAM,SAAS,SAAS,CAAC,YAAY,CAAC;AAG/D,EAAAC,YAAU,MAAM;AACf,QAAI,WAAW,MAAM;AACpB,YAAM,IAAI,iBAAiB,OAAO;AAAA,IACnC;AACA,aAAS,UAAU,QAAQ,OAAO,IAAI,MAAM,QAAQ,MAAM,MAAM,eAAe;AAC/E,oBAAgB,IAAI;AAEpB,WAAO,MAAM;AACZ,UAAI,WAAW,QAAQ,SAAS,WAAW,MAAM;AAChD;AAAA,MACD;AACA,cAAQ,OAAO,OAAO,SAAS,OAAO;AACtC,sBAAgB,KAAK;AAAA,IACtB;AAAA,EACD,GAAG,CAAC,SAAS,MAAM,MAAM,CAAC;AAG1B,kBAAgB,MAAM;AACrB,QAAI,SAAS,SAAS;AACrB,eAAS,YAAY,SAAS,SAAS;AAAA,QACtC,MAAM,MAAM;AAAA,QACZ,GAAG;AAAA,MACJ,CAAC;AAAA,IACF;AAAA,EACD,GAAG,CAAC,MAAM,MAAM,eAAe,CAAC;AAEhC,SAAO;AACR,CAAC;",
|
|
6
|
+
"names": ["equal", "import_fast_deep_equal", "useCallback", "useRef", "label", "useRef", "useRef", "equal", "useRef", "useCallback", "options", "equal", "useCallback", "useContext", "useEffect", "useContext", "useCallback", "useEffect", "React", "useCallback", "useEffect", "useMemo", "useRef", "useState", "createContext", "createContext", "useRef", "useState", "useMemo", "useCallback", "useEffect", "React", "useCallback", "useContext", "useEffect", "useContext", "useCallback", "useEffect", "useCallback", "useContext", "useContext", "useCallback", "useContext", "useEffect", "useRef", "forwardRef", "useImperativeHandle", "useState", "useEffect", "useRef", "useRef", "useEffect", "forwardRef", "useContext", "useRef", "useState", "useImperativeHandle", "useEffect", "useContext", "useEffect", "useContext", "useEffect", "useContext", "useEffect", "useRef", "forwardRef", "useImperativeHandle", "useState", "forwardRef", "useContext", "useRef", "useState", "useImperativeHandle", "useEffect", "useContext", "useEffect", "useRef", "forwardRef", "useImperativeHandle", "useState", "forwardRef", "useContext", "useRef", "useState", "useImperativeHandle", "useEffect", "useContext", "useContext", "React", "useCallback", "useContext", "useEffect", "useMemo", "useRef", "forwardRef", "useImperativeHandle", "useState", "forwardRef", "useContext", "useRef", "useState", "useImperativeHandle", "useEffect", "useCallback", "useMemo", "React", "forwardRef", "useContext", "useEffect", "useImperativeHandle", "useRef", "useState", "forwardRef", "useContext", "useRef", "useState", "useImperativeHandle", "useEffect"]
|
|
7
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mappedin/react-sdk",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.1.0",
|
|
4
|
+
"homepage": "https://developer.mappedin.com/",
|
|
4
5
|
"private": false,
|
|
5
6
|
"main": "lib/esm/index.js",
|
|
6
7
|
"module": "lib/esm/index.js",
|
|
@@ -13,26 +14,25 @@
|
|
|
13
14
|
"THIRD_PARTY_LICENSES.txt"
|
|
14
15
|
],
|
|
15
16
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"
|
|
17
|
+
"peerDependencies": {
|
|
18
|
+
"react": ">=16.8.0",
|
|
19
|
+
"react-dom": ">=16.8.0",
|
|
20
|
+
"@mappedin/mappedin-js": "^6.1.0"
|
|
21
|
+
},
|
|
22
|
+
"dependencies": {},
|
|
23
|
+
"devDependencies": {},
|
|
24
|
+
"volta": {
|
|
25
|
+
"extends": "../../package.json"
|
|
19
26
|
},
|
|
20
27
|
"scripts": {
|
|
21
|
-
"start": "
|
|
22
|
-
"build": "
|
|
23
|
-
"build:prod": "cross-env NODE_ENV=production
|
|
28
|
+
"start": "pnpm build && concurrently \"node scripts/build.mjs --watchChanges\" \"node scripts/start.mjs\"",
|
|
29
|
+
"build": "pnpm clean && tsc -b && node scripts/build.mjs",
|
|
30
|
+
"build:prod": "cross-env NODE_ENV=production pnpm build",
|
|
24
31
|
"types": "tsc -b",
|
|
25
32
|
"test": "NODE_ENV=test jest",
|
|
26
33
|
"test:cov": "NODE_ENV=test jest --coverage",
|
|
27
34
|
"clean": "rm -rf lib/** && rm -rf examples/dist/**",
|
|
28
|
-
"
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
"react-dom": "*"
|
|
33
|
-
},
|
|
34
|
-
"volta": {
|
|
35
|
-
"extends": "../../package.json"
|
|
36
|
-
},
|
|
37
|
-
"gitHead": "609f29c07d7898faf227cc8e5e780691d42016b5"
|
|
38
|
-
}
|
|
35
|
+
"version:ci": "pnpm version --no-commit-hooks --no-git-tag-version",
|
|
36
|
+
"docs": "pnpm build && typedoc --name \"Mappedin React SDK v$npm_package_version\""
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{C as Ye,D,G as W,J as Ke,M as _,O as je,Pa as z,Q as qe,Qa as Ze,S as Xe,U as We,X as Je,Z as P,c as _e,d as Ce,e as Ue,f as ve,g as Le,h as Oe,i as De,j as Pe,k as ze,l as Be,n as Fe,na as Y,o as ke,oa as Qe,p as He,t as Ve,u as V,w as G,z as Ge}from"./chunk-SHB4JBRW.js";import{a as T,j as H}from"./chunk-NTOUDKDJ.js";H();H();var B,J,U,K;function j(c,e=1/0,s=null){J||(J=new We(2,2,1,1)),U||(U=new qe({uniforms:{blitTexture:new Ze(c)},vertexShader:"\n varying vec2 vUv;\n void main(){\n vUv = uv;\n gl_Position = vec4(position.xy * 1.0,0.,.999999);\n }",fragmentShader:"\n uniform sampler2D blitTexture; \n varying vec2 vUv;\n\n void main(){ \n gl_FragColor = vec4(vUv.xy, 0, 1);\n \n #ifdef IS_SRGB\n gl_FragColor = LinearTosRGB( texture2D( blitTexture, vUv) );\n #else\n gl_FragColor = texture2D( blitTexture, vUv);\n #endif\n }"})),U.uniforms.blitTexture.value=c,U.defines.IS_SRGB=c.colorSpace==V,U.needsUpdate=!0,K||(K=new je(J,U),K.frustrumCulled=!1);let r=new Xe,t=new P;t.add(K),s===null&&(s=B=new Je({antialias:!1}));let i=Math.min(c.image.width,e),n=Math.min(c.image.height,e);s.setSize(i,n),s.clear(),s.render(t,r);let o=document.createElement("canvas"),a=o.getContext("2d");o.width=i,o.height=n,a.drawImage(s.domElement,0,0,i,n);let u=new Qe(o);return u.minFilter=c.minFilter,u.magFilter=c.magFilter,u.wrapS=c.wrapS,u.wrapT=c.wrapT,u.name=c.name,B&&(B.forceContextLoss(),B.dispose(),B=null),u}T(j,"decompress");var $e={POSITION:["byte","byte normalized","unsigned byte","unsigned byte normalized","short","short normalized","unsigned short","unsigned short normalized"],NORMAL:["byte normalized","short normalized"],TANGENT:["byte normalized","short normalized"],TEXCOORD:["byte","byte normalized","unsigned byte","short","short normalized","unsigned short"]},pe=class pe{constructor(){this.pluginCallbacks=[],this.register(function(e){return new ee(e)}),this.register(function(e){return new se(e)}),this.register(function(e){return new re(e)}),this.register(function(e){return new ie(e)}),this.register(function(e){return new oe(e)}),this.register(function(e){return new ae(e)}),this.register(function(e){return new te(e)}),this.register(function(e){return new ne(e)}),this.register(function(e){return new ce(e)}),this.register(function(e){return new ue(e)}),this.register(function(e){return new le(e)}),this.register(function(e){return new fe(e)}),this.register(function(e){return new he(e)})}register(e){return this.pluginCallbacks.indexOf(e)===-1&&this.pluginCallbacks.push(e),this}unregister(e){return this.pluginCallbacks.indexOf(e)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,s,r,t){let i=new $,n=[];for(let o=0,a=this.pluginCallbacks.length;o<a;o++)n.push(this.pluginCallbacks[o](i));i.setPlugins(n),i.write(e,s,t).catch(r)}parseAsync(e,s){let r=this;return new Promise(function(t,i){r.parse(e,t,i,s)})}};T(pe,"GLTFExporter");var q=pe,x={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,REPEAT:10497},Q="KHR_mesh_quantization",b={};b[Le]=x.NEAREST;b[Oe]=x.NEAREST_MIPMAP_NEAREST;b[De]=x.NEAREST_MIPMAP_LINEAR;b[Pe]=x.LINEAR;b[ze]=x.LINEAR_MIPMAP_NEAREST;b[Be]=x.LINEAR_MIPMAP_LINEAR;b[Ue]=x.CLAMP_TO_EDGE;b[Ce]=x.REPEAT;b[ve]=x.MIRRORED_REPEAT;var es={scale:"scale",position:"translation",quaternion:"rotation",morphTargetInfluences:"weights"},cs=new Ke,ss=12,us=1179937895,ls=2,ts=8,fs=1313821514,hs=5130562;function F(c,e){return c.length===e.length&&c.every(function(s,r){return s===e[r]})}T(F,"equalArray");function ps(c){return new TextEncoder().encode(c).buffer}T(ps,"stringToArrayBuffer");function ds(c){return F(c.elements,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}T(ds,"isIdentityMatrix");function gs(c,e,s){let r={min:new Array(c.itemSize).fill(Number.POSITIVE_INFINITY),max:new Array(c.itemSize).fill(Number.NEGATIVE_INFINITY)};for(let t=e;t<e+s;t++)for(let i=0;i<c.itemSize;i++){let n;c.itemSize>4?n=c.array[t*c.itemSize+i]:(i===0?n=c.getX(t):i===1?n=c.getY(t):i===2?n=c.getZ(t):i===3&&(n=c.getW(t)),c.normalized===!0&&(n=G.normalize(n,c.array))),r.min[i]=Math.min(r.min[i],n),r.max[i]=Math.max(r.max[i],n)}return r}T(gs,"getMinMax");function is(c){return Math.ceil(c/4)*4}T(is,"getPaddedBufferSize");function Z(c,e=0){let s=is(c.byteLength);if(s!==c.byteLength){let r=new Uint8Array(s);if(r.set(new Uint8Array(c)),e!==0)for(let t=c.byteLength;t<s;t++)r[t]=e;return r.buffer}return c}T(Z,"getPaddedArrayBuffer");function ns(){return typeof document>"u"&&typeof OffscreenCanvas<"u"?new OffscreenCanvas(1,1):document.createElement("canvas")}T(ns,"getCanvas");function rs(c,e){if(c.toBlob!==void 0)return new Promise(r=>c.toBlob(r,e));let s;return e==="image/jpeg"?s=.92:e==="image/webp"&&(s=.8),c.convertToBlob({type:e,quality:s})}T(rs,"getToBlobPromise");var de=class de{constructor(){this.plugins=[],this.options={},this.pending=[],this.buffers=[],this.byteOffset=0,this.buffers=[],this.nodeMap=new Map,this.skins=[],this.extensionsUsed={},this.extensionsRequired={},this.uids=new Map,this.uid=0,this.json={asset:{version:"2.0",generator:"THREE.GLTFExporter"}},this.cache={meshes:new Map,attributes:new Map,attributesNormalized:new Map,materials:new Map,textures:new Map,images:new Map}}setPlugins(e){this.plugins=e}async write(e,s,r={}){this.options=Object.assign({binary:!1,trs:!1,onlyVisible:!0,maxTextureSize:1/0,animations:[],includeCustomExtensions:!1},r),this.options.animations.length>0&&(this.options.trs=!0),this.processInput(e),await Promise.all(this.pending);let t=this,i=t.buffers,n=t.json;r=t.options;let o=t.extensionsUsed,a=t.extensionsRequired,u=new Blob(i,{type:"application/octet-stream"}),p=Object.keys(o),f=Object.keys(a);if(p.length>0&&(n.extensionsUsed=p),f.length>0&&(n.extensionsRequired=f),n.buffers&&n.buffers.length>0&&(n.buffers[0].byteLength=u.size),r.binary===!0){let m=new FileReader;m.readAsArrayBuffer(u),m.onloadend=function(){let l=Z(m.result),d=new DataView(new ArrayBuffer(ts));d.setUint32(0,l.byteLength,!0),d.setUint32(4,hs,!0);let h=Z(ps(JSON.stringify(n)),32),w=new DataView(new ArrayBuffer(ts));w.setUint32(0,h.byteLength,!0),w.setUint32(4,fs,!0);let M=new ArrayBuffer(ss),N=new DataView(M);N.setUint32(0,us,!0),N.setUint32(4,ls,!0);let k=ss+w.byteLength+h.byteLength+d.byteLength+l.byteLength;N.setUint32(8,k,!0);let g=new Blob([M,w,h,d,l],{type:"application/octet-stream"}),y=new FileReader;y.readAsArrayBuffer(g),y.onloadend=function(){s(y.result)}}}else if(n.buffers&&n.buffers.length>0){let m=new FileReader;m.readAsDataURL(u),m.onloadend=function(){let l=m.result;n.buffers[0].uri=l,s(n)}}else s(n)}serializeUserData(e,s){if(Object.keys(e.userData).length===0)return;let r=this.options,t=this.extensionsUsed;try{let i=JSON.parse(JSON.stringify(e.userData));if(r.includeCustomExtensions&&i.gltfExtensions){s.extensions===void 0&&(s.extensions={});for(let n in i.gltfExtensions)s.extensions[n]=i.gltfExtensions[n],t[n]=!0;delete i.gltfExtensions}Object.keys(i).length>0&&(s.extras=i)}catch(i){console.warn("THREE.GLTFExporter: userData of '"+e.name+"' won't be serialized because of JSON.stringify error - "+i.message)}}getUID(e,s=!1){if(this.uids.has(e)===!1){let t=new Map;t.set(!0,this.uid++),t.set(!1,this.uid++),this.uids.set(e,t)}return this.uids.get(e).get(s)}isNormalizedNormalAttribute(e){if(this.cache.attributesNormalized.has(e))return!1;let r=new D;for(let t=0,i=e.count;t<i;t++)if(Math.abs(r.fromBufferAttribute(e,t).length()-1)>5e-4)return!1;return!0}createNormalizedNormalAttribute(e){let s=this.cache;if(s.attributesNormalized.has(e))return s.attributesNormalized.get(e);let r=e.clone(),t=new D;for(let i=0,n=r.count;i<n;i++)t.fromBufferAttribute(r,i),t.x===0&&t.y===0&&t.z===0?t.setX(1):t.normalize(),r.setXYZ(i,t.x,t.y,t.z);return s.attributesNormalized.set(e,r),r}applyTextureTransform(e,s){let r=!1,t={};(s.offset.x!==0||s.offset.y!==0)&&(t.offset=s.offset.toArray(),r=!0),s.rotation!==0&&(t.rotation=s.rotation,r=!0),(s.repeat.x!==1||s.repeat.y!==1)&&(t.scale=s.repeat.toArray(),r=!0),r&&(e.extensions=e.extensions||{},e.extensions.KHR_texture_transform=t,this.extensionsUsed.KHR_texture_transform=!0)}buildMetalRoughTexture(e,s){if(e===s)return e;function r(l){return l.colorSpace===V?T(function(h){return h<.04045?h*.0773993808:Math.pow(h*.9478672986+.0521327014,2.4)},"SRGBToLinear"):T(function(h){return h},"LinearToLinear")}T(r,"getEncodingConversion"),console.warn("THREE.GLTFExporter: Merged metalnessMap and roughnessMap textures."),e instanceof Y&&(e=j(e)),s instanceof Y&&(s=j(s));let t=e?e.image:null,i=s?s.image:null,n=Math.max(t?t.width:0,i?i.width:0),o=Math.max(t?t.height:0,i?i.height:0),a=ns();a.width=n,a.height=o;let u=a.getContext("2d");u.fillStyle="#00ffff",u.fillRect(0,0,n,o);let p=u.getImageData(0,0,n,o);if(t){u.drawImage(t,0,0,n,o);let l=r(e),d=u.getImageData(0,0,n,o).data;for(let h=2;h<d.length;h+=4)p.data[h]=l(d[h]/256)*256}if(i){u.drawImage(i,0,0,n,o);let l=r(s),d=u.getImageData(0,0,n,o).data;for(let h=1;h<d.length;h+=4)p.data[h]=l(d[h]/256)*256}u.putImageData(p,0,0);let m=(e||s).clone();return m.source=new Ge(a),m.colorSpace=Ve,m.channel=(e||s).channel,e&&s&&e.channel!==s.channel&&console.warn("THREE.GLTFExporter: UV channels for metalnessMap and roughnessMap textures must match."),m}processBuffer(e){let s=this.json,r=this.buffers;return s.buffers||(s.buffers=[{byteLength:0}]),r.push(e),0}processBufferView(e,s,r,t,i){let n=this.json;n.bufferViews||(n.bufferViews=[]);let o;switch(s){case x.BYTE:case x.UNSIGNED_BYTE:o=1;break;case x.SHORT:case x.UNSIGNED_SHORT:o=2;break;default:o=4}let a=is(t*e.itemSize*o),u=new DataView(new ArrayBuffer(a)),p=0;for(let l=r;l<r+t;l++)for(let d=0;d<e.itemSize;d++){let h;e.itemSize>4?h=e.array[l*e.itemSize+d]:(d===0?h=e.getX(l):d===1?h=e.getY(l):d===2?h=e.getZ(l):d===3&&(h=e.getW(l)),e.normalized===!0&&(h=G.normalize(h,e.array))),s===x.FLOAT?u.setFloat32(p,h,!0):s===x.INT?u.setInt32(p,h,!0):s===x.UNSIGNED_INT?u.setUint32(p,h,!0):s===x.SHORT?u.setInt16(p,h,!0):s===x.UNSIGNED_SHORT?u.setUint16(p,h,!0):s===x.BYTE?u.setInt8(p,h):s===x.UNSIGNED_BYTE&&u.setUint8(p,h),p+=o}let f={buffer:this.processBuffer(u.buffer),byteOffset:this.byteOffset,byteLength:a};return i!==void 0&&(f.target=i),i===x.ARRAY_BUFFER&&(f.byteStride=e.itemSize*o),this.byteOffset+=a,n.bufferViews.push(f),{id:n.bufferViews.length-1,byteLength:0}}processBufferViewImage(e){let s=this,r=s.json;return r.bufferViews||(r.bufferViews=[]),new Promise(function(t){let i=new FileReader;i.readAsArrayBuffer(e),i.onloadend=function(){let n=Z(i.result),o={buffer:s.processBuffer(n),byteOffset:s.byteOffset,byteLength:n.byteLength};s.byteOffset+=n.byteLength,t(r.bufferViews.push(o)-1)}})}processAccessor(e,s,r,t){let i=this.json,n={1:"SCALAR",2:"VEC2",3:"VEC3",4:"VEC4",9:"MAT3",16:"MAT4"},o;if(e.array.constructor===Float32Array)o=x.FLOAT;else if(e.array.constructor===Int32Array)o=x.INT;else if(e.array.constructor===Uint32Array)o=x.UNSIGNED_INT;else if(e.array.constructor===Int16Array)o=x.SHORT;else if(e.array.constructor===Uint16Array)o=x.UNSIGNED_SHORT;else if(e.array.constructor===Int8Array)o=x.BYTE;else if(e.array.constructor===Uint8Array)o=x.UNSIGNED_BYTE;else throw new Error("THREE.GLTFExporter: Unsupported bufferAttribute component type: "+e.array.constructor.name);if(r===void 0&&(r=0),(t===void 0||t===1/0)&&(t=e.count),t===0)return null;let a=gs(e,r,t),u;s!==void 0&&(u=e===s.index?x.ELEMENT_ARRAY_BUFFER:x.ARRAY_BUFFER);let p=this.processBufferView(e,o,r,t,u),f={bufferView:p.id,byteOffset:p.byteOffset,componentType:o,count:t,max:a.max,min:a.min,type:n[e.itemSize]};return e.normalized===!0&&(f.normalized=!0),i.accessors||(i.accessors=[]),i.accessors.push(f)-1}processImage(e,s,r,t="image/png"){if(e!==null){let i=this,n=i.cache,o=i.json,a=i.options,u=i.pending;n.images.has(e)||n.images.set(e,{});let p=n.images.get(e),f=t+":flipY/"+r.toString();if(p[f]!==void 0)return p[f];o.images||(o.images=[]);let m={mimeType:t},l=ns();l.width=Math.min(e.width,a.maxTextureSize),l.height=Math.min(e.height,a.maxTextureSize);let d=l.getContext("2d");if(r===!0&&(d.translate(0,l.height),d.scale(1,-1)),e.data!==void 0){s!==Fe&&console.error("GLTFExporter: Only RGBAFormat is supported.",s),(e.width>a.maxTextureSize||e.height>a.maxTextureSize)&&console.warn("GLTFExporter: Image size is bigger than maxTextureSize",e);let w=new Uint8ClampedArray(e.height*e.width*4);for(let M=0;M<w.length;M+=4)w[M+0]=e.data[M+0],w[M+1]=e.data[M+1],w[M+2]=e.data[M+2],w[M+3]=e.data[M+3];d.putImageData(new ImageData(w,e.width,e.height),0,0)}else if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap)d.drawImage(e,0,0,l.width,l.height);else throw new Error("THREE.GLTFExporter: Invalid image type. Use HTMLImageElement, HTMLCanvasElement or ImageBitmap.");a.binary===!0?u.push(rs(l,t).then(w=>i.processBufferViewImage(w)).then(w=>{m.bufferView=w})):l.toDataURL!==void 0?m.uri=l.toDataURL(t):u.push(rs(l,t).then(w=>new FileReader().readAsDataURL(w)).then(w=>{m.uri=w}));let h=o.images.push(m)-1;return p[f]=h,h}else throw new Error("THREE.GLTFExporter: No valid image data found. Unable to process texture.")}processSampler(e){let s=this.json;s.samplers||(s.samplers=[]);let r={magFilter:b[e.magFilter],minFilter:b[e.minFilter],wrapS:b[e.wrapS],wrapT:b[e.wrapT]};return s.samplers.push(r)-1}processTexture(e){let r=this.options,t=this.cache,i=this.json;if(t.textures.has(e))return t.textures.get(e);i.textures||(i.textures=[]),e instanceof Y&&(e=j(e,r.maxTextureSize));let n=e.userData.mimeType;n==="image/webp"&&(n="image/png");let o={sampler:this.processSampler(e),source:this.processImage(e.image,e.format,e.flipY,n)};e.name&&(o.name=e.name),this._invokeAll(function(u){u.writeTexture&&u.writeTexture(e,o)});let a=i.textures.push(o)-1;return t.textures.set(e,a),a}processMaterial(e){let s=this.cache,r=this.json;if(s.materials.has(e))return s.materials.get(e);if(e.isShaderMaterial)return console.warn("GLTFExporter: THREE.ShaderMaterial not supported."),null;r.materials||(r.materials=[]);let t={pbrMetallicRoughness:{}};e.isMeshStandardMaterial!==!0&&e.isMeshBasicMaterial!==!0&&console.warn("GLTFExporter: Use MeshStandardMaterial or MeshBasicMaterial for best results.");let i=e.color.toArray().concat([e.opacity]);if(F(i,[1,1,1,1])||(t.pbrMetallicRoughness.baseColorFactor=i),e.isMeshStandardMaterial?(t.pbrMetallicRoughness.metallicFactor=e.metalness,t.pbrMetallicRoughness.roughnessFactor=e.roughness):(t.pbrMetallicRoughness.metallicFactor=.5,t.pbrMetallicRoughness.roughnessFactor=.5),e.metalnessMap||e.roughnessMap){let o=this.buildMetalRoughTexture(e.metalnessMap,e.roughnessMap),a={index:this.processTexture(o),channel:o.channel};this.applyTextureTransform(a,o),t.pbrMetallicRoughness.metallicRoughnessTexture=a}if(e.map){let o={index:this.processTexture(e.map),texCoord:e.map.channel};this.applyTextureTransform(o,e.map),t.pbrMetallicRoughness.baseColorTexture=o}if(e.emissive){let o=e.emissive;if(Math.max(o.r,o.g,o.b)>0&&(t.emissiveFactor=e.emissive.toArray()),e.emissiveMap){let u={index:this.processTexture(e.emissiveMap),texCoord:e.emissiveMap.channel};this.applyTextureTransform(u,e.emissiveMap),t.emissiveTexture=u}}if(e.normalMap){let o={index:this.processTexture(e.normalMap),texCoord:e.normalMap.channel};e.normalScale&&e.normalScale.x!==1&&(o.scale=e.normalScale.x),this.applyTextureTransform(o,e.normalMap),t.normalTexture=o}if(e.aoMap){let o={index:this.processTexture(e.aoMap),texCoord:e.aoMap.channel};e.aoMapIntensity!==1&&(o.strength=e.aoMapIntensity),this.applyTextureTransform(o,e.aoMap),t.occlusionTexture=o}e.transparent?t.alphaMode="BLEND":e.alphaTest>0&&(t.alphaMode="MASK",t.alphaCutoff=e.alphaTest),e.side===_e&&(t.doubleSided=!0),e.name!==""&&(t.name=e.name),this.serializeUserData(e,t),this._invokeAll(function(o){o.writeMaterial&&o.writeMaterial(e,t)});let n=r.materials.push(t)-1;return s.materials.set(e,n),n}processMesh(e){let s=this.cache,r=this.json,t=[e.geometry.uuid];if(Array.isArray(e.material))for(let g=0,y=e.material.length;g<y;g++)t.push(e.material[g].uuid);else t.push(e.material.uuid);let i=t.join(":");if(s.meshes.has(i))return s.meshes.get(i);let n=e.geometry,o;e.isLineSegments?o=x.LINES:e.isLineLoop?o=x.LINE_LOOP:e.isLine?o=x.LINE_STRIP:e.isPoints?o=x.POINTS:o=e.material.wireframe?x.LINES:x.TRIANGLES;let a={},u={},p=[],f=[],m={uv:"TEXCOORD_0",uv1:"TEXCOORD_1",uv2:"TEXCOORD_2",uv3:"TEXCOORD_3",color:"COLOR_0",skinWeight:"WEIGHTS_0",skinIndex:"JOINTS_0"},l=n.getAttribute("normal");l!==void 0&&!this.isNormalizedNormalAttribute(l)&&(console.warn("THREE.GLTFExporter: Creating normalized normal attribute from the non-normalized one."),n.setAttribute("normal",this.createNormalizedNormalAttribute(l)));let d=null;for(let g in n.attributes){if(g.slice(0,5)==="morph")continue;let y=n.attributes[g];if(g=m[g]||g.toUpperCase(),/^(POSITION|NORMAL|TANGENT|TEXCOORD_\d+|COLOR_\d+|JOINTS_\d+|WEIGHTS_\d+)$/.test(g)||(g="_"+g),s.attributes.has(this.getUID(y))){u[g]=s.attributes.get(this.getUID(y));continue}d=null;let A=y.array;g==="JOINTS_0"&&!(A instanceof Uint16Array)&&!(A instanceof Uint8Array)&&(console.warn('GLTFExporter: Attribute "skinIndex" converted to type UNSIGNED_SHORT.'),d=new _(new Uint16Array(A),y.itemSize,y.normalized));let E=this.processAccessor(d||y,n);E!==null&&(g.startsWith("_")||this.detectMeshQuantization(g,y),u[g]=E,s.attributes.set(this.getUID(y),E))}if(l!==void 0&&n.setAttribute("normal",l),Object.keys(u).length===0)return null;if(e.morphTargetInfluences!==void 0&&e.morphTargetInfluences.length>0){let g=[],y=[],I={};if(e.morphTargetDictionary!==void 0)for(let A in e.morphTargetDictionary)I[e.morphTargetDictionary[A]]=A;for(let A=0;A<e.morphTargetInfluences.length;++A){let E={},Se=!1;for(let v in n.morphAttributes){if(v!=="position"&&v!=="normal"){Se||(console.warn("GLTFExporter: Only POSITION and NORMAL morph are supported."),Se=!0);continue}let S=n.morphAttributes[v][A],X=v.toUpperCase(),L=n.attributes[v];if(s.attributes.has(this.getUID(S,!0))){E[X]=s.attributes.get(this.getUID(S,!0));continue}let O=S.clone();if(!n.morphTargetsRelative)for(let R=0,os=S.count;R<os;R++)for(let C=0;C<S.itemSize;C++)C===0&&O.setX(R,S.getX(R)-L.getX(R)),C===1&&O.setY(R,S.getY(R)-L.getY(R)),C===2&&O.setZ(R,S.getZ(R)-L.getZ(R)),C===3&&O.setW(R,S.getW(R)-L.getW(R));E[X]=this.processAccessor(O,n),s.attributes.set(this.getUID(L,!0),E[X])}f.push(E),g.push(e.morphTargetInfluences[A]),e.morphTargetDictionary!==void 0&&y.push(I[A])}a.weights=g,y.length>0&&(a.extras={},a.extras.targetNames=y)}let h=Array.isArray(e.material);if(h&&n.groups.length===0)return null;let w=!1;if(h&&n.index===null){let g=[];for(let y=0,I=n.attributes.position.count;y<I;y++)g[y]=y;n.setIndex(g),w=!0}let M=h?e.material:[e.material],N=h?n.groups:[{materialIndex:0,start:void 0,count:void 0}];for(let g=0,y=N.length;g<y;g++){let I={mode:o,attributes:u};if(this.serializeUserData(n,I),f.length>0&&(I.targets=f),n.index!==null){let E=this.getUID(n.index);(N[g].start!==void 0||N[g].count!==void 0)&&(E+=":"+N[g].start+":"+N[g].count),s.attributes.has(E)?I.indices=s.attributes.get(E):(I.indices=this.processAccessor(n.index,n,N[g].start,N[g].count),s.attributes.set(E,I.indices)),I.indices===null&&delete I.indices}let A=this.processMaterial(M[N[g].materialIndex]);A!==null&&(I.material=A),p.push(I)}w===!0&&n.setIndex(null),a.primitives=p,r.meshes||(r.meshes=[]),this._invokeAll(function(g){g.writeMesh&&g.writeMesh(e,a)});let k=r.meshes.push(a)-1;return s.meshes.set(i,k),k}detectMeshQuantization(e,s){if(this.extensionsUsed[Q])return;let r;switch(s.array.constructor){case Int8Array:r="byte";break;case Uint8Array:r="unsigned byte";break;case Int16Array:r="short";break;case Uint16Array:r="unsigned short";break;default:return}s.normalized&&(r+=" normalized");let t=e.split("_",1)[0];$e[t]&&$e[t].includes(r)&&(this.extensionsUsed[Q]=!0,this.extensionsRequired[Q]=!0)}processCamera(e){let s=this.json;s.cameras||(s.cameras=[]);let r=e.isOrthographicCamera,t={type:r?"orthographic":"perspective"};return r?t.orthographic={xmag:e.right*2,ymag:e.top*2,zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near}:t.perspective={aspectRatio:e.aspect,yfov:G.degToRad(e.fov),zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near},e.name!==""&&(t.name=e.type),s.cameras.push(t)-1}processAnimation(e,s){let r=this.json,t=this.nodeMap;r.animations||(r.animations=[]),e=q.Utils.mergeMorphTargetTracks(e.clone(),s);let i=e.tracks,n=[],o=[];for(let a=0;a<i.length;++a){let u=i[a],p=z.parseTrackName(u.name),f=z.findNode(s,p.nodeName),m=es[p.propertyName];if(p.objectName==="bones"&&(f.isSkinnedMesh===!0?f=f.skeleton.getBoneByName(p.objectIndex):f=void 0),!f||!m)return console.warn('THREE.GLTFExporter: Could not export animation track "%s".',u.name),null;let l=1,d=u.values.length/u.times.length;m===es.morphTargetInfluences&&(d/=f.morphTargetInfluences.length);let h;u.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline===!0?(h="CUBICSPLINE",d/=3):u.getInterpolation()===ke?h="STEP":h="LINEAR",o.push({input:this.processAccessor(new _(u.times,l)),output:this.processAccessor(new _(u.values,d)),interpolation:h}),n.push({sampler:o.length-1,target:{node:t.get(f),path:m}})}return r.animations.push({name:e.name||"clip_"+r.animations.length,samplers:o,channels:n}),r.animations.length-1}processSkin(e){let s=this.json,r=this.nodeMap,t=s.nodes[r.get(e)],i=e.skeleton;if(i===void 0)return null;let n=e.skeleton.bones[0];if(n===void 0)return null;let o=[],a=new Float32Array(i.bones.length*16),u=new W;for(let f=0;f<i.bones.length;++f)o.push(r.get(i.bones[f])),u.copy(i.boneInverses[f]),u.multiply(e.bindMatrix).toArray(a,f*16);return s.skins===void 0&&(s.skins=[]),s.skins.push({inverseBindMatrices:this.processAccessor(new _(a,16)),joints:o,skeleton:r.get(n)}),t.skin=s.skins.length-1}processNode(e){let s=this.json,r=this.options,t=this.nodeMap;s.nodes||(s.nodes=[]);let i={};if(r.trs){let o=e.quaternion.toArray(),a=e.position.toArray(),u=e.scale.toArray();F(o,[0,0,0,1])||(i.rotation=o),F(a,[0,0,0])||(i.translation=a),F(u,[1,1,1])||(i.scale=u)}else e.matrixAutoUpdate&&e.updateMatrix(),ds(e.matrix)===!1&&(i.matrix=e.matrix.elements);if(e.name!==""&&(i.name=String(e.name)),this.serializeUserData(e,i),e.isMesh||e.isLine||e.isPoints){let o=this.processMesh(e);o!==null&&(i.mesh=o)}else e.isCamera&&(i.camera=this.processCamera(e));if(e.isSkinnedMesh&&this.skins.push(e),e.children.length>0){let o=[];for(let a=0,u=e.children.length;a<u;a++){let p=e.children[a];if(p.visible||r.onlyVisible===!1){let f=this.processNode(p);f!==null&&o.push(f)}}o.length>0&&(i.children=o)}this._invokeAll(function(o){o.writeNode&&o.writeNode(e,i)});let n=s.nodes.push(i)-1;return t.set(e,n),n}processScene(e){let s=this.json,r=this.options;s.scenes||(s.scenes=[],s.scene=0);let t={};e.name!==""&&(t.name=e.name),s.scenes.push(t);let i=[];for(let n=0,o=e.children.length;n<o;n++){let a=e.children[n];if(a.visible||r.onlyVisible===!1){let u=this.processNode(a);u!==null&&i.push(u)}}i.length>0&&(t.nodes=i),this.serializeUserData(e,t)}processObjects(e){let s=new P;s.name="AuxScene";for(let r=0;r<e.length;r++)s.children.push(e[r]);this.processScene(s)}processInput(e){let s=this.options;e=e instanceof Array?e:[e],this._invokeAll(function(t){t.beforeParse&&t.beforeParse(e)});let r=[];for(let t=0;t<e.length;t++)e[t]instanceof P?this.processScene(e[t]):r.push(e[t]);r.length>0&&this.processObjects(r);for(let t=0;t<this.skins.length;++t)this.processSkin(this.skins[t]);for(let t=0;t<s.animations.length;++t)this.processAnimation(s.animations[t],e[0]);this._invokeAll(function(t){t.afterParse&&t.afterParse(e)})}_invokeAll(e){for(let s=0,r=this.plugins.length;s<r;s++)e(this.plugins[s])}};T(de,"GLTFWriter");var $=de,ge=class ge{constructor(e){this.writer=e,this.name="KHR_lights_punctual"}writeNode(e,s){if(!e.isLight)return;if(!e.isDirectionalLight&&!e.isPointLight&&!e.isSpotLight){console.warn("THREE.GLTFExporter: Only directional, point, and spot lights are supported.",e);return}let r=this.writer,t=r.json,i=r.extensionsUsed,n={};e.name&&(n.name=e.name),n.color=e.color.toArray(),n.intensity=e.intensity,e.isDirectionalLight?n.type="directional":e.isPointLight?(n.type="point",e.distance>0&&(n.range=e.distance)):e.isSpotLight&&(n.type="spot",e.distance>0&&(n.range=e.distance),n.spot={},n.spot.innerConeAngle=(1-e.penumbra)*e.angle,n.spot.outerConeAngle=e.angle),e.decay!==void 0&&e.decay!==2&&console.warn("THREE.GLTFExporter: Light decay may be lost. glTF is physically-based, and expects light.decay=2."),e.target&&(e.target.parent!==e||e.target.position.x!==0||e.target.position.y!==0||e.target.position.z!==-1)&&console.warn("THREE.GLTFExporter: Light direction may be lost. For best results, make light.target a child of the light with position 0,0,-1."),i[this.name]||(t.extensions=t.extensions||{},t.extensions[this.name]={lights:[]},i[this.name]=!0);let o=t.extensions[this.name].lights;o.push(n),s.extensions=s.extensions||{},s.extensions[this.name]={light:o.length-1}}};T(ge,"GLTFLightExtension");var ee=ge,xe=class xe{constructor(e){this.writer=e,this.name="KHR_materials_unlit"}writeMaterial(e,s){if(!e.isMeshBasicMaterial)return;let t=this.writer.extensionsUsed;s.extensions=s.extensions||{},s.extensions[this.name]={},t[this.name]=!0,s.pbrMetallicRoughness.metallicFactor=0,s.pbrMetallicRoughness.roughnessFactor=.9}};T(xe,"GLTFMaterialsUnlitExtension");var se=xe,me=class me{constructor(e){this.writer=e,this.name="KHR_materials_clearcoat"}writeMaterial(e,s){if(!e.isMeshPhysicalMaterial||e.clearcoat===0)return;let r=this.writer,t=r.extensionsUsed,i={};if(i.clearcoatFactor=e.clearcoat,e.clearcoatMap){let n={index:r.processTexture(e.clearcoatMap),texCoord:e.clearcoatMap.channel};r.applyTextureTransform(n,e.clearcoatMap),i.clearcoatTexture=n}if(i.clearcoatRoughnessFactor=e.clearcoatRoughness,e.clearcoatRoughnessMap){let n={index:r.processTexture(e.clearcoatRoughnessMap),texCoord:e.clearcoatRoughnessMap.channel};r.applyTextureTransform(n,e.clearcoatRoughnessMap),i.clearcoatRoughnessTexture=n}if(e.clearcoatNormalMap){let n={index:r.processTexture(e.clearcoatNormalMap),texCoord:e.clearcoatNormalMap.channel};r.applyTextureTransform(n,e.clearcoatNormalMap),i.clearcoatNormalTexture=n}s.extensions=s.extensions||{},s.extensions[this.name]=i,t[this.name]=!0}};T(me,"GLTFMaterialsClearcoatExtension");var te=me,Te=class Te{constructor(e){this.writer=e,this.name="KHR_materials_iridescence"}writeMaterial(e,s){if(!e.isMeshPhysicalMaterial||e.iridescence===0)return;let r=this.writer,t=r.extensionsUsed,i={};if(i.iridescenceFactor=e.iridescence,e.iridescenceMap){let n={index:r.processTexture(e.iridescenceMap),texCoord:e.iridescenceMap.channel};r.applyTextureTransform(n,e.iridescenceMap),i.iridescenceTexture=n}if(i.iridescenceIor=e.iridescenceIOR,i.iridescenceThicknessMinimum=e.iridescenceThicknessRange[0],i.iridescenceThicknessMaximum=e.iridescenceThicknessRange[1],e.iridescenceThicknessMap){let n={index:r.processTexture(e.iridescenceThicknessMap),texCoord:e.iridescenceThicknessMap.channel};r.applyTextureTransform(n,e.iridescenceThicknessMap),i.iridescenceThicknessTexture=n}s.extensions=s.extensions||{},s.extensions[this.name]=i,t[this.name]=!0}};T(Te,"GLTFMaterialsIridescenceExtension");var ne=Te,ye=class ye{constructor(e){this.writer=e,this.name="KHR_materials_transmission"}writeMaterial(e,s){if(!e.isMeshPhysicalMaterial||e.transmission===0)return;let r=this.writer,t=r.extensionsUsed,i={};if(i.transmissionFactor=e.transmission,e.transmissionMap){let n={index:r.processTexture(e.transmissionMap),texCoord:e.transmissionMap.channel};r.applyTextureTransform(n,e.transmissionMap),i.transmissionTexture=n}s.extensions=s.extensions||{},s.extensions[this.name]=i,t[this.name]=!0}};T(ye,"GLTFMaterialsTransmissionExtension");var re=ye,we=class we{constructor(e){this.writer=e,this.name="KHR_materials_volume"}writeMaterial(e,s){if(!e.isMeshPhysicalMaterial||e.transmission===0)return;let r=this.writer,t=r.extensionsUsed,i={};if(i.thicknessFactor=e.thickness,e.thicknessMap){let n={index:r.processTexture(e.thicknessMap),texCoord:e.thicknessMap.channel};r.applyTextureTransform(n,e.thicknessMap),i.thicknessTexture=n}i.attenuationDistance=e.attenuationDistance,i.attenuationColor=e.attenuationColor.toArray(),s.extensions=s.extensions||{},s.extensions[this.name]=i,t[this.name]=!0}};T(we,"GLTFMaterialsVolumeExtension");var ie=we,Me=class Me{constructor(e){this.writer=e,this.name="KHR_materials_ior"}writeMaterial(e,s){if(!e.isMeshPhysicalMaterial||e.ior===1.5)return;let t=this.writer.extensionsUsed,i={};i.ior=e.ior,s.extensions=s.extensions||{},s.extensions[this.name]=i,t[this.name]=!0}};T(Me,"GLTFMaterialsIorExtension");var oe=Me,Ie=class Ie{constructor(e){this.writer=e,this.name="KHR_materials_specular"}writeMaterial(e,s){if(!e.isMeshPhysicalMaterial||e.specularIntensity===1&&e.specularColor.equals(cs)&&!e.specularIntensityMap&&!e.specularColorMap)return;let r=this.writer,t=r.extensionsUsed,i={};if(e.specularIntensityMap){let n={index:r.processTexture(e.specularIntensityMap),texCoord:e.specularIntensityMap.channel};r.applyTextureTransform(n,e.specularIntensityMap),i.specularTexture=n}if(e.specularColorMap){let n={index:r.processTexture(e.specularColorMap),texCoord:e.specularColorMap.channel};r.applyTextureTransform(n,e.specularColorMap),i.specularColorTexture=n}i.specularFactor=e.specularIntensity,i.specularColorFactor=e.specularColor.toArray(),s.extensions=s.extensions||{},s.extensions[this.name]=i,t[this.name]=!0}};T(Ie,"GLTFMaterialsSpecularExtension");var ae=Ie,Ae=class Ae{constructor(e){this.writer=e,this.name="KHR_materials_sheen"}writeMaterial(e,s){if(!e.isMeshPhysicalMaterial||e.sheen==0)return;let r=this.writer,t=r.extensionsUsed,i={};if(e.sheenRoughnessMap){let n={index:r.processTexture(e.sheenRoughnessMap),texCoord:e.sheenRoughnessMap.channel};r.applyTextureTransform(n,e.sheenRoughnessMap),i.sheenRoughnessTexture=n}if(e.sheenColorMap){let n={index:r.processTexture(e.sheenColorMap),texCoord:e.sheenColorMap.channel};r.applyTextureTransform(n,e.sheenColorMap),i.sheenColorTexture=n}i.sheenRoughnessFactor=e.sheenRoughness,i.sheenColorFactor=e.sheenColor.toArray(),s.extensions=s.extensions||{},s.extensions[this.name]=i,t[this.name]=!0}};T(Ae,"GLTFMaterialsSheenExtension");var ce=Ae,Re=class Re{constructor(e){this.writer=e,this.name="KHR_materials_anisotropy"}writeMaterial(e,s){if(!e.isMeshPhysicalMaterial||e.anisotropy==0)return;let r=this.writer,t=r.extensionsUsed,i={};if(e.anisotropyMap){let n={index:r.processTexture(e.anisotropyMap)};r.applyTextureTransform(n,e.anisotropyMap),i.anisotropyTexture=n}i.anisotropyStrength=e.anisotropy,i.anisotropyRotation=e.anisotropyRotation,s.extensions=s.extensions||{},s.extensions[this.name]=i,t[this.name]=!0}};T(Re,"GLTFMaterialsAnisotropyExtension");var ue=Re,Ee=class Ee{constructor(e){this.writer=e,this.name="KHR_materials_emissive_strength"}writeMaterial(e,s){if(!e.isMeshStandardMaterial||e.emissiveIntensity===1)return;let t=this.writer.extensionsUsed,i={};i.emissiveStrength=e.emissiveIntensity,s.extensions=s.extensions||{},s.extensions[this.name]=i,t[this.name]=!0}};T(Ee,"GLTFMaterialsEmissiveStrengthExtension");var le=Ee,be=class be{constructor(e){this.writer=e,this.name="EXT_materials_bump"}writeMaterial(e,s){if(!e.isMeshStandardMaterial||e.bumpScale===1&&!e.bumpMap)return;let r=this.writer,t=r.extensionsUsed,i={};if(e.bumpMap){let n={index:r.processTexture(e.bumpMap),texCoord:e.bumpMap.channel};r.applyTextureTransform(n,e.bumpMap),i.bumpTexture=n}i.bumpFactor=e.bumpScale,s.extensions=s.extensions||{},s.extensions[this.name]=i,t[this.name]=!0}};T(be,"GLTFMaterialsBumpExtension");var fe=be,Ne=class Ne{constructor(e){this.writer=e,this.name="EXT_mesh_gpu_instancing"}writeNode(e,s){if(!e.isInstancedMesh)return;let r=this.writer,t=e,i=new Float32Array(t.count*3),n=new Float32Array(t.count*4),o=new Float32Array(t.count*3),a=new W,u=new D,p=new Ye,f=new D;for(let l=0;l<t.count;l++)t.getMatrixAt(l,a),a.decompose(u,p,f),u.toArray(i,l*3),p.toArray(n,l*4),f.toArray(o,l*3);let m={TRANSLATION:r.processAccessor(new _(i,3)),ROTATION:r.processAccessor(new _(n,4)),SCALE:r.processAccessor(new _(o,3))};t.instanceColor&&(m._COLOR_0=r.processAccessor(t.instanceColor)),s.extensions=s.extensions||{},s.extensions[this.name]={attributes:m},r.extensionsUsed[this.name]=!0,r.extensionsRequired[this.name]=!0}};T(Ne,"GLTFMeshGpuInstancing");var he=Ne;q.Utils={insertKeyframe:function(c,e){let r=c.getValueSize(),t=new c.TimeBufferType(c.times.length+1),i=new c.ValueBufferType(c.values.length+r),n=c.createInterpolant(new c.ValueBufferType(r)),o;if(c.times.length===0){t[0]=e;for(let a=0;a<r;a++)i[a]=0;o=0}else if(e<c.times[0]){if(Math.abs(c.times[0]-e)<.001)return 0;t[0]=e,t.set(c.times,1),i.set(n.evaluate(e),0),i.set(c.values,r),o=0}else if(e>c.times[c.times.length-1]){if(Math.abs(c.times[c.times.length-1]-e)<.001)return c.times.length-1;t[t.length-1]=e,t.set(c.times,0),i.set(c.values,0),i.set(n.evaluate(e),c.values.length),o=t.length-1}else for(let a=0;a<c.times.length;a++){if(Math.abs(c.times[a]-e)<.001)return a;if(c.times[a]<e&&c.times[a+1]>e){t.set(c.times.slice(0,a+1),0),t[a+1]=e,t.set(c.times.slice(a+1),a+2),i.set(c.values.slice(0,(a+1)*r),0),i.set(n.evaluate(e),(a+1)*r),i.set(c.values.slice((a+1)*r),(a+2)*r),o=a+1;break}}return c.times=t,c.values=i,o},mergeMorphTargetTracks:function(c,e){let s=[],r={},t=c.tracks;for(let i=0;i<t.length;++i){let n=t[i],o=z.parseTrackName(n.name),a=z.findNode(e,o.nodeName);if(o.propertyName!=="morphTargetInfluences"||o.propertyIndex===void 0){s.push(n);continue}if(n.createInterpolant!==n.InterpolantFactoryMethodDiscrete&&n.createInterpolant!==n.InterpolantFactoryMethodLinear){if(n.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline)throw new Error("THREE.GLTFExporter: Cannot merge tracks with glTF CUBICSPLINE interpolation.");console.warn("THREE.GLTFExporter: Morph target interpolation mode not yet supported. Using LINEAR instead."),n=n.clone(),n.setInterpolation(He)}let u=a.morphTargetInfluences.length,p=a.morphTargetDictionary[o.propertyIndex];if(p===void 0)throw new Error("THREE.GLTFExporter: Morph target name not found: "+o.propertyIndex);let f;if(r[a.uuid]===void 0){f=n.clone();let l=new f.ValueBufferType(u*f.times.length);for(let d=0;d<f.times.length;d++)l[d*u+p]=f.values[d];f.name=(o.nodeName||"")+".morphTargetInfluences",f.values=l,r[a.uuid]=f,s.push(f);continue}let m=n.createInterpolant(new n.ValueBufferType(1));f=r[a.uuid];for(let l=0;l<f.times.length;l++)f.values[l*u+p]=m.evaluate(f.times[l]);for(let l=0;l<n.times.length;l++){let d=this.insertKeyframe(f,n.times[l]);f.values[d*u+p]=n.values[l]}}return c.tracks=s,c}};export{q as GLTFExporter};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as ae}from"./chunk-WVWEOR6I.js";import{$ as bt,A as $,Aa as Ut,Ba as se,C as ee,Ca as re,D,Da as ie,E as _t,Ea as jt,F as Et,Fa as Kt,G as j,Ga as oe,Ha as Ft,I as te,Ia as Vt,J as L,Ja as Xt,K as V,Ka as Gt,L as H,M as X,Ma as B,N as xt,Na as zt,O as St,Pa as qt,S as yt,V as wt,W as G,_ as Nt,aa as Mt,b as ct,ba as It,c as ut,d as F,da as Lt,e as lt,ea as Ot,f as ft,fa as Ct,g as dt,h as ht,ha as Dt,i as pt,ia as Pt,j as W,ja as kt,k as mt,ka as Ht,l as Y,la as Bt,ma as vt,o as At,p as Q,r as gt,s as Tt,u as k,v as N,w as Rt,x as Z,xa as ne,y as J,ya as b}from"./chunk-SHB4JBRW.js";import{a as p,j as at}from"./chunk-NTOUDKDJ.js";at();var He=class He extends Kt{constructor(t){super(t),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(e){return new pe(e)}),this.register(function(e){return new Se(e)}),this.register(function(e){return new ye(e)}),this.register(function(e){return new we(e)}),this.register(function(e){return new Ae(e)}),this.register(function(e){return new ge(e)}),this.register(function(e){return new Te(e)}),this.register(function(e){return new Re(e)}),this.register(function(e){return new he(e)}),this.register(function(e){return new _e(e)}),this.register(function(e){return new me(e)}),this.register(function(e){return new xe(e)}),this.register(function(e){return new Ee(e)}),this.register(function(e){return new fe(e)}),this.register(function(e){return new Ne(e)}),this.register(function(e){return new be(e)})}load(t,e,r,n){let s=this,i;if(this.resourcePath!=="")i=this.resourcePath;else if(this.path!==""){let c=B.extractUrlBase(t);i=B.resolveURL(c,this.path)}else i=B.extractUrlBase(t);this.manager.itemStart(t);let a=p(function(c){n?n(c):console.error(c),s.manager.itemError(t),s.manager.itemEnd(t)},"_onError"),o=new oe(this.manager);o.setPath(this.path),o.setResponseType("arraybuffer"),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(t,function(c){try{s.parse(c,i,function(l){e(l),s.manager.itemEnd(t)},a)}catch(l){a(l)}},r,a)}setDRACOLoader(t){return this.dracoLoader=t,this}setDDSLoader(){throw new Error('THREE.GLTFLoader: "MSFT_texture_dds" no longer supported. Please update to "KHR_texture_basisu".')}setKTX2Loader(t){return this.ktx2Loader=t,this}setMeshoptDecoder(t){return this.meshoptDecoder=t,this}register(t){return this.pluginCallbacks.indexOf(t)===-1&&this.pluginCallbacks.push(t),this}unregister(t){return this.pluginCallbacks.indexOf(t)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(t),1),this}parse(t,e,r,n){let s,i={},a={},o=new TextDecoder;if(typeof t=="string")s=JSON.parse(t);else if(t instanceof ArrayBuffer)if(o.decode(new Uint8Array(t,0,4))===$t){try{i[g.KHR_BINARY_GLTF]=new Me(t)}catch(u){n&&n(u);return}s=JSON.parse(i[g.KHR_BINARY_GLTF].content)}else s=JSON.parse(o.decode(t));else s=t;if(s.asset===void 0||s.asset.version[0]<2){n&&n(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));return}let c=new ke(s,{path:e||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});c.fileLoader.setRequestHeader(this.requestHeader);for(let l=0;l<this.pluginCallbacks.length;l++){let u=this.pluginCallbacks[l](c);u.name||console.error("THREE.GLTFLoader: Invalid plugin found: missing name"),a[u.name]=u,i[u.name]=!0}if(s.extensionsUsed)for(let l=0;l<s.extensionsUsed.length;++l){let u=s.extensionsUsed[l],f=s.extensionsRequired||[];switch(u){case g.KHR_MATERIALS_UNLIT:i[u]=new de;break;case g.KHR_DRACO_MESH_COMPRESSION:i[u]=new Ie(s,this.dracoLoader);break;case g.KHR_TEXTURE_TRANSFORM:i[u]=new Le;break;case g.KHR_MESH_QUANTIZATION:i[u]=new Oe;break;default:f.indexOf(u)>=0&&a[u]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+u+'".')}}c.setExtensions(i),c.setPlugins(a),c.parse(r,n)}parseAsync(t,e){let r=this;return new Promise(function(n,s){r.parse(t,e,n,s)})}};p(He,"GLTFLoader");var Wt=He;function en(){let h={};return{get:function(t){return h[t]},add:function(t,e){h[t]=e},remove:function(t){delete h[t]},removeAll:function(){h={}}}}p(en,"GLTFRegistry");var g={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_MATERIALS_BUMP:"EXT_materials_bump",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"},Be=class Be{constructor(t){this.parser=t,this.name=g.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){let t=this.parser,e=this.parser.json.nodes||[];for(let r=0,n=e.length;r<n;r++){let s=e[r];s.extensions&&s.extensions[this.name]&&s.extensions[this.name].light!==void 0&&t._addNodeRef(this.cache,s.extensions[this.name].light)}}_loadLight(t){let e=this.parser,r="light:"+t,n=e.cache.get(r);if(n)return n;let s=e.json,o=((s.extensions&&s.extensions[this.name]||{}).lights||[])[t],c,l=new L(16777215);o.color!==void 0&&l.setRGB(o.color[0],o.color[1],o.color[2],N);let u=o.range!==void 0?o.range:0;switch(o.type){case"directional":c=new Gt(l),c.target.position.set(0,0,-1),c.add(c.target);break;case"point":c=new Xt(l),c.distance=u;break;case"spot":c=new Vt(l),c.distance=u,o.spot=o.spot||{},o.spot.innerConeAngle=o.spot.innerConeAngle!==void 0?o.spot.innerConeAngle:0,o.spot.outerConeAngle=o.spot.outerConeAngle!==void 0?o.spot.outerConeAngle:Math.PI/4,c.angle=o.spot.outerConeAngle,c.penumbra=1-o.spot.innerConeAngle/o.spot.outerConeAngle,c.target.position.set(0,0,-1),c.add(c.target);break;default:throw new Error("THREE.GLTFLoader: Unexpected light type: "+o.type)}return c.position.set(0,0,0),c.decay=2,C(c,o),o.intensity!==void 0&&(c.intensity=o.intensity),c.name=e.createUniqueName(o.name||"light_"+t),n=Promise.resolve(c),e.cache.add(r,n),n}getDependency(t,e){if(t==="light")return this._loadLight(e)}createNodeAttachment(t){let e=this,r=this.parser,s=r.json.nodes[t],a=(s.extensions&&s.extensions[this.name]||{}).light;return a===void 0?null:this._loadLight(a).then(function(o){return r._getNodeRef(e.cache,a,o)})}};p(Be,"GLTFLightsExtension");var fe=Be,ve=class ve{constructor(){this.name=g.KHR_MATERIALS_UNLIT}getMaterialType(){return H}extendParams(t,e,r){let n=[];t.color=new L(1,1,1),t.opacity=1;let s=e.pbrMetallicRoughness;if(s){if(Array.isArray(s.baseColorFactor)){let i=s.baseColorFactor;t.color.setRGB(i[0],i[1],i[2],N),t.opacity=i[3]}s.baseColorTexture!==void 0&&n.push(r.assignTexture(t,"map",s.baseColorTexture,k))}return Promise.all(n)}};p(ve,"GLTFMaterialsUnlitExtension");var de=ve,Ue=class Ue{constructor(t){this.parser=t,this.name=g.KHR_MATERIALS_EMISSIVE_STRENGTH}extendMaterialParams(t,e){let n=this.parser.json.materials[t];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();let s=n.extensions[this.name].emissiveStrength;return s!==void 0&&(e.emissiveIntensity=s),Promise.resolve()}};p(Ue,"GLTFMaterialsEmissiveStrengthExtension");var he=Ue,je=class je{constructor(t){this.parser=t,this.name=g.KHR_MATERIALS_CLEARCOAT}getMaterialType(t){let r=this.parser.json.materials[t];return!r.extensions||!r.extensions[this.name]?null:b}extendMaterialParams(t,e){let r=this.parser,n=r.json.materials[t];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();let s=[],i=n.extensions[this.name];if(i.clearcoatFactor!==void 0&&(e.clearcoat=i.clearcoatFactor),i.clearcoatTexture!==void 0&&s.push(r.assignTexture(e,"clearcoatMap",i.clearcoatTexture)),i.clearcoatRoughnessFactor!==void 0&&(e.clearcoatRoughness=i.clearcoatRoughnessFactor),i.clearcoatRoughnessTexture!==void 0&&s.push(r.assignTexture(e,"clearcoatRoughnessMap",i.clearcoatRoughnessTexture)),i.clearcoatNormalTexture!==void 0&&(s.push(r.assignTexture(e,"clearcoatNormalMap",i.clearcoatNormalTexture)),i.clearcoatNormalTexture.scale!==void 0)){let a=i.clearcoatNormalTexture.scale;e.clearcoatNormalScale=new Z(a,a)}return Promise.all(s)}};p(je,"GLTFMaterialsClearcoatExtension");var pe=je,Ke=class Ke{constructor(t){this.parser=t,this.name=g.KHR_MATERIALS_IRIDESCENCE}getMaterialType(t){let r=this.parser.json.materials[t];return!r.extensions||!r.extensions[this.name]?null:b}extendMaterialParams(t,e){let r=this.parser,n=r.json.materials[t];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();let s=[],i=n.extensions[this.name];return i.iridescenceFactor!==void 0&&(e.iridescence=i.iridescenceFactor),i.iridescenceTexture!==void 0&&s.push(r.assignTexture(e,"iridescenceMap",i.iridescenceTexture)),i.iridescenceIor!==void 0&&(e.iridescenceIOR=i.iridescenceIor),e.iridescenceThicknessRange===void 0&&(e.iridescenceThicknessRange=[100,400]),i.iridescenceThicknessMinimum!==void 0&&(e.iridescenceThicknessRange[0]=i.iridescenceThicknessMinimum),i.iridescenceThicknessMaximum!==void 0&&(e.iridescenceThicknessRange[1]=i.iridescenceThicknessMaximum),i.iridescenceThicknessTexture!==void 0&&s.push(r.assignTexture(e,"iridescenceThicknessMap",i.iridescenceThicknessTexture)),Promise.all(s)}};p(Ke,"GLTFMaterialsIridescenceExtension");var me=Ke,Fe=class Fe{constructor(t){this.parser=t,this.name=g.KHR_MATERIALS_SHEEN}getMaterialType(t){let r=this.parser.json.materials[t];return!r.extensions||!r.extensions[this.name]?null:b}extendMaterialParams(t,e){let r=this.parser,n=r.json.materials[t];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();let s=[];e.sheenColor=new L(0,0,0),e.sheenRoughness=0,e.sheen=1;let i=n.extensions[this.name];if(i.sheenColorFactor!==void 0){let a=i.sheenColorFactor;e.sheenColor.setRGB(a[0],a[1],a[2],N)}return i.sheenRoughnessFactor!==void 0&&(e.sheenRoughness=i.sheenRoughnessFactor),i.sheenColorTexture!==void 0&&s.push(r.assignTexture(e,"sheenColorMap",i.sheenColorTexture,k)),i.sheenRoughnessTexture!==void 0&&s.push(r.assignTexture(e,"sheenRoughnessMap",i.sheenRoughnessTexture)),Promise.all(s)}};p(Fe,"GLTFMaterialsSheenExtension");var Ae=Fe,Ve=class Ve{constructor(t){this.parser=t,this.name=g.KHR_MATERIALS_TRANSMISSION}getMaterialType(t){let r=this.parser.json.materials[t];return!r.extensions||!r.extensions[this.name]?null:b}extendMaterialParams(t,e){let r=this.parser,n=r.json.materials[t];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();let s=[],i=n.extensions[this.name];return i.transmissionFactor!==void 0&&(e.transmission=i.transmissionFactor),i.transmissionTexture!==void 0&&s.push(r.assignTexture(e,"transmissionMap",i.transmissionTexture)),Promise.all(s)}};p(Ve,"GLTFMaterialsTransmissionExtension");var ge=Ve,Xe=class Xe{constructor(t){this.parser=t,this.name=g.KHR_MATERIALS_VOLUME}getMaterialType(t){let r=this.parser.json.materials[t];return!r.extensions||!r.extensions[this.name]?null:b}extendMaterialParams(t,e){let r=this.parser,n=r.json.materials[t];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();let s=[],i=n.extensions[this.name];e.thickness=i.thicknessFactor!==void 0?i.thicknessFactor:0,i.thicknessTexture!==void 0&&s.push(r.assignTexture(e,"thicknessMap",i.thicknessTexture)),e.attenuationDistance=i.attenuationDistance||1/0;let a=i.attenuationColor||[1,1,1];return e.attenuationColor=new L().setRGB(a[0],a[1],a[2],N),Promise.all(s)}};p(Xe,"GLTFMaterialsVolumeExtension");var Te=Xe,Ge=class Ge{constructor(t){this.parser=t,this.name=g.KHR_MATERIALS_IOR}getMaterialType(t){let r=this.parser.json.materials[t];return!r.extensions||!r.extensions[this.name]?null:b}extendMaterialParams(t,e){let n=this.parser.json.materials[t];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();let s=n.extensions[this.name];return e.ior=s.ior!==void 0?s.ior:1.5,Promise.resolve()}};p(Ge,"GLTFMaterialsIorExtension");var Re=Ge,ze=class ze{constructor(t){this.parser=t,this.name=g.KHR_MATERIALS_SPECULAR}getMaterialType(t){let r=this.parser.json.materials[t];return!r.extensions||!r.extensions[this.name]?null:b}extendMaterialParams(t,e){let r=this.parser,n=r.json.materials[t];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();let s=[],i=n.extensions[this.name];e.specularIntensity=i.specularFactor!==void 0?i.specularFactor:1,i.specularTexture!==void 0&&s.push(r.assignTexture(e,"specularIntensityMap",i.specularTexture));let a=i.specularColorFactor||[1,1,1];return e.specularColor=new L().setRGB(a[0],a[1],a[2],N),i.specularColorTexture!==void 0&&s.push(r.assignTexture(e,"specularColorMap",i.specularColorTexture,k)),Promise.all(s)}};p(ze,"GLTFMaterialsSpecularExtension");var _e=ze,qe=class qe{constructor(t){this.parser=t,this.name=g.EXT_MATERIALS_BUMP}getMaterialType(t){let r=this.parser.json.materials[t];return!r.extensions||!r.extensions[this.name]?null:b}extendMaterialParams(t,e){let r=this.parser,n=r.json.materials[t];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();let s=[],i=n.extensions[this.name];return e.bumpScale=i.bumpFactor!==void 0?i.bumpFactor:1,i.bumpTexture!==void 0&&s.push(r.assignTexture(e,"bumpMap",i.bumpTexture)),Promise.all(s)}};p(qe,"GLTFMaterialsBumpExtension");var Ee=qe,We=class We{constructor(t){this.parser=t,this.name=g.KHR_MATERIALS_ANISOTROPY}getMaterialType(t){let r=this.parser.json.materials[t];return!r.extensions||!r.extensions[this.name]?null:b}extendMaterialParams(t,e){let r=this.parser,n=r.json.materials[t];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();let s=[],i=n.extensions[this.name];return i.anisotropyStrength!==void 0&&(e.anisotropy=i.anisotropyStrength),i.anisotropyRotation!==void 0&&(e.anisotropyRotation=i.anisotropyRotation),i.anisotropyTexture!==void 0&&s.push(r.assignTexture(e,"anisotropyMap",i.anisotropyTexture)),Promise.all(s)}};p(We,"GLTFMaterialsAnisotropyExtension");var xe=We,Ye=class Ye{constructor(t){this.parser=t,this.name=g.KHR_TEXTURE_BASISU}loadTexture(t){let e=this.parser,r=e.json,n=r.textures[t];if(!n.extensions||!n.extensions[this.name])return null;let s=n.extensions[this.name],i=e.options.ktx2Loader;if(!i){if(r.extensionsRequired&&r.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return e.loadTextureImage(t,s.source,i)}};p(Ye,"GLTFTextureBasisUExtension");var Se=Ye,Qe=class Qe{constructor(t){this.parser=t,this.name=g.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(t){let e=this.name,r=this.parser,n=r.json,s=n.textures[t];if(!s.extensions||!s.extensions[e])return null;let i=s.extensions[e],a=n.images[i.source],o=r.textureLoader;if(a.uri){let c=r.options.manager.getHandler(a.uri);c!==null&&(o=c)}return this.detectSupport().then(function(c){if(c)return r.loadTextureImage(t,i.source,o);if(n.extensionsRequired&&n.extensionsRequired.indexOf(e)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return r.loadTexture(t)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(t){let e=new Image;e.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",e.onload=e.onerror=function(){t(e.height===1)}})),this.isSupported}};p(Qe,"GLTFTextureWebPExtension");var ye=Qe,Ze=class Ze{constructor(t){this.parser=t,this.name=g.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(t){let e=this.name,r=this.parser,n=r.json,s=n.textures[t];if(!s.extensions||!s.extensions[e])return null;let i=s.extensions[e],a=n.images[i.source],o=r.textureLoader;if(a.uri){let c=r.options.manager.getHandler(a.uri);c!==null&&(o=c)}return this.detectSupport().then(function(c){if(c)return r.loadTextureImage(t,i.source,o);if(n.extensionsRequired&&n.extensionsRequired.indexOf(e)>=0)throw new Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");return r.loadTexture(t)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(t){let e=new Image;e.src="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI=",e.onload=e.onerror=function(){t(e.height===1)}})),this.isSupported}};p(Ze,"GLTFTextureAVIFExtension");var we=Ze,Je=class Je{constructor(t){this.name=g.EXT_MESHOPT_COMPRESSION,this.parser=t}loadBufferView(t){let e=this.parser.json,r=e.bufferViews[t];if(r.extensions&&r.extensions[this.name]){let n=r.extensions[this.name],s=this.parser.getDependency("buffer",n.buffer),i=this.parser.options.meshoptDecoder;if(!i||!i.supported){if(e.extensionsRequired&&e.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return s.then(function(a){let o=n.byteOffset||0,c=n.byteLength||0,l=n.count,u=n.byteStride,f=new Uint8Array(a,o,c);return i.decodeGltfBufferAsync?i.decodeGltfBufferAsync(l,u,f,n.mode,n.filter).then(function(d){return d.buffer}):i.ready.then(function(){let d=new ArrayBuffer(l*u);return i.decodeGltfBuffer(new Uint8Array(d),l,u,f,n.mode,n.filter),d})})}else return null}};p(Je,"GLTFMeshoptCompression");var Ne=Je,$e=class $e{constructor(t){this.name=g.EXT_MESH_GPU_INSTANCING,this.parser=t}createNodeMesh(t){let e=this.parser.json,r=e.nodes[t];if(!r.extensions||!r.extensions[this.name]||r.mesh===void 0)return null;let n=e.meshes[r.mesh];for(let c of n.primitives)if(c.mode!==S.TRIANGLES&&c.mode!==S.TRIANGLE_STRIP&&c.mode!==S.TRIANGLE_FAN&&c.mode!==void 0)return null;let i=r.extensions[this.name].attributes,a=[],o={};for(let c in i)a.push(this.parser.getDependency("accessor",i[c]).then(l=>(o[c]=l,o[c])));return a.length<1?null:(a.push(this.parser.createNodeMesh(t)),Promise.all(a).then(c=>{let l=c.pop(),u=l.isGroup?l.children:[l],f=c[0].count,d=[];for(let m of u){let R=new j,A=new D,T=new ee,E=new D(1,1,1),x=new Ct(m.geometry,m.material,f);for(let _=0;_<f;_++)o.TRANSLATION&&A.fromBufferAttribute(o.TRANSLATION,_),o.ROTATION&&T.fromBufferAttribute(o.ROTATION,_),o.SCALE&&E.fromBufferAttribute(o.SCALE,_),x.setMatrixAt(_,R.compose(A,T,E));for(let _ in o)if(_==="_COLOR_0"){let w=o[_];x.instanceColor=new Ot(w.array,w.itemSize,w.normalized)}else _!=="TRANSLATION"&&_!=="ROTATION"&&_!=="SCALE"&&m.geometry.setAttribute(_,o[_]);te.prototype.copy.call(x,m),this.parser.assignFinalMaterial(x),d.push(x)}return l.isGroup?(l.clear(),l.add(...d),l):d[0]}))}};p($e,"GLTFMeshGpuInstancing");var be=$e,$t="glTF",K=12,Yt={JSON:1313821514,BIN:5130562},et=class et{constructor(t){this.name=g.KHR_BINARY_GLTF,this.content=null,this.body=null;let e=new DataView(t,0,K),r=new TextDecoder;if(this.header={magic:r.decode(new Uint8Array(t.slice(0,4))),version:e.getUint32(4,!0),length:e.getUint32(8,!0)},this.header.magic!==$t)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");let n=this.header.length-K,s=new DataView(t,K),i=0;for(;i<n;){let a=s.getUint32(i,!0);i+=4;let o=s.getUint32(i,!0);if(i+=4,o===Yt.JSON){let c=new Uint8Array(t,K+i,a);this.content=r.decode(c)}else if(o===Yt.BIN){let c=K+i;this.body=t.slice(c,c+a)}i+=a}if(this.content===null)throw new Error("THREE.GLTFLoader: JSON content not found.")}};p(et,"GLTFBinaryExtension");var Me=et,tt=class tt{constructor(t,e){if(!e)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=g.KHR_DRACO_MESH_COMPRESSION,this.json=t,this.dracoLoader=e,this.dracoLoader.preload()}decodePrimitive(t,e){let r=this.json,n=this.dracoLoader,s=t.extensions[this.name].bufferView,i=t.extensions[this.name].attributes,a={},o={},c={};for(let l in i){let u=De[l]||l.toLowerCase();a[u]=i[l]}for(let l in t.attributes){let u=De[l]||l.toLowerCase();if(i[l]!==void 0){let f=r.accessors[t.attributes[l]],d=v[f.componentType];c[u]=d.name,o[u]=f.normalized===!0}}return e.getDependency("bufferView",s).then(function(l){return new Promise(function(u,f){n.decodeDracoFile(l,function(d){for(let m in d.attributes){let R=d.attributes[m],A=o[m];A!==void 0&&(R.normalized=A)}u(d)},a,c,N,f)})})}};p(tt,"GLTFDracoMeshCompressionExtension");var Ie=tt,nt=class nt{constructor(){this.name=g.KHR_TEXTURE_TRANSFORM}extendTexture(t,e){return(e.texCoord===void 0||e.texCoord===t.channel)&&e.offset===void 0&&e.rotation===void 0&&e.scale===void 0||(t=t.clone(),e.texCoord!==void 0&&(t.channel=e.texCoord),e.offset!==void 0&&t.offset.fromArray(e.offset),e.rotation!==void 0&&(t.rotation=e.rotation),e.scale!==void 0&&t.repeat.fromArray(e.scale),t.needsUpdate=!0),t}};p(nt,"GLTFTextureTransformExtension");var Le=nt,st=class st{constructor(){this.name=g.KHR_MESH_QUANTIZATION}};p(st,"GLTFMeshQuantizationExtension");var Oe=st,rt=class rt extends Ut{constructor(t,e,r,n){super(t,e,r,n)}copySampleValue_(t){let e=this.resultBuffer,r=this.sampleValues,n=this.valueSize,s=t*n*3+n;for(let i=0;i!==n;i++)e[i]=r[s+i];return e}interpolate_(t,e,r,n){let s=this.resultBuffer,i=this.sampleValues,a=this.valueSize,o=a*2,c=a*3,l=n-e,u=(r-e)/l,f=u*u,d=f*u,m=t*c,R=m-c,A=-2*d+3*f,T=d-f,E=1-A,x=T-f+u;for(let _=0;_!==a;_++){let w=i[R+_+a],M=i[R+_+o]*l,y=i[m+_+a],U=i[m+_]*l;s[_]=E*w+x*M+A*y+T*U}return s}};p(rt,"GLTFCubicSplineInterpolant");var z=rt,tn=new ee,it=class it extends z{interpolate_(t,e,r,n){let s=super.interpolate_(t,e,r,n);return tn.fromArray(s).normalize().toArray(s),s}};p(it,"GLTFCubicSplineQuaternionInterpolant");var Ce=it,S={FLOAT:5126,FLOAT_MAT3:35675,FLOAT_MAT4:35676,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,LINEAR:9729,REPEAT:10497,SAMPLER_2D:35678,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123},v={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},Qt={9728:dt,9729:W,9984:ht,9985:mt,9986:pt,9987:Y},Zt={33071:lt,33648:ft,10497:F},ce={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},De={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv1",TEXCOORD_2:"uv2",TEXCOORD_3:"uv3",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},O={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},nn={CUBICSPLINE:void 0,LINEAR:Q,STEP:At},ue={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function sn(h){return h.DefaultMaterial===void 0&&(h.DefaultMaterial=new ne({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:ct})),h.DefaultMaterial}p(sn,"createDefaultMaterial");function P(h,t,e){for(let r in e.extensions)h[r]===void 0&&(t.userData.gltfExtensions=t.userData.gltfExtensions||{},t.userData.gltfExtensions[r]=e.extensions[r])}p(P,"addUnknownExtensionsToUserData");function C(h,t){t.extras!==void 0&&(typeof t.extras=="object"?Object.assign(h.userData,t.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+t.extras))}p(C,"assignExtrasToUserData");function rn(h,t,e){let r=!1,n=!1,s=!1;for(let c=0,l=t.length;c<l;c++){let u=t[c];if(u.POSITION!==void 0&&(r=!0),u.NORMAL!==void 0&&(n=!0),u.COLOR_0!==void 0&&(s=!0),r&&n&&s)break}if(!r&&!n&&!s)return Promise.resolve(h);let i=[],a=[],o=[];for(let c=0,l=t.length;c<l;c++){let u=t[c];if(r){let f=u.POSITION!==void 0?e.getDependency("accessor",u.POSITION):h.attributes.position;i.push(f)}if(n){let f=u.NORMAL!==void 0?e.getDependency("accessor",u.NORMAL):h.attributes.normal;a.push(f)}if(s){let f=u.COLOR_0!==void 0?e.getDependency("accessor",u.COLOR_0):h.attributes.color;o.push(f)}}return Promise.all([Promise.all(i),Promise.all(a),Promise.all(o)]).then(function(c){let l=c[0],u=c[1],f=c[2];return r&&(h.morphAttributes.position=l),n&&(h.morphAttributes.normal=u),s&&(h.morphAttributes.color=f),h.morphTargetsRelative=!0,h})}p(rn,"addMorphTargets");function on(h,t){if(h.updateMorphTargets(),t.weights!==void 0)for(let e=0,r=t.weights.length;e<r;e++)h.morphTargetInfluences[e]=t.weights[e];if(t.extras&&Array.isArray(t.extras.targetNames)){let e=t.extras.targetNames;if(h.morphTargetInfluences.length===e.length){h.morphTargetDictionary={};for(let r=0,n=e.length;r<n;r++)h.morphTargetDictionary[e[r]]=r}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}p(on,"updateMorphTargets");function an(h){let t,e=h.extensions&&h.extensions[g.KHR_DRACO_MESH_COMPRESSION];if(e?t="draco:"+e.bufferView+":"+e.indices+":"+le(e.attributes):t=h.indices+":"+le(h.attributes)+":"+h.mode,h.targets!==void 0)for(let r=0,n=h.targets.length;r<n;r++)t+=":"+le(h.targets[r]);return t}p(an,"createPrimitiveKey");function le(h){let t="",e=Object.keys(h).sort();for(let r=0,n=e.length;r<n;r++)t+=e[r]+":"+h[e[r]]+";";return t}p(le,"createAttributesKey");function Pe(h){switch(h){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:throw new Error("THREE.GLTFLoader: Unsupported normalized accessor component type.")}}p(Pe,"getNormalizedComponentScale");function cn(h){return h.search(/\.jpe?g($|\?)/i)>0||h.search(/^data\:image\/jpeg/)===0?"image/jpeg":h.search(/\.webp($|\?)/i)>0||h.search(/^data\:image\/webp/)===0?"image/webp":"image/png"}p(cn,"getImageURIMimeType");var un=new j,ot=class ot{constructor(t={},e={}){this.json=t,this.extensions={},this.plugins={},this.options=e,this.cache=new en,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let r=!1,n=!1,s=-1;typeof navigator<"u"&&(r=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)===!0,n=navigator.userAgent.indexOf("Firefox")>-1,s=n?navigator.userAgent.match(/Firefox\/([0-9]+)\./)[1]:-1),typeof createImageBitmap>"u"||r||n&&s<98?this.textureLoader=new Ft(this.options.manager):this.textureLoader=new zt(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new oe(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials"&&this.fileLoader.setWithCredentials(!0)}setExtensions(t){this.extensions=t}setPlugins(t){this.plugins=t}parse(t,e){let r=this,n=this.json,s=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(i){return i._markDefs&&i._markDefs()}),Promise.all(this._invokeAll(function(i){return i.beforeRoot&&i.beforeRoot()})).then(function(){return Promise.all([r.getDependencies("scene"),r.getDependencies("animation"),r.getDependencies("camera")])}).then(function(i){let a={scene:i[0][n.scene||0],scenes:i[0],animations:i[1],cameras:i[2],asset:n.asset,parser:r,userData:{}};return P(s,a,n),C(a,n),Promise.all(r._invokeAll(function(o){return o.afterRoot&&o.afterRoot(a)})).then(function(){t(a)})}).catch(e)}_markDefs(){let t=this.json.nodes||[],e=this.json.skins||[],r=this.json.meshes||[];for(let n=0,s=e.length;n<s;n++){let i=e[n].joints;for(let a=0,o=i.length;a<o;a++)t[i[a]].isBone=!0}for(let n=0,s=t.length;n<s;n++){let i=t[n];i.mesh!==void 0&&(this._addNodeRef(this.meshCache,i.mesh),i.skin!==void 0&&(r[i.mesh].isSkinnedMesh=!0)),i.camera!==void 0&&this._addNodeRef(this.cameraCache,i.camera)}}_addNodeRef(t,e){e!==void 0&&(t.refs[e]===void 0&&(t.refs[e]=t.uses[e]=0),t.refs[e]++)}_getNodeRef(t,e,r){if(t.refs[e]<=1)return r;let n=r.clone(),s=p((i,a)=>{let o=this.associations.get(i);o!=null&&this.associations.set(a,o);for(let[c,l]of i.children.entries())s(l,a.children[c])},"updateMappings");return s(r,n),n.name+="_instance_"+t.uses[e]++,n}_invokeOne(t){let e=Object.values(this.plugins);e.push(this);for(let r=0;r<e.length;r++){let n=t(e[r]);if(n)return n}return null}_invokeAll(t){let e=Object.values(this.plugins);e.unshift(this);let r=[];for(let n=0;n<e.length;n++){let s=t(e[n]);s&&r.push(s)}return r}getDependency(t,e){let r=t+":"+e,n=this.cache.get(r);if(!n){switch(t){case"scene":n=this.loadScene(e);break;case"node":n=this._invokeOne(function(s){return s.loadNode&&s.loadNode(e)});break;case"mesh":n=this._invokeOne(function(s){return s.loadMesh&&s.loadMesh(e)});break;case"accessor":n=this.loadAccessor(e);break;case"bufferView":n=this._invokeOne(function(s){return s.loadBufferView&&s.loadBufferView(e)});break;case"buffer":n=this.loadBuffer(e);break;case"material":n=this._invokeOne(function(s){return s.loadMaterial&&s.loadMaterial(e)});break;case"texture":n=this._invokeOne(function(s){return s.loadTexture&&s.loadTexture(e)});break;case"skin":n=this.loadSkin(e);break;case"animation":n=this._invokeOne(function(s){return s.loadAnimation&&s.loadAnimation(e)});break;case"camera":n=this.loadCamera(e);break;default:if(n=this._invokeOne(function(s){return s!=this&&s.getDependency&&s.getDependency(t,e)}),!n)throw new Error("Unknown type: "+t);break}this.cache.add(r,n)}return n}getDependencies(t){let e=this.cache.get(t);if(!e){let r=this,n=this.json[t+(t==="mesh"?"es":"s")]||[];e=Promise.all(n.map(function(s,i){return r.getDependency(t,i)})),this.cache.add(t,e)}return e}loadBuffer(t){let e=this.json.buffers[t],r=this.fileLoader;if(e.type&&e.type!=="arraybuffer")throw new Error("THREE.GLTFLoader: "+e.type+" buffer type is not supported.");if(e.uri===void 0&&t===0)return Promise.resolve(this.extensions[g.KHR_BINARY_GLTF].body);let n=this.options;return new Promise(function(s,i){r.load(B.resolveURL(e.uri,n.path),s,void 0,function(){i(new Error('THREE.GLTFLoader: Failed to load buffer "'+e.uri+'".'))})})}loadBufferView(t){let e=this.json.bufferViews[t];return this.getDependency("buffer",e.buffer).then(function(r){let n=e.byteLength||0,s=e.byteOffset||0;return r.slice(s,s+n)})}loadAccessor(t){let e=this,r=this.json,n=this.json.accessors[t];if(n.bufferView===void 0&&n.sparse===void 0){let i=ce[n.type],a=v[n.componentType],o=n.normalized===!0,c=new a(n.count*i);return Promise.resolve(new X(c,i,o))}let s=[];return n.bufferView!==void 0?s.push(this.getDependency("bufferView",n.bufferView)):s.push(null),n.sparse!==void 0&&(s.push(this.getDependency("bufferView",n.sparse.indices.bufferView)),s.push(this.getDependency("bufferView",n.sparse.values.bufferView))),Promise.all(s).then(function(i){let a=i[0],o=ce[n.type],c=v[n.componentType],l=c.BYTES_PER_ELEMENT,u=l*o,f=n.byteOffset||0,d=n.bufferView!==void 0?r.bufferViews[n.bufferView].byteStride:void 0,m=n.normalized===!0,R,A;if(d&&d!==u){let T=Math.floor(f/d),E="InterleavedBuffer:"+n.bufferView+":"+n.componentType+":"+T+":"+n.count,x=e.cache.get(E);x||(R=new c(a,T*d,n.count*d/l),x=new Nt(R,d/l),e.cache.add(E,x)),A=new bt(x,o,f%d/l,m)}else a===null?R=new c(n.count*o):R=new c(a,f,n.count*o),A=new X(R,o,m);if(n.sparse!==void 0){let T=ce.SCALAR,E=v[n.sparse.indices.componentType],x=n.sparse.indices.byteOffset||0,_=n.sparse.values.byteOffset||0,w=new E(i[1],x,n.sparse.count*T),M=new c(i[2],_,n.sparse.count*o);a!==null&&(A=new X(A.array.slice(),A.itemSize,A.normalized));for(let y=0,U=w.length;y<U;y++){let I=w[y];if(A.setX(I,M[y*o]),o>=2&&A.setY(I,M[y*o+1]),o>=3&&A.setZ(I,M[y*o+2]),o>=4&&A.setW(I,M[y*o+3]),o>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return A})}loadTexture(t){let e=this.json,r=this.options,s=e.textures[t].source,i=e.images[s],a=this.textureLoader;if(i.uri){let o=r.manager.getHandler(i.uri);o!==null&&(a=o)}return this.loadTextureImage(t,s,a)}loadTextureImage(t,e,r){let n=this,s=this.json,i=s.textures[t],a=s.images[e],o=(a.uri||a.bufferView)+":"+i.sampler;if(this.textureCache[o])return this.textureCache[o];let c=this.loadImageSource(e,r).then(function(l){l.flipY=!1,l.name=i.name||a.name||"",l.name===""&&typeof a.uri=="string"&&a.uri.startsWith("data:image/")===!1&&(l.name=a.uri);let f=(s.samplers||{})[i.sampler]||{};return l.magFilter=Qt[f.magFilter]||W,l.minFilter=Qt[f.minFilter]||Y,l.wrapS=Zt[f.wrapS]||F,l.wrapT=Zt[f.wrapT]||F,n.associations.set(l,{textures:t}),l}).catch(function(){return null});return this.textureCache[o]=c,c}loadImageSource(t,e){let r=this,n=this.json,s=this.options;if(this.sourceCache[t]!==void 0)return this.sourceCache[t].then(u=>u.clone());let i=n.images[t],a=self.URL||self.webkitURL,o=i.uri||"",c=!1;if(i.bufferView!==void 0)o=r.getDependency("bufferView",i.bufferView).then(function(u){c=!0;let f=new Blob([u],{type:i.mimeType});return o=a.createObjectURL(f),o});else if(i.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+t+" is missing URI and bufferView");let l=Promise.resolve(o).then(function(u){return new Promise(function(f,d){let m=f;e.isImageBitmapLoader===!0&&(m=p(function(R){let A=new $(R);A.needsUpdate=!0,f(A)},"onLoad")),e.load(B.resolveURL(u,s.path),m,void 0,d)})}).then(function(u){return c===!0&&a.revokeObjectURL(o),u.userData.mimeType=i.mimeType||cn(i.uri),u}).catch(function(u){throw console.error("THREE.GLTFLoader: Couldn't load texture",o),u});return this.sourceCache[t]=l,l}assignTexture(t,e,r,n){let s=this;return this.getDependency("texture",r.index).then(function(i){if(!i)return null;if(r.texCoord!==void 0&&r.texCoord>0&&(i=i.clone(),i.channel=r.texCoord),s.extensions[g.KHR_TEXTURE_TRANSFORM]){let a=r.extensions!==void 0?r.extensions[g.KHR_TEXTURE_TRANSFORM]:void 0;if(a){let o=s.associations.get(i);i=s.extensions[g.KHR_TEXTURE_TRANSFORM].extendTexture(i,a),s.associations.set(i,o)}}return n!==void 0&&(i.colorSpace=n),t[e]=i,i})}assignFinalMaterial(t){let e=t.geometry,r=t.material,n=e.attributes.tangent===void 0,s=e.attributes.color!==void 0,i=e.attributes.normal===void 0;if(t.isPoints){let a="PointsMaterial:"+r.uuid,o=this.cache.get(a);o||(o=new Bt,V.prototype.copy.call(o,r),o.color.copy(r.color),o.map=r.map,o.sizeAttenuation=!1,this.cache.add(a,o)),r=o}else if(t.isLine){let a="LineBasicMaterial:"+r.uuid,o=this.cache.get(a);o||(o=new Dt,V.prototype.copy.call(o,r),o.color.copy(r.color),o.map=r.map,this.cache.add(a,o)),r=o}if(n||s||i){let a="ClonedMaterial:"+r.uuid+":";n&&(a+="derivative-tangents:"),s&&(a+="vertex-colors:"),i&&(a+="flat-shading:");let o=this.cache.get(a);o||(o=r.clone(),s&&(o.vertexColors=!0),i&&(o.flatShading=!0),n&&(o.normalScale&&(o.normalScale.y*=-1),o.clearcoatNormalScale&&(o.clearcoatNormalScale.y*=-1)),this.cache.add(a,o),this.associations.set(o,this.associations.get(r))),r=o}t.material=r}getMaterialType(){return ne}loadMaterial(t){let e=this,r=this.json,n=this.extensions,s=r.materials[t],i,a={},o=s.extensions||{},c=[];if(o[g.KHR_MATERIALS_UNLIT]){let u=n[g.KHR_MATERIALS_UNLIT];i=u.getMaterialType(),c.push(u.extendParams(a,s,e))}else{let u=s.pbrMetallicRoughness||{};if(a.color=new L(1,1,1),a.opacity=1,Array.isArray(u.baseColorFactor)){let f=u.baseColorFactor;a.color.setRGB(f[0],f[1],f[2],N),a.opacity=f[3]}u.baseColorTexture!==void 0&&c.push(e.assignTexture(a,"map",u.baseColorTexture,k)),a.metalness=u.metallicFactor!==void 0?u.metallicFactor:1,a.roughness=u.roughnessFactor!==void 0?u.roughnessFactor:1,u.metallicRoughnessTexture!==void 0&&(c.push(e.assignTexture(a,"metalnessMap",u.metallicRoughnessTexture)),c.push(e.assignTexture(a,"roughnessMap",u.metallicRoughnessTexture))),i=this._invokeOne(function(f){return f.getMaterialType&&f.getMaterialType(t)}),c.push(Promise.all(this._invokeAll(function(f){return f.extendMaterialParams&&f.extendMaterialParams(t,a)})))}s.doubleSided===!0&&(a.side=ut);let l=s.alphaMode||ue.OPAQUE;if(l===ue.BLEND?(a.transparent=!0,a.depthWrite=!1):(a.transparent=!1,l===ue.MASK&&(a.alphaTest=s.alphaCutoff!==void 0?s.alphaCutoff:.5)),s.normalTexture!==void 0&&i!==H&&(c.push(e.assignTexture(a,"normalMap",s.normalTexture)),a.normalScale=new Z(1,1),s.normalTexture.scale!==void 0)){let u=s.normalTexture.scale;a.normalScale.set(u,u)}if(s.occlusionTexture!==void 0&&i!==H&&(c.push(e.assignTexture(a,"aoMap",s.occlusionTexture)),s.occlusionTexture.strength!==void 0&&(a.aoMapIntensity=s.occlusionTexture.strength)),s.emissiveFactor!==void 0&&i!==H){let u=s.emissiveFactor;a.emissive=new L().setRGB(u[0],u[1],u[2],N)}return s.emissiveTexture!==void 0&&i!==H&&c.push(e.assignTexture(a,"emissiveMap",s.emissiveTexture,k)),Promise.all(c).then(function(){let u=new i(a);return s.name&&(u.name=s.name),C(u,s),e.associations.set(u,{materials:t}),s.extensions&&P(n,u,s),u})}createUniqueName(t){let e=qt.sanitizeNodeName(t||"");return e in this.nodeNamesUsed?e+"_"+ ++this.nodeNamesUsed[e]:(this.nodeNamesUsed[e]=0,e)}loadGeometries(t){let e=this,r=this.extensions,n=this.primitiveCache;function s(a){return r[g.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(a,e).then(function(o){return Jt(o,a,e)})}p(s,"createDracoPrimitive");let i=[];for(let a=0,o=t.length;a<o;a++){let c=t[a],l=an(c),u=n[l];if(u)i.push(u.promise);else{let f;c.extensions&&c.extensions[g.KHR_DRACO_MESH_COMPRESSION]?f=s(c):f=Jt(new xt,c,e),n[l]={primitive:c,promise:f},i.push(f)}}return Promise.all(i)}loadMesh(t){let e=this,r=this.json,n=this.extensions,s=r.meshes[t],i=s.primitives,a=[];for(let o=0,c=i.length;o<c;o++){let l=i[o].material===void 0?sn(this.cache):this.getDependency("material",i[o].material);a.push(l)}return a.push(e.loadGeometries(i)),Promise.all(a).then(function(o){let c=o.slice(0,o.length-1),l=o[o.length-1],u=[];for(let d=0,m=l.length;d<m;d++){let R=l[d],A=i[d],T,E=c[d];if(A.mode===S.TRIANGLES||A.mode===S.TRIANGLE_STRIP||A.mode===S.TRIANGLE_FAN||A.mode===void 0)T=s.isSkinnedMesh===!0?new Mt(R,E):new St(R,E),T.isSkinnedMesh===!0&&T.normalizeSkinWeights(),A.mode===S.TRIANGLE_STRIP?T.geometry=ae(T.geometry,gt):A.mode===S.TRIANGLE_FAN&&(T.geometry=ae(T.geometry,Tt));else if(A.mode===S.LINES)T=new kt(R,E);else if(A.mode===S.LINE_STRIP)T=new Pt(R,E);else if(A.mode===S.LINE_LOOP)T=new Ht(R,E);else if(A.mode===S.POINTS)T=new vt(R,E);else throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+A.mode);Object.keys(T.geometry.morphAttributes).length>0&&on(T,s),T.name=e.createUniqueName(s.name||"mesh_"+t),C(T,s),A.extensions&&P(n,T,A),e.assignFinalMaterial(T),u.push(T)}for(let d=0,m=u.length;d<m;d++)e.associations.set(u[d],{meshes:t,primitives:d});if(u.length===1)return s.extensions&&P(n,u[0],s),u[0];let f=new G;s.extensions&&P(n,f,s),e.associations.set(f,{meshes:t});for(let d=0,m=u.length;d<m;d++)f.add(u[d]);return f})}loadCamera(t){let e,r=this.json.cameras[t],n=r[r.type];if(!n){console.warn("THREE.GLTFLoader: Missing camera parameters.");return}return r.type==="perspective"?e=new yt(Rt.radToDeg(n.yfov),n.aspectRatio||1,n.znear||1,n.zfar||2e6):r.type==="orthographic"&&(e=new wt(-n.xmag,n.xmag,n.ymag,-n.ymag,n.znear,n.zfar)),r.name&&(e.name=this.createUniqueName(r.name)),C(e,r),Promise.resolve(e)}loadSkin(t){let e=this.json.skins[t],r=[];for(let n=0,s=e.joints.length;n<s;n++)r.push(this._loadNodeShallow(e.joints[n]));return e.inverseBindMatrices!==void 0?r.push(this.getDependency("accessor",e.inverseBindMatrices)):r.push(null),Promise.all(r).then(function(n){let s=n.pop(),i=n,a=[],o=[];for(let c=0,l=i.length;c<l;c++){let u=i[c];if(u){a.push(u);let f=new j;s!==null&&f.fromArray(s.array,c*16),o.push(f)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',e.joints[c])}return new Lt(a,o)})}loadAnimation(t){let e=this.json,r=this,n=e.animations[t],s=n.name?n.name:"animation_"+t,i=[],a=[],o=[],c=[],l=[];for(let u=0,f=n.channels.length;u<f;u++){let d=n.channels[u],m=n.samplers[d.sampler],R=d.target,A=R.node,T=n.parameters!==void 0?n.parameters[m.input]:m.input,E=n.parameters!==void 0?n.parameters[m.output]:m.output;R.node!==void 0&&(i.push(this.getDependency("node",A)),a.push(this.getDependency("accessor",T)),o.push(this.getDependency("accessor",E)),c.push(m),l.push(R))}return Promise.all([Promise.all(i),Promise.all(a),Promise.all(o),Promise.all(c),Promise.all(l)]).then(function(u){let f=u[0],d=u[1],m=u[2],R=u[3],A=u[4],T=[];for(let E=0,x=f.length;E<x;E++){let _=f[E],w=d[E],M=m[E],y=R[E],U=A[E];if(_===void 0)continue;_.updateMatrix&&_.updateMatrix();let I=r._createAnimationTracks(_,w,M,y,U);if(I)for(let q=0;q<I.length;q++)T.push(I[q])}return new jt(s,void 0,T)})}createNodeMesh(t){let e=this.json,r=this,n=e.nodes[t];return n.mesh===void 0?null:r.getDependency("mesh",n.mesh).then(function(s){let i=r._getNodeRef(r.meshCache,n.mesh,s);return n.weights!==void 0&&i.traverse(function(a){if(a.isMesh)for(let o=0,c=n.weights.length;o<c;o++)a.morphTargetInfluences[o]=n.weights[o]}),i})}loadNode(t){let e=this.json,r=this,n=e.nodes[t],s=r._loadNodeShallow(t),i=[],a=n.children||[];for(let c=0,l=a.length;c<l;c++)i.push(r.getDependency("node",a[c]));let o=n.skin===void 0?Promise.resolve(null):r.getDependency("skin",n.skin);return Promise.all([s,Promise.all(i),o]).then(function(c){let l=c[0],u=c[1],f=c[2];f!==null&&l.traverse(function(d){d.isSkinnedMesh&&d.bind(f,un)});for(let d=0,m=u.length;d<m;d++)l.add(u[d]);return l})}_loadNodeShallow(t){let e=this.json,r=this.extensions,n=this;if(this.nodeCache[t]!==void 0)return this.nodeCache[t];let s=e.nodes[t],i=s.name?n.createUniqueName(s.name):"",a=[],o=n._invokeOne(function(c){return c.createNodeMesh&&c.createNodeMesh(t)});return o&&a.push(o),s.camera!==void 0&&a.push(n.getDependency("camera",s.camera).then(function(c){return n._getNodeRef(n.cameraCache,s.camera,c)})),n._invokeAll(function(c){return c.createNodeAttachment&&c.createNodeAttachment(t)}).forEach(function(c){a.push(c)}),this.nodeCache[t]=Promise.all(a).then(function(c){let l;if(s.isBone===!0?l=new It:c.length>1?l=new G:c.length===1?l=c[0]:l=new te,l!==c[0])for(let u=0,f=c.length;u<f;u++)l.add(c[u]);if(s.name&&(l.userData.name=s.name,l.name=i),C(l,s),s.extensions&&P(r,l,s),s.matrix!==void 0){let u=new j;u.fromArray(s.matrix),l.applyMatrix4(u)}else s.translation!==void 0&&l.position.fromArray(s.translation),s.rotation!==void 0&&l.quaternion.fromArray(s.rotation),s.scale!==void 0&&l.scale.fromArray(s.scale);return n.associations.has(l)||n.associations.set(l,{}),n.associations.get(l).nodes=t,l}),this.nodeCache[t]}loadScene(t){let e=this.extensions,r=this.json.scenes[t],n=this,s=new G;r.name&&(s.name=n.createUniqueName(r.name)),C(s,r),r.extensions&&P(e,s,r);let i=r.nodes||[],a=[];for(let o=0,c=i.length;o<c;o++)a.push(n.getDependency("node",i[o]));return Promise.all(a).then(function(o){for(let l=0,u=o.length;l<u;l++)s.add(o[l]);let c=p(l=>{let u=new Map;for(let[f,d]of n.associations)(f instanceof V||f instanceof $)&&u.set(f,d);return l.traverse(f=>{let d=n.associations.get(f);d!=null&&u.set(f,d)}),u},"reduceAssociations");return n.associations=c(s),s})}_createAnimationTracks(t,e,r,n,s){let i=[],a=t.name?t.name:t.uuid,o=[];O[s.path]===O.weights?t.traverse(function(f){f.morphTargetInfluences&&o.push(f.name?f.name:f.uuid)}):o.push(a);let c;switch(O[s.path]){case O.weights:c=se;break;case O.rotation:c=re;break;case O.position:case O.scale:c=ie;break;default:switch(r.itemSize){case 1:c=se;break;case 2:case 3:default:c=ie;break}break}let l=n.interpolation!==void 0?nn[n.interpolation]:Q,u=this._getArrayFromAccessor(r);for(let f=0,d=o.length;f<d;f++){let m=new c(o[f]+"."+O[s.path],e.array,u,l);n.interpolation==="CUBICSPLINE"&&this._createCubicSplineTrackInterpolant(m),i.push(m)}return i}_getArrayFromAccessor(t){let e=t.array;if(t.normalized){let r=Pe(e.constructor),n=new Float32Array(e.length);for(let s=0,i=e.length;s<i;s++)n[s]=e[s]*r;e=n}return e}_createCubicSplineTrackInterpolant(t){t.createInterpolant=p(function(r){let n=this instanceof re?Ce:z;return new n(this.times,this.values,this.getValueSize()/3,r)},"InterpolantFactoryMethodGLTFCubicSpline"),t.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0}};p(ot,"GLTFParser");var ke=ot;function ln(h,t,e){let r=t.attributes,n=new _t;if(r.POSITION!==void 0){let a=e.json.accessors[r.POSITION],o=a.min,c=a.max;if(o!==void 0&&c!==void 0){if(n.set(new D(o[0],o[1],o[2]),new D(c[0],c[1],c[2])),a.normalized){let l=Pe(v[a.componentType]);n.min.multiplyScalar(l),n.max.multiplyScalar(l)}}else{console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");return}}else return;let s=t.targets;if(s!==void 0){let a=new D,o=new D;for(let c=0,l=s.length;c<l;c++){let u=s[c];if(u.POSITION!==void 0){let f=e.json.accessors[u.POSITION],d=f.min,m=f.max;if(d!==void 0&&m!==void 0){if(o.setX(Math.max(Math.abs(d[0]),Math.abs(m[0]))),o.setY(Math.max(Math.abs(d[1]),Math.abs(m[1]))),o.setZ(Math.max(Math.abs(d[2]),Math.abs(m[2]))),f.normalized){let R=Pe(v[f.componentType]);o.multiplyScalar(R)}a.max(o)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}n.expandByVector(a)}h.boundingBox=n;let i=new Et;n.getCenter(i.center),i.radius=n.min.distanceTo(n.max)/2,h.boundingSphere=i}p(ln,"computeBounds");function Jt(h,t,e){let r=t.attributes,n=[];function s(i,a){return e.getDependency("accessor",i).then(function(o){h.setAttribute(a,o)})}p(s,"assignAttributeAccessor");for(let i in r){let a=De[i]||i.toLowerCase();a in h.attributes||n.push(s(r[i],a))}if(t.indices!==void 0&&!h.index){let i=e.getDependency("accessor",t.indices).then(function(a){h.setIndex(a)});n.push(i)}return J.workingColorSpace!==N&&"COLOR_0"in r&&console.warn('THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "'.concat(J.workingColorSpace,'" not supported.')),C(h,t),ln(h,t,e),Promise.all(n).then(function(){return t.targets!==void 0?rn(h,t.targets,e):h})}p(Jt,"addPrimitiveAttributes");export{Wt as GLTFLoader};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as u,j as hn}from"./chunk-NTOUDKDJ.js";hn();var ln={},Qn=u(function(n,r,t,e,i){var a=new Worker(ln[r]||(ln[r]=URL.createObjectURL(new Blob([n+';addEventListener("error",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'],{type:"text/javascript"}))));return a.onmessage=function(o){var f=o.data,v=f.$e$;if(v){var s=new Error(v[0]);s.code=v[1],s.stack=v[2],i(s,null)}else i(null,f)},a.postMessage(t,e),a},"wk"),U=Uint8Array,q=Uint16Array,gr=Uint32Array,yr=new U([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),wr=new U([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Ur=new U([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),xn=u(function(n,r){for(var t=new q(31),e=0;e<31;++e)t[e]=r+=1<<n[e-1];for(var i=new gr(t[30]),e=1;e<30;++e)for(var a=t[e];a<t[e+1];++a)i[a]=a-t[e]<<5|e;return[t,i]},"freb"),zn=xn(yr,2),dr=zn[0],Or=zn[1];dr[28]=258,Or[258]=28;var An=xn(wr,0),Mn=An[0],Yr=An[1],Dr=new q(32768);for(E=0;E<32768;++E)tr=(E&43690)>>>1|(E&21845)<<1,tr=(tr&52428)>>>2|(tr&13107)<<2,tr=(tr&61680)>>>4|(tr&3855)<<4,Dr[E]=((tr&65280)>>>8|(tr&255)<<8)>>>1;var tr,E,X=u(function(n,r,t){for(var e=n.length,i=0,a=new q(r);i<e;++i)n[i]&&++a[n[i]-1];var o=new q(r);for(i=0;i<r;++i)o[i]=o[i-1]+a[i-1]<<1;var f;if(t){f=new q(1<<r);var v=15-r;for(i=0;i<e;++i)if(n[i])for(var s=i<<4|n[i],h=r-n[i],l=o[n[i]-1]++<<h,y=l|(1<<h)-1;l<=y;++l)f[Dr[l]>>>v]=s}else for(f=new q(e),i=0;i<e;++i)n[i]&&(f[i]=Dr[o[n[i]-1]++]>>>15-n[i]);return f},"hMap"),ir=new U(288);for(E=0;E<144;++E)ir[E]=8;var E;for(E=144;E<256;++E)ir[E]=9;var E;for(E=256;E<280;++E)ir[E]=7;var E;for(E=280;E<288;++E)ir[E]=8;var E,cr=new U(32);for(E=0;E<32;++E)cr[E]=5;var E,Tn=X(ir,9,0),Un=X(ir,9,1),Dn=X(cr,5,0),Sn=X(cr,5,1),Zr=u(function(n){for(var r=n[0],t=1;t<n.length;++t)n[t]>r&&(r=n[t]);return r},"max"),V=u(function(n,r,t){var e=r/8|0;return(n[e]|n[e+1]<<8)>>(r&7)&t},"bits"),kr=u(function(n,r){var t=r/8|0;return(n[t]|n[t+1]<<8|n[t+2]<<16)>>(r&7)},"bits16"),Sr=u(function(n){return(n+7)/8|0},"shft"),d=u(function(n,r,t){(r==null||r<0)&&(r=0),(t==null||t>n.length)&&(t=n.length);var e=new(n.BYTES_PER_ELEMENT==2?q:n.BYTES_PER_ELEMENT==4?gr:U)(t-r);return e.set(n.subarray(r,t)),e},"slc"),at={UnexpectedEOF:0,InvalidBlockType:1,InvalidLengthLiteral:2,InvalidDistance:3,StreamFinished:4,NoStreamHandler:5,InvalidHeader:6,NoCallback:7,InvalidUTF8:8,ExtraFieldTooLong:9,InvalidDate:10,FilenameTooLong:11,StreamFinishing:12,InvalidZipData:13,UnknownCompressionMethod:14},Cn=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],g=u(function(n,r,t){var e=new Error(r||Cn[n]);if(e.code=n,Error.captureStackTrace&&Error.captureStackTrace(e,g),!t)throw e;return e},"err"),Cr=u(function(n,r,t){var e=n.length;if(!e||t&&t.f&&!t.l)return r||new U(0);var i=!r||t,a=!t||t.i;t||(t={}),r||(r=new U(e*3));var o=u(function(Ir){var Tr=r.length;if(Ir>Tr){var vr=new U(Math.max(Tr*2,Ir));vr.set(r),r=vr}},"cbuf"),f=t.f||0,v=t.p||0,s=t.b||0,h=t.l,l=t.d,y=t.m,z=t.n,x=e*8;do{if(!h){f=V(n,v,1);var A=V(n,v+1,3);if(v+=3,A)if(A==1)h=Un,l=Sn,y=9,z=5;else if(A==2){var M=V(n,v,31)+257,m=V(n,v+10,15)+4,B=M+V(n,v+5,31)+1;v+=14;for(var C=new U(B),D=new U(19),c=0;c<m;++c)D[Ur[c]]=V(n,v+c*3,7);v+=m*3;for(var G=Zr(D),S=(1<<G)-1,R=X(D,G,1),c=0;c<B;){var Z=R[V(n,v,S)];v+=Z&15;var p=Z>>>4;if(p<16)C[c++]=p;else{var O=0,F=0;for(p==16?(F=3+V(n,v,3),v+=2,O=C[c-1]):p==17?(F=3+V(n,v,7),v+=3):p==18&&(F=11+V(n,v,127),v+=7);F--;)C[c++]=O}}var P=C.subarray(0,M),k=C.subarray(M);y=Zr(P),z=Zr(k),h=X(P,y,1),l=X(k,z,1)}else g(1);else{var p=Sr(v)+4,w=n[p-4]|n[p-3]<<8,T=p+w;if(T>e){a&&g(0);break}i&&o(s+w),r.set(n.subarray(p,T),s),t.b=s+=w,t.p=v=T*8,t.f=f;continue}if(v>x){a&&g(0);break}}i&&o(s+131072);for(var L=(1<<y)-1,H=(1<<z)-1,j=v;;j=v){var O=h[kr(n,v)&L],Q=O>>>4;if(v+=O&15,v>x){a&&g(0);break}if(O||g(2),Q<256)r[s++]=Q;else if(Q==256){j=v,h=null;break}else{var Y=Q-254;if(Q>264){var c=Q-257,_=yr[c];Y=V(n,v,(1<<_)-1)+dr[c],v+=_}var rr=l[kr(n,v)&H],J=rr>>>4;rr||g(3),v+=rr&15;var k=Mn[J];if(J>3){var _=wr[J];k+=kr(n,v)&(1<<_)-1,v+=_}if(v>x){a&&g(0);break}i&&o(s+131072);for(var $=s+Y;s<$;s+=4)r[s]=r[s-k],r[s+1]=r[s+1-k],r[s+2]=r[s+2-k],r[s+3]=r[s+3-k];s=$}}t.l=h,t.p=j,t.b=s,t.f=f,h&&(f=1,t.m=y,t.d=l,t.n=z)}while(!f);return s==r.length?r:d(r,0,s)},"inflt"),nr=u(function(n,r,t){t<<=r&7;var e=r/8|0;n[e]|=t,n[e+1]|=t>>>8},"wbits"),hr=u(function(n,r,t){t<<=r&7;var e=r/8|0;n[e]|=t,n[e+1]|=t>>>8,n[e+2]|=t>>>16},"wbits16"),Gr=u(function(n,r){for(var t=[],e=0;e<n.length;++e)n[e]&&t.push({s:e,f:n[e]});var i=t.length,a=t.slice();if(!i)return[er,0];if(i==1){var o=new U(t[0].s+1);return o[t[0].s]=1,[o,1]}t.sort(function(B,C){return B.f-C.f}),t.push({s:-1,f:25001});var f=t[0],v=t[1],s=0,h=1,l=2;for(t[0]={s:-1,f:f.f+v.f,l:f,r:v};h!=i-1;)f=t[t[s].f<t[l].f?s++:l++],v=t[s!=h&&t[s].f<t[l].f?s++:l++],t[h++]={s:-1,f:f.f+v.f,l:f,r:v};for(var y=a[0].s,e=1;e<i;++e)a[e].s>y&&(y=a[e].s);var z=new q(y+1),x=Lr(t[h-1],z,0);if(x>r){var e=0,A=0,p=x-r,w=1<<p;for(a.sort(function(C,D){return z[D.s]-z[C.s]||C.f-D.f});e<i;++e){var T=a[e].s;if(z[T]>r)A+=w-(1<<x-z[T]),z[T]=r;else break}for(A>>>=p;A>0;){var M=a[e].s;z[M]<r?A-=1<<r-z[M]++-1:++e}for(;e>=0&&A;--e){var m=a[e].s;z[m]==r&&(--z[m],++A)}x=r}return[new U(z),x]},"hTree"),Lr=u(function(n,r,t){return n.s==-1?Math.max(Lr(n.l,r,t+1),Lr(n.r,r,t+1)):r[n.s]=t},"ln"),Wr=u(function(n){for(var r=n.length;r&&!n[--r];);for(var t=new q(++r),e=0,i=n[0],a=1,o=u(function(v){t[e++]=v},"w"),f=1;f<=r;++f)if(n[f]==i&&f!=r)++a;else{if(!i&&a>2){for(;a>138;a-=138)o(32754);a>2&&(o(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(o(i),--a;a>6;a-=6)o(8304);a>2&&(o(a-3<<5|8208),a=0)}for(;a--;)o(i);a=1,i=n[f]}return[t.subarray(0,e),r]},"lc"),lr=u(function(n,r){for(var t=0,e=0;e<r.length;++e)t+=n[e]*r[e];return t},"clen"),Pr=u(function(n,r,t){var e=t.length,i=Sr(r+2);n[i]=e&255,n[i+1]=e>>>8,n[i+2]=n[i]^255,n[i+3]=n[i+1]^255;for(var a=0;a<e;++a)n[i+a+4]=t[a];return(i+4+e)*8},"wfblk"),jr=u(function(n,r,t,e,i,a,o,f,v,s,h){nr(r,h++,t),++i[256];for(var l=Gr(i,15),y=l[0],z=l[1],x=Gr(a,15),A=x[0],p=x[1],w=Wr(y),T=w[0],M=w[1],m=Wr(A),B=m[0],C=m[1],D=new q(19),c=0;c<T.length;++c)D[T[c]&31]++;for(var c=0;c<B.length;++c)D[B[c]&31]++;for(var G=Gr(D,7),S=G[0],R=G[1],Z=19;Z>4&&!S[Ur[Z-1]];--Z);var O=s+5<<3,F=lr(i,ir)+lr(a,cr)+o,P=lr(i,y)+lr(a,A)+o+14+3*Z+lr(D,S)+(2*D[16]+3*D[17]+7*D[18]);if(O<=F&&O<=P)return Pr(r,h,n.subarray(v,v+s));var k,L,H,j;if(nr(r,h,1+(P<F)),h+=2,P<F){k=X(y,z,0),L=y,H=X(A,p,0),j=A;var Q=X(S,R,0);nr(r,h,M-257),nr(r,h+5,C-1),nr(r,h+10,Z-4),h+=14;for(var c=0;c<Z;++c)nr(r,h+3*c,S[Ur[c]]);h+=3*Z;for(var Y=[T,B],_=0;_<2;++_)for(var rr=Y[_],c=0;c<rr.length;++c){var J=rr[c]&31;nr(r,h,Q[J]),h+=S[J],J>15&&(nr(r,h,rr[c]>>>5&127),h+=rr[c]>>>12)}}else k=Tn,L=ir,H=Dn,j=cr;for(var c=0;c<f;++c)if(e[c]>255){var J=e[c]>>>18&31;hr(r,h,k[J+257]),h+=L[J+257],J>7&&(nr(r,h,e[c]>>>23&31),h+=yr[J]);var $=e[c]&31;hr(r,h,H[$]),h+=j[$],$>3&&(hr(r,h,e[c]>>>5&8191),h+=wr[$])}else hr(r,h,k[e[c]]),h+=L[e[c]];return hr(r,h,k[256]),h+L[256]},"wblk"),En=new gr([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),er=new U(0),Fn=u(function(n,r,t,e,i,a){var o=n.length,f=new U(e+o+5*(1+Math.ceil(o/7e3))+i),v=f.subarray(e,f.length-i),s=0;if(!r||o<8)for(var h=0;h<=o;h+=65535){var l=h+65535;l>=o&&(v[s>>3]=a),s=Pr(v,s+1,n.subarray(h,l))}else{for(var y=En[r-1],z=y>>>13,x=y&8191,A=(1<<t)-1,p=new q(32768),w=new q(A+1),T=Math.ceil(t/3),M=2*T,m=u(function(qr){return(n[qr]^n[qr+1]<<T^n[qr+2]<<M)&A},"hsh"),B=new gr(25e3),C=new q(288),D=new q(32),c=0,G=0,h=0,S=0,R=0,Z=0;h<o;++h){var O=m(h),F=h&32767,P=w[O];if(p[F]=P,w[O]=F,R<=h){var k=o-h;if((c>7e3||S>24576)&&k>423){s=jr(n,v,0,B,C,D,G,S,Z,h-Z,s),S=c=G=0,Z=h;for(var L=0;L<286;++L)C[L]=0;for(var L=0;L<30;++L)D[L]=0}var H=2,j=0,Q=x,Y=F-P&32767;if(k>2&&O==m(h-Y))for(var _=Math.min(z,k)-1,rr=Math.min(32767,h),J=Math.min(258,k);Y<=rr&&--Q&&F!=P;){if(n[h+H]==n[h+H-Y]){for(var $=0;$<J&&n[h+$]==n[h+$-Y];++$);if($>H){if(H=$,j=Y,$>_)break;for(var Ir=Math.min(Y,$-2),Tr=0,L=0;L<Ir;++L){var vr=h-Y+L+32768&32767,Kn=p[vr],sn=vr-Kn+32768&32767;sn>Tr&&(Tr=sn,P=vr)}}}F=P,P=p[F],Y+=F-P+32768&32767}if(j){B[S++]=268435456|Or[H]<<18|Yr[j];var un=Or[H]&31,vn=Yr[j]&31;G+=yr[un]+wr[vn],++C[257+un],++D[vn],R=h+H,++c}else B[S++]=n[h],++C[n[h]]}}s=jr(n,v,a,B,C,D,G,S,Z,h-Z,s),!a&&s&7&&(s=Pr(v,s+1,er))}return d(f,0,e+Sr(s)+i)},"dflt"),In=function(){for(var n=new Int32Array(256),r=0;r<256;++r){for(var t=r,e=9;--e;)t=(t&1&&-306674912)^t>>>1;n[r]=t}return n}(),mr=u(function(){var n=-1;return{p:function(r){for(var t=n,e=0;e<r.length;++e)t=In[t&255^r[e]]^t>>>8;n=t},d:function(){return~n}}},"crc"),br=u(function(){var n=1,r=0;return{p:function(t){for(var e=n,i=r,a=t.length|0,o=0;o!=a;){for(var f=Math.min(o+2655,a);o<f;++o)i+=e+=t[o];e=(e&65535)+15*(e>>16),i=(i&65535)+15*(i>>16)}n=e,r=i},d:function(){return n%=65521,r%=65521,(n&255)<<24|n>>>8<<16|(r&255)<<8|r>>>8}}},"adler"),ur=u(function(n,r,t,e,i){return Fn(n,r.level==null?6:r.level,r.mem==null?Math.ceil(Math.max(8,Math.min(13,Math.log(n.length)))*1.5):12+r.mem,t,e,!i)},"dopt"),Er=u(function(n,r){var t={};for(var e in n)t[e]=n[e];for(var e in r)t[e]=r[e];return t},"mrg"),cn=u(function(n,r,t){for(var e=n(),i=n.toString(),a=i.slice(i.indexOf("[")+1,i.lastIndexOf("]")).replace(/\s+/g,"").split(","),o=0;o<e.length;++o){var f=e[o],v=a[o];if(typeof f=="function"){r+=";"+v+"=";var s=f.toString();if(f.prototype)if(s.indexOf("[native code]")!=-1){var h=s.indexOf(" ",8)+1;r+=s.slice(h,s.indexOf("(",h))}else{r+=s;for(var l in f.prototype)r+=";"+v+".prototype."+l+"="+f.prototype[l].toString()}else r+=s}else t[v]=f}return[r,t]},"wcln"),Br=[],Vn=u(function(n){var r=[];for(var t in n)n[t].buffer&&r.push((n[t]=new n[t].constructor(n[t])).buffer);return r},"cbfs"),Bn=u(function(n,r,t,e){var i;if(!Br[t]){for(var a="",o={},f=n.length-1,v=0;v<f;++v)i=cn(n[v],a,o),a=i[0],o=i[1];Br[t]=cn(n[f],a,o)}var s=Er({},Br[t][1]);return Qn(Br[t][0]+";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage="+r.toString()+"}",t,s,Vn(s),e)},"wrkr"),xr=u(function(){return[U,q,gr,yr,wr,Ur,dr,Mn,Un,Sn,Dr,Cn,X,Zr,V,kr,Sr,d,g,Cr,Fr,fr,_r]},"bInflt"),zr=u(function(){return[U,q,gr,yr,wr,Ur,Or,Yr,Tn,ir,Dn,cr,Dr,En,er,X,nr,hr,Gr,Lr,Wr,lr,Pr,jr,Sr,d,Fn,ur,$r,fr]},"bDflt"),Zn=u(function(){return[rn,tn,I,mr,In]},"gze"),kn=u(function(){return[nn,Ln]},"guze"),Gn=u(function(){return[en,I,br]},"zle"),On=u(function(){return[Pn]},"zule"),fr=u(function(n){return postMessage(n,[n.buffer])},"pbf"),_r=u(function(n){return n&&n.size&&new U(n.size)},"gu8"),Ar=u(function(n,r,t,e,i,a){var o=Bn(t,e,i,function(f,v){o.terminate(),a(f,v)});return o.postMessage([n,r],r.consume?[n.buffer]:[]),function(){o.terminate()}},"cbify"),b=u(function(n){return n.ondata=function(r,t){return postMessage([r,t],[r.buffer])},function(r){return n.push(r.data[0],r.data[1])}},"astrm"),Mr=u(function(n,r,t,e,i){var a,o=Bn(n,e,i,function(f,v){f?(o.terminate(),r.ondata.call(r,f)):(v[1]&&o.terminate(),r.ondata.call(r,f,v[0],v[1]))});o.postMessage(t),r.push=function(f,v){r.ondata||g(5),a&&r.ondata(g(4,0,1),null,!!v),o.postMessage([f,a=v],[f.buffer])},r.terminate=function(){o.terminate()}},"astrmify"),W=u(function(n,r){return n[r]|n[r+1]<<8},"b2"),N=u(function(n,r){return(n[r]|n[r+1]<<8|n[r+2]<<16|n[r+3]<<24)>>>0},"b4"),Hr=u(function(n,r){return N(n,r)+N(n,r+4)*4294967296},"b8"),I=u(function(n,r,t){for(;t;++r)n[r]=t,t>>>=8},"wbytes"),rn=u(function(n,r){var t=r.filename;if(n[0]=31,n[1]=139,n[2]=8,n[8]=r.level<2?4:r.level==9?2:0,n[9]=3,r.mtime!=0&&I(n,4,Math.floor(new Date(r.mtime||Date.now())/1e3)),t){n[3]=8;for(var e=0;e<=t.length;++e)n[e+10]=t.charCodeAt(e)}},"gzh"),nn=u(function(n){(n[0]!=31||n[1]!=139||n[2]!=8)&&g(6,"invalid gzip data");var r=n[3],t=10;r&4&&(t+=n[10]|(n[11]<<8)+2);for(var e=(r>>3&1)+(r>>4&1);e>0;e-=!n[t++]);return t+(r&2)},"gzs"),Ln=u(function(n){var r=n.length;return(n[r-4]|n[r-3]<<8|n[r-2]<<16|n[r-1]<<24)>>>0},"gzl"),tn=u(function(n){return 10+(n.filename&&n.filename.length+1||0)},"gzhl"),en=u(function(n,r){var t=r.level,e=t==0?0:t<6?1:t==9?3:2;n[0]=120,n[1]=e<<6|(e?32-2*e:1)},"zlh"),Pn=u(function(n){((n[0]&15)!=8||n[0]>>>4>7||(n[0]<<8|n[1])%31)&&g(6,"invalid zlib data"),n[1]&32&&g(6,"invalid zlib data: preset dictionaries not supported")},"zlv");function an(n,r){return!r&&typeof n=="function"&&(r=n,n={}),this.ondata=r,n}u(an,"AsyncCmpStrm");var ar=function(){function n(r,t){!t&&typeof r=="function"&&(t=r,r={}),this.ondata=t,this.o=r||{}}return u(n,"Deflate"),n.prototype.p=function(r,t){this.ondata(ur(r,this.o,0,0,!t),t)},n.prototype.push=function(r,t){this.ondata||g(5),this.d&&g(4),this.d=t,this.p(r,t||!1)},n}();var Xn=function(){function n(r,t){Mr([zr,function(){return[b,ar]}],this,an.call(this,r,t),function(e){var i=new ar(e.data);onmessage=b(i)},6)}return u(n,"AsyncDeflate"),n}();function dn(n,r,t){return t||(t=r,r={}),typeof t!="function"&&g(7),Ar(n,r,[zr],function(e){return fr($r(e.data[0],e.data[1]))},0,t)}u(dn,"deflate");function $r(n,r){return ur(n,r||{},0,0)}u($r,"deflateSync");var K=function(){function n(r){this.s={},this.p=new U(0),this.ondata=r}return u(n,"Inflate"),n.prototype.e=function(r){this.ondata||g(5),this.d&&g(4);var t=this.p.length,e=new U(t+r.length);e.set(this.p),e.set(r,t),this.p=e},n.prototype.c=function(r){this.d=this.s.i=r||!1;var t=this.s.b,e=Cr(this.p,this.o,this.s);this.ondata(d(e,t,this.s.b),this.d),this.o=d(e,this.s.b-32768),this.s.b=this.o.length,this.p=d(this.p,this.s.p/8|0),this.s.p&=7},n.prototype.push=function(r,t){this.e(r),this.c(t)},n}();var Nn=function(){function n(r){this.ondata=r,Mr([xr,function(){return[b,K]}],this,0,function(){var t=new K;onmessage=b(t)},7)}return u(n,"AsyncInflate"),n}();function Rn(n,r,t){return t||(t=r,r={}),typeof t!="function"&&g(7),Ar(n,r,[xr],function(e){return fr(Fr(e.data[0],_r(e.data[1])))},1,t)}u(Rn,"inflate");function Fr(n,r){return Cr(n,r)}u(Fr,"inflateSync");var pn=function(){function n(r,t){this.c=mr(),this.l=0,this.v=1,ar.call(this,r,t)}return u(n,"Gzip"),n.prototype.push=function(r,t){ar.prototype.push.call(this,r,t)},n.prototype.p=function(r,t){this.c.p(r),this.l+=r.length;var e=ur(r,this.o,this.v&&tn(this.o),t&&8,!t);this.v&&(rn(e,this.o),this.v=0),t&&(I(e,e.length-8,this.c.d()),I(e,e.length-4,this.l)),this.ondata(e,t)},n}();var ot=function(){function n(r,t){Mr([zr,Zn,function(){return[b,ar,pn]}],this,an.call(this,r,t),function(e){var i=new pn(e.data);onmessage=b(i)},8)}return u(n,"AsyncGzip"),n}();function ft(n,r,t){return t||(t=r,r={}),typeof t!="function"&&g(7),Ar(n,r,[zr,Zn,function(){return[gn]}],function(e){return fr(gn(e.data[0],e.data[1]))},2,t)}u(ft,"gzip");function gn(n,r){r||(r={});var t=mr(),e=n.length;t.p(n);var i=ur(n,r,tn(r),8),a=i.length;return rn(i,r),I(i,a-8,t.d()),I(i,a-4,e),i}u(gn,"gzipSync");var Jr=function(){function n(r){this.v=1,K.call(this,r)}return u(n,"Gunzip"),n.prototype.push=function(r,t){if(K.prototype.e.call(this,r),this.v){var e=this.p.length>3?nn(this.p):4;if(e>=this.p.length&&!t)return;this.p=this.p.subarray(e),this.v=0}t&&(this.p.length<8&&g(6,"invalid gzip data"),this.p=this.p.subarray(0,-8)),K.prototype.c.call(this,t)},n}();var bn=function(){function n(r){this.ondata=r,Mr([xr,kn,function(){return[b,K,Jr]}],this,0,function(){var t=new Jr;onmessage=b(t)},9)}return u(n,"AsyncGunzip"),n}();function _n(n,r,t){return t||(t=r,r={}),typeof t!="function"&&g(7),Ar(n,r,[xr,kn,function(){return[Kr]}],function(e){return fr(Kr(e.data[0]))},3,t)}u(_n,"gunzip");function Kr(n,r){return Cr(n.subarray(nn(n),-8),r||new U(Ln(n)))}u(Kr,"gunzipSync");var yn=function(){function n(r,t){this.c=br(),this.v=1,ar.call(this,r,t)}return u(n,"Zlib"),n.prototype.push=function(r,t){ar.prototype.push.call(this,r,t)},n.prototype.p=function(r,t){this.c.p(r);var e=ur(r,this.o,this.v&&2,t&&4,!t);this.v&&(en(e,this.o),this.v=0),t&&I(e,e.length-4,this.c.d()),this.ondata(e,t)},n}();var st=function(){function n(r,t){Mr([zr,Gn,function(){return[b,ar,yn]}],this,an.call(this,r,t),function(e){var i=new yn(e.data);onmessage=b(i)},10)}return u(n,"AsyncZlib"),n}();function ut(n,r,t){return t||(t=r,r={}),typeof t!="function"&&g(7),Ar(n,r,[zr,Gn,function(){return[wn]}],function(e){return fr(wn(e.data[0],e.data[1]))},4,t)}u(ut,"zlib");function wn(n,r){r||(r={});var t=br();t.p(n);var e=ur(n,r,2,4);return en(e,r),I(e,e.length-4,t.d()),e}u(wn,"zlibSync");var Qr=function(){function n(r){this.v=1,K.call(this,r)}return u(n,"Unzlib"),n.prototype.push=function(r,t){if(K.prototype.e.call(this,r),this.v){if(this.p.length<2&&!t)return;this.p=this.p.subarray(2),this.v=0}t&&(this.p.length<4&&g(6,"invalid zlib data"),this.p=this.p.subarray(0,-4)),K.prototype.c.call(this,t)},n}();var rt=function(){function n(r){this.ondata=r,Mr([xr,On,function(){return[b,K,Qr]}],this,0,function(){var t=new Qr;onmessage=b(t)},11)}return u(n,"AsyncUnzlib"),n}();function nt(n,r,t){return t||(t=r,r={}),typeof t!="function"&&g(7),Ar(n,r,[xr,On,function(){return[Vr]}],function(e){return fr(Vr(e.data[0],_r(e.data[1])))},5,t)}u(nt,"unzlib");function Vr(n,r){return Cr((Pn(n),n.subarray(2,-4)),r)}u(Vr,"unzlibSync");var tt=function(){function n(r){this.G=Jr,this.I=K,this.Z=Qr,this.ondata=r}return u(n,"Decompress"),n.prototype.push=function(r,t){if(this.ondata||g(5),this.s)this.s.push(r,t);else{if(this.p&&this.p.length){var e=new U(this.p.length+r.length);e.set(this.p),e.set(r,this.p.length)}else this.p=r;if(this.p.length>2){var i=this,a=u(function(){i.ondata.apply(i,arguments)},"cb");this.s=this.p[0]==31&&this.p[1]==139&&this.p[2]==8?new this.G(a):(this.p[0]&15)!=8||this.p[0]>>4>7||(this.p[0]<<8|this.p[1])%31?new this.I(a):new this.Z(a),this.s.push(this.p,t),this.p=null}}},n}();var vt=function(){function n(r){this.G=bn,this.I=Nn,this.Z=rt,this.ondata=r}return u(n,"AsyncDecompress"),n.prototype.push=function(r,t){tt.prototype.push.call(this,r,t)},n}();function ht(n,r,t){return t||(t=r,r={}),typeof t!="function"&&g(7),n[0]==31&&n[1]==139&&n[2]==8?_n(n,r,t):(n[0]&15)!=8||n[0]>>4>7||(n[0]<<8|n[1])%31?Rn(n,r,t):nt(n,r,t)}u(ht,"decompress");function lt(n,r){return n[0]==31&&n[1]==139&&n[2]==8?Kr(n,r):(n[0]&15)!=8||n[0]>>4>7||(n[0]<<8|n[1])%31?Fr(n,r):Vr(n,r)}u(lt,"decompressSync");var on=u(function(n,r,t,e){for(var i in n){var a=n[i],o=r+i,f=e;Array.isArray(a)&&(f=Er(e,a[1]),a=a[0]),a instanceof U?t[o]=[a,f]:(t[o+="/"]=[new U(0),f],on(a,o,t,e))}},"fltn"),mn=typeof TextEncoder<"u"&&new TextEncoder,Xr=typeof TextDecoder<"u"&&new TextDecoder,$n=0;try{Xr.decode(er,{stream:!0}),$n=1}catch{}var qn=u(function(n){for(var r="",t=0;;){var e=n[t++],i=(e>127)+(e>223)+(e>239);if(t+i>n.length)return[r,d(n,t-1)];i?i==3?(e=((e&15)<<18|(n[t++]&63)<<12|(n[t++]&63)<<6|n[t++]&63)-65536,r+=String.fromCharCode(55296|e>>10,56320|e&1023)):i&1?r+=String.fromCharCode((e&31)<<6|n[t++]&63):r+=String.fromCharCode((e&15)<<12|(n[t++]&63)<<6|n[t++]&63):r+=String.fromCharCode(e)}},"dutf8"),ct=function(){function n(r){this.ondata=r,$n?this.t=new TextDecoder:this.p=er}return u(n,"DecodeUTF8"),n.prototype.push=function(r,t){if(this.ondata||g(5),t=!!t,this.t){this.ondata(this.t.decode(r,{stream:!0}),t),t&&(this.t.decode().length&&g(8),this.t=null);return}this.p||g(4);var e=new U(this.p.length+r.length);e.set(this.p),e.set(r,this.p.length);var i=qn(e),a=i[0],o=i[1];t?(o.length&&g(8),this.p=null):this.p=o,this.ondata(a,t)},n}();var pt=function(){function n(r){this.ondata=r}return u(n,"EncodeUTF8"),n.prototype.push=function(r,t){this.ondata||g(5),this.d&&g(4),this.ondata(sr(r),this.d=t||!1)},n}();function sr(n,r){if(r){for(var t=new U(n.length),e=0;e<n.length;++e)t[e]=n.charCodeAt(e);return t}if(mn)return mn.encode(n);for(var i=n.length,a=new U(n.length+(n.length>>1)),o=0,f=u(function(h){a[o++]=h},"w"),e=0;e<i;++e){if(o+5>a.length){var v=new U(o+8+(i-e<<1));v.set(a),a=v}var s=n.charCodeAt(e);s<128||r?f(s):s<2048?(f(192|s>>6),f(128|s&63)):s>55295&&s<57344?(s=65536+(s&1047552)|n.charCodeAt(++e)&1023,f(240|s>>18),f(128|s>>12&63),f(128|s>>6&63),f(128|s&63)):(f(224|s>>12),f(128|s>>6&63),f(128|s&63))}return d(a,0,o)}u(sr,"strToU8");function Hn(n,r){if(r){for(var t="",e=0;e<n.length;e+=16384)t+=String.fromCharCode.apply(null,n.subarray(e,e+16384));return t}else{if(Xr)return Xr.decode(n);var i=qn(n),a=i[0],o=i[1];return o.length&&g(8),a}}u(Hn,"strFromU8");var Yn=u(function(n){return n==1?3:n<6?2:n==9?1:0},"dbf"),Wn=u(function(n,r){return r+30+W(n,r+26)+W(n,r+28)},"slzh"),jn=u(function(n,r,t){var e=W(n,r+28),i=Hn(n.subarray(r+46,r+46+e),!(W(n,r+8)&2048)),a=r+46+e,o=N(n,r+20),f=t&&o==4294967295?Jn(n,a):[o,N(n,r+24),N(n,r+42)],v=f[0],s=f[1],h=f[2];return[W(n,r+10),v,s,i,a+W(n,r+30)+W(n,r+32),h]},"zh"),Jn=u(function(n,r){for(;W(n,r)!=1;r+=4+W(n,r+2));return[Hr(n,r+12),Hr(n,r+4),Hr(n,r+20)]},"z64e"),or=u(function(n){var r=0;if(n)for(var t in n){var e=n[t].length;e>65535&&g(9),r+=e+4}return r},"exfl"),pr=u(function(n,r,t,e,i,a,o,f){var v=e.length,s=t.extra,h=f&&f.length,l=or(s);I(n,r,o!=null?33639248:67324752),r+=4,o!=null&&(n[r++]=20,n[r++]=t.os),n[r]=20,r+=2,n[r++]=t.flag<<1|(a<0&&8),n[r++]=i&&8,n[r++]=t.compression&255,n[r++]=t.compression>>8;var y=new Date(t.mtime==null?Date.now():t.mtime),z=y.getFullYear()-1980;if((z<0||z>119)&&g(10),I(n,r,z<<25|y.getMonth()+1<<21|y.getDate()<<16|y.getHours()<<11|y.getMinutes()<<5|y.getSeconds()>>>1),r+=4,a!=-1&&(I(n,r,t.crc),I(n,r+4,a<0?-a-2:a),I(n,r+8,t.size)),I(n,r+12,v),I(n,r+14,l),r+=16,o!=null&&(I(n,r,h),I(n,r+6,t.attrs),I(n,r+10,o),r+=14),n.set(e,r),r+=v,l)for(var x in s){var A=s[x],p=A.length;I(n,r,+x),I(n,r+2,p),n.set(A,r+4),r+=4+p}return h&&(n.set(f,r),r+=h),r},"wzh"),fn=u(function(n,r,t,e,i){I(n,r,101010256),I(n,r+8,t),I(n,r+10,t),I(n,r+12,e),I(n,r+16,i)},"wzf"),Nr=function(){function n(r){this.filename=r,this.c=mr(),this.size=0,this.compression=0}return u(n,"ZipPassThrough"),n.prototype.process=function(r,t){this.ondata(null,r,t)},n.prototype.push=function(r,t){this.ondata||g(5),this.c.p(r),this.size+=r.length,t&&(this.crc=this.c.d()),this.process(r,t||!1)},n}();var gt=function(){function n(r,t){var e=this;t||(t={}),Nr.call(this,r),this.d=new ar(t,function(i,a){e.ondata(null,i,a)}),this.compression=8,this.flag=Yn(t.level)}return u(n,"ZipDeflate"),n.prototype.process=function(r,t){try{this.d.push(r,t)}catch(e){this.ondata(e,null,t)}},n.prototype.push=function(r,t){Nr.prototype.push.call(this,r,t)},n}();var yt=function(){function n(r,t){var e=this;t||(t={}),Nr.call(this,r),this.d=new Xn(t,function(i,a,o){e.ondata(i,a,o)}),this.compression=8,this.flag=Yn(t.level),this.terminate=this.d.terminate}return u(n,"AsyncZipDeflate"),n.prototype.process=function(r,t){this.d.push(r,t)},n.prototype.push=function(r,t){Nr.prototype.push.call(this,r,t)},n}();var wt=function(){function n(r){this.ondata=r,this.u=[],this.d=1}return u(n,"Zip"),n.prototype.add=function(r){var t=this;if(this.ondata||g(5),this.d&2)this.ondata(g(4+(this.d&1)*8,0,1),null,!1);else{var e=sr(r.filename),i=e.length,a=r.comment,o=a&&sr(a),f=i!=r.filename.length||o&&a.length!=o.length,v=i+or(r.extra)+30;i>65535&&this.ondata(g(11,0,1),null,!1);var s=new U(v);pr(s,0,r,e,f,-1);var h=[s],l=u(function(){for(var p=0,w=h;p<w.length;p++){var T=w[p];t.ondata(null,T,!1)}h=[]},"pAll_1"),y=this.d;this.d=0;var z=this.u.length,x=Er(r,{f:e,u:f,o,t:function(){r.terminate&&r.terminate()},r:function(){if(l(),y){var p=t.u[z+1];p?p.r():t.d=1}y=1}}),A=0;r.ondata=function(p,w,T){if(p)t.ondata(p,w,T),t.terminate();else if(A+=w.length,h.push(w),T){var M=new U(16);I(M,0,134695760),I(M,4,r.crc),I(M,8,A),I(M,12,r.size),h.push(M),x.c=A,x.b=v+A+16,x.crc=r.crc,x.size=r.size,y&&x.r(),y=1}else y&&l()},this.u.push(x)}},n.prototype.end=function(){var r=this;if(this.d&2){this.ondata(g(4+(this.d&1)*8,0,1),null,!0);return}this.d?this.e():this.u.push({r:function(){r.d&1&&(r.u.splice(-1,1),r.e())},t:function(){}}),this.d=3},n.prototype.e=function(){for(var r=0,t=0,e=0,i=0,a=this.u;i<a.length;i++){var o=a[i];e+=46+o.f.length+or(o.extra)+(o.o?o.o.length:0)}for(var f=new U(e+22),v=0,s=this.u;v<s.length;v++){var o=s[v];pr(f,r,o,o.f,o.u,-o.c-2,t,o.o),r+=46+o.f.length+or(o.extra)+(o.o?o.o.length:0),t+=o.b}fn(f,r,this.u.length,e,t),this.ondata(null,f,!0),this.d=2},n.prototype.terminate=function(){for(var r=0,t=this.u;r<t.length;r++){var e=t[r];e.t()}this.d=2},n}();function mt(n,r,t){t||(t=r,r={}),typeof t!="function"&&g(7);var e={};on(n,"",e,r);var i=Object.keys(e),a=i.length,o=0,f=0,v=a,s=new Array(a),h=[],l=u(function(){for(var p=0;p<h.length;++p)h[p]()},"tAll"),y=u(function(p,w){Rr(function(){t(p,w)})},"cbd");Rr(function(){y=t});var z=u(function(){var p=new U(f+22),w=o,T=f-o;f=0;for(var M=0;M<v;++M){var m=s[M];try{var B=m.c.length;pr(p,f,m,m.f,m.u,B);var C=30+m.f.length+or(m.extra),D=f+C;p.set(m.c,D),pr(p,o,m,m.f,m.u,B,f,m.m),o+=16+C+(m.m?m.m.length:0),f=D+B}catch(c){return y(c,null)}}fn(p,o,s.length,T,w),y(null,p)},"cbf");a||z();for(var x=u(function(p){var w=i[p],T=e[w],M=T[0],m=T[1],B=mr(),C=M.length;B.p(M);var D=sr(w),c=D.length,G=m.comment,S=G&&sr(G),R=S&&S.length,Z=or(m.extra),O=m.level==0?0:8,F=u(function(P,k){if(P)l(),y(P,null);else{var L=k.length;s[p]=Er(m,{size:C,crc:B.d(),c:k,f:D,m:S,u:c!=w.length||S&&G.length!=R,compression:O}),o+=30+c+Z+L,f+=76+2*(c+Z)+(R||0)+L,--a||z()}},"cbl");if(c>65535&&F(g(11,0,1),null),!O)F(null,M);else if(C<16e4)try{F(null,$r(M,m))}catch(P){F(P,null)}else h.push(dn(M,m,F))},"_loop_1"),A=0;A<v;++A)x(A);return l}u(mt,"zip");function xt(n,r){r||(r={});var t={},e=[];on(n,"",t,r);var i=0,a=0;for(var o in t){var f=t[o],v=f[0],s=f[1],h=s.level==0?0:8,l=sr(o),y=l.length,z=s.comment,x=z&&sr(z),A=x&&x.length,p=or(s.extra);y>65535&&g(11);var w=h?$r(v,s):v,T=w.length,M=mr();M.p(v),e.push(Er(s,{size:v.length,crc:M.d(),c:w,f:l,m:x,u:y!=o.length||x&&z.length!=A,o:i,compression:h})),i+=30+y+p+T,a+=76+2*(y+p)+(A||0)+T}for(var m=new U(a+22),B=i,C=a-i,D=0;D<e.length;++D){var l=e[D];pr(m,l.o,l,l.f,l.u,l.c.length);var c=30+l.f.length+or(l.extra);m.set(l.c,l.o+c),pr(m,i,l,l.f,l.u,l.c.length,l.o,l.m),i+=16+c+(l.m?l.m.length:0)}return fn(m,i,e.length,C,B),m}u(xt,"zipSync");var et=function(){function n(){}return u(n,"UnzipPassThrough"),n.prototype.push=function(r,t){this.ondata(null,r,t)},n.compression=0,n}();var zt=function(){function n(){var r=this;this.i=new K(function(t,e){r.ondata(null,t,e)})}return u(n,"UnzipInflate"),n.prototype.push=function(r,t){try{this.i.push(r,t)}catch(e){this.ondata(e,null,t)}},n.compression=8,n}();var At=function(){function n(r,t){var e=this;t<32e4?this.i=new K(function(i,a){e.ondata(null,i,a)}):(this.i=new Nn(function(i,a,o){e.ondata(i,a,o)}),this.terminate=this.i.terminate)}return u(n,"AsyncUnzipInflate"),n.prototype.push=function(r,t){this.i.terminate&&(r=d(r,0)),this.i.push(r,t)},n.compression=8,n}();var Mt=function(){function n(r){this.onfile=r,this.k=[],this.o={0:et},this.p=er}return u(n,"Unzip"),n.prototype.push=function(r,t){var e=this;if(this.onfile||g(5),this.p||g(4),this.c>0){var i=Math.min(this.c,r.length),a=r.subarray(0,i);if(this.c-=i,this.d?this.d.push(a,!this.c):this.k[0].push(a),r=r.subarray(i),r.length)return this.push(r,t)}else{var o=0,f=0,v=void 0,s=void 0;this.p.length?r.length?(s=new U(this.p.length+r.length),s.set(this.p),s.set(r,this.p.length)):s=this.p:s=r;for(var h=s.length,l=this.c,y=l&&this.d,z=u(function(){var w,T=N(s,f);if(T==67324752){o=1,v=f,x.d=null,x.c=0;var M=W(s,f+6),m=W(s,f+8),B=M&2048,C=M&8,D=W(s,f+26),c=W(s,f+28);if(h>f+30+D+c){var G=[];x.k.unshift(G),o=2;var S=N(s,f+18),R=N(s,f+22),Z=Hn(s.subarray(f+30,f+=30+D),!B);S==4294967295?(w=C?[-2]:Jn(s,f),S=w[0],R=w[1]):C&&(S=-1),f+=c,x.c=S;var O,F={name:Z,compression:m,start:function(){if(F.ondata||g(5),!S)F.ondata(null,er,!0);else{var P=e.o[m];P||F.ondata(g(14,"unknown compression type "+m,1),null,!1),O=S<0?new P(Z):new P(Z,S,R),O.ondata=function(j,Q,Y){F.ondata(j,Q,Y)};for(var k=0,L=G;k<L.length;k++){var H=L[k];O.push(H,!1)}e.k[0]==G&&e.c?e.d=O:O.push(er,!0)}},terminate:function(){O&&O.terminate&&O.terminate()}};S>=0&&(F.size=S,F.originalSize=R),x.onfile(F)}return"break"}else if(l){if(T==134695760)return v=f+=12+(l==-2&&8),o=3,x.c=0,"break";if(T==33639248)return v=f-=4,o=3,x.c=0,"break"}},"_loop_2"),x=this;f<h-4;++f){var A=z();if(A==="break")break}if(this.p=er,l<0){var p=o?s.subarray(0,v-12-(l==-2&&8)-(N(s,v-16)==134695760&&4)):s.subarray(0,f);y?y.push(p,!!o):this.k[+(o==2)].push(p)}if(o&2)return this.push(s.subarray(f),t);this.p=s.subarray(f)}t&&(this.c&&g(13),this.p=null)},n.prototype.register=function(r){this.o[r.compression]=r},n}();var Rr=typeof queueMicrotask=="function"?queueMicrotask:typeof setTimeout=="function"?setTimeout:function(n){n()};function Tt(n,r,t){t||(t=r,r={}),typeof t!="function"&&g(7);var e=[],i=u(function(){for(var p=0;p<e.length;++p)e[p]()},"tAll"),a={},o=u(function(p,w){Rr(function(){t(p,w)})},"cbd");Rr(function(){o=t});for(var f=n.length-22;N(n,f)!=101010256;--f)if(!f||n.length-f>65558)return o(g(13,0,1),null),i;var v=W(n,f+8);if(v){var s=v,h=N(n,f+16),l=h==4294967295||s==65535;if(l){var y=N(n,f-12);l=N(n,y)==101075792,l&&(s=v=N(n,y+32),h=N(n,y+48))}for(var z=r&&r.filter,x=u(function(p){var w=jn(n,h,l),T=w[0],M=w[1],m=w[2],B=w[3],C=w[4],D=w[5],c=Wn(n,D);h=C;var G=u(function(R,Z){R?(i(),o(R,null)):(Z&&(a[B]=Z),--v||o(null,a))},"cbl");if(!z||z({name:B,size:M,originalSize:m,compression:T}))if(!T)G(null,d(n,c,c+M));else if(T==8){var S=n.subarray(c,c+M);if(M<32e4)try{G(null,Fr(S,new U(m)))}catch(R){G(R,null)}else e.push(Rn(S,{size:m},G))}else G(g(14,"unknown compression type "+T,1),null);else G(null,null)},"_loop_3"),A=0;A<s;++A)x(A)}else o(null,{});return i}u(Tt,"unzip");function Ut(n,r){for(var t={},e=n.length-22;N(n,e)!=101010256;--e)(!e||n.length-e>65558)&&g(13);var i=W(n,e+8);if(!i)return{};var a=N(n,e+16),o=a==4294967295||i==65535;if(o){var f=N(n,e-12);o=N(n,f)==101075792,o&&(i=N(n,f+32),a=N(n,f+48))}for(var v=r&&r.filter,s=0;s<i;++s){var h=jn(n,a,o),l=h[0],y=h[1],z=h[2],x=h[3],A=h[4],p=h[5],w=Wn(n,p);a=A,(!v||v({name:x,size:y,originalSize:z,compression:l}))&&(l?l==8?t[x]=Fr(n.subarray(w,w+y),new U(z)):g(14,"unknown compression type "+l):t[x]=d(n,w,w+y))}return t}u(Ut,"unzipSync");export{ot as AsyncCompress,vt as AsyncDecompress,Xn as AsyncDeflate,bn as AsyncGunzip,ot as AsyncGzip,Nn as AsyncInflate,At as AsyncUnzipInflate,rt as AsyncUnzlib,yt as AsyncZipDeflate,st as AsyncZlib,pn as Compress,ct as DecodeUTF8,tt as Decompress,ar as Deflate,pt as EncodeUTF8,at as FlateErrorCode,Jr as Gunzip,pn as Gzip,K as Inflate,Mt as Unzip,zt as UnzipInflate,et as UnzipPassThrough,Qr as Unzlib,wt as Zip,gt as ZipDeflate,Nr as ZipPassThrough,yn as Zlib,ft as compress,gn as compressSync,ht as decompress,lt as decompressSync,dn as deflate,$r as deflateSync,_n as gunzip,Kr as gunzipSync,ft as gzip,gn as gzipSync,Rn as inflate,Fr as inflateSync,Hn as strFromU8,sr as strToU8,Tt as unzip,Ut as unzipSync,nt as unzlib,Vr as unzlibSync,mt as zip,xt as zipSync,ut as zlib,wn as zlibSync};
|